Symfony\Component\DependencyInjection\Definition::removeMethodCall PHP Method

removeMethodCall() public method

Removes a method to call after service initialization.
public removeMethodCall ( string $method ) : Definition
$method string The method name to remove
return Definition The current instance
    public function removeMethodCall($method)
    {
        foreach ($this->calls as $i => $call) {
            if ($call[0] === $method) {
                unset($this->calls[$i]);
                break;
            }
        }

        return $this;
    }

Usage Example

 /**
  * @param Definition $definition
  */
 private function clearMethodCalls(Definition $definition)
 {
     $methodCall = 'offsetSet';
     while ($definition->hasMethodCall($methodCall)) {
         $definition->removeMethodCall($methodCall);
     }
 }
All Usage Examples Of Symfony\Component\DependencyInjection\Definition::removeMethodCall