class IndexedReader
Allows the reader to be used in-place of Doctrine's reader.
Hierarchy
- class \Doctrine\Common\Annotations\IndexedReader implements \Doctrine\Common\Annotations\Reader
Expanded class hierarchy of IndexedReader
File
-
vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ IndexedReader.php, line 15
Namespace
Doctrine\Common\AnnotationsView source
class IndexedReader implements Reader {
/** @var Reader */
private $delegate;
public function __construct(Reader $reader) {
$this->delegate = $reader;
}
/**
* {@inheritDoc}
*/
public function getClassAnnotations(ReflectionClass $class) {
$annotations = [];
foreach ($this->delegate
->getClassAnnotations($class) as $annot) {
$annotations[get_class($annot)] = $annot;
}
return $annotations;
}
/**
* {@inheritDoc}
*/
public function getClassAnnotation(ReflectionClass $class, $annotationName) {
return $this->delegate
->getClassAnnotation($class, $annotationName);
}
/**
* {@inheritDoc}
*/
public function getMethodAnnotations(ReflectionMethod $method) {
$annotations = [];
foreach ($this->delegate
->getMethodAnnotations($method) as $annot) {
$annotations[get_class($annot)] = $annot;
}
return $annotations;
}
/**
* {@inheritDoc}
*/
public function getMethodAnnotation(ReflectionMethod $method, $annotationName) {
return $this->delegate
->getMethodAnnotation($method, $annotationName);
}
/**
* {@inheritDoc}
*/
public function getPropertyAnnotations(ReflectionProperty $property) {
$annotations = [];
foreach ($this->delegate
->getPropertyAnnotations($property) as $annot) {
$annotations[get_class($annot)] = $annot;
}
return $annotations;
}
/**
* {@inheritDoc}
*/
public function getPropertyAnnotation(ReflectionProperty $property, $annotationName) {
return $this->delegate
->getPropertyAnnotation($property, $annotationName);
}
/**
* Proxies all methods to the delegate.
*
* @param mixed[] $args
*
* @return mixed
*/
public function __call(string $method, array $args) {
return call_user_func_array([
$this->delegate,
$method,
], $args);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
IndexedReader::$delegate | private | property | @var Reader | |
IndexedReader::getClassAnnotation | public | function | Gets a class annotation. | Overrides Reader::getClassAnnotation |
IndexedReader::getClassAnnotations | public | function | Gets the annotations applied to a class. | Overrides Reader::getClassAnnotations |
IndexedReader::getMethodAnnotation | public | function | Gets a method annotation. | Overrides Reader::getMethodAnnotation |
IndexedReader::getMethodAnnotations | public | function | Gets the annotations applied to a method. | Overrides Reader::getMethodAnnotations |
IndexedReader::getPropertyAnnotation | public | function | Gets a property annotation. | Overrides Reader::getPropertyAnnotation |
IndexedReader::getPropertyAnnotations | public | function | Gets the annotations applied to a property. | Overrides Reader::getPropertyAnnotations |
IndexedReader::__call | public | function | Proxies all methods to the delegate. | |
IndexedReader::__construct | public | function |