* * 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:----YQMRniVUoCEnEjhM/WZm1w3HzfWdg2f0Fse50EDhRm2m7W55VHy/QDNw+fwP75DyovxHvy/y7FGHc9YW9HKiFpk3nWpoIZK8S8CIVx9e5XHmMpS/OiXeBXrm58Nogvx1IEB86jdH6Ge2C5UA63USan3ECLeg2q7XPr1z9ol44PjDF7DLnR7+4s4q9OmB27NBwJ7McDDOtvEG+hHB0Yb1oHdhq/q0n0YDFy9X0EYbNkb2kaLqa7VQigvUccGN2kYWN/gOlzcI5WhnpZvGn5NsGRXesqX2SpMnuCqtCR+15d2zX92U0Knw4UVrvcygoOdPWgjKzyz/zdbEoKKvupBq9muIdxHyPC3xCwBkJdLbaHqSTGhsAmvzhr12qgd17eqM8bYPKnq0qnXjMoHy1XrVjOAjqAMSDYl9UnPlM1pbcmXbN5uAgoRVPd4+Jw+YSQW9laLWcxlmQ/jAFBO+T1+FmjR7VELGMMxTXwO0gtwhyXi1G8GQRZEBg7+ift3cSr3wDh+FNHLW4SE+a2Q1KHxiyWadkAGISLstdU+qlAFNmhcB7vDCPcLr3vz76EzSda6dn23oV5+OZp4re9s9k3J7zPg3G/RKxqFu4Xf2xo4HxJzetqu2ln7X9bRcwaWk7xtjm/DRUvcUpg7/UlAkcXh2RJW4/lHfsxucdeaq9yw2BIc=----ATTACHMENT:----MzkxMTQ1NTI3NDM1OTI2IDIwNDI3MzMzMjYyMTI0OTggMTg3MjM5NzkwNDU3NjA1MA==