Skip to content

Latest commit

 

History

History
269 lines (108 loc) · 3.75 KB

SimpleAnnotationReader.md

File metadata and controls

269 lines (108 loc) · 3.75 KB

SimpleAnnotationReader

Simple Annotation Reader.

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

  • Full name: \Doctrine\Common\Annotations\SimpleAnnotationReader
  • Warning: this class is deprecated. This means that this class will likely be removed in a future version.
  • This class implements: \Doctrine\Common\Annotations\Reader

Properties

parser

private \Doctrine\Common\Annotations\DocParser $parser

Methods

__construct

Initializes a new SimpleAnnotationReader.

public __construct(): mixed

addNamespace

Adds a namespace in which we will look for annotations.

public addNamespace(string $namespace): void

Parameters:

Parameter Type Description
$namespace string

getClassAnnotations

Gets the annotations applied to a class.

public getClassAnnotations(\ReflectionClass $class): object[]

Parameters:

Parameter Type Description
$class \ReflectionClass The ReflectionClass of the class from which
the class annotations should be read.

Return Value:

An array of Annotations.


getMethodAnnotations

Gets the annotations applied to a method.

public getMethodAnnotations(\ReflectionMethod $method): object[]

Parameters:

Parameter Type Description
$method \ReflectionMethod The ReflectionMethod of the method from which
the annotations should be read.

Return Value:

An array of Annotations.


getPropertyAnnotations

Gets the annotations applied to a property.

public getPropertyAnnotations(\ReflectionProperty $property): object[]

Parameters:

Parameter Type Description
$property \ReflectionProperty The ReflectionProperty of the property
from which the annotations should be read.

Return Value:

An array of Annotations.


getClassAnnotation

Gets a class annotation.

public getClassAnnotation(\ReflectionClass $class, mixed $annotationName): \Doctrine\Common\Annotations\T|null

Parameters:

Parameter Type Description
$class \ReflectionClass The ReflectionClass of the class from which
the class annotations should be read.
$annotationName mixed The name of the annotation.

Return Value:

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


getMethodAnnotation

Gets a method annotation.

public getMethodAnnotation(\ReflectionMethod $method, mixed $annotationName): \Doctrine\Common\Annotations\T|null

Parameters:

Parameter Type Description
$method \ReflectionMethod The ReflectionMethod to read the annotations from.
$annotationName mixed The name of the annotation.

Return Value:

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


getPropertyAnnotation

Gets a property annotation.

public getPropertyAnnotation(\ReflectionProperty $property, mixed $annotationName): \Doctrine\Common\Annotations\T|null

Parameters:

Parameter Type Description
$property \ReflectionProperty The ReflectionProperty to read the annotations from.
$annotationName mixed The name of the annotation.

Return Value:

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