hasMethod() public method

public hasMethod ( string $name, boolean | false $inherit = false ) : boolean
$name string
$inherit boolean | false
return boolean
コード例 #1
0
ファイル: ClassDefinition.php プロジェクト: sekjun9878/phpsa
 /**
  * @param string $name
  * @param boolean|false $inherit
  * @return bool
  */
 public function hasMethod($name, $inherit = false)
 {
     if (isset($this->methods[$name])) {
         return true;
     }
     if ($inherit && $this->extendsClassDefinition && $this->extendsClassDefinition->hasMethod($name, true)) {
         $method = $this->extendsClassDefinition->getMethod($name);
         return $method->isPublic() || $method->isProtected();
     }
     return false;
 }