Deprecated: Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 58

Deprecated: Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler

vendor/symfony/dependency-injection/Loader/Configurator/DefaultsConfigurator.php line 67

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Component\DependencyInjection\Loader\Configurator;
  11. use Symfony\Component\DependencyInjection\Definition;
  12. use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
  13. /**
  14.  * @author Nicolas Grekas <p@tchwork.com>
  15.  */
  16. class DefaultsConfigurator extends AbstractServiceConfigurator
  17. {
  18.     use Traits\AutoconfigureTrait;
  19.     use Traits\AutowireTrait;
  20.     use Traits\BindTrait;
  21.     use Traits\PublicTrait;
  22.     public const FACTORY 'defaults';
  23.     private $path;
  24.     public function __construct(ServicesConfigurator $parentDefinition $definitionstring $path null)
  25.     {
  26.         parent::__construct($parent$definitionnull, []);
  27.         $this->path $path;
  28.     }
  29.     /**
  30.      * Adds a tag for this definition.
  31.      *
  32.      * @return $this
  33.      *
  34.      * @throws InvalidArgumentException when an invalid tag name or attribute is provided
  35.      */
  36.     final public function tag(string $name, array $attributes = []): self
  37.     {
  38.         if ('' === $name) {
  39.             throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');
  40.         }
  41.         foreach ($attributes as $attribute => $value) {
  42.             if (null !== $value && !\is_scalar($value)) {
  43.                 throw new InvalidArgumentException(sprintf('Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type.'$name$attribute));
  44.             }
  45.         }
  46.         $this->definition->addTag($name$attributes);
  47.         return $this;
  48.     }
  49.     /**
  50.      * Defines an instanceof-conditional to be applied to following service definitions.
  51.      */
  52.     final public function instanceof(string $fqcn): InstanceofConfigurator
  53.     {
  54.         return $this->parent->instanceof($fqcn);
  55.     }
  56. }