diff --git a/framework/web/Controller.php b/framework/web/Controller.php index d8bfac14d3a..d1688cfafee 100644 --- a/framework/web/Controller.php +++ b/framework/web/Controller.php @@ -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; + $isArray = ($type = $param->getType()) instanceof \ReflectionNamedType && $type->getName() === 'array'; + if ($isArray) { $params[$name] = (array)$params[$name]; } elseif (is_array($params[$name])) {