Skip to content

Commit e168774

Browse files
Fix annotation reader when decorated (#13)
1 parent 8c29c1e commit e168774

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ONGRElasticsearchBundle.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\ManagerPass;
1515
use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\MappingPass;
16+
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
1718
use Symfony\Component\HttpKernel\Bundle\Bundle;
1819

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

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

0 commit comments

Comments
 (0)