public function getPrototype() : self
    {
        $currentClass = $this->getDeclaringClass();

        while ($currentClass) {
            foreach ($currentClass->getImmediateInterfaces() as $interface) {
                if ($interface->hasMethod($this->getName())) {
                    return $interface->getMethod($this->getName());
                }
            }

            $currentClass = $currentClass->getParentClass();

            if ($currentClass === null || ! $currentClass->hasMethod($this->getName())) {
                break;
            }

            $prototype = $currentClass->getMethod($this->getName())->findPrototype();

            if ($prototype !== null) {
                return $prototype;
            }
        }

        throw new Exception\MethodPrototypeNotFound(sprintf(
            'Method %s::%s does not have a prototype',
            $this->getDeclaringClass()->getName(),
            $this->getName()
        ));
    }
public function getPrototype() : self
    {
        $currentClass = $this->getDeclaringClass();

        while ($currentClass) {
            foreach ($currentClass->getImmediateInterfaces() as $interface) {
                if ($interface->hasMethod($this->getName())) {
                    return $interface->getMethod($this->getName());
                }
            }

            $currentClass = $currentClass->getParentClass();

            if ($currentClass === null || ! $currentClass->hasMethod($this->getName())) {
                break;
            }

            $prototype = $currentClass->getMethod($this->getName())->findPrototype();

            if ($prototype !== null) {
                return $prototype;
            }
        }

        throw new Exception\MethodPrototypeNotFound(sprintf(
            'Method %s::%s does not have a prototype',
            $this->getDeclaringClass()->getName(),
            $this->getName()
        ));
    }
public function getPrototype ( ) : self { $ currentClass = $ this -> getDeclaringClass ( ) ; while ( $ currentClass ) { foreach ( $ currentClass -> getImmediateInterfaces ( ) as $ interface ) { if ( $ interface -> hasMethod ( $ this -> getName ( ) ) ) { return $ interface -> getMethod ( $ this -> getName ( ) ) ; } } $ currentClass = $ currentClass -> getParentClass ( ) ; if ( $ currentClass === null || ! $ currentClass -> hasMethod ( $ this -> getName ( ) ) ) { break ; } $ prototype = $ currentClass -> getMethod ( $ this -> getName ( ) ) -> findPrototype ( ) ; if ( $ prototype !== null ) { return $ prototype ; } } throw new Exception \ MethodPrototypeNotFound ( sprintf ( 'Method %s::%s does not have a prototype' , $ this -> getDeclaringClass ( ) -> getName ( ) , $ this -> getName ( ) ) ) ; }
Find the prototype for this method, if it exists. If it does not exist
it will throw a MethodPrototypeNotFound exception.

@throws Exception\MethodPrototypeNotFound
Find the prototype for this method if it exists . If it does not exist it will throw a MethodPrototypeNotFound exception .