class Reader implements ReaderInterface (View source)

Properties

protected $reader

Methods

__construct(Cache $cacheReader = null)

Instantiates a new annotation reader, optionally injecting a cache mechanism for it.

array
getClassAnnotations(ReflectionClass $class)

Gets the annotations applied to a class.

The
getClassAnnotation(ReflectionClass $class, string $annotation)

Gets a class annotation.

array
getPropertyAnnotations(ReflectionProperty $property)

Gets the annotations applied to a property.

The
getPropertyAnnotation(ReflectionProperty $property, string $annotation)

Gets a property annotation.

array
getMethodAnnotations(ReflectionMethod $method)

Gets the annotations applied to a method.

The
getMethodAnnotation(ReflectionMethod $method, string $annotation)

Gets a method annotation.

CachedReader
getReader()

Returns the cached reader associated with this reader.

CacheProvider
createCacheProvider()

Creates a new instance of a cache provider.

Details

__construct(Cache $cacheReader = null)

Instantiates a new annotation reader, optionally injecting a cache mechanism for it.

This reader is basically a proxy wrapping Doctrine's one.

Parameters

Cache $cacheReader

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.

The getClassAnnotation(ReflectionClass $class, string $annotation)

Gets a class annotation.

Parameters

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

Return Value

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 name or ReflectionProperty of the property from which the annotations should be read.

Return Value

array An array of Annotations.

The getPropertyAnnotation(ReflectionProperty $property, string $annotation)

Gets a property annotation.

Parameters

ReflectionProperty $property
string $annotation The name of the annotation.

Return Value

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

Return Value

array An array of Annotations.

The getMethodAnnotation(ReflectionMethod $method, string $annotation)

Gets a method annotation.

Parameters

ReflectionMethod $method
string $annotation The name of the annotation.

Return Value

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

protected CachedReader getReader()

Returns the cached reader associated with this reader.

Return Value

CachedReader

protected CacheProvider createCacheProvider()

Creates a new instance of a cache provider.

Return Value

CacheProvider