yii\apidoc\models\Context::inheritMethodRecursive PHP Method

inheritMethodRecursive() private method

private inheritMethodRecursive ( yii\apidoc\models\MethodDoc $method, yii\apidoc\models\ClassDoc $class ) : mixed
$method yii\apidoc\models\MethodDoc
$class yii\apidoc\models\ClassDoc
return mixed
    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);
    }