BetterReflection\Reflection\ReflectionClass::hasMethod PHP Method

hasMethod() public method

Does the class have the specified method method?
public hasMethod ( string $methodName ) : boolean
$methodName string
return boolean
    public function hasMethod($methodName)
    {
        try {
            $this->getMethod($methodName);
            return true;
        } catch (\OutOfBoundsException $exception) {
            return false;
        }
    }

Usage Example

 /**
  * {@inheritDoc}
  */
 public function hasMethod($name)
 {
     return $this->betterReflectionClass->hasMethod($name);
 }