/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/DependencyInjection/Kernel/FileLocator.php
39 строк
1009 B
Nicolas Grekas
[DependencyInjection] Add Kernel and Bundle infrastructure for HTTP-less DI-powered apps
01 апр 2026, 20:55
01 апр 2026, 20:55
9a122ee
Код
Авторство
О чём код?
<?php /* * 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\Component\DependencyInjection\Kernel; use Symfony\Component\Config\FileLocator as BaseFileLocator; /** * FileLocator uses the KernelInterface to locate resources in bundles. * * @author Fabien Potencier <fabien@symfony.com> */ class FileLocator extends BaseFileLocator { public function __construct( private KernelInterface $kernel, ) { parent::__construct(); } public function locate(string $file, ?string $currentPath = null, bool $first = true): string|array { if (isset($file[0]) && '@' === $file[0]) { $resource = $this->kernel->locateResource($file); return $first ? $resource : [$resource]; } return parent::locate($file, $currentPath, $first); } }