src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DataProviderPass.php 1 location
|
@@ 38-43 (lines=6) @@
|
| 35 |
|
|
| 36 |
|
private function registerDataProviders(ContainerBuilder $container, string $type) { |
| 37 |
|
$sortedServices = []; |
| 38 |
|
foreach ($container->findTaggedServiceIds('api_platform.'.$type.'_data_provider') as $serviceId => $tags) { |
| 39 |
|
foreach ($tags as $tag) { |
| 40 |
|
$priority = isset($tag['priority']) ? $tag['priority'] : 0; |
| 41 |
|
$sortedServices[$priority][] = new Reference($serviceId); |
| 42 |
|
} |
| 43 |
|
} |
| 44 |
|
krsort($sortedServices); |
| 45 |
|
|
| 46 |
|
$container->getDefinition('api_platform.'.$type.'_data_provider')->addArgument(call_user_func_array('array_merge', $sortedServices)); |
src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DoctrineQueryExtensionPass.php 1 location
|
@@ 51-56 (lines=6) @@
|
| 48 |
|
private function findSortedServices(ContainerBuilder $container, $tag) |
| 49 |
|
{ |
| 50 |
|
$extensions = []; |
| 51 |
|
foreach ($container->findTaggedServiceIds($tag) as $serviceId => $tags) { |
| 52 |
|
foreach ($tags as $tag) { |
| 53 |
|
$priority = isset($tag['priority']) ? $tag['priority'] : 0; |
| 54 |
|
$extensions[$priority][] = new Reference($serviceId); |
| 55 |
|
} |
| 56 |
|
} |
| 57 |
|
krsort($extensions); |
| 58 |
|
|
| 59 |
|
// Flatten the array |