From 8c29c1e8972910fb09b890b3d4ee0aa5b11ca6f6 Mon Sep 17 00:00:00 2001 From: Johannes Wachter Date: Fri, 11 Sep 2020 10:16:05 +0200 Subject: [PATCH] Use the reader interface instead for annotation reader (#12) --- Command/DocumentGenerateCommand.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Command/DocumentGenerateCommand.php b/Command/DocumentGenerateCommand.php index 96d92dd5..a6604dd9 100644 --- a/Command/DocumentGenerateCommand.php +++ b/Command/DocumentGenerateCommand.php @@ -12,6 +12,7 @@ namespace ONGR\ElasticsearchBundle\Command; use Doctrine\Common\Annotations\CachedReader; +use Doctrine\Common\Annotations\Reader; use ONGR\ElasticsearchBundle\Mapping\MetadataCollector; use ONGR\ElasticsearchBundle\Service\GenerateService; use Symfony\Component\Console\Helper\FormatterHelper; @@ -35,9 +36,9 @@ class DocumentGenerateCommand extends AbstractManagerAwareCommand protected $metadataCollector; /** - * @var CachedReader + * @var Reader */ - protected $cachedReader; + protected $reader; /** * @var array @@ -48,7 +49,7 @@ public function __construct( array $bundles, GenerateService $generateService, MetadataCollector $metadataCollector, - CachedReader $cachedReader, + Reader $reader, array $managers = [] ) { parent::__construct($managers, self::$defaultName); @@ -56,7 +57,7 @@ public function __construct( $this->bundles = $bundles; $this->generateService = $generateService; $this->metadataCollector = $metadataCollector; - $this->cachedReader = $cachedReader; + $this->reader = $reader; } /** @@ -654,7 +655,7 @@ private function getPropertyTypes() { $reflection = new \ReflectionClass('ONGR\ElasticsearchBundle\Annotation\Property'); - return $this->cachedReader + return $this->reader ->getPropertyAnnotation($reflection->getProperty('type'), 'Doctrine\Common\Annotations\Annotation\Enum') ->value; }