MIOLO20
|
Membros públicos | |
__construct (Lexer $lexer=null) | |
getLexer () | |
setAutoloadAnnotations ($bool) | |
setAnnotationCreationFunction (Closure $func) | |
getAutoloadAnnotations () | |
setDefaultAnnotationNamespace ($defaultNamespace) | |
setAnnotationNamespaceAlias ($namespace, $alias) | |
getNamespaceAliases () | |
parse ($docBlockString, $context='') | |
match ($token) | |
Annotations () | |
Annotation () | |
Values () | |
Value () | |
PlainValue () | |
FieldAssignment () | |
Arrayx () | |
ArrayEntry () | |
Membros protegidos | |
newAnnotation ($name, array $values) | |
Atributos Protegidos | |
$isNestedAnnotation = false | |
A simple parser for docblock annotations.
This Parser can be subclassed to customize certain aspects of the annotation parsing and/or creation process. Note though that currently no special care is taken to maintain full backwards compatibility for subclasses. Implementation details of the default Parser can change without explicit notice.
Definido na linha 38 do ficheiro Parser.php.
__construct | ( | Lexer | $lexer = null | ) |
Constructs a new AnnotationParser.
Definido na linha 95 do ficheiro Parser.php.
Annotation | ( | ) |
Annotation ::= "@" AnnotationName ["(" [Values] ")"] AnnotationName ::= QualifiedName | SimpleName | AliasedName QualifiedName ::= NameSpacePart "\" {NameSpacePart ""}* SimpleName AliasedName ::= Alias ":" SimpleName NameSpacePart ::= identifier SimpleName ::= identifier Alias ::= identifier
Definido na linha 300 do ficheiro Parser.php.
Annotations | ( | ) |
Annotations ::= Annotation {[ "*" ]* [Annotation]}*
Definido na linha 264 do ficheiro Parser.php.
ArrayEntry | ( | ) |
ArrayEntry ::= Value | KeyValuePair KeyValuePair ::= Key "=" PlainValue Key ::= string | integer
Definido na linha 512 do ficheiro Parser.php.
Arrayx | ( | ) |
Array ::= "{" ArrayEntry {"," ArrayEntry}* "}"
Definido na linha 478 do ficheiro Parser.php.
FieldAssignment | ( | ) |
FieldAssignment ::= FieldName "=" PlainValue FieldName ::= identifier
Definido na linha 464 do ficheiro Parser.php.
getAutoloadAnnotations | ( | ) |
Gets a flag whether to try to autoload annotation classes.
Definido na linha 149 do ficheiro Parser.php.
getLexer | ( | ) |
Gets the lexer used by this parser.
Definido na linha 105 do ficheiro Parser.php.
getNamespaceAliases | ( | ) |
Gets the namespace alias mappings used by this parser.
Definido na linha 181 do ficheiro Parser.php.
match | ( | $token | ) |
Attempts to match the given token with the current lookahead token. If they match, updates the lookahead token; otherwise raises a syntax error.
int | Token type. |
Definido na linha 221 do ficheiro Parser.php.
|
protected |
Constructs a new annotation with a given map of values.
The default construction procedure is to instantiate a new object of a class with the same name as the annotation. Subclasses can override this method to change the construction process of new annotations.
string | The name of the annotation. |
array | The map of annotation values. |
Definido na linha 541 do ficheiro Parser.php.
parse | ( | $docBlockString, | |
$context = '' ) |
Parses the given docblock string for annotations.
string | $docBlockString | The docblock string to parse. |
string | $context | The parsing context. |
Definido na linha 193 do ficheiro Parser.php.
PlainValue | ( | ) |
PlainValue ::= integer | string | float | boolean | Array | Annotation
Definido na linha 422 do ficheiro Parser.php.
setAnnotationCreationFunction | ( | Closure | $func | ) |
Sets the custom function to use for creating new annotations.
The function is supplied two arguments. The first argument is the name of the annotation and the second argument an array of values for this annotation. The function is assumed to return an object or NULL. Whenever the function returns NULL for an annotation, the parser falls back to the default annotation creation process.
Whenever the function returns NULL for an annotation, the implementation falls back to the default annotation creation process.
Closure | $func |
Definido na linha 138 do ficheiro Parser.php.
setAnnotationNamespaceAlias | ( | $namespace, | |
$alias ) |
Sets an alias for an annotation namespace.
string | $namespace | |
string | $alias |
Definido na linha 171 do ficheiro Parser.php.
setAutoloadAnnotations | ( | $bool | ) |
Sets a flag whether to try to autoload annotation classes, as well as to distinguish between what is an annotation and what not by triggering autoloading.
NOTE: Autoloading of annotation classes is inefficient and requires silently failing autoloaders. In particular, setting this option to TRUE renders the Parser incompatible with a ClassLoader
.
boolean | $bool | Boolean flag. |
Definido na linha 119 do ficheiro Parser.php.
setDefaultAnnotationNamespace | ( | $defaultNamespace | ) |
Sets the default namespace that is assumed for an annotation that does not define a namespace prefix.
string | $defaultNamespace |
Definido na linha 160 do ficheiro Parser.php.
Value | ( | ) |
Values | ( | ) |
|
protected |
Definido na linha 61 do ficheiro Parser.php.