Skip to content

Commit

Permalink
Fix annotation reader when decorated (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz authored Sep 28, 2020
1 parent 8c29c1e commit e168774
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ONGRElasticsearchBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\ManagerPass;
use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\MappingPass;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

Expand All @@ -28,7 +29,8 @@ public function build(ContainerBuilder $container)
{
parent::build($container);

$container->addCompilerPass(new MappingPass());
$container->addCompilerPass(new ManagerPass());
// MappingPass need to be behind the Symfony `DecoratorServicePass` to allow decorating the annotation reader
$container->addCompilerPass(new MappingPass(), PassConfig::TYPE_OPTIMIZE, -10);
$container->addCompilerPass(new ManagerPass(), PassConfig::TYPE_OPTIMIZE, -11);
}
}

0 comments on commit e168774

Please sign in to comment.