File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
DependencyInjection/Compiler Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,18 @@ public function process(ContainerBuilder $container)
3030 $ registry = $ container ->getDefinition ('fos_elastica.provider_registry ' );
3131 $ providers = $ container ->findTaggedServiceIds ('fos_elastica.provider ' );
3232
33- foreach ($ providers as $ providerId => $ tags ) {
33+ $ providersByPriority = array ();
34+ foreach ($ providers as $ id => $ attributes ) {
35+ $ priority = isset ($ attributes [0 ]['priority ' ]) ? $ attributes [0 ]['priority ' ] : 0 ;
36+ $ providersByPriority [$ priority ][$ id ] = $ attributes ;
37+ }
38+
39+ if (!empty ($ providersByPriority )){
40+ krsort ($ providersByPriority );
41+ $ providersByPriority = call_user_func_array ('array_merge ' , $ providersByPriority );
42+ }
43+
44+ foreach ($ providersByPriority as $ providerId => $ tags ) {
3445 $ index = $ type = null ;
3546 $ class = $ container ->getDefinition ($ providerId )->getClass ();
3647
You can’t perform that action at this time.
0 commit comments