W3cubDocs

/Symfony 4.1

DecorateTrait

trait DecorateTrait

Methods

$this decorate(string|null $id, string|null $renamedId = null, int $priority = 0)

Sets the service that this service is decorating.

Details

final $this decorate(string|null $id, string|null $renamedId = null, int $priority = 0)

Sets the service that this service is decorating.

Parameters

string|null $id The decorated service id, use null to remove decoration
string|null $renamedId The new decorated service id
int $priority The priority of decoration

Return Value

$this

Exceptions

InvalidArgumentException in case the decorated service id and the new decorated service id are equals