Skip to content

Commit

Permalink
Update Controller.php
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark authored May 16, 2024
1 parent 55c9cc6 commit 8dd2c01
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->getType() && $param->getType()->getName() === 'array';
}
$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
$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
if ($isArray) {
$params[$name] = (array)$params[$name];
} elseif (is_array($params[$name])) {
Expand Down

0 comments on commit 8dd2c01

Please sign in to comment.