Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Reader.php

interface Reader

Interface for annotation readers.

Hierarchy

  • interface \Doctrine\Common\Annotations\Reader

Expanded class hierarchy of Reader

All classes that implement Reader

1 file declares its use of Reader
SimpleAnnotationReader.php in core/lib/Drupal/Component/Annotation/Doctrine/SimpleAnnotationReader.php
This class is a near-copy of Doctrine\Common\Annotations\SimpleAnnotationReader, which is part of the Doctrine project: <http://www.doctrine-project.org&gt;. It was copied from version 1.2.7.

File

vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php, line 12

Namespace

Doctrine\Common\Annotations
View source
interface Reader {
    
    /**
     * Gets the annotations applied to a class.
     *
     * @param ReflectionClass $class The ReflectionClass of the class from which
     * the class annotations should be read.
     *
     * @return array<object> An array of Annotations.
     */
    public function getClassAnnotations(ReflectionClass $class);
    
    /**
     * Gets a class annotation.
     *
     * @param ReflectionClass $class          The ReflectionClass of the class from which
     *          the class annotations should be read.
     * @param class-string<T> $annotationName The name of the annotation.
     *
     * @return T|null The Annotation or NULL, if the requested annotation does not exist.
     *
     * @template T
     */
    public function getClassAnnotation(ReflectionClass $class, $annotationName);
    
    /**
     * Gets the annotations applied to a method.
     *
     * @param ReflectionMethod $method The ReflectionMethod of the method from which
     * the annotations should be read.
     *
     * @return array<object> An array of Annotations.
     */
    public function getMethodAnnotations(ReflectionMethod $method);
    
    /**
     * Gets a method annotation.
     *
     * @param ReflectionMethod $method         The ReflectionMethod to read the annotations from.
     * @param class-string<T>  $annotationName The name of the annotation.
     *
     * @return T|null The Annotation or NULL, if the requested annotation does not exist.
     *
     * @template T
     */
    public function getMethodAnnotation(ReflectionMethod $method, $annotationName);
    
    /**
     * Gets the annotations applied to a property.
     *
     * @param ReflectionProperty $property The ReflectionProperty of the property
     * from which the annotations should be read.
     *
     * @return array<object> An array of Annotations.
     */
    public function getPropertyAnnotations(ReflectionProperty $property);
    
    /**
     * Gets a property annotation.
     *
     * @param ReflectionProperty $property       The ReflectionProperty to read the annotations from.
     * @param class-string<T>    $annotationName The name of the annotation.
     *
     * @return T|null The Annotation or NULL, if the requested annotation does not exist.
     *
     * @template T
     */
    public function getPropertyAnnotation(ReflectionProperty $property, $annotationName);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
Reader::getClassAnnotation public function Gets a class annotation. 4
Reader::getClassAnnotations public function Gets the annotations applied to a class. 4
Reader::getMethodAnnotation public function Gets a method annotation. 4
Reader::getMethodAnnotations public function Gets the annotations applied to a method. 4
Reader::getPropertyAnnotation public function Gets a property annotation. 4
Reader::getPropertyAnnotations public function Gets the annotations applied to a property. 4

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal