public function getProtectedMethod(...$params)
    {
        if (is_string($params[0])) {
            list($className, $object, $name) = $params;
        } elseif (is_object($params[0])) {
            list($object, $name) = $params;
            $className = get_class($object);
        }

        /** @var string $className */
        /** @var object $object */
        /** @var string $name */


        $this->checkOnObject($object);
        $this->checkOnMemberName($name);

        $reflector = $this->getReflectionMethod($className, $name);

        return $reflector->getClosure($object);
    }
public function getProtectedMethod(...$params)
    {
        if (is_string($params[0])) {
            list($className, $object, $name) = $params;
        } elseif (is_object($params[0])) {
            list($object, $name) = $params;
            $className = get_class($object);
        }

        /** @var string $className */
        /** @var object $object */
        /** @var string $name */


        $this->checkOnObject($object);
        $this->checkOnMemberName($name);

        $reflector = $this->getReflectionMethod($className, $name);

        return $reflector->getClosure($object);
    }
public function getProtectedMethod ( ... $ params ) { if ( is_string ( $ params [ 0 ] ) ) { list ( $ className , $ object , $ name ) = $ params ; } elseif ( is_object ( $ params [ 0 ] ) ) { list ( $ object , $ name ) = $ params ; $ className = get_class ( $ object ) ; } /** @var string $className */ /** @var object $object */ /** @var string $name */ $ this -> checkOnObject ( $ object ) ; $ this -> checkOnMemberName ( $ name ) ; $ reflector = $ this -> getReflectionMethod ( $ className , $ name ) ; return $ reflector -> getClosure ( $ object ) ; }
Returns a method as closure

@param array ...$params

@return \Closure
@throws ProtectedMembersAccessException
Returns a method as closure