PHPDocMD\Parser::getClassDefinitions PHP Method

getClassDefinitions() protected method

Gets all classes and interfaces from the file and puts them in an easy to use array.
protected getClassDefinitions ( SimpleXmlElement $xml )
$xml SimpleXmlElement
    protected function getClassDefinitions(SimpleXmlElement $xml)
    {
        $classNames = [];
        foreach ($xml->xpath('file/class|file/interface') as $class) {
            $className = (string) $class->full_name;
            $className = ltrim($className, '\\');
            $fileName = str_replace('\\', '-', $className) . '.md';
            $implements = [];
            if (isset($class->implements)) {
                foreach ($class->implements as $interface) {
                    $implements[] = ltrim((string) $interface, '\\');
                }
            }
            $extends = [];
            if (isset($class->extends)) {
                foreach ($class->extends as $parent) {
                    $extends[] = ltrim((string) $parent, '\\');
                }
            }
            $classNames[$className] = ['fileName' => $fileName, 'className' => $className, 'shortClass' => (string) $class->name, 'namespace' => (string) $class['namespace'], 'description' => (string) $class->docblock->description, 'longDescription' => (string) $class->docblock->{'long-description'}, 'implements' => $implements, 'extends' => $extends, 'isClass' => $class->getName() === 'class', 'isInterface' => $class->getName() === 'interface', 'abstract' => (string) $class['abstract'] == 'true', 'deprecated' => count($class->xpath('docblock/tag[@name="deprecated"]')) > 0, 'methods' => $this->parseMethods($class), 'properties' => $this->parseProperties($class), 'constants' => $this->parseConstants($class)];
        }
        $this->classDefinitions = $classNames;
    }