class SimpleAnnotationReader implements Reader (View source)

Simple Annotation Reader.

This annotation reader is intended to be used in projects where you have full-control over all annotations that are available.

Methods

__construct()

Constructor.

addNamespace(string $namespace)

Adds a namespace in which we will look for annotations.

getClassAnnotations(ReflectionClass $class)

Gets the annotations applied to a class.

getMethodAnnotations(ReflectionMethod $method)

Gets the annotations applied to a method.

getPropertyAnnotations(ReflectionProperty $property)

Gets the annotations applied to a property.

getClassAnnotation(ReflectionClass $class, $annotationName)

Gets a class annotation.

getMethodAnnotation(ReflectionMethod $method, $annotationName)

Gets a method annotation.

getPropertyAnnotation(ReflectionProperty $property, $annotationName)

Gets a property annotation.

Details

__construct()

Constructor.

Initializes a new SimpleAnnotationReader.

addNamespace(string $namespace)

Adds a namespace in which we will look for annotations.

Parameters

string $namespace

getClassAnnotations(ReflectionClass $class)

Gets the annotations applied to a class.

Parameters

ReflectionClass $class

getMethodAnnotations(ReflectionMethod $method)

Gets the annotations applied to a method.

Parameters

ReflectionMethod $method

getPropertyAnnotations(ReflectionProperty $property)

Gets the annotations applied to a property.

Parameters

ReflectionProperty $property

getClassAnnotation(ReflectionClass $class, $annotationName)

Gets a class annotation.

Parameters

ReflectionClass $class
$annotationName

getMethodAnnotation(ReflectionMethod $method, $annotationName)

Gets a method annotation.

Parameters

ReflectionMethod $method
$annotationName

getPropertyAnnotation(ReflectionProperty $property, $annotationName)

Gets a property annotation.

Parameters

ReflectionProperty $property
$annotationName