public function isDeclaration()
{
if ($this->isPrivate()) {
return true;
}
$methodName = strtolower($this->getName());
$parentNode = $this->getNode()->getParent();
foreach ($parentNode->getInterfaces() as $parentType) {
$methods = $parentType->getAllMethods();
if (isset($methods[$methodName])) {
return false;
}
}
if (is_object($parentType = $parentNode->getParentClass())) {
$methods = $parentType->getAllMethods();
if (isset($methods[$methodName])) {
return false;
}
}
return true;
}