public function callFromScopeOn($context, array $arguments = [ ])
    {
        $scopeWrapper = function ($context, $methodName, array $arguments) {
            return call_user_func_array([ $context, $methodName ], $arguments);
        };

        if (is_object($context)) {
            $scopeWrapper = $scopeWrapper->bindTo($context, $context);
        } else {
            $scopeWrapper = $scopeWrapper->bindTo(null, $context);
        }

        return $scopeWrapper($context, $this->name(), $arguments);
    }
public function callFromScopeOn($context, array $arguments = [ ])
    {
        $scopeWrapper = function ($context, $methodName, array $arguments) {
            return call_user_func_array([ $context, $methodName ], $arguments);
        };

        if (is_object($context)) {
            $scopeWrapper = $scopeWrapper->bindTo($context, $context);
        } else {
            $scopeWrapper = $scopeWrapper->bindTo(null, $context);
        }

        return $scopeWrapper($context, $this->name(), $arguments);
    }
public function callFromScopeOn ( $ context , array $ arguments = [ ] ) { $ scopeWrapper = function ( $ context , $ methodName , array $ arguments ) { return call_user_func_array ( [ $ context , $ methodName ] , $ arguments ) ; } ; if ( is_object ( $ context ) ) { $ scopeWrapper = $ scopeWrapper -> bindTo ( $ context , $ context ) ; } else { $ scopeWrapper = $ scopeWrapper -> bindTo ( null , $ context ) ; } return $ scopeWrapper ( $ context , $ this -> name ( ) , $ arguments ) ; }
Call the method represented by the the current instance in the specified
context from the scope of that context

We use this method instead of self::callOn() when we need to dynamically
call a private or protected method that this class cannot otherwise
access, such as if we're using a DynamicMethod instance in a class that
needs to call its own private methods. As a best practice, avoid using
this method to call private or protected methods from scopes that cannot
normally access those methods

@param object|string $context   The context in which to call the method
@param array         $arguments The arguments to pass to the called
method

@return mixed The return value of the called method

@see  call_user_func_array()
@link http://php.net/manual/en/function.call-user-func-array.php
Call the method represented by the the current instance in the specified context from the scope of that context