From a91c4e4f96309401f2e1a7a05ccadc876781298e Mon Sep 17 00:00:00 2001 From: Mate Bartus Date: Wed, 24 Jun 2015 13:08:19 +0200 Subject: [ticket/13961] Add ordered service collection PHPBB3-13961 --- phpBB/phpbb/di/pass/collection_pass.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/di/pass') diff --git a/phpBB/phpbb/di/pass/collection_pass.php b/phpBB/phpbb/di/pass/collection_pass.php index a5c054674e..ccc1250c20 100644 --- a/phpBB/phpbb/di/pass/collection_pass.php +++ b/phpBB/phpbb/di/pass/collection_pass.php @@ -37,7 +37,16 @@ class collection_pass implements CompilerPassInterface foreach ($container->findTaggedServiceIds($data[0]['tag']) as $service_id => $service_data) { - $definition->addMethodCall('add', array($service_id)); + if (substr($definition->getClass(), -strlen('ordered_service_collection')) === 'ordered_service_collection') + { + $arguments = array($service_id, $service_data[0]['order']); + } + else + { + $arguments = array($service_id); + } + + $definition->addMethodCall('add', $arguments); } } } -- cgit v1.2.1