Skip to content

Commit

Permalink
Merge pull request #2023 from phalcon/development
Browse files Browse the repository at this point in the history
0.12.13
  • Loading branch information
sergeyklay authored Dec 8, 2019
2 parents 1094502 + acfa593 commit a4e9535
Show file tree
Hide file tree
Showing 30 changed files with 124 additions and 126 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
## [0.12.13] - 2019-12-08
### Fixed
- Removed `uint` and `ulong` typedefs support
- Fixed PHP 7.4 support for macOS [phalcon/cphalcon#14577](https://github.com/phalcon/cphalcon/issues/14577)

## [0.12.12] - 2019-11-25
### Added
- Option to set banner for stubs generator
Expand Down Expand Up @@ -339,7 +344,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fixed casting resource to int (only ZendEngine 3)
[#1524](https://github.com/phalcon/zephir/issues/1524)

[Unreleased]: https://github.com/phalcon/zephir/compare/0.12.12...HEAD
[Unreleased]: https://github.com/phalcon/zephir/compare/0.12.13...HEAD
[0.12.13]: https://github.com/phalcon/zephir/compare/0.12.12...0.12.13
[0.12.12]: https://github.com/phalcon/zephir/compare/0.12.11...0.12.12
[0.12.11]: https://github.com/phalcon/zephir/compare/0.12.10...0.12.11
[0.12.10]: https://github.com/phalcon/zephir/compare/0.12.9...0.12.10
Expand Down
4 changes: 2 additions & 2 deletions Library/Console/Command/DevelopmentModeAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ trait DevelopmentModeAwareTrait
*
* @return bool
*/
protected function isDevelopmentModeEnabled(InputInterface $input)
protected function isDevelopmentModeEnabled(InputInterface $input): bool
{
if (false == $input->getOption('no-dev')) {
if (false === $input->getOption('no-dev')) {
return $input->getOption('dev') || PHP_DEBUG;
}

Expand Down
11 changes: 4 additions & 7 deletions Library/Console/Command/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Zephir\BaseBackend;
use Zephir\Compiler;
use Zephir\Config;

/**
Expand All @@ -29,14 +28,12 @@
*/
final class InitCommand extends Command
{
private $compiler;
private $backend;
private $config;
private $logger;

public function __construct(Compiler $compiler, BaseBackend $backend, Config $config, LoggerInterface $logger)
public function __construct(BaseBackend $backend, Config $config, LoggerInterface $logger)
{
$this->compiler = $compiler;
$this->backend = $backend;
$this->config = $config;
$this->logger = $logger;
Expand Down Expand Up @@ -82,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 0;
}

protected function createDefinition()
protected function createDefinition(): InputDefinition
{
return new InputDefinition(
[
Expand Down Expand Up @@ -129,7 +126,7 @@ private function sanitizeNamespace($namespace)
*
* @return bool
*/
private function recursiveProcess($src, $dst, $pattern = null, $callback = 'copy')
private function recursiveProcess($src, $dst, $pattern = null, $callback = 'copy'): bool
{
$success = true;
$iterator = new \DirectoryIterator($src);
Expand All @@ -152,7 +149,7 @@ private function recursiveProcess($src, $dst, $pattern = null, $callback = 'copy
}
} elseif (!$pattern || ($pattern && 1 === preg_match($pattern, $fileName))) {
$path = $dst.\DIRECTORY_SEPARATOR.$fileName;
$success = $success && \call_user_func($callback, $pathName, $path);
$success = $success && $callback($pathName, $path);
}
}

Expand Down
3 changes: 1 addition & 2 deletions Library/Console/Command/ZflagsAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ trait ZflagsAwareTrait
*
* @return string
*/
protected function getZflagsHelp()
protected function getZflagsHelp(): string
{
return <<<EOT
Common flags are:
<info>-f([a-z0-9\-]+)</info> Enables compiler optimizations
<info>-fno-([a-z0-9\-]+)</info> Disables compiler optimizations
<info>-w([a-z0-9\-]+)</info> Turns a warning on
<info>-W([a-z0-9\-]+)</info> Turns a warning off
EOT;
}
}
2 changes: 1 addition & 1 deletion Library/Zephir.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
final class Zephir
{
const VERSION = '0.12.12-$Id$';
const VERSION = '0.12.13-$Id$';

const LOGO = <<<'ASCII'
_____ __ _
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.12.12-{build}
version: 0.12.13-{build}

environment:
matrix:
Expand Down
24 changes: 12 additions & 12 deletions ext/kernel/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "kernel/object.h"
#include "kernel/fcall.h"

void ZEPHIR_FASTCALL zephir_create_array(zval *return_value, uint size, int initialize)
void ZEPHIR_FASTCALL zephir_create_array(zval *return_value, zend_uint size, int initialize)
{
uint i;
zval null_value;
Expand Down Expand Up @@ -114,7 +114,7 @@ int zephir_array_isset_fetch(zval *fetched, const zval *arr, zval *index, int re
break;

case IS_DOUBLE:
result = zend_hash_index_find(h, (ulong)Z_DVAL_P(index));
result = zend_hash_index_find(h, (zend_ulong)Z_DVAL_P(index));
break;

case IS_LONG:
Expand Down Expand Up @@ -153,7 +153,7 @@ int zephir_array_isset_fetch(zval *fetched, const zval *arr, zval *index, int re
return 0;
}

int zephir_array_isset_string_fetch(zval *fetched, const zval *arr, char *index, uint index_length, int readonly)
int zephir_array_isset_string_fetch(zval *fetched, const zval *arr, char *index, zend_uint index_length, int readonly)
{
zval *zv;
if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev((zval *)arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
Expand Down Expand Up @@ -261,7 +261,7 @@ int ZEPHIR_FASTCALL zephir_array_isset(const zval *arr, zval *index)
return zend_hash_str_exists(h, SL(""));

case IS_DOUBLE:
return zend_hash_index_exists(h, (ulong)Z_DVAL_P(index));
return zend_hash_index_exists(h, (zend_ulong)Z_DVAL_P(index));

case IS_TRUE:
case IS_FALSE:
Expand All @@ -280,7 +280,7 @@ int ZEPHIR_FASTCALL zephir_array_isset(const zval *arr, zval *index)
}
}

int ZEPHIR_FASTCALL zephir_array_isset_string(const zval *arr, const char *index, uint index_length)
int ZEPHIR_FASTCALL zephir_array_isset_string(const zval *arr, const char *index, zend_uint index_length)
{
if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev((zval *)arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
Expand Down Expand Up @@ -348,7 +348,7 @@ int ZEPHIR_FASTCALL zephir_array_unset(zval *arr, zval *index, int flags)
return (zend_hash_str_del(ht, "", 1) == SUCCESS);

case IS_DOUBLE:
return (zend_hash_index_del(ht, (ulong)Z_DVAL_P(index)) == SUCCESS);
return (zend_hash_index_del(ht, (zend_ulong)Z_DVAL_P(index)) == SUCCESS);

case IS_TRUE:
return (zend_hash_index_del(ht, 1) == SUCCESS);
Expand All @@ -369,7 +369,7 @@ int ZEPHIR_FASTCALL zephir_array_unset(zval *arr, zval *index, int flags)
}
}

int ZEPHIR_FASTCALL zephir_array_unset_string(zval *arr, const char *index, uint index_length, int flags)
int ZEPHIR_FASTCALL zephir_array_unset_string(zval *arr, const char *index, zend_uint index_length, int flags)
{
if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
zend_long ZEPHIR_LAST_CALL_STATUS;
Expand Down Expand Up @@ -437,7 +437,7 @@ int zephir_array_fetch(zval *return_value, zval *arr, zval *index, int flags ZEP
zval *zv;
HashTable *ht;
int result = SUCCESS, found = 0;
ulong uidx = 0;
zend_ulong uidx = 0;
char *sidx = NULL;

if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
Expand All @@ -460,7 +460,7 @@ int zephir_array_fetch(zval *return_value, zval *arr, zval *index, int flags ZEP
break;

case IS_DOUBLE:
uidx = (ulong)Z_DVAL_P(index);
uidx = (zend_ulong)Z_DVAL_P(index);
found = (zv = zend_hash_index_find(ht, uidx)) != NULL;
break;

Expand Down Expand Up @@ -515,7 +515,7 @@ int zephir_array_fetch(zval *return_value, zval *arr, zval *index, int flags ZEP
return FAILURE;
}

int zephir_array_fetch_string(zval *return_value, zval *arr, const char *index, uint index_length, int flags ZEPHIR_DEBUG_PARAMS)
int zephir_array_fetch_string(zval *return_value, zval *arr, const char *index, zend_uint index_length, int flags ZEPHIR_DEBUG_PARAMS)
{
zval *zv;

Expand Down Expand Up @@ -673,7 +673,7 @@ int zephir_array_update_zval(zval *arr, zval *index, zval *value, int flags)
break;

case IS_DOUBLE:
ret = zend_hash_index_update(ht, (ulong)Z_DVAL_P(index), value);
ret = zend_hash_index_update(ht, (zend_ulong)Z_DVAL_P(index), value);
break;

case IS_LONG:
Expand All @@ -698,7 +698,7 @@ int zephir_array_update_zval(zval *arr, zval *index, zval *value, int flags)
return ret != NULL ? FAILURE : SUCCESS;
}

int zephir_array_update_string(zval *arr, const char *index, uint index_length, zval *value, int flags)
int zephir_array_update_string(zval *arr, const char *index, zend_uint index_length, zval *value, int flags)
{

if (UNEXPECTED(Z_TYPE_P(arr) == IS_OBJECT && zephir_instance_of_ev(arr, (const zend_class_entry *)zend_ce_arrayaccess))) {
Expand Down
12 changes: 6 additions & 6 deletions ext/kernel/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "kernel/globals.h"
#include "kernel/main.h"

void ZEPHIR_FASTCALL zephir_create_array(zval *return_value, uint size, int initialize);
void ZEPHIR_FASTCALL zephir_create_array(zval *return_value, zend_uint size, int initialize);

/**
* Simple convenience function which ensures that you are dealing with an array and you can
Expand All @@ -28,22 +28,22 @@ void ZEPHIR_FASTCALL zephir_ensure_array(zval *probable_array);

/** Combined isset/fetch */
int zephir_array_isset_fetch(zval *fetched, const zval *arr, zval *index, int readonly);
int zephir_array_isset_string_fetch(zval *fetched, const zval *arr, char *index, uint index_length, int readonly);
int zephir_array_isset_string_fetch(zval *fetched, const zval *arr, char *index, zend_uint index_length, int readonly);
int zephir_array_isset_long_fetch(zval *fetched, const zval *arr, unsigned long index, int readonly);

/** Check for index existence */
int ZEPHIR_FASTCALL zephir_array_isset(const zval *arr, zval *index);
int ZEPHIR_FASTCALL zephir_array_isset_long(const zval *arr, unsigned long index);
int ZEPHIR_FASTCALL zephir_array_isset_string(const zval *arr, const char *index, uint index_length);
int ZEPHIR_FASTCALL zephir_array_isset_string(const zval *arr, const char *index, zend_uint index_length);

/** Unset existing indexes */
int ZEPHIR_FASTCALL zephir_array_unset(zval *arr, zval *index, int flags);
int ZEPHIR_FASTCALL zephir_array_unset_long(zval *arr, unsigned long index, int flags);
int ZEPHIR_FASTCALL zephir_array_unset_string(zval *arr, const char *index, uint index_length, int flags);
int ZEPHIR_FASTCALL zephir_array_unset_string(zval *arr, const char *index, zend_uint index_length, int flags);

/** Fetch items from arrays */
int zephir_array_fetch(zval *return_value, zval *arr, zval *index, int flags ZEPHIR_DEBUG_PARAMS);
int zephir_array_fetch_string(zval *return_value, zval *arr, const char *index, uint index_length, int flags ZEPHIR_DEBUG_PARAMS);
int zephir_array_fetch_string(zval *return_value, zval *arr, const char *index, zend_uint index_length, int flags ZEPHIR_DEBUG_PARAMS);
int zephir_array_fetch_long(zval *return_value, zval *arr, unsigned long index, int flags ZEPHIR_DEBUG_PARAMS);

/** Append elements to arrays */
Expand All @@ -52,7 +52,7 @@ void zephir_merge_append(zval *left, zval *values);

/** Modify array */
int zephir_array_update_zval(zval *arr, zval *index, zval *value, int flags);
int zephir_array_update_string(zval *arr, const char *index, uint index_length, zval *value, int flags);
int zephir_array_update_string(zval *arr, const char *index, zend_uint index_length, zval *value, int flags);
int zephir_array_update_long(zval *arr, unsigned long index, zval *value, int flags ZEPHIR_DEBUG_PARAMS);

void zephir_array_keys(zval *return_value, zval *arr);
Expand Down
6 changes: 0 additions & 6 deletions ext/kernel/fcall_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@
#define ZEPHIR_CALL_INTERNAL_METHOD_P0(return_value_ptr, object, method) \
do { \
ZEPHIR_BACKUP_SCOPE(); \
ZEPHIR_BACKUP_THIS_PTR(); \
ZEPHIR_SET_THIS(object); \
ZEPHIR_SET_SCOPE((Z_OBJ_P(object) ? Z_OBJCE_P(object) : NULL), (Z_OBJ_P(object) ? Z_OBJCE_P(object) : NULL)); \
ZEPHIR_INIT_NVAR((return_value_ptr)); \
method(0, execute_data, return_value_ptr, object, 1); \
ZEPHIR_LAST_CALL_STATUS = EG(exception) ? FAILURE : SUCCESS; \
ZEPHIR_RESTORE_THIS_PTR(); \
ZEPHIR_RESTORE_SCOPE(); \
} while (0)

#define ZEPHIR_CALL_INTERNAL_METHOD_P2(return_value_ptr, object, method, p0, p1) \
do { \
ZEPHIR_BACKUP_SCOPE(); \
ZEPHIR_BACKUP_THIS_PTR(); \
ZEPHIR_SET_THIS(object); \
ZEPHIR_SET_SCOPE((Z_OBJ_P(object) ? Z_OBJCE_P(object) : NULL), (Z_OBJ_P(object) ? Z_OBJCE_P(object) : NULL)); \
zval _p0, _p1; \
Expand All @@ -33,19 +30,16 @@
Z_TRY_DELREF_P(p0); \
Z_TRY_DELREF_P(p1); \
ZEPHIR_LAST_CALL_STATUS = EG(exception) ? FAILURE : SUCCESS; \
ZEPHIR_RESTORE_THIS_PTR(); \
ZEPHIR_RESTORE_SCOPE(); \
} while (0)

#define ZEPHIR_RETURN_CALL_INTERNAL_METHOD_P0(object, method) \
do { \
ZEPHIR_BACKUP_SCOPE(); \
ZEPHIR_BACKUP_THIS_PTR(); \
ZEPHIR_SET_THIS(object); \
ZEPHIR_SET_SCOPE((Z_OBJ_P(object) ? Z_OBJCE_P(object) : NULL), (Z_OBJ_P(object) ? Z_OBJCE_P(object) : NULL)); \
method(0, execute_data, return_value, object, 0); \
ZEPHIR_LAST_CALL_STATUS = EG(exception) ? FAILURE : SUCCESS; \
ZEPHIR_RESTORE_THIS_PTR(); \
ZEPHIR_RESTORE_SCOPE(); \
} while (0)

Expand Down
2 changes: 1 addition & 1 deletion ext/kernel/math.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ zephir_mt_rand(zend_long min, zend_long max)
zend_long number;

if (max < min) {
php_error_docref(NULL, E_WARNING, "max(%ld) is smaller than min(%ld)", max, min);
php_error_docref(NULL, E_WARNING, "max(%lld) is smaller than min(%lld)", max, min);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion ext/php_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define PHP_TEST_VERSION "1.0.0"
#define PHP_TEST_EXTNAME "test"
#define PHP_TEST_AUTHOR "Zephir Team and contributors"
#define PHP_TEST_ZEPVERSION "0.12.12-$Id$"
#define PHP_TEST_ZEPVERSION "0.12.13-$Id$"
#define PHP_TEST_DESCRIPTION "Description <b>test</b> for<br/>Test Extension."

typedef struct _zephir_struct_db {
Expand Down
Loading

0 comments on commit a4e9535

Please sign in to comment.