Documentation

Reader

Interface for annotation readers.

Tags
author

Johannes M. Schmitt schmittjoh@gmail.com

Table of Contents

getClassAnnotation()  : object|null
Gets a class annotation.
getClassAnnotations()  : array<string|int, mixed>
Gets the annotations applied to a class.
getMethodAnnotation()  : object|null
Gets a method annotation.
getMethodAnnotations()  : array<string|int, mixed>
Gets the annotations applied to a method.
getPropertyAnnotation()  : object|null
Gets a property annotation.
getPropertyAnnotations()  : array<string|int, mixed>
Gets the annotations applied to a property.

Methods

getClassAnnotation()

Gets a class annotation.

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

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

$annotationName : string

The name of the annotation.

Return values
object|null

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

getClassAnnotations()

Gets the annotations applied to a class.

public getClassAnnotations(ReflectionClass $class) : array<string|int, mixed>
Parameters
$class : ReflectionClass

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

Return values
array<string|int, mixed>

An array of Annotations.

getMethodAnnotation()

Gets a method annotation.

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

The ReflectionMethod to read the annotations from.

$annotationName : string

The name of the annotation.

Return values
object|null

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

getMethodAnnotations()

Gets the annotations applied to a method.

public getMethodAnnotations(ReflectionMethod $method) : array<string|int, mixed>
Parameters
$method : ReflectionMethod

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

Return values
array<string|int, mixed>

An array of Annotations.

getPropertyAnnotation()

Gets a property annotation.

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

The ReflectionProperty to read the annotations from.

$annotationName : string

The name of the annotation.

Return values
object|null

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

getPropertyAnnotations()

Gets the annotations applied to a property.

public getPropertyAnnotations(ReflectionProperty $property) : array<string|int, mixed>
Parameters
$property : ReflectionProperty

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

Return values
array<string|int, mixed>

An array of Annotations.

Search results