Spaces:
Runtime error
Runtime error
Download symfony/framework-bundle/Controller/ControllerResolver.php from Alcazard/vibe-coding-api: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/spaces/Alcazard/vibe-coding-api/resolve/main/symfony/framework-bundle/Controller/ControllerResolver.php
- Command line
-
hf download hf://spaces/Alcazard/vibe-coding-api/symfony/framework-bundle/Controller/ControllerResolver.php
-
curl -L -o ControllerResolver.php https://huggingface.co/spaces/Alcazard/vibe-coding-api/resolve/main/symfony/framework-bundle/Controller/ControllerResolver.php
1.54 kB
| /* | |
| * This file is part of the Symfony package. | |
| * | |
| * (c) Fabien Potencier <fabien@symfony.com> | |
| * | |
| * For the full copyright and license information, please view the LICENSE | |
| * file that was distributed with this source code. | |
| */ | |
| namespace Symfony\Bundle\FrameworkBundle\Controller; | |
| use Symfony\Component\DependencyInjection\ContainerAwareInterface; | |
| use Symfony\Component\HttpKernel\Controller\ContainerControllerResolver; | |
| /** | |
| * @author Fabien Potencier <fabien@symfony.com> | |
| * | |
| * @final | |
| */ | |
| class ControllerResolver extends ContainerControllerResolver | |
| { | |
| protected function instantiateController(string $class): object | |
| { | |
| $controller = parent::instantiateController($class); | |
| if ($controller instanceof ContainerAwareInterface) { | |
| trigger_deprecation('symfony/dependency-injection', '6.4', 'Relying on "%s" to get the container in "%s" is deprecated, register the controller as a service and use dependency injection instead.', ContainerAwareInterface::class, get_debug_type($controller)); | |
| $controller->setContainer($this->container); | |
| } | |
| if ($controller instanceof AbstractController) { | |
| if (null === $previousContainer = $controller->setContainer($this->container)) { | |
| throw new \LogicException(\sprintf('"%s" has no container set, did you forget to define it as a service subscriber?', $class)); | |
| } else { | |
| $controller->setContainer($previousContainer); | |
| } | |
| } | |
| return $controller; | |
| } | |
| } | |