Total Complexity | 5 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | final class SectionsSorter implements SectionsSorterInterface |
||
17 | { |
||
18 | public function sortBySections(array $pages): array |
||
19 | { |
||
20 | $result = []; |
||
21 | |||
22 | /** @var PageInterface $page */ |
||
23 | foreach ($pages as $page) { |
||
24 | $result = $this->updateSectionsArray($page, $result); |
||
25 | } |
||
26 | |||
27 | return $result; |
||
28 | } |
||
29 | |||
30 | private function updateSectionsArray(PageInterface $page, array $currentResult): array |
||
45 | } |
||
46 | } |
||
47 |