class CachedReader implements Reader (View source)

A cache aware annotation reader.

Methods

__construct(Reader $reader, Cache $cache, bool $debug = false)

Constructor.

array
getClassAnnotations(ReflectionClass $class)

Gets the annotations applied to a class.

object|null
getClassAnnotation(ReflectionClass $class, string $annotationName)

Gets a class annotation.

array
getPropertyAnnotations(ReflectionProperty $property)

Gets the annotations applied to a property.

object|null
getPropertyAnnotation(ReflectionProperty $property, string $annotationName)

Gets a property annotation.

array
getMethodAnnotations(ReflectionMethod $method)

Gets the annotations applied to a method.

object|null
getMethodAnnotation(ReflectionMethod $method, string $annotationName)

Gets a method annotation.

void
clearLoadedAnnotations()

Clears loaded annotations.

Details

__construct(Reader $reader, Cache $cache, bool $debug = false)

Constructor.

Parameters

Reader $reader
Cache $cache
bool $debug

array getClassAnnotations(ReflectionClass $class)

Gets the annotations applied to a class.

Parameters

ReflectionClass $class The ReflectionClass of the class from which the class annotations should be read.

Return Value

array An array of Annotations.

object|null getClassAnnotation(ReflectionClass $class, string $annotationName)

Gets a class annotation.

Parameters

ReflectionClass $class The ReflectionClass of the class from which the class annotations should be read.
string $annotationName The name of the annotation.

Return Value

object|null The Annotation or NULL, if the requested annotation does not exist.

array getPropertyAnnotations(ReflectionProperty $property)

Gets the annotations applied to a property.

Parameters

ReflectionProperty $property The ReflectionProperty of the property from which the annotations should be read.

Return Value

array An array of Annotations.

object|null getPropertyAnnotation(ReflectionProperty $property, string $annotationName)

Gets a property annotation.

Parameters

ReflectionProperty $property The ReflectionProperty to read the annotations from.
string $annotationName The name of the annotation.

Return Value

object|null The Annotation or NULL, if the requested annotation does not exist.

array getMethodAnnotations(ReflectionMethod $method)

Gets the annotations applied to a method.

Parameters

ReflectionMethod $method The ReflectionMethod of the method from which the annotations should be read.

Return Value

array An array of Annotations.

object|null getMethodAnnotation(ReflectionMethod $method, string $annotationName)

Gets a method annotation.

Parameters

ReflectionMethod $method The ReflectionMethod to read the annotations from.
string $annotationName The name of the annotation.

Return Value

object|null The Annotation or NULL, if the requested annotation does not exist.

void clearLoadedAnnotations()

Clears loaded annotations.

Return Value

void