PHP Class lithium\analysis\Docblock

This parser may be used as the basis for a variety of secondary tools, including a reflection-based API generator, a code metrics analyzer, and various other possible use cases.
Inheritance: extends lithium\core\StaticObject
Datei anzeigen Open project: unionofrad/lithium Class Usage Examples

Public Properties

Property Type Description
$tags array List of supported docblock tags.

Public Methods

Method Description
comment ( string $comment ) : array Parses a doc block into its major components of description, text and tags.
tags ( string $string ) : array Parses @ docblock tags and their descriptions from a docblock.

Protected Methods

Method Description
_params ( array $params ) : array Parses @param docblock tags to separate out the parameter type from the description.

Method Details

_params() protected static method

Parses @param docblock tags to separate out the parameter type from the description.
protected static _params ( array $params ) : array
$params array An array of `@param` tags, as parsed from the `tags()` method.
return array Returns an array where each key is a parameter name, and each value is an associative array containing `'type'` and `'text'` keys.

comment() public static method

Parses a doc block into its major components of description, text and tags.
public static comment ( string $comment ) : array
$comment string The doc block string to be parsed
return array An associative array of the parsed comment, whose keys are `description`, `text` and `tags`.

tags() public static method

See the $tags property for the list of supported tags.
public static tags ( string $string ) : array
$string string The string to be parsed for tags
return array Returns an array where each docblock tag is a key name, and the corresponding values are either strings (if one of each tag), or arrays (if multiple of the same tag).

Property Details

$tags public_oe static_oe property

List of supported docblock tags.
public static array $tags
return array