Gets the methods to call after service initialization.
public getMethodCalls ( ) : array | ||
return | array | An array of method calls |
use Symfony\Component\DependencyInjection\Definition; // create a new service definition $definition = new Definition('MyService'); // add a method call instruction $definition->addMethodCall('setLogger', ['@logger']); // get the method calls array $methodCalls = $definition->getMethodCalls(); // output the method calls var_dump($methodCalls);In this example, we create a new service definition for a class called `MyService`. We then add a method call instruction to set the logger, using the `addMethodCall` method. Finally, we get the method calls array using `getMethodCalls` and output it to the screen. This method is useful when you need to manipulate the method calls array for a service definition, for example, to remove or modify a method call instruction before the service is instantiated. The `getMethodCalls` method is part of the `DependencyInjection` component of the Symfony PHP framework.
public getMethodCalls ( ) : array | ||
return | array | An array of method calls |