PHPDocMD\Parser::parseConstants PHP Method

parseConstants() protected method

You must pass an xml element that refers to either the class or interface element from structure.xml.
protected parseConstants ( SimpleXMLElement $class ) : array
$class SimpleXMLElement
return array
    protected function parseConstants(SimpleXMLElement $class)
    {
        $constants = [];
        $className = (string) $class->full_name;
        $className = ltrim($className, '\\');
        foreach ($class->constant as $xConstant) {
            $name = (string) $xConstant->name;
            $value = (string) $xConstant->value;
            $signature = sprintf('const %s = %s', $name, $value);
            $constants[$name] = ['name' => $name, 'description' => (string) $xConstant->docblock->description . "\n\n" . (string) $xConstant->docblock->{'long-description'}, 'signature' => $signature, 'value' => $value, 'deprecated' => count($class->xpath('docblock/tag[@name="deprecated"]')) > 0, 'definedBy' => $className];
        }
        return $constants;
    }