Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\Routing\Loader\DependencyInjection; Chris@0: Chris@14: use Psr\Container\ContainerInterface; Chris@0: use Symfony\Component\Routing\Loader\ObjectRouteLoader; Chris@0: Chris@0: /** Chris@0: * A route loader that executes a service to load the routes. Chris@0: * Chris@0: * @author Ryan Weaver Chris@0: */ Chris@0: class ServiceRouterLoader extends ObjectRouteLoader Chris@0: { Chris@0: /** Chris@0: * @var ContainerInterface Chris@0: */ Chris@0: private $container; Chris@0: Chris@0: public function __construct(ContainerInterface $container) Chris@0: { Chris@0: $this->container = $container; Chris@0: } Chris@0: Chris@0: protected function getServiceObject($id) Chris@0: { Chris@0: return $this->container->get($id); Chris@0: } Chris@0: }