Commit 51ad5109 authored by Dominique Feyer's avatar Dominique Feyer

TASK: Use strnatcmp in SortOperation

parent 25de5cc1
......@@ -76,8 +76,13 @@ class SortOperation extends AbstractOperation {
}
if ($sortOrder === 'DESC') {
arsort($sortSequence);
uasort($sortSequence, function($a, $b) {
return strnatcmp($b, $a);
});
} else {
asort($sortSequence);
uasort($sortSequence, function($a, $b) {
return strnatcmp($a, $b);
});
}
foreach ($sortSequence as $nodeIdentifier => $value) {
$sortedNodes[] = $nodesByIdentifier[$nodeIdentifier];
......@@ -85,4 +90,4 @@ class SortOperation extends AbstractOperation {
$flowQuery->setContext($sortedNodes);
}
}
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment