platform/api/symfony/Component/DependencyInjection/Loader/PhpFileLoader.yaml
2024-09-02 10:44:11 -07:00

105 lines
5 KiB
YAML

name: PhpFileLoader
class_comment: '# * PhpFileLoader loads service definitions from a PHP file.
# *
# * The PHP file is required and the $container variable can be
# * used within the file to change the container.
# *
# * @author Fabien Potencier <fabien@symfony.com>'
dependencies:
- name: ConfigBuilderGenerator
type: class
source: Symfony\Component\Config\Builder\ConfigBuilderGenerator
- name: ConfigBuilderGeneratorInterface
type: class
source: Symfony\Component\Config\Builder\ConfigBuilderGeneratorInterface
- name: ConfigBuilderInterface
type: class
source: Symfony\Component\Config\Builder\ConfigBuilderInterface
- name: FileLocatorInterface
type: class
source: Symfony\Component\Config\FileLocatorInterface
- name: When
type: class
source: Symfony\Component\DependencyInjection\Attribute\When
- name: WhenNot
type: class
source: Symfony\Component\DependencyInjection\Attribute\WhenNot
- name: Container
type: class
source: Symfony\Component\DependencyInjection\Container
- name: ContainerBuilder
type: class
source: Symfony\Component\DependencyInjection\ContainerBuilder
- name: InvalidArgumentException
type: class
source: Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
- name: LogicException
type: class
source: Symfony\Component\DependencyInjection\Exception\LogicException
- name: ConfigurationExtensionInterface
type: class
source: Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface
- name: ExtensionInterface
type: class
source: Symfony\Component\DependencyInjection\Extension\ExtensionInterface
- name: ContainerConfigurator
type: class
source: Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator
properties: []
methods:
- name: executeCallback
visibility: private
parameters:
- name: callback
- name: containerConfigurator
- name: path
comment: "# * PhpFileLoader loads service definitions from a PHP file.\n# *\n# *\
\ The PHP file is required and the $container variable can be\n# * used within\
\ the file to change the container.\n# *\n# * @author Fabien Potencier <fabien@symfony.com>\n\
# */\n# class PhpFileLoader extends FileLoader\n# {\n# protected bool $autoRegisterAliasesForSinglyImplementedInterfaces\
\ = false;\n# \n# public function __construct(\n# ContainerBuilder $container,\n\
# FileLocatorInterface $locator,\n# ?string $env = null,\n# private ?ConfigBuilderGeneratorInterface\
\ $generator = null,\n# bool $prepend = false,\n# ) {\n# parent::__construct($container,\
\ $locator, $env, $prepend);\n# }\n# \n# public function load(mixed $resource,\
\ ?string $type = null): mixed\n# {\n# // the container and loader variables are\
\ exposed to the included file below\n# $container = $this->container;\n# $loader\
\ = $this;\n# \n# $path = $this->locator->locate($resource);\n# $this->setCurrentDir(\\\
dirname($path));\n# $this->container->fileExists($path);\n# \n# // the closure\
\ forbids access to the private scope in the included file\n# $load = \\Closure::bind(function\
\ ($path, $env) use ($container, $loader, $resource, $type) {\n# return include\
\ $path;\n# }, $this, ProtectedPhpFileLoader::class);\n# \n# try {\n# $callback\
\ = $load($path, $this->env);\n# \n# if (\\is_object($callback) && \\is_callable($callback))\
\ {\n# $this->executeCallback($callback, new ContainerConfigurator($this->container,\
\ $this, $this->instanceof, $path, $resource, $this->env), $path);\n# }\n# } finally\
\ {\n# $this->instanceof = [];\n# $this->registerAliasesForSinglyImplementedInterfaces();\n\
# }\n# \n# return null;\n# }\n# \n# public function supports(mixed $resource,\
\ ?string $type = null): bool\n# {\n# if (!\\is_string($resource)) {\n# return\
\ false;\n# }\n# \n# if (null === $type && 'php' === pathinfo($resource, \\PATHINFO_EXTENSION))\
\ {\n# return true;\n# }\n# \n# return 'php' === $type;\n# }\n# \n# /**\n# * Resolve\
\ the parameters to the $callback and execute it."
- name: configBuilder
visibility: private
parameters:
- name: namespace
comment: '# * @param string $namespace FQCN string for a class implementing ConfigBuilderInterface'
traits:
- Symfony\Component\Config\Builder\ConfigBuilderGenerator
- Symfony\Component\Config\Builder\ConfigBuilderGeneratorInterface
- Symfony\Component\Config\Builder\ConfigBuilderInterface
- Symfony\Component\Config\FileLocatorInterface
- Symfony\Component\DependencyInjection\Attribute\When
- Symfony\Component\DependencyInjection\Attribute\WhenNot
- Symfony\Component\DependencyInjection\Container
- Symfony\Component\DependencyInjection\ContainerBuilder
- Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
- Symfony\Component\DependencyInjection\Exception\LogicException
- Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface
- Symfony\Component\DependencyInjection\Extension\ExtensionInterface
- Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator
interfaces:
- ConfigBuilderInterface