diff --git a/composer.json b/composer.json index 512bb5914..65dfce949 100644 --- a/composer.json +++ b/composer.json @@ -94,15 +94,15 @@ "pear/archive_tar": "~1.4.6" }, "extra": { - "composer-exit-on-patch-failure": true, - "patches": { - "phpunit/phpunit-mock-objects": { - "Fix PHP 7 and 8 compatibility": "./tests/phpunit_mock_objects.patch" - }, - "phpunit/phpunit": { - "Fix PHP 7 compatibility": "./tests/phpunit_php7.patch", + "composer-exit-on-patch-failure": true, + "patches": { + "phpunit/phpunit-mock-objects": { + "Fix PHP 7 and 8 compatibility": "./tests/phpunit_mock_objects.patch" + }, + "phpunit/phpunit": { + "Fix PHP 7 compatibility": "./tests/phpunit_php7.patch", "Fix PHP 8 compatibility": "./tests/phpunit_php8.patch" - } - } - } + } + } + } } diff --git a/framework/console/CConsoleCommand.php b/framework/console/CConsoleCommand.php index 640ace3f7..9dc45dd6a 100644 --- a/framework/console/CConsoleCommand.php +++ b/framework/console/CConsoleCommand.php @@ -129,11 +129,11 @@ abstract class CConsoleCommand extends CComponent $name=$param->getName(); if(isset($options[$name])) { - if(version_compare(PHP_VERSION,'8.0','>=')) { - $isArray = $param->getType() && $param->getType()->getName() === 'array'; - } else { - $isArray = $param->isArray(); - } + if(version_compare(PHP_VERSION,'8.0','>=')) { + $isArray=$param->getType() && $param->getType()->getName()==='array'; + } else { + $isArray = $param->isArray(); + } if($isArray) $params[]=is_array($options[$name]) ? $options[$name] : array($options[$name]); diff --git a/framework/utils/CPropertyValue.php b/framework/utils/CPropertyValue.php index 0a95ba2ec..f001dc2a1 100644 --- a/framework/utils/CPropertyValue.php +++ b/framework/utils/CPropertyValue.php @@ -53,7 +53,7 @@ class CPropertyValue public static function ensureBoolean($value) { if (is_string($value)) - return !strcasecmp($value,'true') || ($value != 0 && $value !== '' && is_numeric($value)); + return !strcasecmp($value,'true') || ($value!=0 && $value!=='' && is_numeric($value)); else return (boolean)$value; } diff --git a/framework/web/actions/CAction.php b/framework/web/actions/CAction.php index 7373f021d..21dcdc47c 100644 --- a/framework/web/actions/CAction.php +++ b/framework/web/actions/CAction.php @@ -94,10 +94,10 @@ abstract class CAction extends CComponent implements IAction $name=$param->getName(); if(isset($params[$name])) { - if(version_compare(PHP_VERSION,'8.0','>=')) { - $isArray = $param->getType() && $param->getType()->getName() === 'array'; - } else { - $isArray = $param->isArray(); + if(version_compare(PHP_VERSION,'8.0','>=')) { + $isArray=$param->getType() && $param->getType()->getName()==='array'; + } else { + $isArray=$param->isArray(); } if($isArray) diff --git a/tests/framework/web/helpers/CHtmlTest.php b/tests/framework/web/helpers/CHtmlTest.php index bd789101b..3ecffc9bf 100644 --- a/tests/framework/web/helpers/CHtmlTest.php +++ b/tests/framework/web/helpers/CHtmlTest.php @@ -571,13 +571,13 @@ class CHtmlTest extends CTestCase array(array('v1'),0.0,'defaultValue','v1'), ); - // create_function is not supported by CHtml::value(), we're just testing this feature/property - if(version_compare(PHP_VERSION,'8.0','<')) { - $result=array_merge($result, array( - array(array('k1' => 'v1', 'k2' => 'v2', 'v3', 'v4'), create_function('$model', 'return $model["k2"];'), null, null), - array((object)array('k1' => 'v1', 'k2' => 'v2', 'v3', 'v4'), create_function('$model', 'return $model->k2;'), null, null), - )); - } + // create_function is not supported by CHtml::value(), we're just testing this feature/property + if(version_compare(PHP_VERSION,'8.0','<')) { + $result=array_merge($result, array( + array(array('k1' => 'v1', 'k2' => 'v2', 'v3', 'v4'), create_function('$model', 'return $model["k2"];'), null, null), + array((object)array('k1' => 'v1', 'k2' => 'v2', 'v3', 'v4'), create_function('$model', 'return $model->k2;'), null, null), + )); + } if(class_exists('Closure',false)) {