src/main/php/CallMap.php
public function resultFor(string $method, array $arguments, int $invocationCount)
    {
        if (!isset($this->callMap[$method])) {
            return null;
        }

        if ($this->callMap[$method] instanceof InvocationResults) {
            $result = $this->callMap[$method]->resultForInvocation($invocationCount - 1);
        } else {
            $result = $this->callMap[$method];
        }

        if (is_callable($result)) {
            return $result(...$arguments);
        }

        return $result;
    }
public function resultFor(string $method, array $arguments, int $invocationCount)
    {
        if (!isset($this->callMap[$method])) {
            return null;
        }

        if ($this->callMap[$method] instanceof InvocationResults) {
            $result = $this->callMap[$method]->resultForInvocation($invocationCount - 1);
        } else {
            $result = $this->callMap[$method];
        }

        if (is_callable($result)) {
            return $result(...$arguments);
        }

        return $result;
    }
public function resultFor ( string $ method , array $ arguments , int $ invocationCount ) { if ( ! isset ( $ this -> callMap [ $ method ] ) ) { return null ; } if ( $ this -> callMap [ $ method ] instanceof InvocationResults ) { $ result = $ this -> callMap [ $ method ] -> resultForInvocation ( $ invocationCount - 1 ) ; } else { $ result = $ this -> callMap [ $ method ] ; } if ( is_callable ( $ result ) ) { return $ result ( ... $ arguments ) ; } return $ result ; }
returns the result for the method invocation done with given arguments

@param   string   $method           name of invoked method
@param   mixed[]  $arguments        arguments passed for the method call
@param   int      $invocationCount  denotes which nth invocation of the method this is
@return  mixed
@throws  \Exception
returns the result for the method invocation done with given arguments