diff --git a/src/Symfony/Component/DependencyInjection/Compiler/FactoryReturnTypePass.php b/src/Symfony/Component/DependencyInjection/Compiler/FactoryReturnTypePass.php index 66ddd03c99..e4e64db41b 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/FactoryReturnTypePass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/FactoryReturnTypePass.php @@ -58,7 +58,7 @@ class FactoryReturnTypePass implements CompilerPassInterface if ($factory[0] instanceof Reference) { $previous[$id] = true; $factoryDefinition = $container->findDefinition((string) $factory[0]); - $this->updateDefinition($container, (string) $factory[0], $factoryDefinition, $previous); + $this->updateDefinition($container, strtolower($factory[0]), $factoryDefinition, $previous); $class = $factoryDefinition->getClass(); } else { $class = $factory[0]; @@ -73,12 +73,12 @@ class FactoryReturnTypePass implements CompilerPassInterface $returnType = $m->getReturnType(); if (null !== $returnType && !$returnType->isBuiltin()) { - $returnType = (string) $returnType; + $returnType = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : $returnType->__toString(); if (null !== $class) { $declaringClass = $m->getDeclaringClass()->getName(); - if ('self' === $returnType) { + if ('self' === strtolower($returnType)) { $returnType = $declaringClass; - } elseif ('parent' === $returnType) { + } elseif ('parent' === strtolower($returnType)) { $returnType = get_parent_class($declaringClass) ?: null; } } diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index 7c6548ddf3..085f2a40d8 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -91,12 +91,12 @@ class ContainerBuilder extends Container implements TaggedContainerInterface private $usedTags = array(); /** - * @var string[][] A map of env var names to their placeholders + * @var string[][] a map of env var names to their placeholders */ private $envPlaceholders = array(); /** - * @var int[] A map of env vars to their resolution counter. + * @var int[] a map of env vars to their resolution counter */ private $envCounters = array();