8000 [DI] Add support for immutable setters in CallTrait · symfony/symfony@90ace51 · GitHub
[go: up one dir, main page]

Skip to content

Commit 90ace51

Browse files
committed
[DI] Add support for immutable setters in CallTrait
1 parent 3df1d1e commit 90ace51

File tree

1 file changed

+5
-4
lines changed
  • src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits

1 file changed

+5
-4
lines changed

src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/CallTrait.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ trait CallTrait
1818
/**
1919
* Adds a method to call after service initialization.
2020
*
21-
* @param string $method The method name to call
22-
* @param array $arguments An array of arguments to pass to the method call
21+
* @param string $method The method name to call
22+
* @param array $arguments An array of arguments to pass to the method call
23+
* @param bool $returnsClone Whether the call returns the service instance or not
2324
*
2425
* @return $this
2526
*
2627
* @throws InvalidArgumentException on empty $method param
2728
*/
28-
final public function call($method, array $arguments = [])
29+
final public function call($method, array $arguments = [], $returnsClone = false)
2930
{
30-
$this->definition->addMethodCall($method, static::processValue($arguments, true));
31+
$this->definition->addMethodCall($method, static::processValue($arguments, true), $returnsClone);
3132

3233
return $this;
3334
}

0 commit comments

Comments
 (0)
0