src/main/php/ClassProxyMethodHandler.php
protected function handleMethodCall(string $method, array $arguments, bool $shouldReturnSelf)
    {
        $invocation = $this->invocations($method)->recordCall($arguments);
        if (null !== $this->callMap && $this->callMap->hasResultFor($method, $invocation)) {
            return $this->callMap->resultFor($method, $arguments, $invocation);
        }

        if ($this->parentCallsAllowed && is_callable(['parent', $method])) {
            // is_callable() returns true even for abstract methods
            $refMethod = new \ReflectionMethod(get_parent_class(), $method);
            if (!$refMethod->isAbstract()) {
                return parent::$method(...$arguments);
            }
        }

        if ($shouldReturnSelf) {
            return $this;
        }

        return null;
    }
protected function handleMethodCall(string $method, array $arguments, bool $shouldReturnSelf)
    {
        $invocation = $this->invocations($method)->recordCall($arguments);
        if (null !== $this->callMap && $this->callMap->hasResultFor($method, $invocation)) {
            return $this->callMap->resultFor($method, $arguments, $invocation);
        }

        if ($this->parentCallsAllowed && is_callable(['parent', $method])) {
            // is_callable() returns true even for abstract methods
            $refMethod = new \ReflectionMethod(get_parent_class(), $method);
            if (!$refMethod->isAbstract()) {
                return parent::$method(...$arguments);
            }
        }

        if ($shouldReturnSelf) {
            return $this;
        }

        return null;
    }
protected function handleMethodCall ( string $ method , array $ arguments , bool $ shouldReturnSelf ) { $ invocation = $ this -> invocations ( $ method ) -> recordCall ( $ arguments ) ; if ( null !== $ this -> callMap && $ this -> callMap -> hasResultFor ( $ method , $ invocation ) ) { return $ this -> callMap -> resultFor ( $ method , $ arguments , $ invocation ) ; } if ( $ this -> parentCallsAllowed && is_callable ( [ 'parent' , $ method ] ) ) { // is_callable() returns true even for abstract methods $ refMethod = new \ ReflectionMethod ( get_parent_class ( ) , $ method ) ; if ( ! $ refMethod -> isAbstract ( ) ) { return parent :: $ method ( ... $ arguments ) ; } } if ( $ shouldReturnSelf ) { return $ this ; } return null ; }
handles actual method calls

@param   string    $method            actually called method
@param   mixed[]   $arguments         list of given arguments for methods
@param   bool      $shouldReturnSelf  whether the return value should be the instance itself
@return  mixed
@throws  \Exception
handles actual method calls