From 90ace5132890255308b672704f7c921e9fd0740f Mon Sep 17 00:00:00 2001 From: Lctrs Date: Wed, 11 Dec 2019 13:18:13 +0100 Subject: [PATCH] [DI] Add support for immutable setters in CallTrait --- .../Loader/Configurator/Traits/CallTrait.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/CallTrait.php b/src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/CallTrait.php index 8e6b17a19d28..282054063b08 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/CallTrait.php +++ b/src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/CallTrait.php @@ -18,16 +18,17 @@ 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 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($method, array $arguments = []) + final public function call($method, array $arguments = [], $returnsClone = false) { - $this->definition->addMethodCall($method, static::processValue($arguments, true)); + $this->definition->addMethodCall($method, static::processValue($arguments, true), $returnsClone); return $this; }