Skip to content

Commit

Permalink
Use the reader interface instead for annotation reader (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes authored Sep 11, 2020
1 parent eea1a34 commit 8c29c1e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Command/DocumentGenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -35,9 +36,9 @@ class DocumentGenerateCommand extends AbstractManagerAwareCommand
protected $metadataCollector;

/**
* @var CachedReader
* @var Reader
*/
protected $cachedReader;
protected $reader;

/**
* @var array
Expand All @@ -48,15 +49,15 @@ public function __construct(
array $bundles,
GenerateService $generateService,
MetadataCollector $metadataCollector,
CachedReader $cachedReader,
Reader $reader,
array $managers = []
) {
parent::__construct($managers, self::$defaultName);

$this->bundles = $bundles;
$this->generateService = $generateService;
$this->metadataCollector = $metadataCollector;
$this->cachedReader = $cachedReader;
$this->reader = $reader;
}

/**
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 8c29c1e

Please sign in to comment.