vendor/symfony/dependency-injection/Loader/Configurator/Traits/DecorateTrait.php line 28

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\Traits;
  11. use Symfony\Component\DependencyInjection\ContainerInterface;
  12. use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
  13. trait DecorateTrait
  14. {
  15.     /**
  16.      * Sets the service that this service is decorating.
  17.      *
  18.      * @param string|null $id The decorated service id, use null to remove decoration
  19.      *
  20.      * @return $this
  21.      *
  22.      * @throws InvalidArgumentException in case the decorated service id and the new decorated service id are equals
  23.      */
  24.     final public function decorate(?string $idstring $renamedId nullint $priority 0int $invalidBehavior ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE): self
  25.     {
  26.         $this->definition->setDecoratedService($id$renamedId$priority$invalidBehavior);
  27.         return $this;
  28.     }
  29. }