PHP Класс phprs\util\DocParser

It is strongly discouraged to change the default annotation parsing process.
Автор: Benjamin Eberlei ([email protected])
Автор: Guilherme Blanco ([email protected])
Автор: Jonathan Wage ([email protected])
Автор: Roman Borschel ([email protected])
Автор: Johannes M. Schmitt ([email protected])
Автор: Fabio B. Silva ([email protected])
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( ) Constructs a new DocParser.
parse ( string $input, string $context = '', $record_doc ) : array Parses the given docblock string for annotations.
setIgnoredAnnotationNames ( array $names ) : void Sets the annotation names that are ignored during the parsing process.

Приватные методы

Метод Описание
Annotations ( $record_doc = false ) : array Annotations ::= Annotation {[ "*" ]* [Annotation]}*
ArrayEntry ( ) : array ArrayEntry ::= Value | KeyValuePair KeyValuePair ::= Key ("=" | ":") PlainValue | Constant Key ::= string | integer | Constant
Arrayx ( ) : array Array ::= "{" ArrayEntry {"," ArrayEntry}* [","] "}"
Constant ( ) : mixed Constant ::= integer | string | float | boolean
FieldAssignment ( ) : array FieldAssignment ::= FieldName "=" PlainValue FieldName ::= identifier
Identifier ( ) : string Identifier ::= string
MethodCall ( ) : array MethodCall ::= ["(" [Values] ")"]
PlainValue ( ) : mixed PlainValue ::= integer | string | float | boolean | Array | Annotation
Value ( ) : mixed Value ::= PlainValue | FieldAssignment
Values ( ) : array Values ::= Array | Value {"," Value}* [","]
findInitialTokenPosition ( string $input ) : integer | null Finds the first valid annotation
match ( integer $token ) : boolean Attempts to match the given token with the current lookahead token.
matchAny ( array $tokens ) : boolean Attempts to match the current lookahead token with any of the given tokens.
syntaxError ( string $expected, array | null $token = null ) : void Generates a new syntax error.

Описание методов

__construct() публичный метод

Constructs a new DocParser.
public __construct ( )

parse() публичный метод

Parses the given docblock string for annotations.
public parse ( string $input, string $context = '', $record_doc ) : array
$input string The docblock string to parse.
$context string The parsing context.
Результат array Array of annotations. If no annotations are found, an empty array is returned.

setIgnoredAnnotationNames() публичный метод

The names are supposed to be the raw names as used in the class, not the fully qualified class names.
public setIgnoredAnnotationNames ( array $names ) : void
$names array
Результат void