class AnnotationReader implements Reader (View source)

A reader for docblock annotations.

Methods

static 
addGlobalIgnoredName(string $name)

Add a new annotation to the globally ignored annotation names with regard to exception handling.

__construct()

Constructor. Initializes a new AnnotationReader that uses the given Cache provider.

setIgnoreNotImportedAnnotations(bool $bool)

Ignore not imported annotations and not throw an exception.

setEnableParsePhpImports(bool $flag) deprecated

Detect imports by parsing the use statements of affected files.

bool
isParsePhpImportsEnabled() deprecated

No description

setDefaultAnnotationNamespace(string $defaultNamespace) deprecated

Sets the default namespace that the AnnotationReader should assume for annotations with not fully qualified names.

setAnnotationCreationFunction(Closure $func) deprecated

Sets the custom function to use for creating new annotations on the underlying parser.

setAnnotationNamespaceAlias(string $namespace, string $alias)

Sets an alias for an annotation namespace.

getClassAnnotations(ReflectionClass $class)

Gets the annotations applied to a class.

getClassAnnotation(ReflectionClass $class, $annotationName)

Gets a class annotation.

getPropertyAnnotations(ReflectionProperty $property)

Gets the annotations applied to a property.

getPropertyAnnotation(ReflectionProperty $property, $annotationName)

Gets a property annotation.

getMethodAnnotations(ReflectionMethod $method)

Gets the annotations applied to a method.

getMethodAnnotation(ReflectionMethod $method, $annotationName)

Gets a method annotation.

Details

static addGlobalIgnoredName(string $name)

Add a new annotation to the globally ignored annotation names with regard to exception handling.

Parameters

string $name

__construct()

Constructor. Initializes a new AnnotationReader that uses the given Cache provider.

setIgnoreNotImportedAnnotations(bool $bool)

Ignore not imported annotations and not throw an exception.

Parameters

bool $bool

setEnableParsePhpImports(bool $flag) deprecated

deprecated Will be removed in 3.0, imports will always be enabled.

Detect imports by parsing the use statements of affected files.

Parameters

bool $flag

bool isParsePhpImportsEnabled() deprecated

deprecated Will be removed in 3.0, imports will always be enabled.

Return Value

bool

setDefaultAnnotationNamespace(string $defaultNamespace) deprecated

deprecated This method will be removed in Doctrine Common 3.0

Sets the default namespace that the AnnotationReader should assume for annotations with not fully qualified names.

Parameters

string $defaultNamespace

setAnnotationCreationFunction(Closure $func) deprecated

deprecated This method will be removed in Doctrine Common 3.0

Sets the custom function to use for creating new annotations on the underlying parser.

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 implementation falls back to the default annotation creation process of the underlying parser.

Parameters

Closure $func

setAnnotationNamespaceAlias(string $namespace, string $alias)

Sets an alias for an annotation namespace.

Parameters

string $namespace
string $alias

getClassAnnotations(ReflectionClass $class)

Gets the annotations applied to a class.

Parameters

ReflectionClass $class

getClassAnnotation(ReflectionClass $class, $annotationName)

Gets a class annotation.

Parameters

ReflectionClass $class
$annotationName

getPropertyAnnotations(ReflectionProperty $property)

Gets the annotations applied to a property.

Parameters

ReflectionProperty $property

getPropertyAnnotation(ReflectionProperty $property, $annotationName)

Gets a property annotation.

Parameters

ReflectionProperty $property
$annotationName

getMethodAnnotations(ReflectionMethod $method)

Gets the annotations applied to a method.

Parameters

ReflectionMethod $method

getMethodAnnotation(ReflectionMethod $method, $annotationName)

Gets a method annotation.

Parameters

ReflectionMethod $method
$annotationName