Skip to content

Commit

Permalink
Update deprecated isArray() method in Controller.php
Browse files Browse the repository at this point in the history
Update deprecated ReflectionParameter::isArray() method.

Reference (PHP 8): https://php.watch/versions/8.0/deprecated-reflectionparameter-methods
  • Loading branch information
creativebash authored May 15, 2024
1 parent 8861f7b commit 55c9cc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/web/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function bindActionParams($action, $params)
if (PHP_VERSION_ID >= 80000) {
$isArray = ($type = $param->getType()) instanceof \ReflectionNamedType && $type->getName() === 'array';
} else {
$isArray = $param->isArray();
$isArray = $param->getType() && $param->getType()->getName() === 'array';
}
if ($isArray) {
$params[$name] = (array)$params[$name];
Expand Down

0 comments on commit 55c9cc6

Please sign in to comment.