diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index fce4bd9538..ca858f1204 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -520,7 +520,7 @@ class SecurityExtension extends Extension return $this->contextListeners[$contextKey] = $listenerId; } - private function createAuthenticationListeners($container, $id, $firewall, &$authenticationProviders, $defaultProvider = null, array $providerIds, $defaultEntryPoint, $contextListenerId = null) + private function createAuthenticationListeners($container, $id, $firewall, &$authenticationProviders, $defaultProvider, array $providerIds, $defaultEntryPoint, $contextListenerId = null) { $listeners = []; $hasListeners = false; diff --git a/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php b/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php index d97f121ab9..0b59ecdce9 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php @@ -528,7 +528,7 @@ class AutowirePass extends AbstractRecursivePass if (method_exists($parameter, 'getType')) { $type = $parameter->getType(); if ($type && !$type->isBuiltin()) { - $class = new \ReflectionClass(method_exists($type, 'getName') ? $type->getName() : (string) $type); + $class = new \ReflectionClass($type instanceof \ReflectionNamedType ? $type->getName() : (string) $type); } else { $class = null; } diff --git a/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php b/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php index 015448b510..8ed79ff7b2 100644 --- a/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php +++ b/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php @@ -274,7 +274,7 @@ class ControllerResolver implements ArgumentResolverInterface, ControllerResolve return false; } - $class = new \ReflectionClass(method_exists($type, 'getName') ? $type->getName() : (string) $type); + $class = new \ReflectionClass($type instanceof \ReflectionNamedType ? $type->getName() : (string) $type); return $class && $class->isInstance($request); } diff --git a/src/Symfony/Component/OptionsResolver/OptionsResolver.php b/src/Symfony/Component/OptionsResolver/OptionsResolver.php index 7354caf8a6..cf8c366450 100644 --- a/src/Symfony/Component/OptionsResolver/OptionsResolver.php +++ b/src/Symfony/Component/OptionsResolver/OptionsResolver.php @@ -1080,6 +1080,6 @@ class OptionsResolver implements Options return null; } - return method_exists($type, 'getName') ? $type->getName() : (string) $type; + return $type instanceof \ReflectionNamedType ? $type->getName() : (string) $type; } }