vendor/jms/serializer/src/Metadata/Driver/AnnotationDriver.php line 47

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace JMS\Serializer\Metadata\Driver;
  4. use Doctrine\Common\Annotations\Reader;
  5. use JMS\Serializer\Expression\CompilableExpressionEvaluatorInterface;
  6. use JMS\Serializer\Naming\PropertyNamingStrategyInterface;
  7. use JMS\Serializer\Type\ParserInterface;
  8. class AnnotationDriver extends AnnotationOrAttributeDriver
  9. {
  10.     /**
  11.      * @var Reader
  12.      */
  13.     private $reader;
  14.     public function __construct(Reader $readerPropertyNamingStrategyInterface $namingStrategy, ?ParserInterface $typeParser null, ?CompilableExpressionEvaluatorInterface $expressionEvaluator null)
  15.     {
  16.         parent::__construct($namingStrategy$typeParser$expressionEvaluator);
  17.         $this->reader $reader;
  18.     }
  19.     /**
  20.      * @return list<object>
  21.      */
  22.     protected function getClassAnnotations(\ReflectionClass $class): array
  23.     {
  24.         return $this->reader->getClassAnnotations($class);
  25.     }
  26.     /**
  27.      * @return list<object>
  28.      */
  29.     protected function getMethodAnnotations(\ReflectionMethod $method): array
  30.     {
  31.         return $this->reader->getMethodAnnotations($method);
  32.     }
  33.     /**
  34.      * @return list<object>
  35.      */
  36.     protected function getPropertyAnnotations(\ReflectionProperty $property): array
  37.     {
  38.         return $this->reader->getPropertyAnnotations($property);
  39.     }
  40. }