* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver; use Psr\Container\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; /** * Yields a service keyed by _controller and argument name. * * @author Nicolas Grekas */ final class ServiceValueResolver implements ArgumentValueResolverInterface { private $container; public function __construct(ContainerInterface $container) { $this->container = $container; } /** * {@inheritdoc} */ public function supports(Request $request, ArgumentMetadata $argument) { $controller = $request->attributes->get('_controller'); if (\is_array($controller) && \is_callable($controller, true) && \is_string($controller[0])) { $controller = $controller[0].'::'.$controller[1]; } elseif (!\is_string($controller) || '' === $controller) { return false; } if ('\\' === $controller[0]) { $controller = ltrim($controller, '\\'); } return $this->container->has($controller) && $this->container->get($controller)->has($argument->getName()); } /** * {@inheritdoc} */ public function resolve(Request $request, ArgumentMetadata $argument) { if (\is_array($controller = $request->attributes->get('_controller'))) { $controller = $controller[0].'::'.$controller[1]; } if ('\\' === $controller[0]) { $controller = ltrim($controller, '\\'); } yield $this->container->get($controller)->get($argument->getName()); } } __halt_compiler();----SIGNATURE:----KCK0ox3ofYinPnPr94w4x9lHnIeVTDHf4fJpQtXmcqtBxFo1pZ8inXNM38vt3lNNnrDj0Ycon1DEh65ofpjj5EJGloP+J+3cNsB7EjJMQqeU/nrfjDjeX6zX6BYl1gaLyieIugshyfl0KnbdZWRr+/XZeesSivjH89F61+FBYUw7k0lpkKXYhJyFASylDGs0eMO29FoNYdACd8qq2RCG1sQzpznLO3k/XOlnU29Ky+iAqI7GpVPnZcz0vlTu5WV3BKlP+3HPfeuN9zQLu2If4l1IoxK1EHjjuvs4YIAse1BViYlareOdrfFKYcOsiFVJbVnZwP39GilwMrBiLYkfc1Dn27BuaLxm2uPzCUJk2U8yT+6nE0FqqMq1K2jiV6S0ud4iStIYhbSkPueb0la627Cb2OxoHLKRKSr710LPkiK8yNbl7LCnrTrSAV/IKPGleJXn54F4nwVBYBVlQovlVshUT9yGiH1vuAqcFN8B3p1AHYagYoqu+iEzRtwFuz3cZajeifjQG18u2ACxtL0id5e8zWkA3dvHbz3Yb1hh487yxCdLYwSOZIKY857I5OcOsjTncmcRxLs/P0TAfdPOl8f1NgRs3MfVN7G2iPrfpRFMOS5oEP+0obuuSuZ1YZ50Wimrk7kXVa2PLqM29uvvNdX7AGeYiwWKW3Kdefr4MbA=----ATTACHMENT:----MTA4ODExNjY1ODc1ODgxNyAzMDMyOTMyMDY3MzMyMDk4IDkwNjk3OTUwNzcwMDk1Njk=