PHPDocMD\Parser::expandMethods PHP Method

expandMethods() protected method

This method goes through all the class definitions, and adds non-overridden method information from parent classes.
protected expandMethods ( string $className ) : array
$className string
return array
    protected function expandMethods($className)
    {
        $class = $this->classDefinitions[$className];
        $newMethods = [];
        foreach (array_merge($class['extends'], $class['implements']) as $extends) {
            if (!isset($this->classDefinitions[$extends])) {
                continue;
            }
            foreach ($this->classDefinitions[$extends]['methods'] as $methodName => $methodInfo) {
                if (!isset($class[$methodName])) {
                    $newMethods[$methodName] = $methodInfo;
                }
            }
            $newMethods = array_merge($newMethods, $this->expandMethods($extends));
        }
        $this->classDefinitions[$className]['methods'] = array_merge($this->classDefinitions[$className]['methods'], $newMethods);
        return $newMethods;
    }