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;
    }
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;
    }
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 ; }
Parses all constant information for a single class or interface.

You must pass an xml element that refers to either the class or interface element from
structure.xml.

@param SimpleXMLElement $class

@return array
Parses all constant information for a single class or interface .