File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
DependencyInjection/Compiler Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,20 @@ class AddSpreadCompilerPass implements CompilerPassInterface
1212 */
1313 public function process (ContainerBuilder $ container )
1414 {
15- $ alias = $ container ->getAlias ('spy_timeline.spread.deployer ' );
16- $ spreadDeployer = $ container ->getDefinition ((string ) $ alias );
15+ $ alias = $ container ->getAlias ('spy_timeline.spread.deployer ' );
16+ $ spreadDeployer = $ container ->getDefinition ((string ) $ alias );
17+ $ spreadByPriority = [];
1718
18- foreach ($ container ->findTaggedServiceIds ('spy_timeline.spread ' ) as $ id => $ tags ) {
19- $ spreadDeployer ->addMethodCall ('addSpread ' , array ($ container ->getDefinition ($ id )));
19+ foreach ($ container ->findTaggedServiceIds ('spy_timeline.spread ' ) as $ id => $ options ) {
20+ $ priority = array_key_exists ('priority ' , $ options [0 ]) ? $ options [0 ]['priority ' ] : 0 ;
21+
22+ $ spreadByPriority [$ priority ][] = $ container ->getDefinition ($ id );
23+ }
24+
25+ krsort ($ spreadByPriority );
26+
27+ foreach ($ spreadByPriority as $ spreads ) {
28+ $ spreadDeployer ->addMethodCall ('addSpread ' , $ spreads );
2029 }
2130 }
2231}
You can’t perform that action at this time.
0 commit comments