PHP 클래스 Doctrine\Common\Annotations\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])
파일 보기 프로젝트 열기: doctrine/annotations 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( ) Constructs a new DocParser.
addNamespace ( array $namespace ) : void Sets the default namespaces.
parse ( string $input, string $context = '' ) : array Parses the given docblock string for annotations.
setIgnoreNotImportedAnnotations ( boolean $bool ) : void Sets ignore on not-imported annotations.
setIgnoredAnnotationNames ( array $names ) : void Sets the annotation names that are ignored during the parsing process.
setIgnoredAnnotationNamespaces ( bool[] $ignoredAnnotationNamespaces ) : void Sets the annotation namespaces that are ignored during the parsing process.
setImports ( array $imports ) : void Sets the imports.
setTarget ( integer $target ) : void Sets current target context as bitmask.

비공개 메소드들

메소드 설명
Annotation ( ) : mixed Annotation ::= "@" AnnotationName MethodCall AnnotationName ::= QualifiedName | SimpleName QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName NameSpacePart ::= identifier | null | false | true SimpleName ::= identifier | null | false | true
Annotations ( ) : 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}* [","]
classExists ( string $fqcn ) : boolean Attempts to check if a class exists or not. This never goes through the PHP autoloading mechanism but uses the {@link AnnotationRegistry} to load classes.
collectAnnotationMetadata ( string $name ) : void Collects parsing metadata for a given annotation class
collectAttributeTypeMetadata ( array &$metadata, Doctrine\Common\Annotations\Annotation\Attribute $attribute ) : void Collects parsing metadata for a given attribute.
findInitialTokenPosition ( string $input ) : integer | null Finds the first valid annotation
isIgnoredAnnotation ( string $name ) : boolean Checks whether the given $name matches any ignored annotation name or namespace
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 ( )

addNamespace() 공개 메소드

Sets the default namespaces.
public addNamespace ( array $namespace ) : void
$namespace array
리턴 void

parse() 공개 메소드

Parses the given docblock string for annotations.
public parse ( string $input, string $context = '' ) : 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.

setIgnoreNotImportedAnnotations() 공개 메소드

Sets ignore on not-imported annotations.
public setIgnoreNotImportedAnnotations ( boolean $bool ) : void
$bool boolean
리턴 void

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 indexed by annotation name
리턴 void

setIgnoredAnnotationNamespaces() 공개 메소드

Sets the annotation namespaces that are ignored during the parsing process.
public setIgnoredAnnotationNamespaces ( bool[] $ignoredAnnotationNamespaces ) : void
$ignoredAnnotationNamespaces bool[] indexed by annotation namespace name
리턴 void

setImports() 공개 메소드

Sets the imports.
public setImports ( array $imports ) : void
$imports array
리턴 void

setTarget() 공개 메소드

Sets current target context as bitmask.
public setTarget ( integer $target ) : void
$target integer
리턴 void