Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | private function updateSectionsArray(PageInterface $page, array $currentResult): array |
||
31 | { |
||
32 | Assert::isIterable($page->getSections()); |
||
33 | foreach ($page->getSections() as $section) { |
||
34 | $sectionCode = $section->getCode(); |
||
35 | Assert::notNull($sectionCode); |
||
36 | if (!array_key_exists($sectionCode, $currentResult)) { |
||
37 | $currentResult[$sectionCode] = []; |
||
38 | $currentResult[$sectionCode]['section'] = $section; |
||
39 | } |
||
40 | |||
41 | $currentResult[$sectionCode][] = $page; |
||
42 | } |
||
43 | |||
44 | return $currentResult; |
||
45 | } |
||
47 |