name: ContainerBuilder class_comment: '# * ContainerBuilder is a DI container that provides an API to easily describe services. # * # * @author Fabien Potencier ' dependencies: - name: InstalledVersions type: class source: Composer\InstalledVersions - name: ClassExistenceResource type: class source: Symfony\Component\Config\Resource\ClassExistenceResource - name: ComposerResource type: class source: Symfony\Component\Config\Resource\ComposerResource - name: DirectoryResource type: class source: Symfony\Component\Config\Resource\DirectoryResource - name: FileExistenceResource type: class source: Symfony\Component\Config\Resource\FileExistenceResource - name: FileResource type: class source: Symfony\Component\Config\Resource\FileResource - name: GlobResource type: class source: Symfony\Component\Config\Resource\GlobResource - name: ReflectionClassResource type: class source: Symfony\Component\Config\Resource\ReflectionClassResource - name: ResourceInterface type: class source: Symfony\Component\Config\Resource\ResourceInterface - name: AbstractArgument type: class source: Symfony\Component\DependencyInjection\Argument\AbstractArgument - name: IteratorArgument type: class source: Symfony\Component\DependencyInjection\Argument\IteratorArgument - name: LazyClosure type: class source: Symfony\Component\DependencyInjection\Argument\LazyClosure - name: RewindableGenerator type: class source: Symfony\Component\DependencyInjection\Argument\RewindableGenerator - name: ServiceClosureArgument type: class source: Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument - name: ServiceLocator type: class source: Symfony\Component\DependencyInjection\Argument\ServiceLocator - name: ServiceLocatorArgument type: class source: Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument - name: Target type: class source: Symfony\Component\DependencyInjection\Attribute\Target - name: Compiler type: class source: Symfony\Component\DependencyInjection\Compiler\Compiler - name: CompilerPassInterface type: class source: Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface - name: PassConfig type: class source: Symfony\Component\DependencyInjection\Compiler\PassConfig - name: ResolveEnvPlaceholdersPass type: class source: Symfony\Component\DependencyInjection\Compiler\ResolveEnvPlaceholdersPass - name: BadMethodCallException type: class source: Symfony\Component\DependencyInjection\Exception\BadMethodCallException - name: InvalidArgumentException type: class source: Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - name: LogicException type: class source: Symfony\Component\DependencyInjection\Exception\LogicException - name: ParameterNotFoundException type: class source: Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException - name: RuntimeException type: class source: Symfony\Component\DependencyInjection\Exception\RuntimeException - name: ServiceCircularReferenceException type: class source: Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException - name: ServiceNotFoundException type: class source: Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException - name: ExtensionInterface type: class source: Symfony\Component\DependencyInjection\Extension\ExtensionInterface - name: InstantiatorInterface type: class source: Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface - name: LazyServiceInstantiator type: class source: Symfony\Component\DependencyInjection\LazyProxy\Instantiator\LazyServiceInstantiator - name: RealServiceInstantiator type: class source: Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator - name: EnvPlaceholderParameterBag type: class source: Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag - name: ParameterBag type: class source: Symfony\Component\DependencyInjection\ParameterBag\ParameterBag - name: ParameterBagInterface type: class source: Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface - name: Expression type: class source: Symfony\Component\ExpressionLanguage\Expression - name: ExpressionFunctionProviderInterface type: class source: Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface properties: [] methods: - name: setResourceTracking visibility: public parameters: - name: track comment: "# * ContainerBuilder is a DI container that provides an API to easily\ \ describe services.\n# *\n# * @author Fabien Potencier \n\ # */\n# class ContainerBuilder extends Container implements TaggedContainerInterface\n\ # {\n# /**\n# * @var array\n# */\n# private array\ \ $extensions = [];\n# \n# /**\n# * @var array\n#\ \ */\n# private array $extensionsByNs = [];\n# \n# /**\n# * @var array\n# */\n# private array $definitions = [];\n# \n# /**\n# * @var array\n# */\n# private array $aliasDefinitions = [];\n# \n# /**\n# * @var array\n# */\n# private array $resources = [];\n# \n# /**\n# * @var\ \ array>>\n# */\n# private array $extensionConfigs\ \ = [];\n# \n# private Compiler $compiler;\n# private bool $trackResources;\n\ # private InstantiatorInterface $proxyInstantiator;\n# private ExpressionLanguage\ \ $expressionLanguage;\n# \n# /**\n# * @var ExpressionFunctionProviderInterface[]\n\ # */\n# private array $expressionLanguageProviders = [];\n# \n# /**\n# * @var\ \ string[] with tag names used by findTaggedServiceIds\n# */\n# private array\ \ $usedTags = [];\n# \n# /**\n# * @var string[][] a map of env var names to their\ \ placeholders\n# */\n# private array $envPlaceholders = [];\n# \n# /**\n# * @var\ \ int[] a map of env vars to their resolution counter\n# */\n# private array $envCounters\ \ = [];\n# \n# /**\n# * @var string[] the list of vendor directories\n# */\n#\ \ private array $vendors;\n# \n# /**\n# * @var string[] the list of paths in vendor\ \ directories\n# */\n# private array $pathsInVendor = [];\n# \n# /**\n# * @var\ \ array\n# */\n# private array $autoconfiguredInstanceof\ \ = [];\n# \n# /**\n# * @var array\n# */\n# private array $autoconfiguredAttributes\ \ = [];\n# \n# /**\n# * @var array\n# */\n# private array $removedIds\ \ = [];\n# \n# /**\n# * @var array\n# */\n# private array $removedBindingIds\ \ = [];\n# \n# private const INTERNAL_TYPES = [\n# 'int' => true,\n# 'float' =>\ \ true,\n# 'string' => true,\n# 'bool' => true,\n# 'resource' => true,\n# 'object'\ \ => true,\n# 'array' => true,\n# 'null' => true,\n# 'callable' => true,\n# 'iterable'\ \ => true,\n# 'mixed' => true,\n# ];\n# \n# public function __construct(?ParameterBagInterface\ \ $parameterBag = null)\n# {\n# parent::__construct($parameterBag);\n# \n# $this->trackResources\ \ = interface_exists(ResourceInterface::class);\n# $this->setDefinition('service_container',\ \ (new Definition(ContainerInterface::class))->setSynthetic(true)->setPublic(true));\n\ # }\n# \n# /**\n# * @var array\n# */\n# private array\ \ $classReflectors;\n# \n# /**\n# * Sets the track resources flag.\n# *\n# * If\ \ you are not using the loaders and therefore don't want\n# * to depend on the\ \ Config component, set this flag to false." - name: isTrackingResources visibility: public parameters: [] comment: '# * Checks if resources are tracked.' - name: setProxyInstantiator visibility: public parameters: - name: proxyInstantiator comment: '# * Sets the instantiator to be used when fetching proxies.' - name: registerExtension visibility: public parameters: - name: extension comment: null - name: getExtension visibility: public parameters: - name: name comment: '# * Returns an extension by alias or namespace. # * # * @throws LogicException if the extension is not registered' - name: getExtensions visibility: public parameters: [] comment: '# * Returns all registered extensions. # * # * @return array' - name: hasExtension visibility: public parameters: - name: name comment: '# * Checks if we have an extension.' - name: getResources visibility: public parameters: [] comment: '# * Returns an array of resources loaded to build this configuration. # * # * @return ResourceInterface[]' - name: addResource visibility: public parameters: - name: resource comment: '# * @return $this' - name: setResources visibility: public parameters: - name: resources comment: '# * Sets the resources for this configuration. # * # * @param array $resources # * # * @return $this' - name: addObjectResource visibility: public parameters: - name: object comment: '# * Adds the object class hierarchy as resources. # * # * @param object|string $object An object instance or class name # * # * @return $this' - name: getReflectionClass visibility: public parameters: - name: class - name: throw default: 'true' comment: '# * Retrieves the requested reflection class and registers it for resource tracking. # * # * @throws \ReflectionException when a parent class/interface/trait is not found and $throw is true # * # * @final' - name: fileExists visibility: public parameters: - name: path - name: trackContents default: 'true' comment: '# * Checks whether the requested file or directory exists and registers the result for resource tracking. # * # * @param string $path The file or directory path for which to check the existence # * @param bool|string $trackContents Whether to track contents of the given resource. If a string is passed, # * it will be used as pattern for tracking contents of the requested directory # * # * @final' - name: loadFromExtension visibility: public parameters: - name: extension - name: values default: 'null' comment: '# * Loads the configuration for an extension. # * # * @param string $extension The extension alias or namespace # * @param array|null $values An array of values that customizes the extension # * # * @return $this # * # * @throws BadMethodCallException When this ContainerBuilder is compiled # * @throws \LogicException if the extension is not registered' - name: addCompilerPass visibility: public parameters: - name: pass - name: type default: PassConfig::TYPE_BEFORE_OPTIMIZATION - name: priority default: '0' comment: '# * Adds a compiler pass. # * # * @param string $type The type of compiler pass # * @param int $priority Used to sort the passes # * # * @return $this' - name: getCompilerPassConfig visibility: public parameters: [] comment: '# * Returns the compiler pass config which can then be modified.' - name: getCompiler visibility: public parameters: [] comment: '# * Returns the compiler.' - name: set visibility: public parameters: - name: id - name: service comment: '# * Sets a service. # * # * @throws BadMethodCallException When this ContainerBuilder is compiled' - name: removeDefinition visibility: public parameters: - name: id comment: '# * Removes a service definition.' - name: has visibility: public parameters: - name: id comment: null - name: get visibility: public parameters: - name: id - name: invalidBehavior default: ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE comment: '# * @throws InvalidArgumentException when no definitions are available # * @throws ServiceCircularReferenceException When a circular reference is detected # * @throws ServiceNotFoundException When the service is not defined # * @throws \Exception # * # * @see Reference' - name: doGet visibility: private parameters: - name: id - name: invalidBehavior default: ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE - name: '&$inlineServices' default: 'null' - name: isConstructorArgument default: 'false' comment: null - name: merge visibility: public parameters: - name: container comment: '# * Merges a ContainerBuilder with the current ContainerBuilder configuration. # * # * Service definitions overrides the current defined ones. # * # * But for parameters, they are overridden by the current ones. It allows # * the parameters passed to the container constructor to have precedence # * over the loaded ones. # * # * $container = new ContainerBuilder(new ParameterBag([''foo'' => ''bar''])); # * $loader = new LoaderXXX($container); # * $loader->load(''resource_name''); # * $container->register(''foo'', ''stdClass''); # * # * In the above example, even if the loaded resource defines a foo # * parameter, the value will still be ''bar'' as defined in the ContainerBuilder # * constructor. # * # * @throws BadMethodCallException When this ContainerBuilder is compiled' - name: getExtensionConfig visibility: public parameters: - name: name comment: '# * Returns the configuration array for the given extension. # * # * @return array>' - name: prependExtensionConfig visibility: public parameters: - name: name - name: config comment: '# * Prepends a config array to the configs of the given extension. # * # * @param array $config' - name: deprecateParameter visibility: public parameters: - name: name - name: package - name: version - name: message default: '''The parameter "%s" is deprecated.''' comment: '# * Deprecates a service container parameter. # * # * @throws ParameterNotFoundException if the parameter is not defined' - name: compile visibility: public parameters: - name: resolveEnvPlaceholders default: 'false' comment: '# * Compiles the container. # * # * This method passes the container to compiler # * passes whose job is to manipulate and optimize # * the container. # * # * The main compiler passes roughly do four things: # * # * * The extension configurations are merged; # * * Parameter values are resolved; # * * The parameter bag is frozen; # * * Extension loading is disabled. # * # * @param bool $resolveEnvPlaceholders Whether %env()% parameters should be resolved using the current # * env vars or be replaced by uniquely identifiable placeholders. # * Set to "true" when you want to use the current ContainerBuilder # * directly, keep to "false" when the container is dumped instead.' - name: getServiceIds visibility: public parameters: [] comment: null - name: getRemovedIds visibility: public parameters: [] comment: '# * Gets removed service or alias ids. # * # * @return array' - name: addAliases visibility: public parameters: - name: aliases comment: '# * Adds the service aliases. # * # * @param array $aliases' - name: setAliases visibility: public parameters: - name: aliases comment: '# * Sets the service aliases. # * # * @param array $aliases' - name: setAlias visibility: public parameters: - name: alias - name: id comment: '# * Sets an alias for an existing service. # * # * @throws InvalidArgumentException if the id is not a string or an Alias # * @throws InvalidArgumentException if the alias is for itself' - name: removeAlias visibility: public parameters: - name: alias comment: null - name: hasAlias visibility: public parameters: - name: id comment: null - name: getAliases visibility: public parameters: [] comment: '# * @return array' - name: getAlias visibility: public parameters: - name: id comment: '# * @throws InvalidArgumentException if the alias does not exist' - name: register visibility: public parameters: - name: id - name: class default: 'null' comment: '# * Registers a service definition. # * # * This method allows for simple registration of service definition # * with a fluid interface.' - name: autowire visibility: public parameters: - name: id - name: class default: 'null' comment: '# * Registers an autowired service definition. # * # * This method implements a shortcut for using setDefinition() with # * an autowired definition.' - name: addDefinitions visibility: public parameters: - name: definitions comment: '# * Adds the service definitions. # * # * @param array $definitions' - name: setDefinitions visibility: public parameters: - name: definitions comment: '# * Sets the service definitions. # * # * @param array $definitions' - name: getDefinitions visibility: public parameters: [] comment: '# * Gets all service definitions. # * # * @return array' - name: setDefinition visibility: public parameters: - name: id - name: definition comment: '# * Sets a service definition. # * # * @throws BadMethodCallException When this ContainerBuilder is compiled' - name: hasDefinition visibility: public parameters: - name: id comment: '# * Returns true if a service definition exists under the given identifier.' - name: getDefinition visibility: public parameters: - name: id comment: '# * Gets a service definition. # * # * @throws ServiceNotFoundException if the service definition does not exist' - name: findDefinition visibility: public parameters: - name: id comment: '# * Gets a service definition by id or alias. # * # * The method "unaliases" recursively to return a Definition instance. # * # * @throws ServiceNotFoundException if the service definition does not exist' - name: createService visibility: private parameters: - name: definition - name: '&$inlineServices' - name: isConstructorArgument default: 'false' - name: id default: 'null' - name: tryProxy default: 'true' comment: '# * Creates a service for a service definition. # * # * @throws RuntimeException When the factory definition is incomplete # * @throws RuntimeException When the service is a synthetic service # * @throws InvalidArgumentException When configure callable is not callable' - name: resolveServices visibility: public parameters: - name: value comment: '# * Replaces service references by the real service instance and evaluates expressions. # * # * @return mixed The same value with all service references replaced by # * the real service instances and all expressions evaluated' - name: doResolveServices visibility: private parameters: - name: value - name: '&$inlineServices' default: '[]' - name: isConstructorArgument default: 'false' comment: null - name: findTaggedServiceIds visibility: public parameters: - name: name - name: throwOnAbstract default: 'false' comment: '# * Returns service ids for a given tag. # * # * Example: # * # * $container->register(''foo'')->addTag(''my.tag'', [''hello'' => ''world'']); # * # * $serviceIds = $container->findTaggedServiceIds(''my.tag''); # * foreach ($serviceIds as $serviceId => $tags) { # * foreach ($tags as $tag) { # * echo $tag[''hello'']; # * } # * } # * # * @return array An array of tags with the tagged service as key, holding a list of attribute arrays' - name: findTags visibility: public parameters: [] comment: '# * Returns all tags the defined services use. # * # * @return string[]' - name: findUnusedTags visibility: public parameters: [] comment: '# * Returns all tags not queried by findTaggedServiceIds. # * # * @return string[]' - name: addExpressionLanguageProvider visibility: public parameters: - name: provider comment: null - name: getExpressionLanguageProviders visibility: public parameters: [] comment: '# * @return ExpressionFunctionProviderInterface[]' - name: registerForAutoconfiguration visibility: public parameters: - name: interface comment: '# * Returns a ChildDefinition that will be used for autoconfiguring the interface/class.' - name: registerAttributeForAutoconfiguration visibility: public parameters: - name: attributeClass - name: configurator comment: '# * Registers an attribute that will be used for autoconfiguring annotated classes. # * # * The third argument passed to the callable is the reflector of the # * class/method/property/parameter that the attribute targets. Using one or many of # * \ReflectionClass|\ReflectionMethod|\ReflectionProperty|\ReflectionParameter as a type-hint # * for this argument allows filtering which attributes should be passed to the callable. # * # * @template T # * # * @param class-string $attributeClass # * @param callable(ChildDefinition, T, \Reflector): void $configurator' - name: registerAliasForArgument visibility: public parameters: - name: id - name: type - name: name default: 'null' comment: '# * Registers an autowiring alias that only binds to a specific argument name. # * # * The argument name is derived from $name if provided (from $id otherwise) # * using camel case: "foo.bar" or "foo_bar" creates an alias bound to # * "$fooBar"-named arguments with $type as type-hint. Such arguments will # * receive the service $id when autowiring is used.' - name: getAutoconfiguredInstanceof visibility: public parameters: [] comment: '# * Returns an array of ChildDefinition[] keyed by interface. # * # * @return array' - name: getAutoconfiguredAttributes visibility: public parameters: [] comment: '# * @return array' - name: resolveEnvPlaceholders visibility: public parameters: - name: value - name: format default: 'null' - name: '&$usedEnvs' default: 'null' comment: '# * Resolves env parameter placeholders in a string or an array. # * # * @param string|true|null $format A sprintf() format returning the replacement for each env var name or # * null to resolve back to the original "%env(VAR)%" format or # * true to resolve to the actual values of the referenced env vars # * @param array &$usedEnvs Env vars found while resolving are added to this array # * # * @return mixed The value with env parameters resolved if a string or an array is passed' - name: getEnvCounters visibility: public parameters: [] comment: '# * Get statistics about env usage. # * # * @return int[] The number of time each env vars has been resolved' - name: log visibility: public parameters: - name: pass - name: message comment: '# * @final' - name: getRemovedBindingIds visibility: public parameters: [] comment: "# * Checks whether a class is available and will remain available in the\ \ \"no-dev\" mode of Composer.\n# *\n# * When parent packages are provided and\ \ if any of them is in dev-only mode,\n# * the class will be considered available\ \ even if it is also in dev-only mode.\n# *\n# * @throws \\LogicException If dependencies\ \ have been installed with Composer 1\n# */\n# final public static function willBeAvailable(string\ \ $package, string $class, array $parentPackages): bool\n# {\n# if (!class_exists(InstalledVersions::class))\ \ {\n# throw new \\LogicException(\\sprintf('Calling \"%s\" when dependencies\ \ have been installed with Composer 1 is not supported. Consider upgrading to\ \ Composer 2.', __METHOD__));\n# }\n# \n# if (!class_exists($class) && !interface_exists($class,\ \ false) && !trait_exists($class, false)) {\n# return false;\n# }\n# \n# if (!InstalledVersions::isInstalled($package)\ \ || InstalledVersions::isInstalled($package, false)) {\n# return true;\n# }\n\ # \n# // the package is installed but in dev-mode only, check if this applies\ \ to one of the parent packages too\n# \n# $rootPackage = InstalledVersions::getRootPackage()['name']\ \ ?? '';\n# \n# if ('symfony/symfony' === $rootPackage) {\n# return true;\n# }\n\ # \n# foreach ($parentPackages as $parentPackage) {\n# if ($rootPackage === $parentPackage\ \ || (InstalledVersions::isInstalled($parentPackage) && !InstalledVersions::isInstalled($parentPackage,\ \ false))) {\n# return true;\n# }\n# }\n# \n# return false;\n# }\n# \n# /**\n\ # * Gets removed binding ids.\n# *\n# * @return array\n# *\n# * @internal" - name: removeBindings visibility: public parameters: - name: id comment: '# * Removes bindings for a service. # * # * @internal' - name: getServiceConditionals visibility: public parameters: - name: value comment: '# * @return string[] # * # * @internal' - name: getInitializedConditionals visibility: public parameters: - name: value comment: '# * @return string[] # * # * @internal' - name: hash visibility: public parameters: - name: value comment: '# * Computes a reasonably unique hash of a serializable value.' - name: getEnv visibility: protected parameters: - name: name comment: null - name: callMethod visibility: private parameters: - name: service - name: call - name: '&$inlineServices' comment: null - name: shareService visibility: private parameters: - name: definition - name: service - name: id - name: '&$inlineServices' comment: null - name: getExpressionLanguage visibility: private parameters: [] comment: null - name: inVendors visibility: private parameters: - name: path comment: null traits: - Composer\InstalledVersions - Symfony\Component\Config\Resource\ClassExistenceResource - Symfony\Component\Config\Resource\ComposerResource - Symfony\Component\Config\Resource\DirectoryResource - Symfony\Component\Config\Resource\FileExistenceResource - Symfony\Component\Config\Resource\FileResource - Symfony\Component\Config\Resource\GlobResource - Symfony\Component\Config\Resource\ReflectionClassResource - Symfony\Component\Config\Resource\ResourceInterface - Symfony\Component\DependencyInjection\Argument\AbstractArgument - Symfony\Component\DependencyInjection\Argument\IteratorArgument - Symfony\Component\DependencyInjection\Argument\LazyClosure - Symfony\Component\DependencyInjection\Argument\RewindableGenerator - Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument - Symfony\Component\DependencyInjection\Argument\ServiceLocator - Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument - Symfony\Component\DependencyInjection\Attribute\Target - Symfony\Component\DependencyInjection\Compiler\Compiler - Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface - Symfony\Component\DependencyInjection\Compiler\PassConfig - Symfony\Component\DependencyInjection\Compiler\ResolveEnvPlaceholdersPass - Symfony\Component\DependencyInjection\Exception\BadMethodCallException - Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - Symfony\Component\DependencyInjection\Exception\LogicException - Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException - Symfony\Component\DependencyInjection\Exception\RuntimeException - Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException - Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException - Symfony\Component\DependencyInjection\Extension\ExtensionInterface - Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface - Symfony\Component\DependencyInjection\LazyProxy\Instantiator\LazyServiceInstantiator - Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator - Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag - Symfony\Component\DependencyInjection\ParameterBag\ParameterBag - Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface - Symfony\Component\ExpressionLanguage\Expression - Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface interfaces: - TaggedContainerInterface - a