public function findMethod($class, $name)
    {
        $reflection = new ReflectionClass($class);

        while (false === $reflection->hasMethod($name)) {
            if (false === ($reflection = $reflection->getParentClass())) {
                throw new ReflectionException(sprintf(
                    'The method "%s" does not exist in the class "%s".',
                    $name,
                    is_object($class) ? get_class($class) : $class
                ));
            }
        }

        return $reflection->getMethod($name);
    }
public function findMethod($class, $name)
    {
        $reflection = new ReflectionClass($class);

        while (false === $reflection->hasMethod($name)) {
            if (false === ($reflection = $reflection->getParentClass())) {
                throw new ReflectionException(sprintf(
                    'The method "%s" does not exist in the class "%s".',
                    $name,
                    is_object($class) ? get_class($class) : $class
                ));
            }
        }

        return $reflection->getMethod($name);
    }
public function findMethod ( $ class , $ name ) { $ reflection = new ReflectionClass ( $ class ) ; while ( false === $ reflection -> hasMethod ( $ name ) ) { if ( false === ( $ reflection = $ reflection -> getParentClass ( ) ) ) { throw new ReflectionException ( sprintf ( 'The method "%s" does not exist in the class "%s".' , $ name , is_object ( $ class ) ? get_class ( $ class ) : $ class ) ) ; } } return $ reflection -> getMethod ( $ name ) ; }
Finds a class method and returns the ReflectionMethod instance.

@param object|string $class The class name or object.
@param string        $name  The method name.

@return ReflectionMethod The method name.

@throws ReflectionException If the method does not exist.
Finds a class method and returns the ReflectionMethod instance .