Nelmio\Alice\Definition\MethodCallBag::mergeWith PHP Method

mergeWith() public method

Creates a new instance to which the given properties have been merged. In case of conflicts, the existing values are kept.
public mergeWith ( self $methodCallsBag ) : self
$methodCallsBag self
return self
    public function mergeWith(self $methodCallsBag) : self
    {
        $clone = clone $methodCallsBag;
        foreach ($this->methodCalls as $methodCall) {
            $clone->methodCalls[] = $methodCall;
        }
        return $clone;
    }