* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Compiler; @trigger_error('The '.__NAMESPACE__.'\AutowireExceptionPass class is deprecated since Symfony 3.4 and will be removed in 4.0. Use the DefinitionErrorExceptionPass class instead.', E_USER_DEPRECATED); use Symfony\Component\DependencyInjection\ContainerBuilder; /** * Throws autowire exceptions from AutowirePass for definitions that still exist. * * @deprecated since version 3.4, will be removed in 4.0. * * @author Ryan Weaver */ class AutowireExceptionPass implements CompilerPassInterface { private $autowirePass; private $inlineServicePass; public function __construct(AutowirePass $autowirePass, InlineServiceDefinitionsPass $inlineServicePass) { $this->autowirePass = $autowirePass; $this->inlineServicePass = $inlineServicePass; } public function process(ContainerBuilder $container) { // the pass should only be run once if (null === $this->autowirePass || null === $this->inlineServicePass) { return; } $inlinedIds = $this->inlineServicePass->getInlinedServiceIds(); $exceptions = $this->autowirePass->getAutowiringExceptions(); // free up references $this->autowirePass = null; $this->inlineServicePass = null; foreach ($exceptions as $exception) { if ($this->doesServiceExistInTheContainer($exception->getServiceId(), $container, $inlinedIds)) { throw $exception; } } } private function doesServiceExistInTheContainer($serviceId, ContainerBuilder $container, array $inlinedIds) { if ($container->hasDefinition($serviceId)) { return true; } // was the service inlined? Of so, does its parent service exist? if (isset($inlinedIds[$serviceId])) { foreach ($inlinedIds[$serviceId] as $parentId) { if ($this->doesServiceExistInTheContainer($parentId, $container, $inlinedIds)) { return true; } } } return false; } } __halt_compiler();----SIGNATURE:----DIS2qMEOgc3lZRvRJYpugB+L23JNUeSu7hVvwKDesBxnAps+DZ9qaQoWfvkLs8g0e/XNuhTW5FFXhHPaSRoFxl64lnBTavi4aJaMOZk9a1HZXwGMybykbzZidliiMB3NPOmHGFB102UlUngk35qzJKLMoWNku3BOfv5DDTwkwyLqfeoTYGUkpUXVKMJCbQGMRyWEMx3u2FftWg5/3TvlLs9A8EzxHs0HZqAqlnC+CYUCnLY3CFwdtps3L48ELdKtaaU5yh9Y3Mf6wlJduM6kJMhCreKJ/nv2+bJbKhXef/4HRankMW9kPvbunsf+r9RNUNKSJE3P3+ZGJOoWQlHvM5BxvkEN49QUbl3vI9oqost1zs98NC4I7IPd3j68ozY2JUXbezAQxwnQfZ2PshKfqIsm2sTkKuMWf7prwXjC/0JwENyT5ftiFt/hOuVe1tjUTYKnolLjwiXf5I8zEHeSB6GTtbyIn+D2tcsdTRc4tGZr1sKGvhuy+5GLyRJCWtJldSAvAsKP08bXd7T0fSrQcivmMME6i85XceenFdJTAGOhaA+Grl64zw6VGtnDnGOTK/zas+Qio3C9aluUqAqI4kU7MTE07pMRprPCN5tuyS1Yvt319IiTWH1WAF6RApkweLSCIutQdH5erPWD4V9Fwn9nw48xKTbbsRBQCLkT3mE=----ATTACHMENT:----OTI3OTMxNjYxMjQ1MDA4NiA1NTY5OTgwNzAxNTg3MTYgNjI0MDY3Mzg1NTkzMTgwNw==