mirror of
https://github.com/yiisoft/yii.git
synced 2026-02-20 01:21:22 +01:00
Fix formatting
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user