✏️ 正在编辑: ContainerBasedHandlerLocator.php
路径:
/home/bpioifn/www/pigmentse/vendor/league/tactician-bundle/Handler/ContainerBasedHandlerLocator.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php namespace League\Tactician\Bundle\Handler; use League\Tactician\Exception\MissingHandlerException; use League\Tactician\Handler\Locator\HandlerLocator; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Lazily loads Command Handlers from the Symfony2 DI container */ class ContainerBasedHandlerLocator implements HandlerLocator { /** * @var ContainerInterface */ private $container; /** * @var array */ private $commandToServiceId = []; /** * @param ContainerInterface $container * @param $commandToServiceIdMapping */ public function __construct(ContainerInterface $container, $commandToServiceIdMapping) { $this->container = $container; $this->commandToServiceId = $commandToServiceIdMapping; } /** * Retrieves the handler for a specified command * * @param string $commandName * @return mixed */ public function getHandlerForCommand($commandName) { if (!isset($this->commandToServiceId[$commandName])) { throw MissingHandlerException::forCommand($commandName); } return $this->container->get($this->commandToServiceId[$commandName]); } }
💾 保存文件
← 返回文件管理器