Skip to content

Commit 3b08bdb

Browse files
committed
Add subgroups to allow sorting within a group - fix rebase conflict
1 parent 6c07952 commit 3b08bdb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/PHPFormatter/Sorter/UseSorter.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,17 @@ public function sort($data)
235235
continue;
236236
}
237237

238+
if (is_int($groupKey)) {
239+
$subGroupSorted = array();
240+
foreach ($group as $subGroupKey => $subGroup) {
241+
$subGroupSorted = array_merge($subGroupSorted, $this->sortGroup($subGroup));
242+
}
243+
244+
$groups[$groupKey] = $subGroupSorted;
245+
} else {
246+
$groups[$groupKey] = $this->sortGroup($group);
247+
}
248+
238249
$groups[$groupKey] = $this->sortGroup($group);
239250
}
240251

0 commit comments

Comments
 (0)