* * 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:----PBWB8sGCEPcP0GoijRVx4A63ZUc/B2P0b+LhNSw90JxPw38NHlw/sAaOIRfgjYVbo1reY9LIXpKZM2q1p9OHuEHgb/S4l59h9vL6QFR6h4r4kVXVFulgUUe1nqGS1rfKYKWEC0jlMUup7P3mbM1W3fR3Imlz43eI6h5Opfsz6gf5sysqBmHiUsqzH86ZIL/YZFW+PtiOXZBGk2jhIpv15FhQ/Fi45YXAaPMOvgKYS9GClZksu4K34f664FuqfzIKgzFjFuRmT6jK9QHTn15gmTpFYLNZpDbhZ3KhD8d/SzuOzyvleqDH+Isw7tAViCR5nRJ9/pJrEkkQMyW8aq3rTY+RZFfQ7DswKiNOjLjeFdC9R1w9e7NW1qab3FQDsWrjQrxHtj3mHPI4nE4DPqQPl4ob0rH3a3Uv63xY2QI6ly6J42UAapEcWiN98GwhzmtFxlN4vsmK7V3fDMceSTbOU+DC8l8TN8ZmXbzVBTJqVDqyrl5fAy1kb8zMCnxpBqY3zsDi8kbFb/HPlFJFi452cNaxb42+YP9cHzDiGvwG51td0mH9dXWQMTaa7Ei3+E+CntsX0XKEWIgc1N7BEFxtkxx1MqI1LM+fCSze4JxVW5iOE/pI5s1elWDwt0Dtknplx4HLsaT2QAL/+KUdwAfaDsBYlmpnqp3s+hd3Nq4mjTE=----ATTACHMENT:----NDI1MDU1MjA1Njc4MTE5MSA2MzAyMjMxMDE1MzQ3ODU3IDQ1OTg0OTMxMDYyMTU4MjM=