Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcReflectionDocCommentParserImpl

Reflection::ezcReflectionDocCommentParserImpl

Class ezcReflectionDocCommentParserImpl

Provides structured data from PHP Documentor comments

Parser is implemented as state based parser using a state transisiton table consisting of transition rules for empty and non-empty lines.

Source for this file: /Reflection/src/doc_comment_parser.php

Implements interfaces:

Version:   //autogen//

Constants

ANNOTATIONS = 2
BEGINNING = 10
LONG_DESC = 1
SHORT_DESC = 0

Member Variables

protected ezcReflectionAnnotation[] $annotations
protected string $docComment
protected ezcReflectionAnnotation $lastAnnotation = null
protected string $longDesc
protected string $shortDesc
protected int $state = self::BEGINNING
protected array(int=>int) $stateTable = array(
true => array ( // empty lines
self::BEGINNING => self::BEGINNING,
self::SHORT_DESC => self::LONG_DESC,
self::LONG_DESC => self::LONG_DESC,
self::ANNOTATIONS => self::ANNOTATIONS
),false=>array(// non empty lines
self::BEGINNING=>self::SHORT_DESC,self::SHORT_DESC=>self::SHORT_DESC,self::LONG_DESC=>self::LONG_DESC,self::ANNOTATIONS=>self::ANNOTATIONS))

Method Summary

public ezcReflectionDocCommentParserImpl __construct( )
Constructs an instance of ezcReflectionDocCommentParserImpl
protected string extractContentFromDocCommentLine( $line )
public ezcReflectionAnnotation[] getAnnotations( )
public ezcReflectionAnnotation[] getAnnotationsByName( $name )
Returns an array of annotations with a given name
public string getLongDescription( )
Returns the long description from the source code documentation
public ezcReflectionAnnotationParam[] getParamAnnotations( )
public ezcReflectionAnnotationReturn[] getReturnAnnotations( )
Return an array of return annotations
public string getShortDescription( )
Returns the short description from the source code documentation
public ezcReflectionAnnotationVar[] getVarAnnotations( )
public boolean hasAnnotation( $with )
Checks whether a annotation is used
public void parse( $docComment )
Initialize parsing of the given documentation fragment.
protected void parseAnnotation( $line )

Methods

__construct

Constructs an instance of ezcReflectionDocCommentParserImpl

extractContentFromDocCommentLine

string extractContentFromDocCommentLine( string $line )
Parameters:
Name Type Description
$line string

getAnnotations

ezcReflectionAnnotation[] getAnnotations( )
Implementation of:
Method Description
ezcReflectionDocCommentParser::getAnnotations() Retrieve all found annotations

getAnnotationsByName

ezcReflectionAnnotation[] getAnnotationsByName( string $name )

Returns an array of annotations with a given name

Parameters:
Name Type Description
$name string
Implementation of:
Method Description
ezcReflectionDocCommentParser::getAnnotationsByName() Return all found annotations with the given name.

getLongDescription

string getLongDescription( )

Returns the long description from the source code documentation

Implementation of:
Method Description
ezcReflectionDocCommentParser::getLongDescription() Returns long description

getParamAnnotations

ezcReflectionAnnotationParam[] getParamAnnotations( )
Implementation of:
Method Description
ezcReflectionDocCommentParser::getParamAnnotations() Retrieve all param annotations

getReturnAnnotations

ezcReflectionAnnotationReturn[] getReturnAnnotations( )

Return an array of return annotations

Implementation of:
Method Description
ezcReflectionDocCommentParser::getReturnAnnotations() Retrieve all return annotations

getShortDescription

string getShortDescription( )

Returns the short description from the source code documentation

Implementation of:
Method Description
ezcReflectionDocCommentParser::getShortDescription() Returns short description

getVarAnnotations

ezcReflectionAnnotationVar[] getVarAnnotations( )
Implementation of:
Method Description
ezcReflectionDocCommentParser::getVarAnnotations() Retrieve all var annotations

hasAnnotation

boolean hasAnnotation( string $with )

Checks whether a annotation is used

Parameters:
Name Type Description
$with string name of used annotation
Implementation of:
Method Description
ezcReflectionDocCommentParser::hasAnnotation() Checks whether an annotation was used in the parsed documentation fragment

parse

void parse( string $docComment )

Initialize parsing of the given documentation fragment.

Results can be retrieved after completion by the getters provided.

Parameters:
Name Type Description
$docComment string
Implementation of:
Method Description
ezcReflectionDocCommentParser::parse() Initialize parsing of the given documentation fragment.

parseAnnotation

void parseAnnotation( string $line )
Parameters:
Name Type Description
$line string
Documentation generated by phpDocumentor 1.4.3