private function inheritMethodRecursive($method, $class)
{
$inheritanceCandidates = array_merge($this->getParents($class), $this->getInterfaces($class));
$methods = [];
foreach ($inheritanceCandidates as $candidate) {
if (isset($candidate->methods[$method->name])) {
$cmethod = $candidate->methods[$method->name];
if ($cmethod->hasTag('inheritdoc')) {
$this->inheritDocs($candidate);
}
$methods[] = $cmethod;
}
}
return reset($methods);
}