* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\ContainerBuilder; /** * Replaces all references to aliases with references to the actual service. * * @author Johannes M. Schmitt */ class ResolveReferencesToAliasesPass extends AbstractRecursivePass { /** * {@inheritdoc} */ public function process(ContainerBuilder $container) { parent::process($container); foreach ($container->getAliases() as $id => $alias) { $aliasId = $container->normalizeId($alias); if ($aliasId !== $defId = $this->getDefinitionId($aliasId, $container)) { $container->setAlias($id, $defId)->setPublic($alias->isPublic())->setPrivate($alias->isPrivate()); } } } /** * {@inheritdoc} */ protected function processValue($value, $isRoot = false) { if ($value instanceof Reference) { $defId = $this->getDefinitionId($id = $this->container->normalizeId($value), $this->container); if ($defId !== $id) { return new Reference($defId, $value->getInvalidBehavior()); } } return parent::processValue($value); } /** * Resolves an alias into a definition id. * * @param string $id The definition or alias id to resolve * @param ContainerBuilder $container * * @return string The definition id with aliases resolved */ private function getDefinitionId($id, ContainerBuilder $container) { $seen = array(); while ($container->hasAlias($id)) { if (isset($seen[$id])) { throw new ServiceCircularReferenceException($id, array_keys($seen)); } $seen[$id] = true; $id = $container->normalizeId($container->getAlias($id)); } return $id; } } __halt_compiler();----SIGNATURE:----b3VXOL/by2sejRWuRReoxqpegHCB8R6DXj1Ca8YjzcP0hlp4g2/DSLt/GQt0ZzV7IAu0hnwM2p10u3LKvW+DggkKpo6j4E00Z1ld6o/B2Y69V/BqnULS7q8D4LWVYWYtzK6TtFi8WCCjWTSQohIiTDnYTqJL1YZqyVq9CISNm0ReBpLOagnS+XogOav6NtLJkvW8r2tkaurDOo7qyQWrg+YoNL6hwQpHX84jSBFDpwVIkJeKa+GR5esaTTOFgOSCc76gyUgV7XMheY3geLjwdIl7UmobwQbSPPqKenGaJJjVMmKURgAzz6QtpK/Rjq3AB0rRVmJ6aBCdH4x2uyppMb+cxad9wfwAAJpOFG6PbDLkk2oeRr5MwUwD921cVTsT+SmXbGvS/zdAyDVLKRumnGX/aoozOmagSQ9kscuXAGEeHZ7UhTIGvN/BTgaiBpkXvQo4j2bmEkRDzOFWQCTOvAsnreAIWR/UgnKU1Y8onP+KBLX4m0DMgyG9sqY+IVyAQZyZVsZx8McFdF0W+5sg0L7qqFZpoP6VAiTwtNnGOPFC3OiGl8gj9IcLgPa4l5ZFUR1TcRteRvUuwh5rJq80MiRKlVGcGmmPKdzEOgoxvg5XUXLpty7EnW0jsf5teniIIgRkGiPbpbCaciro7FFq4vCbKLx5RC7yR/nXHqEqnI4=----ATTACHMENT:----NjQ0ODAzNDA5ODgxNzY2MSA5NjM4MTQ5MDc3NDk1OTIxIDg0NDgwMTc2MDkyMzQwMTQ=