Initial Drupal 11 with DDEV setup
This commit is contained in:
		
							
								
								
									
										117
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/AbstractConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/AbstractConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,117 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\Config\Loader\ParamConfigurator;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Alias;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Argument\AbstractArgument;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Argument\ArgumentInterface;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Definition;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Parameter;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Reference;
 | 
			
		||||
use Symfony\Component\ExpressionLanguage\Expression;
 | 
			
		||||
 | 
			
		||||
abstract class AbstractConfigurator
 | 
			
		||||
{
 | 
			
		||||
    public const FACTORY = 'unknown';
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @var \Closure(mixed, bool):mixed|null
 | 
			
		||||
     */
 | 
			
		||||
    public static ?\Closure $valuePreProcessor = null;
 | 
			
		||||
 | 
			
		||||
    /** @internal */
 | 
			
		||||
    protected Definition|Alias|null $definition = null;
 | 
			
		||||
 | 
			
		||||
    public function __call(string $method, array $args): mixed
 | 
			
		||||
    {
 | 
			
		||||
        if (method_exists($this, 'set'.$method)) {
 | 
			
		||||
            return $this->{'set'.$method}(...$args);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        throw new \BadMethodCallException(\sprintf('Call to undefined method "%s::%s()".', static::class, $method));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function __serialize(): array
 | 
			
		||||
    {
 | 
			
		||||
        throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function __unserialize(array $data): void
 | 
			
		||||
    {
 | 
			
		||||
        throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value.
 | 
			
		||||
     *
 | 
			
		||||
     * @param bool $allowServices whether Definition and Reference are allowed; by default, only scalars, arrays and enum are
 | 
			
		||||
     *
 | 
			
		||||
     * @return mixed the value, optionally cast to a Definition/Reference
 | 
			
		||||
     */
 | 
			
		||||
    public static function processValue(mixed $value, bool $allowServices = false): mixed
 | 
			
		||||
    {
 | 
			
		||||
        if (\is_array($value)) {
 | 
			
		||||
            foreach ($value as $k => $v) {
 | 
			
		||||
                $value[$k] = static::processValue($v, $allowServices);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return self::$valuePreProcessor ? (self::$valuePreProcessor)($value, $allowServices) : $value;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (self::$valuePreProcessor) {
 | 
			
		||||
            $value = (self::$valuePreProcessor)($value, $allowServices);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($value instanceof ReferenceConfigurator) {
 | 
			
		||||
            $reference = new Reference($value->id, $value->invalidBehavior);
 | 
			
		||||
 | 
			
		||||
            return $value instanceof ClosureReferenceConfigurator ? new ServiceClosureArgument($reference) : $reference;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($value instanceof InlineServiceConfigurator) {
 | 
			
		||||
            $def = $value->definition;
 | 
			
		||||
            $value->definition = null;
 | 
			
		||||
 | 
			
		||||
            return $def;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($value instanceof ParamConfigurator) {
 | 
			
		||||
            return (string) $value;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($value instanceof self) {
 | 
			
		||||
            throw new InvalidArgumentException(\sprintf('"%s()" can be used only at the root of service configuration files.', $value::FACTORY));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        switch (true) {
 | 
			
		||||
            case null === $value:
 | 
			
		||||
            case \is_scalar($value):
 | 
			
		||||
            case $value instanceof \UnitEnum:
 | 
			
		||||
                return $value;
 | 
			
		||||
 | 
			
		||||
            case $value instanceof ArgumentInterface:
 | 
			
		||||
            case $value instanceof Definition:
 | 
			
		||||
            case $value instanceof Expression:
 | 
			
		||||
            case $value instanceof Parameter:
 | 
			
		||||
            case $value instanceof AbstractArgument:
 | 
			
		||||
            case $value instanceof Reference:
 | 
			
		||||
                if ($allowServices) {
 | 
			
		||||
                    return $value;
 | 
			
		||||
                }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        throw new InvalidArgumentException(\sprintf('Cannot use values of type "%s" in service configuration files.', get_debug_type($value)));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										115
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/AbstractServiceConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										115
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/AbstractServiceConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,115 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Definition;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
 | 
			
		||||
 | 
			
		||||
abstract class AbstractServiceConfigurator extends AbstractConfigurator
 | 
			
		||||
{
 | 
			
		||||
    private array $defaultTags = [];
 | 
			
		||||
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        protected ServicesConfigurator $parent,
 | 
			
		||||
        Definition $definition,
 | 
			
		||||
        protected ?string $id = null,
 | 
			
		||||
        array $defaultTags = [],
 | 
			
		||||
    ) {
 | 
			
		||||
        $this->definition = $definition;
 | 
			
		||||
        $this->defaultTags = $defaultTags;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function __destruct()
 | 
			
		||||
    {
 | 
			
		||||
        // default tags should be added last
 | 
			
		||||
        foreach ($this->defaultTags as $name => $attributes) {
 | 
			
		||||
            foreach ($attributes as $attribute) {
 | 
			
		||||
                $this->definition->addTag($name, $attribute);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        $this->defaultTags = [];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Registers a service.
 | 
			
		||||
     */
 | 
			
		||||
    final public function set(?string $id, ?string $class = null): ServiceConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        $this->__destruct();
 | 
			
		||||
 | 
			
		||||
        return $this->parent->set($id, $class);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Creates an alias.
 | 
			
		||||
     */
 | 
			
		||||
    final public function alias(string $id, string $referencedId): AliasConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        $this->__destruct();
 | 
			
		||||
 | 
			
		||||
        return $this->parent->alias($id, $referencedId);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Registers a PSR-4 namespace using a glob pattern.
 | 
			
		||||
     */
 | 
			
		||||
    final public function load(string $namespace, string $resource): PrototypeConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        $this->__destruct();
 | 
			
		||||
 | 
			
		||||
        return $this->parent->load($namespace, $resource);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Gets an already defined service definition.
 | 
			
		||||
     *
 | 
			
		||||
     * @throws ServiceNotFoundException if the service definition does not exist
 | 
			
		||||
     */
 | 
			
		||||
    final public function get(string $id): ServiceConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        $this->__destruct();
 | 
			
		||||
 | 
			
		||||
        return $this->parent->get($id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Removes an already defined service definition or alias.
 | 
			
		||||
     */
 | 
			
		||||
    final public function remove(string $id): ServicesConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        $this->__destruct();
 | 
			
		||||
 | 
			
		||||
        return $this->parent->remove($id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Registers a stack of decorator services.
 | 
			
		||||
     *
 | 
			
		||||
     * @param InlineServiceConfigurator[]|ReferenceConfigurator[] $services
 | 
			
		||||
     */
 | 
			
		||||
    final public function stack(string $id, array $services): AliasConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        $this->__destruct();
 | 
			
		||||
 | 
			
		||||
        return $this->parent->stack($id, $services);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Registers a service.
 | 
			
		||||
     */
 | 
			
		||||
    final public function __invoke(string $id, ?string $class = null): ServiceConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        $this->__destruct();
 | 
			
		||||
 | 
			
		||||
        return $this->parent->set($id, $class);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										31
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/AliasConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/AliasConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,31 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Alias;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Nicolas Grekas <p@tchwork.com>
 | 
			
		||||
 */
 | 
			
		||||
class AliasConfigurator extends AbstractServiceConfigurator
 | 
			
		||||
{
 | 
			
		||||
    use Traits\DeprecateTrait;
 | 
			
		||||
    use Traits\PublicTrait;
 | 
			
		||||
 | 
			
		||||
    public const FACTORY = 'alias';
 | 
			
		||||
 | 
			
		||||
    public function __construct(ServicesConfigurator $parent, Alias $alias)
 | 
			
		||||
    {
 | 
			
		||||
        $this->parent = $parent;
 | 
			
		||||
        $this->definition = $alias;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										16
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/ClosureReferenceConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/ClosureReferenceConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,16 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
class ClosureReferenceConfigurator extends ReferenceConfigurator
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										200
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										200
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,200 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\Config\Loader\ParamConfigurator;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Argument\AbstractArgument;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
 | 
			
		||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Definition;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Loader\UndefinedExtensionHandler;
 | 
			
		||||
use Symfony\Component\ExpressionLanguage\Expression;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Nicolas Grekas <p@tchwork.com>
 | 
			
		||||
 */
 | 
			
		||||
class ContainerConfigurator extends AbstractConfigurator
 | 
			
		||||
{
 | 
			
		||||
    public const FACTORY = 'container';
 | 
			
		||||
 | 
			
		||||
    private array $instanceof;
 | 
			
		||||
    private int $anonymousCount = 0;
 | 
			
		||||
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        private ContainerBuilder $container,
 | 
			
		||||
        private PhpFileLoader $loader,
 | 
			
		||||
        array &$instanceof,
 | 
			
		||||
        private string $path,
 | 
			
		||||
        private string $file,
 | 
			
		||||
        private ?string $env = null,
 | 
			
		||||
    ) {
 | 
			
		||||
        $this->instanceof = &$instanceof;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    final public function extension(string $namespace, array $config, bool $prepend = false): void
 | 
			
		||||
    {
 | 
			
		||||
        if ($prepend) {
 | 
			
		||||
            $this->container->prependExtensionConfig($namespace, static::processValue($config));
 | 
			
		||||
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!$this->container->hasExtension($namespace)) {
 | 
			
		||||
            $extensions = array_filter(array_map(fn (ExtensionInterface $ext) => $ext->getAlias(), $this->container->getExtensions()));
 | 
			
		||||
            throw new InvalidArgumentException(UndefinedExtensionHandler::getErrorMessage($namespace, $this->file, $namespace, $extensions));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $this->container->loadFromExtension($namespace, static::processValue($config));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    final public function import(string $resource, ?string $type = null, bool|string $ignoreErrors = false): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->loader->setCurrentDir(\dirname($this->path));
 | 
			
		||||
        $this->loader->import($resource, $type, $ignoreErrors, $this->file);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    final public function parameters(): ParametersConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        return new ParametersConfigurator($this->container);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    final public function services(): ServicesConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        return new ServicesConfigurator($this->container, $this->loader, $this->instanceof, $this->path, $this->anonymousCount);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Get the current environment to be able to write conditional configuration.
 | 
			
		||||
     */
 | 
			
		||||
    final public function env(): ?string
 | 
			
		||||
    {
 | 
			
		||||
        return $this->env;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    final public function withPath(string $path): static
 | 
			
		||||
    {
 | 
			
		||||
        $clone = clone $this;
 | 
			
		||||
        $clone->path = $clone->file = $path;
 | 
			
		||||
        $clone->loader->setCurrentDir(\dirname($path));
 | 
			
		||||
 | 
			
		||||
        return $clone;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a parameter.
 | 
			
		||||
 */
 | 
			
		||||
function param(string $name): ParamConfigurator
 | 
			
		||||
{
 | 
			
		||||
    return new ParamConfigurator($name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a reference to a service.
 | 
			
		||||
 */
 | 
			
		||||
function service(string $serviceId): ReferenceConfigurator
 | 
			
		||||
{
 | 
			
		||||
    return new ReferenceConfigurator($serviceId);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates an inline service.
 | 
			
		||||
 */
 | 
			
		||||
function inline_service(?string $class = null): InlineServiceConfigurator
 | 
			
		||||
{
 | 
			
		||||
    return new InlineServiceConfigurator(new Definition($class));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a service locator.
 | 
			
		||||
 *
 | 
			
		||||
 * @param array<ReferenceConfigurator|InlineServiceConfigurator> $values
 | 
			
		||||
 */
 | 
			
		||||
function service_locator(array $values): ServiceLocatorArgument
 | 
			
		||||
{
 | 
			
		||||
    $values = AbstractConfigurator::processValue($values, true);
 | 
			
		||||
 | 
			
		||||
    return new ServiceLocatorArgument($values);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a lazy iterator.
 | 
			
		||||
 *
 | 
			
		||||
 * @param ReferenceConfigurator[] $values
 | 
			
		||||
 */
 | 
			
		||||
function iterator(array $values): IteratorArgument
 | 
			
		||||
{
 | 
			
		||||
    return new IteratorArgument(AbstractConfigurator::processValue($values, true));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a lazy iterator by tag name.
 | 
			
		||||
 */
 | 
			
		||||
function tagged_iterator(string $tag, ?string $indexAttribute = null, ?string $defaultIndexMethod = null, ?string $defaultPriorityMethod = null, string|array $exclude = [], bool $excludeSelf = true): TaggedIteratorArgument
 | 
			
		||||
{
 | 
			
		||||
    return new TaggedIteratorArgument($tag, $indexAttribute, $defaultIndexMethod, false, $defaultPriorityMethod, (array) $exclude, $excludeSelf);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a service locator by tag name.
 | 
			
		||||
 */
 | 
			
		||||
function tagged_locator(string $tag, ?string $indexAttribute = null, ?string $defaultIndexMethod = null, ?string $defaultPriorityMethod = null, string|array $exclude = [], bool $excludeSelf = true): ServiceLocatorArgument
 | 
			
		||||
{
 | 
			
		||||
    return new ServiceLocatorArgument(new TaggedIteratorArgument($tag, $indexAttribute, $defaultIndexMethod, true, $defaultPriorityMethod, (array) $exclude, $excludeSelf));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates an expression.
 | 
			
		||||
 */
 | 
			
		||||
function expr(string $expression): Expression
 | 
			
		||||
{
 | 
			
		||||
    return new Expression($expression);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates an abstract argument.
 | 
			
		||||
 */
 | 
			
		||||
function abstract_arg(string $description): AbstractArgument
 | 
			
		||||
{
 | 
			
		||||
    return new AbstractArgument($description);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates an environment variable reference.
 | 
			
		||||
 */
 | 
			
		||||
function env(string $name): EnvConfigurator
 | 
			
		||||
{
 | 
			
		||||
    return new EnvConfigurator($name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a closure service reference.
 | 
			
		||||
 */
 | 
			
		||||
function service_closure(string $serviceId): ClosureReferenceConfigurator
 | 
			
		||||
{
 | 
			
		||||
    return new ClosureReferenceConfigurator($serviceId);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a closure.
 | 
			
		||||
 */
 | 
			
		||||
function closure(string|array|ReferenceConfigurator|Expression $callable): InlineServiceConfigurator
 | 
			
		||||
{
 | 
			
		||||
    return (new InlineServiceConfigurator(new Definition('Closure')))
 | 
			
		||||
        ->factory(['Closure', 'fromCallable'])
 | 
			
		||||
        ->args([$callable]);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										76
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/DefaultsConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/DefaultsConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,76 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Definition;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Nicolas Grekas <p@tchwork.com>
 | 
			
		||||
 */
 | 
			
		||||
class DefaultsConfigurator extends AbstractServiceConfigurator
 | 
			
		||||
{
 | 
			
		||||
    use Traits\AutoconfigureTrait;
 | 
			
		||||
    use Traits\AutowireTrait;
 | 
			
		||||
    use Traits\BindTrait;
 | 
			
		||||
    use Traits\PublicTrait;
 | 
			
		||||
 | 
			
		||||
    public const FACTORY = 'defaults';
 | 
			
		||||
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        ServicesConfigurator $parent,
 | 
			
		||||
        Definition $definition,
 | 
			
		||||
        private ?string $path = null,
 | 
			
		||||
    ) {
 | 
			
		||||
        parent::__construct($parent, $definition, null, []);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a tag for this definition.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     *
 | 
			
		||||
     * @throws InvalidArgumentException when an invalid tag name or attribute is provided
 | 
			
		||||
     */
 | 
			
		||||
    final public function tag(string $name, array $attributes = []): static
 | 
			
		||||
    {
 | 
			
		||||
        if ('' === $name) {
 | 
			
		||||
            throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $this->validateAttributes($name, $attributes);
 | 
			
		||||
 | 
			
		||||
        $this->definition->addTag($name, $attributes);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Defines an instanceof-conditional to be applied to following service definitions.
 | 
			
		||||
     */
 | 
			
		||||
    final public function instanceof(string $fqcn): InstanceofConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        return $this->parent->instanceof($fqcn);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private function validateAttributes(string $tag, array $attributes, array $path = []): void
 | 
			
		||||
    {
 | 
			
		||||
        foreach ($attributes as $name => $value) {
 | 
			
		||||
            if (\is_array($value)) {
 | 
			
		||||
                $this->validateAttributes($tag, $value, [...$path, $name]);
 | 
			
		||||
            } elseif (!\is_scalar($value ?? '')) {
 | 
			
		||||
                $name = implode('.', [...$path, $name]);
 | 
			
		||||
                throw new InvalidArgumentException(\sprintf('Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type or an array of scalar-type.', $tag, $name));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										236
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/EnvConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										236
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/EnvConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,236 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\Config\Loader\ParamConfigurator;
 | 
			
		||||
 | 
			
		||||
class EnvConfigurator extends ParamConfigurator
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var string[]
 | 
			
		||||
     */
 | 
			
		||||
    private array $stack;
 | 
			
		||||
 | 
			
		||||
    public function __construct(string $name)
 | 
			
		||||
    {
 | 
			
		||||
        $this->stack = explode(':', $name);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function __toString(): string
 | 
			
		||||
    {
 | 
			
		||||
        return '%env('.implode(':', $this->stack).')%';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function __call(string $name, array $arguments): static
 | 
			
		||||
    {
 | 
			
		||||
        $processor = strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1_\2', $name));
 | 
			
		||||
 | 
			
		||||
        $this->custom($processor, ...$arguments);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function custom(string $processor, ...$args): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, $processor, ...$args);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function base64(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'base64');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function bool(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'bool');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function not(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'not');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function const(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'const');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function csv(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'csv');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function file(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'file');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function float(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'float');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function int(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'int');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function json(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'json');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function key(string $key): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'key', $key);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function url(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'url');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function queryString(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'query_string');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function resolve(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'resolve');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function default(string $fallbackParam): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'default', $fallbackParam);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function string(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'string');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function trim(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'trim');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function require(): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'require');
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param class-string<\BackedEnum> $backedEnumClassName
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    public function enum(string $backedEnumClassName): static
 | 
			
		||||
    {
 | 
			
		||||
        array_unshift($this->stack, 'enum', $backedEnumClassName);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										45
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/FromCallableConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/FromCallableConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,45 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Definition;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Nicolas Grekas <p@tchwork.com>
 | 
			
		||||
 */
 | 
			
		||||
class FromCallableConfigurator extends AbstractServiceConfigurator
 | 
			
		||||
{
 | 
			
		||||
    use Traits\AbstractTrait;
 | 
			
		||||
    use Traits\AutoconfigureTrait;
 | 
			
		||||
    use Traits\AutowireTrait;
 | 
			
		||||
    use Traits\BindTrait;
 | 
			
		||||
    use Traits\DecorateTrait;
 | 
			
		||||
    use Traits\DeprecateTrait;
 | 
			
		||||
    use Traits\LazyTrait;
 | 
			
		||||
    use Traits\PublicTrait;
 | 
			
		||||
    use Traits\ShareTrait;
 | 
			
		||||
    use Traits\TagTrait;
 | 
			
		||||
 | 
			
		||||
    public const FACTORY = 'services';
 | 
			
		||||
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        private ServiceConfigurator $serviceConfigurator,
 | 
			
		||||
        Definition $definition,
 | 
			
		||||
    ) {
 | 
			
		||||
        parent::__construct($serviceConfigurator->parent, $definition, $serviceConfigurator->id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function __destruct()
 | 
			
		||||
    {
 | 
			
		||||
        $this->serviceConfigurator->__destruct();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										44
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/InlineServiceConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/InlineServiceConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,44 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Definition;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Nicolas Grekas <p@tchwork.com>
 | 
			
		||||
 */
 | 
			
		||||
class InlineServiceConfigurator extends AbstractConfigurator
 | 
			
		||||
{
 | 
			
		||||
    use Traits\ArgumentTrait;
 | 
			
		||||
    use Traits\AutowireTrait;
 | 
			
		||||
    use Traits\BindTrait;
 | 
			
		||||
    use Traits\CallTrait;
 | 
			
		||||
    use Traits\ConfiguratorTrait;
 | 
			
		||||
    use Traits\ConstructorTrait;
 | 
			
		||||
    use Traits\FactoryTrait;
 | 
			
		||||
    use Traits\FileTrait;
 | 
			
		||||
    use Traits\LazyTrait;
 | 
			
		||||
    use Traits\ParentTrait;
 | 
			
		||||
    use Traits\PropertyTrait;
 | 
			
		||||
    use Traits\TagTrait;
 | 
			
		||||
 | 
			
		||||
    public const FACTORY = 'service';
 | 
			
		||||
 | 
			
		||||
    private string $id = '[inline]';
 | 
			
		||||
    private bool $allowParent = true;
 | 
			
		||||
    private ?string $path = null;
 | 
			
		||||
 | 
			
		||||
    public function __construct(Definition $definition)
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition = $definition;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										50
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/InstanceofConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/InstanceofConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,50 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Definition;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Nicolas Grekas <p@tchwork.com>
 | 
			
		||||
 */
 | 
			
		||||
class InstanceofConfigurator extends AbstractServiceConfigurator
 | 
			
		||||
{
 | 
			
		||||
    use Traits\AutowireTrait;
 | 
			
		||||
    use Traits\BindTrait;
 | 
			
		||||
    use Traits\CallTrait;
 | 
			
		||||
    use Traits\ConfiguratorTrait;
 | 
			
		||||
    use Traits\ConstructorTrait;
 | 
			
		||||
    use Traits\LazyTrait;
 | 
			
		||||
    use Traits\PropertyTrait;
 | 
			
		||||
    use Traits\PublicTrait;
 | 
			
		||||
    use Traits\ShareTrait;
 | 
			
		||||
    use Traits\TagTrait;
 | 
			
		||||
 | 
			
		||||
    public const FACTORY = 'instanceof';
 | 
			
		||||
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        ServicesConfigurator $parent,
 | 
			
		||||
        Definition $definition,
 | 
			
		||||
        string $id,
 | 
			
		||||
        private ?string $path = null,
 | 
			
		||||
    ) {
 | 
			
		||||
        parent::__construct($parent, $definition, $id, []);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Defines an instanceof-conditional to be applied to following service definitions.
 | 
			
		||||
     */
 | 
			
		||||
    final public function instanceof(string $fqcn): self
 | 
			
		||||
    {
 | 
			
		||||
        return $this->parent->instanceof($fqcn);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										51
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/ParametersConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/ParametersConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,51 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
use Symfony\Component\ExpressionLanguage\Expression;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Nicolas Grekas <p@tchwork.com>
 | 
			
		||||
 */
 | 
			
		||||
class ParametersConfigurator extends AbstractConfigurator
 | 
			
		||||
{
 | 
			
		||||
    public const FACTORY = 'parameters';
 | 
			
		||||
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        private ContainerBuilder $container,
 | 
			
		||||
    ) {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function set(string $name, mixed $value): static
 | 
			
		||||
    {
 | 
			
		||||
        if ($value instanceof Expression) {
 | 
			
		||||
            throw new InvalidArgumentException(\sprintf('Using an expression in parameter "%s" is not allowed.', $name));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $this->container->setParameter($name, static::processValue($value, true));
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function __invoke(string $name, mixed $value): static
 | 
			
		||||
    {
 | 
			
		||||
        return $this->set($name, $value);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										88
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/PrototypeConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/PrototypeConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,88 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Definition;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Nicolas Grekas <p@tchwork.com>
 | 
			
		||||
 */
 | 
			
		||||
class PrototypeConfigurator extends AbstractServiceConfigurator
 | 
			
		||||
{
 | 
			
		||||
    use Traits\AbstractTrait;
 | 
			
		||||
    use Traits\ArgumentTrait;
 | 
			
		||||
    use Traits\AutoconfigureTrait;
 | 
			
		||||
    use Traits\AutowireTrait;
 | 
			
		||||
    use Traits\BindTrait;
 | 
			
		||||
    use Traits\CallTrait;
 | 
			
		||||
    use Traits\ConfiguratorTrait;
 | 
			
		||||
    use Traits\ConstructorTrait;
 | 
			
		||||
    use Traits\DeprecateTrait;
 | 
			
		||||
    use Traits\FactoryTrait;
 | 
			
		||||
    use Traits\LazyTrait;
 | 
			
		||||
    use Traits\ParentTrait;
 | 
			
		||||
    use Traits\PropertyTrait;
 | 
			
		||||
    use Traits\PublicTrait;
 | 
			
		||||
    use Traits\ShareTrait;
 | 
			
		||||
    use Traits\TagTrait;
 | 
			
		||||
 | 
			
		||||
    public const FACTORY = 'load';
 | 
			
		||||
 | 
			
		||||
    private ?array $excludes = null;
 | 
			
		||||
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        ServicesConfigurator $parent,
 | 
			
		||||
        private PhpFileLoader $loader,
 | 
			
		||||
        Definition $defaults,
 | 
			
		||||
        string $namespace,
 | 
			
		||||
        private string $resource,
 | 
			
		||||
        private bool $allowParent,
 | 
			
		||||
        private ?string $path = null,
 | 
			
		||||
    ) {
 | 
			
		||||
        $definition = new Definition();
 | 
			
		||||
        if (!$defaults->isPublic() || !$defaults->isPrivate()) {
 | 
			
		||||
            $definition->setPublic($defaults->isPublic());
 | 
			
		||||
        }
 | 
			
		||||
        $definition->setAutowired($defaults->isAutowired());
 | 
			
		||||
        $definition->setAutoconfigured($defaults->isAutoconfigured());
 | 
			
		||||
        // deep clone, to avoid multiple process of the same instance in the passes
 | 
			
		||||
        $definition->setBindings(unserialize(serialize($defaults->getBindings())));
 | 
			
		||||
        $definition->setChanges([]);
 | 
			
		||||
 | 
			
		||||
        parent::__construct($parent, $definition, $namespace, $defaults->getTags());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function __destruct()
 | 
			
		||||
    {
 | 
			
		||||
        parent::__destruct();
 | 
			
		||||
 | 
			
		||||
        if (isset($this->loader)) {
 | 
			
		||||
            $this->loader->registerClasses($this->definition, $this->id, $this->resource, $this->excludes, $this->path);
 | 
			
		||||
        }
 | 
			
		||||
        unset($this->loader);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Excludes files from registration using glob patterns.
 | 
			
		||||
     *
 | 
			
		||||
     * @param string[]|string $excludes
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function exclude(array|string $excludes): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->excludes = (array) $excludes;
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										66
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/ReferenceConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/ReferenceConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,66 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\ContainerInterface;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Nicolas Grekas <p@tchwork.com>
 | 
			
		||||
 */
 | 
			
		||||
class ReferenceConfigurator extends AbstractConfigurator
 | 
			
		||||
{
 | 
			
		||||
    /** @internal */
 | 
			
		||||
    protected string $id;
 | 
			
		||||
 | 
			
		||||
    /** @internal */
 | 
			
		||||
    protected int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
 | 
			
		||||
 | 
			
		||||
    public function __construct(string $id)
 | 
			
		||||
    {
 | 
			
		||||
        $this->id = $id;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function ignoreOnInvalid(): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function nullOnInvalid(): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE;
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function ignoreOnUninitialized(): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->invalidBehavior = ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE;
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function __toString(): string
 | 
			
		||||
    {
 | 
			
		||||
        return $this->id;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										73
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/ServiceConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/ServiceConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,73 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Definition;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Nicolas Grekas <p@tchwork.com>
 | 
			
		||||
 */
 | 
			
		||||
class ServiceConfigurator extends AbstractServiceConfigurator
 | 
			
		||||
{
 | 
			
		||||
    use Traits\AbstractTrait;
 | 
			
		||||
    use Traits\ArgumentTrait;
 | 
			
		||||
    use Traits\AutoconfigureTrait;
 | 
			
		||||
    use Traits\AutowireTrait;
 | 
			
		||||
    use Traits\BindTrait;
 | 
			
		||||
    use Traits\CallTrait;
 | 
			
		||||
    use Traits\ClassTrait;
 | 
			
		||||
    use Traits\ConfiguratorTrait;
 | 
			
		||||
    use Traits\ConstructorTrait;
 | 
			
		||||
    use Traits\DecorateTrait;
 | 
			
		||||
    use Traits\DeprecateTrait;
 | 
			
		||||
    use Traits\FactoryTrait;
 | 
			
		||||
    use Traits\FileTrait;
 | 
			
		||||
    use Traits\FromCallableTrait;
 | 
			
		||||
    use Traits\LazyTrait;
 | 
			
		||||
    use Traits\ParentTrait;
 | 
			
		||||
    use Traits\PropertyTrait;
 | 
			
		||||
    use Traits\PublicTrait;
 | 
			
		||||
    use Traits\ShareTrait;
 | 
			
		||||
    use Traits\SyntheticTrait;
 | 
			
		||||
    use Traits\TagTrait;
 | 
			
		||||
 | 
			
		||||
    public const FACTORY = 'services';
 | 
			
		||||
 | 
			
		||||
    private bool $destructed = false;
 | 
			
		||||
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        private ContainerBuilder $container,
 | 
			
		||||
        private array $instanceof,
 | 
			
		||||
        private bool $allowParent,
 | 
			
		||||
        ServicesConfigurator $parent,
 | 
			
		||||
        Definition $definition,
 | 
			
		||||
        ?string $id,
 | 
			
		||||
        array $defaultTags,
 | 
			
		||||
        private ?string $path = null,
 | 
			
		||||
    ) {
 | 
			
		||||
        parent::__construct($parent, $definition, $id, $defaultTags);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function __destruct()
 | 
			
		||||
    {
 | 
			
		||||
        if ($this->destructed) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        $this->destructed = true;
 | 
			
		||||
 | 
			
		||||
        parent::__destruct();
 | 
			
		||||
 | 
			
		||||
        $this->container->removeBindings($this->id);
 | 
			
		||||
        $this->container->setDefinition($this->id, $this->definition->setInstanceofConditionals($this->instanceof));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										191
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/ServicesConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										191
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/ServicesConfigurator.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,191 @@
 | 
			
		||||
<?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\Loader\Configurator;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Alias;
 | 
			
		||||
use Symfony\Component\DependencyInjection\ChildDefinition;
 | 
			
		||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Definition;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Nicolas Grekas <p@tchwork.com>
 | 
			
		||||
 */
 | 
			
		||||
class ServicesConfigurator extends AbstractConfigurator
 | 
			
		||||
{
 | 
			
		||||
    public const FACTORY = 'services';
 | 
			
		||||
 | 
			
		||||
    private Definition $defaults;
 | 
			
		||||
    private array $instanceof;
 | 
			
		||||
    private string $anonymousHash;
 | 
			
		||||
    private int $anonymousCount;
 | 
			
		||||
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        private ContainerBuilder $container,
 | 
			
		||||
        private PhpFileLoader $loader,
 | 
			
		||||
        array &$instanceof,
 | 
			
		||||
        private ?string $path = null,
 | 
			
		||||
        int &$anonymousCount = 0,
 | 
			
		||||
    ) {
 | 
			
		||||
        $this->defaults = new Definition();
 | 
			
		||||
        $this->instanceof = &$instanceof;
 | 
			
		||||
        $this->anonymousHash = ContainerBuilder::hash($path ?: mt_rand());
 | 
			
		||||
        $this->anonymousCount = &$anonymousCount;
 | 
			
		||||
        $instanceof = [];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Defines a set of defaults for following service definitions.
 | 
			
		||||
     */
 | 
			
		||||
    final public function defaults(): DefaultsConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        return new DefaultsConfigurator($this, $this->defaults = new Definition(), $this->path);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Defines an instanceof-conditional to be applied to following service definitions.
 | 
			
		||||
     */
 | 
			
		||||
    final public function instanceof(string $fqcn): InstanceofConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        $this->instanceof[$fqcn] = $definition = new ChildDefinition('');
 | 
			
		||||
 | 
			
		||||
        return new InstanceofConfigurator($this, $definition, $fqcn, $this->path);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Registers a service.
 | 
			
		||||
     *
 | 
			
		||||
     * @param string|null $id    The service id, or null to create an anonymous service
 | 
			
		||||
     * @param string|null $class The class of the service, or null when $id is also the class name
 | 
			
		||||
     */
 | 
			
		||||
    final public function set(?string $id, ?string $class = null): ServiceConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        $defaults = $this->defaults;
 | 
			
		||||
        $definition = new Definition();
 | 
			
		||||
 | 
			
		||||
        if (null === $id) {
 | 
			
		||||
            if (!$class) {
 | 
			
		||||
                throw new \LogicException('Anonymous services must have a class name.');
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $id = \sprintf('.%d_%s', ++$this->anonymousCount, preg_replace('/^.*\\\\/', '', $class).'~'.$this->anonymousHash);
 | 
			
		||||
        } elseif (!$defaults->isPublic() || !$defaults->isPrivate()) {
 | 
			
		||||
            $definition->setPublic($defaults->isPublic() && !$defaults->isPrivate());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $definition->setAutowired($defaults->isAutowired());
 | 
			
		||||
        $definition->setAutoconfigured($defaults->isAutoconfigured());
 | 
			
		||||
        // deep clone, to avoid multiple process of the same instance in the passes
 | 
			
		||||
        $definition->setBindings(unserialize(serialize($defaults->getBindings())));
 | 
			
		||||
        $definition->setChanges([]);
 | 
			
		||||
 | 
			
		||||
        $configurator = new ServiceConfigurator($this->container, $this->instanceof, true, $this, $definition, $id, $defaults->getTags(), $this->path);
 | 
			
		||||
 | 
			
		||||
        return null !== $class ? $configurator->class($class) : $configurator;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Removes an already defined service definition or alias.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function remove(string $id): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->container->removeDefinition($id);
 | 
			
		||||
        $this->container->removeAlias($id);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Creates an alias.
 | 
			
		||||
     */
 | 
			
		||||
    final public function alias(string $id, string $referencedId): AliasConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        $ref = static::processValue($referencedId, true);
 | 
			
		||||
        $alias = new Alias((string) $ref);
 | 
			
		||||
        if (!$this->defaults->isPublic() || !$this->defaults->isPrivate()) {
 | 
			
		||||
            $alias->setPublic($this->defaults->isPublic());
 | 
			
		||||
        }
 | 
			
		||||
        $this->container->setAlias($id, $alias);
 | 
			
		||||
 | 
			
		||||
        return new AliasConfigurator($this, $alias);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Registers a PSR-4 namespace using a glob pattern.
 | 
			
		||||
     */
 | 
			
		||||
    final public function load(string $namespace, string $resource): PrototypeConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        return new PrototypeConfigurator($this, $this->loader, $this->defaults, $namespace, $resource, true, $this->path);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Gets an already defined service definition.
 | 
			
		||||
     *
 | 
			
		||||
     * @throws ServiceNotFoundException if the service definition does not exist
 | 
			
		||||
     */
 | 
			
		||||
    final public function get(string $id): ServiceConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        $definition = $this->container->getDefinition($id);
 | 
			
		||||
 | 
			
		||||
        return new ServiceConfigurator($this->container, $definition->getInstanceofConditionals(), true, $this, $definition, $id, []);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Registers a stack of decorator services.
 | 
			
		||||
     *
 | 
			
		||||
     * @param InlineServiceConfigurator[]|ReferenceConfigurator[] $services
 | 
			
		||||
     */
 | 
			
		||||
    final public function stack(string $id, array $services): AliasConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        foreach ($services as $i => $service) {
 | 
			
		||||
            if ($service instanceof InlineServiceConfigurator) {
 | 
			
		||||
                $definition = $service->definition->setInstanceofConditionals($this->instanceof);
 | 
			
		||||
 | 
			
		||||
                $changes = $definition->getChanges();
 | 
			
		||||
                $definition->setAutowired((isset($changes['autowired']) ? $definition : $this->defaults)->isAutowired());
 | 
			
		||||
                $definition->setAutoconfigured((isset($changes['autoconfigured']) ? $definition : $this->defaults)->isAutoconfigured());
 | 
			
		||||
                $definition->setBindings(array_merge($this->defaults->getBindings(), $definition->getBindings()));
 | 
			
		||||
                $definition->setChanges($changes);
 | 
			
		||||
 | 
			
		||||
                $services[$i] = $definition;
 | 
			
		||||
            } elseif (!$service instanceof ReferenceConfigurator) {
 | 
			
		||||
                throw new InvalidArgumentException(\sprintf('"%s()" expects a list of definitions as returned by "%s()" or "%s()", "%s" given at index "%s" for service "%s".', __METHOD__, InlineServiceConfigurator::FACTORY, ReferenceConfigurator::FACTORY, $service instanceof AbstractConfigurator ? $service::FACTORY.'()' : get_debug_type($service), $i, $id));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $alias = $this->alias($id, '');
 | 
			
		||||
        $alias->definition = $this->set($id)
 | 
			
		||||
            ->parent('')
 | 
			
		||||
            ->args($services)
 | 
			
		||||
            ->tag('container.stack')
 | 
			
		||||
            ->definition;
 | 
			
		||||
 | 
			
		||||
        return $alias;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Registers a service.
 | 
			
		||||
     */
 | 
			
		||||
    final public function __invoke(string $id, ?string $class = null): ServiceConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        return $this->set($id, $class);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function __destruct()
 | 
			
		||||
    {
 | 
			
		||||
        $this->loader->registerAliasesForSinglyImplementedInterfaces();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										28
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/AbstractTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/AbstractTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,28 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
trait AbstractTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Whether this definition is abstract, that means it merely serves as a
 | 
			
		||||
     * template for other definitions.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function abstract(bool $abstract = true): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setAbstract($abstract);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										39
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/ArgumentTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/ArgumentTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,39 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
trait ArgumentTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets the arguments to pass to the service constructor/factory method.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function args(array $arguments): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setArguments(static::processValue($arguments, true));
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets one argument to pass to the service constructor/factory method.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function arg(string|int $key, mixed $value): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setArgument($key, static::processValue($value, true));
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										31
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/AutoconfigureTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/AutoconfigureTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,31 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
 | 
			
		||||
trait AutoconfigureTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets whether or not instanceof conditionals should be prepended with a global set.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     *
 | 
			
		||||
     * @throws InvalidArgumentException when a parent is already set
 | 
			
		||||
     */
 | 
			
		||||
    final public function autoconfigure(bool $autoconfigured = true): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setAutoconfigured($autoconfigured);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										27
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/AutowireTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/AutowireTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
trait AutowireTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Enables/disables autowiring.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function autowire(bool $autowired = true): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setAutowired($autowired);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										42
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/BindTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/BindTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,42 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Loader\Configurator\DefaultsConfigurator;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator;
 | 
			
		||||
 | 
			
		||||
trait BindTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets bindings.
 | 
			
		||||
     *
 | 
			
		||||
     * Bindings map $named or FQCN arguments to values that should be
 | 
			
		||||
     * injected in the matching parameters (of the constructor, of methods
 | 
			
		||||
     * called and of controller actions).
 | 
			
		||||
     *
 | 
			
		||||
     * @param string $nameOrFqcn A parameter name with its "$" prefix, or an FQCN
 | 
			
		||||
     * @param mixed  $valueOrRef The value or reference to bind
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function bind(string $nameOrFqcn, mixed $valueOrRef): static
 | 
			
		||||
    {
 | 
			
		||||
        $valueOrRef = static::processValue($valueOrRef, true);
 | 
			
		||||
        $bindings = $this->definition->getBindings();
 | 
			
		||||
        $type = $this instanceof DefaultsConfigurator ? BoundArgument::DEFAULTS_BINDING : ($this instanceof InstanceofConfigurator ? BoundArgument::INSTANCEOF_BINDING : BoundArgument::SERVICE_BINDING);
 | 
			
		||||
        $bindings[$nameOrFqcn] = new BoundArgument($valueOrRef, true, $type, $this->path ?? null);
 | 
			
		||||
        $this->definition->setBindings($bindings);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										35
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/CallTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/CallTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,35 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
 | 
			
		||||
trait CallTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a method to call after service initialization.
 | 
			
		||||
     *
 | 
			
		||||
     * @param string $method       The method name to call
 | 
			
		||||
     * @param array  $arguments    An array of arguments to pass to the method call
 | 
			
		||||
     * @param bool   $returnsClone Whether the call returns the service instance or not
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     *
 | 
			
		||||
     * @throws InvalidArgumentException on empty $method param
 | 
			
		||||
     */
 | 
			
		||||
    final public function call(string $method, array $arguments = [], bool $returnsClone = false): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->addMethodCall($method, static::processValue($arguments, true), $returnsClone);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										27
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/ClassTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/ClassTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
trait ClassTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets the service class.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function class(?string $class): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setClass($class);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/ConfiguratorTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/ConfiguratorTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,29 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator;
 | 
			
		||||
 | 
			
		||||
trait ConfiguratorTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets a configurator to call after the service is fully initialized.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function configurator(string|array|ReferenceConfigurator $configurator): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setConfigurator(static::processValue($configurator, true));
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										27
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/ConstructorTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/ConstructorTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
trait ConstructorTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets a static constructor.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function constructor(string $constructor): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setFactory([null, $constructor]);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										34
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/DecorateTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/DecorateTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,34 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\ContainerInterface;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
 | 
			
		||||
trait DecorateTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets the service that this service is decorating.
 | 
			
		||||
     *
 | 
			
		||||
     * @param string|null $id The decorated service id, use null to remove decoration
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     *
 | 
			
		||||
     * @throws InvalidArgumentException in case the decorated service id and the new decorated service id are equals
 | 
			
		||||
     */
 | 
			
		||||
    final public function decorate(?string $id, ?string $renamedId = null, int $priority = 0, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setDecoratedService($id, $renamedId, $priority, $invalidBehavior);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										35
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/DeprecateTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/DeprecateTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,35 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
 | 
			
		||||
trait DeprecateTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Whether this definition is deprecated, that means it should not be called anymore.
 | 
			
		||||
     *
 | 
			
		||||
     * @param string $package The name of the composer package that is triggering the deprecation
 | 
			
		||||
     * @param string $version The version of the package that introduced the deprecation
 | 
			
		||||
     * @param string $message The deprecation message to use
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     *
 | 
			
		||||
     * @throws InvalidArgumentException when the message template is invalid
 | 
			
		||||
     */
 | 
			
		||||
    final public function deprecate(string $package, string $version, string $message): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setDeprecated($package, $version, $message);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										41
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/FactoryTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/FactoryTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,41 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator;
 | 
			
		||||
use Symfony\Component\ExpressionLanguage\Expression;
 | 
			
		||||
 | 
			
		||||
trait FactoryTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets a factory.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function factory(string|array|ReferenceConfigurator|Expression $factory): static
 | 
			
		||||
    {
 | 
			
		||||
        if (\is_string($factory) && 1 === substr_count($factory, ':')) {
 | 
			
		||||
            $factoryParts = explode(':', $factory);
 | 
			
		||||
 | 
			
		||||
            throw new InvalidArgumentException(\sprintf('Invalid factory "%s": the "service:method" notation is not available when using PHP-based DI configuration. Use "[service(\'%s\'), \'%s\']" instead.', $factory, $factoryParts[0], $factoryParts[1]));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($factory instanceof Expression) {
 | 
			
		||||
            $factory = '@='.$factory;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $this->definition->setFactory(static::processValue($factory, true));
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										27
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/FileTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/FileTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
trait FileTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets a file to require before creating the service.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function file(string $file): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setFile($file);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										64
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/FromCallableTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/FromCallableTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,64 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\ChildDefinition;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Loader\Configurator\FromCallableConfigurator;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator;
 | 
			
		||||
use Symfony\Component\ExpressionLanguage\Expression;
 | 
			
		||||
 | 
			
		||||
trait FromCallableTrait
 | 
			
		||||
{
 | 
			
		||||
    final public function fromCallable(string|array|ReferenceConfigurator|Expression $callable): FromCallableConfigurator
 | 
			
		||||
    {
 | 
			
		||||
        if ($this->definition instanceof ChildDefinition) {
 | 
			
		||||
            throw new InvalidArgumentException('The configuration key "parent" is unsupported when using "fromCallable()".');
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        foreach ([
 | 
			
		||||
            'synthetic' => 'isSynthetic',
 | 
			
		||||
            'factory' => 'getFactory',
 | 
			
		||||
            'file' => 'getFile',
 | 
			
		||||
            'arguments' => 'getArguments',
 | 
			
		||||
            'properties' => 'getProperties',
 | 
			
		||||
            'configurator' => 'getConfigurator',
 | 
			
		||||
            'calls' => 'getMethodCalls',
 | 
			
		||||
        ] as $key => $method) {
 | 
			
		||||
            if ($this->definition->$method()) {
 | 
			
		||||
                throw new InvalidArgumentException(\sprintf('The configuration key "%s" is unsupported when using "fromCallable()".', $key));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $this->definition->setFactory(['Closure', 'fromCallable']);
 | 
			
		||||
 | 
			
		||||
        if (\is_string($callable) && 1 === substr_count($callable, ':')) {
 | 
			
		||||
            $parts = explode(':', $callable);
 | 
			
		||||
 | 
			
		||||
            throw new InvalidArgumentException(\sprintf('Invalid callable "%s": the "service:method" notation is not available when using PHP-based DI configuration. Use "[service(\'%s\'), \'%s\']" instead.', $callable, $parts[0], $parts[1]));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($callable instanceof Expression) {
 | 
			
		||||
            $callable = '@='.$callable;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $this->definition->setArguments([static::processValue($callable, true)]);
 | 
			
		||||
 | 
			
		||||
        if ('Closure' !== ($this->definition->getClass() ?? 'Closure')) {
 | 
			
		||||
            $this->definition->setLazy(true);
 | 
			
		||||
        } else {
 | 
			
		||||
            $this->definition->setClass('Closure');
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return new FromCallableConfigurator($this, $this->definition);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										32
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/LazyTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/LazyTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,32 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
trait LazyTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets the lazy flag of this service.
 | 
			
		||||
     *
 | 
			
		||||
     * @param bool|string $lazy A FQCN to derivate the lazy proxy from or `true` to make it extend from the definition's class
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function lazy(bool|string $lazy = true): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setLazy((bool) $lazy);
 | 
			
		||||
        if (\is_string($lazy)) {
 | 
			
		||||
            $this->definition->addTag('proxy', ['interface' => $lazy]);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										46
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/ParentTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/ParentTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,46 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\ChildDefinition;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
 | 
			
		||||
trait ParentTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets the Definition to inherit from.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     *
 | 
			
		||||
     * @throws InvalidArgumentException when parent cannot be set
 | 
			
		||||
     */
 | 
			
		||||
    final public function parent(string $parent): static
 | 
			
		||||
    {
 | 
			
		||||
        if (!$this->allowParent) {
 | 
			
		||||
            throw new InvalidArgumentException(\sprintf('A parent cannot be defined when either "_instanceof" or "_defaults" are also defined for service prototype "%s".', $this->id));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($this->definition instanceof ChildDefinition) {
 | 
			
		||||
            $this->definition->setParent($parent);
 | 
			
		||||
        } else {
 | 
			
		||||
            // cast Definition to ChildDefinition
 | 
			
		||||
            $definition = serialize($this->definition);
 | 
			
		||||
            $definition = substr_replace($definition, '53', 2, 2);
 | 
			
		||||
            $definition = substr_replace($definition, 'Child', 44, 0);
 | 
			
		||||
            $definition = unserialize($definition);
 | 
			
		||||
 | 
			
		||||
            $this->definition = $definition->setParent($parent);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										27
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/PropertyTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/PropertyTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
trait PropertyTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets a specific property.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function property(string $name, mixed $value): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setProperty($name, static::processValue($value, true));
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										35
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/PublicTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/PublicTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,35 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
trait PublicTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function public(): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setPublic(true);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function private(): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setPublic(false);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										27
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/ShareTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/ShareTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,27 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
trait ShareTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets if the service must be shared or not.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function share(bool $shared = true): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setShared($shared);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										28
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/SyntheticTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/SyntheticTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,28 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
trait SyntheticTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets whether this definition is synthetic, that is not constructed by the
 | 
			
		||||
     * container, but dynamically injected.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function synthetic(bool $synthetic = true): static
 | 
			
		||||
    {
 | 
			
		||||
        $this->definition->setSynthetic($synthetic);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										47
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/TagTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								vendor/symfony/dependency-injection/Loader/Configurator/Traits/TagTrait.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,47 @@
 | 
			
		||||
<?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\Loader\Configurator\Traits;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 | 
			
		||||
 | 
			
		||||
trait TagTrait
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds a tag for this definition.
 | 
			
		||||
     *
 | 
			
		||||
     * @return $this
 | 
			
		||||
     */
 | 
			
		||||
    final public function tag(string $name, array $attributes = []): static
 | 
			
		||||
    {
 | 
			
		||||
        if ('' === $name) {
 | 
			
		||||
            throw new InvalidArgumentException(\sprintf('The tag name for service "%s" must be a non-empty string.', $this->id));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $this->validateAttributes($name, $attributes);
 | 
			
		||||
 | 
			
		||||
        $this->definition->addTag($name, $attributes);
 | 
			
		||||
 | 
			
		||||
        return $this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private function validateAttributes(string $tag, array $attributes, array $path = []): void
 | 
			
		||||
    {
 | 
			
		||||
        foreach ($attributes as $name => $value) {
 | 
			
		||||
            if (\is_array($value)) {
 | 
			
		||||
                $this->validateAttributes($tag, $value, [...$path, $name]);
 | 
			
		||||
            } elseif (!\is_scalar($value ?? '')) {
 | 
			
		||||
                $name = implode('.', [...$path, $name]);
 | 
			
		||||
                throw new InvalidArgumentException(\sprintf('A tag attribute must be of a scalar-type or an array of scalar-types for service "%s", tag "%s", attribute "%s".', $this->id, $tag, $name));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user