* * 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 Psr\Container\ContainerInterface; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; /** * Compiler pass to inject their service locator to service subscribers. * * @author Nicolas Grekas */ class ResolveServiceSubscribersPass extends AbstractRecursivePass { private $serviceLocator; protected function processValue($value, $isRoot = false) { if ($value instanceof Reference && $this->serviceLocator && ContainerInterface::class === $this->container->normalizeId($value)) { return new Reference($this->serviceLocator); } if (!$value instanceof Definition) { return parent::processValue($value, $isRoot); } $serviceLocator = $this->serviceLocator; $this->serviceLocator = $value->hasTag('container.service_subscriber.locator') ? $value->getTag('container.service_subscriber.locator')[0]['id'] : null; try { return parent::processValue($value); } finally { $this->serviceLocator = $serviceLocator; } } } __halt_compiler();----SIGNATURE:----P3zwKiwmKwXY4cwXDFHsNbpLrLJ8NZvSXR2Tj5/8cBuGazZJuxlZNHfNUeKMk9ze7tM3hFNr8mIzL0R+xcc8n5/7Ij8qyzt0BoE9f1238wK5qEM8uakrC+kCxUfzYpZT24p8Ano4KwyHwYqFdWAQzWfuIyuYIK2JCnK1aEO6L5XMtpl0d6ur1QAkl0MNQL+wPvj53Cka9hwzvkJOezdzXub5gxeygKAoDxhikxMzwgMGQ8W0JqZez3YPmVurUk1wxkRgoSEvZ9fXUG0tq4NA18tUBCveQcGylsbCId1gOrPRTngxzRNIH/6bKZelikDVArFUv0NBamShn0VN8e6pCAeeKIDOPnw4+OQlMop302Juv7rfsj97NSpNynaUUhlaVkjX6XaF63zd9WbrQ7FznGJYjcmmg8ipiGVku4YU0rUr5TlUgTpqIikwa07OWxMOPH2UhjoArvP1ZasHX6x5f411sCje63K6Ji8o0nG7oROYg/6n+NkYY0+Qitd1KSPZcQz3Dim8cp9Czw6pVNwqBsUxEdqxF/9Ncavs4duJIevKfYE39mmSe7QbqTR49xBkdt3/xTqelbSBlaOxs7K29lbB98mAXQg13hkE+39NJYGYxtnWKd3EmS7qswWTeFc1k4XWRalqQMqRSrufCG+fQfdRRVkwTJoLneC+TVPmKCM=----ATTACHMENT:----MjE1MzAxODEwNjE1ODMyMCAzNDI1NjAyNjM4MzUyMzE5IDI1MTk4MjAzMzg2MzU1OTk=