src/Proxy/ProxyTrait.php
private function callMethod(
        StateInterface $state,
        string &$methodName,
        array &$arguments,
        string &$scopeVisibility,
        callable &$callback
    ) : ProxyInterface {
        $callerStatedClass = $this->getCallerStatedClassName();
        $this->pushCallerStatedClassName($state);

        //Call it
        try {
            $state->executeClosure($this, $methodName, $arguments, $scopeVisibility, $callerStatedClass, $callback);
        } catch (\Throwable $e) {
            //Restore stated class name stack
            $this->popCallerStatedClassName();

            throw $e;
        }

        //Restore stated class name stack
        $this->popCallerStatedClassName();

        return $this;
    }
private function callMethod(
        StateInterface $state,
        string &$methodName,
        array &$arguments,
        string &$scopeVisibility,
        callable &$callback
    ) : ProxyInterface {
        $callerStatedClass = $this->getCallerStatedClassName();
        $this->pushCallerStatedClassName($state);

        //Call it
        try {
            $state->executeClosure($this, $methodName, $arguments, $scopeVisibility, $callerStatedClass, $callback);
        } catch (\Throwable $e) {
            //Restore stated class name stack
            $this->popCallerStatedClassName();

            throw $e;
        }

        //Restore stated class name stack
        $this->popCallerStatedClassName();

        return $this;
    }
private function callMethod ( StateInterface $ state , string & $ methodName , array & $ arguments , string & $ scopeVisibility , callable & $ callback ) : ProxyInterface { $ callerStatedClass = $ this -> getCallerStatedClassName ( ) ; $ this -> pushCallerStatedClassName ( $ state ) ; //Call it try { $ state -> executeClosure ( $ this , $ methodName , $ arguments , $ scopeVisibility , $ callerStatedClass , $ callback ) ; } catch ( \ Throwable $ e ) { //Restore stated class name stack $ this -> popCallerStatedClassName ( ) ; throw $ e ; } //Restore stated class name stack $ this -> popCallerStatedClassName ( ) ; return $ this ; }
Prepare the execution's context and execute a method in a state passed in args with the closure.

@param StateInterface $state
@param string         $methodName
@param array          $arguments
@param string         $scopeVisibility self::VISIBILITY_PUBLIC
self::VISIBILITY_PROTECTED
self::VISIBILITY_PRIVATE
@param callable &$callback

@return self|ProxyInterface

@throws \Throwable
Prepare the execution s context and execute a method in a state passed in args with the closure .