Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 241684a

Browse filesBrowse files
committed
trying to fix test
1 parent 245263b commit 241684a
Copy full SHA for 241684a

File tree

1 file changed

+10
-10
lines changed
Filter options
  • src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler

1 file changed

+10
-10
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,22 @@ public function process(ContainerBuilder $container)
6060
throw new InvalidArgumentException(sprintf('Tagged form type extension must have the extended type configured using the extended_type/extended-type attribute, none was configured for the "%s" service.', $serviceId));
6161
}
6262

63-
$typeExtensionsToSort[$extendedType][] = array(
63+
$priority = isset($tag[0]['priority']) ? $tag[0]['priority'] : 0;
64+
$typeExtensionsToSort[$priority][] = array(
6465
'service_id' => $serviceId,
6566
'extended_type' => $extendedType,
66-
'priority' => isset($tag[0]['priority']) ? $tag[0]['priority'] : 0,
6767
);
6868
}
6969

7070
$typeExtensions = array();
71-
array_walk($typeExtensionsToSort, function ($data) use (&$typeExtensions) {
72-
usort($data, function ($a, $b) {
73-
return $a['priority'] <= $b['priority'];
74-
});
75-
array_walk($data, function ($d) use (&$typeExtensions) {
76-
$typeExtensions[$d['extended_type']][] = $d['service_id'];
77-
});
78-
});
71+
if ($typeExtensionsToSort) {
72+
krsort($typeExtensionsToSort);
73+
$typeExtensionsSorted = call_user_func_array('array_merge', $typeExtensionsToSort);
74+
75+
foreach ($typeExtensionsSorted as $typeExtension) {
76+
$typeExtensions[$typeExtension['extended_type']][] = $typeExtension['service_id'];
77+
}
78+
}
7979

8080
$definition->replaceArgument(2, $typeExtensions);
8181

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.