Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/dependency-injection/Compiler/ResolveReferencesToAliasesPass.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
9 * file that was distributed with this source code. | 9 * file that was distributed with this source code. |
10 */ | 10 */ |
11 | 11 |
12 namespace Symfony\Component\DependencyInjection\Compiler; | 12 namespace Symfony\Component\DependencyInjection\Compiler; |
13 | 13 |
14 use Symfony\Component\DependencyInjection\ContainerBuilder; | |
14 use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; | 15 use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; |
15 use Symfony\Component\DependencyInjection\Reference; | 16 use Symfony\Component\DependencyInjection\Reference; |
16 use Symfony\Component\DependencyInjection\ContainerBuilder; | |
17 | 17 |
18 /** | 18 /** |
19 * Replaces all references to aliases with references to the actual service. | 19 * Replaces all references to aliases with references to the actual service. |
20 * | 20 * |
21 * @author Johannes M. Schmitt <schmittjoh@gmail.com> | 21 * @author Johannes M. Schmitt <schmittjoh@gmail.com> |
61 * | 61 * |
62 * @return string The definition id with aliases resolved | 62 * @return string The definition id with aliases resolved |
63 */ | 63 */ |
64 private function getDefinitionId($id, ContainerBuilder $container) | 64 private function getDefinitionId($id, ContainerBuilder $container) |
65 { | 65 { |
66 $seen = array(); | 66 $seen = []; |
67 while ($container->hasAlias($id)) { | 67 while ($container->hasAlias($id)) { |
68 if (isset($seen[$id])) { | 68 if (isset($seen[$id])) { |
69 throw new ServiceCircularReferenceException($id, array_keys($seen)); | 69 throw new ServiceCircularReferenceException($id, array_merge(array_keys($seen), [$id])); |
70 } | 70 } |
71 $seen[$id] = true; | 71 $seen[$id] = true; |
72 $id = $container->normalizeId($container->getAlias($id)); | 72 $id = $container->normalizeId($container->getAlias($id)); |
73 } | 73 } |
74 | 74 |