public isSubclassOf ( |
||
$code_base | ||
$other | ||
Результат | boolean |
public function isSubclassOf(CodeBase $code_base, Clazz $other) : bool
{
if (!$this->hasParentType()) {
return false;
}
if (!$code_base->hasClassWithFQSEN($this->getParentClassFQSEN())) {
// Let this emit an issue elsewhere for the
// parent not existing
return false;
}
// Get the parent class
$parent = $this->getParentClass($code_base);
if ($parent === $other) {
return true;
}
return $parent->isSubclassOf($code_base, $other);
}