From 8dd2c01ea86ddce23e8aa8d04b9b3afc408c97fe Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 16 May 2024 12:22:46 +0300 Subject: [PATCH] Update Controller.php --- framework/web/Controller.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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])) {