mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-19 07:07:58 +08:00
Fix yii\base\Controller::bindInjectedParams() to not throw error when argument of ReflectionUnionType type is passed (#18869)
This commit is contained in:
@@ -563,6 +563,10 @@ class Controller extends Component implements ViewContextInterface
|
||||
*/
|
||||
final protected function bindInjectedParams(\ReflectionType $type, $name, &$args, &$requestedParams)
|
||||
{
|
||||
if (!$type instanceof \ReflectionNamedType || $type->isBuiltin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Since it is not a builtin type it must be DI injection.
|
||||
$typeName = $type->getName();
|
||||
if (($component = $this->module->get($name, false)) instanceof $typeName) {
|
||||
|
||||
Reference in New Issue
Block a user