Skip to content

Commit

Permalink
Use autowire for annotation reader
Browse files Browse the repository at this point in the history
  • Loading branch information
trejjam committed Jan 15, 2018
1 parent 2628727 commit 017b50a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Kdyby/Doctrine/DI/OrmExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -622,15 +622,8 @@ protected function processMetadataDriver(Nette\DI\ServiceDefinition $metadataDri
}

if ($impl === self::ANNOTATION_DRIVER) {
$annotationExtensionName = self::ANNOTATION_DRIVER;
foreach ($this->compiler->getExtensions(AnnotationsExtension::class) as $annotationExtension) {
$annotationExtensionName = $annotationExtension->name;

break;
}

$driver->arguments = [
"@{$annotationExtensionName}.reader",
'@' . Doctrine\Common\Annotations\Reader::class,
Nette\Utils\Arrays::flatten($driver->arguments)
];
}
Expand Down

0 comments on commit 017b50a

Please sign in to comment.