/** * @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; }