Neos\Flow\Reflection\ReflectionService::hasMethod PHP Method

hasMethod() public method

Wrapper for method_exists() which tells if the given method exists.
public hasMethod ( string $className, string $methodName ) : boolean
$className string Name of the class containing the method
$methodName string Name of the method
return boolean
    public function hasMethod($className, $methodName)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        return isset($this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName]);
    }

Usage Example

 /**
  * Builds PHP code which calls the original (ie. parent) method after the added code has been executed.
  *
  * @param string $fullClassName Fully qualified name of the original class
  * @param string $methodName Name of the original method
  * @return string PHP code
  */
 protected function buildCallParentMethodCode($fullClassName, $methodName)
 {
     if (!$this->reflectionService->hasMethod($fullClassName, $methodName)) {
         return '';
     }
     return 'parent::' . $methodName . '(' . $this->buildMethodParametersCode($fullClassName, $methodName, false) . ");\n";
 }
All Usage Examples Of Neos\Flow\Reflection\ReflectionService::hasMethod
ReflectionService