Skip to content

Commit

Permalink
Update deprecated isArray() method in Controller.php (yiisoft#20156)
Browse files Browse the repository at this point in the history
  • Loading branch information
creativebash committed May 16, 2024
1 parent 391997a commit f2ea9be
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions framework/web/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,9 @@ public function bindActionParams($action, $params)
foreach ($method->getParameters() as $param) {
$name = $param->getName();
if (array_key_exists($name, $params)) {
$isValid = true;
if (PHP_VERSION_ID >= 80000) {
$isArray = ($type = $param->getType()) instanceof \ReflectionNamedType && $type->getName() === 'array';
} else {
$isArray = $param->isArray();
}
$isValid = true;

Check failure on line 132 in framework/web/Controller.php

View workflow job for this annotation

GitHub Actions / PHP_CodeSniffer

Whitespace found at end of line

Check failure on line 132 in framework/web/Controller.php

View workflow job for this annotation

GitHub Actions / PHP_CodeSniffer

Whitespace found at end of line

Check failure on line 132 in framework/web/Controller.php

View workflow job for this annotation

GitHub Actions / PHP_CodeSniffer

Whitespace found at end of line
$isArray = ($type = $param->getType()) instanceof \ReflectionNamedType && $type->getName() === 'array';

Check failure on line 134 in framework/web/Controller.php

View workflow job for this annotation

GitHub Actions / PHP_CodeSniffer

Whitespace found at end of line

Check failure on line 134 in framework/web/Controller.php

View workflow job for this annotation

GitHub Actions / PHP_CodeSniffer

Whitespace found at end of line

Check failure on line 134 in framework/web/Controller.php

View workflow job for this annotation

GitHub Actions / PHP_CodeSniffer

Whitespace found at end of line
if ($isArray) {
$params[$name] = (array)$params[$name];
} elseif (is_array($params[$name])) {
Expand Down

0 comments on commit f2ea9be

Please sign in to comment.