Chris@14: Chris@14: * Chris@14: * For the full copyright and license information, please view the LICENSE Chris@14: * file that was distributed with this source code. Chris@14: */ Chris@14: Chris@14: namespace Symfony\Component\DependencyInjection\Loader\Configurator\Traits; Chris@14: Chris@14: use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; Chris@14: Chris@14: trait CallTrait Chris@14: { Chris@14: /** Chris@14: * Adds a method to call after service initialization. Chris@14: * Chris@14: * @param string $method The method name to call Chris@14: * @param array $arguments An array of arguments to pass to the method call Chris@14: * Chris@14: * @return $this Chris@14: * Chris@14: * @throws InvalidArgumentException on empty $method param Chris@14: */ Chris@17: final public function call($method, array $arguments = []) Chris@14: { Chris@14: $this->definition->addMethodCall($method, static::processValue($arguments, true)); Chris@14: Chris@14: return $this; Chris@14: } Chris@14: }