12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace Symfony\Component\Routing\Loader;
- use Psr\Container\ContainerInterface;
- class ContainerLoader extends ObjectLoader
- {
- private $container;
- public function __construct(ContainerInterface $container, string $env = null)
- {
- $this->container = $container;
- parent::__construct($env);
- }
-
- public function supports($resource, string $type = null)
- {
- return 'service' === $type && \is_string($resource);
- }
-
- protected function getObject(string $id)
- {
- return $this->container->get($id);
- }
- }
|