Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 17 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 27 | public function getCollection(array $sortedSections): CommitCollection |
|
23 | { |
||
24 | 27 | $sections = []; |
|
25 | 27 | $default = null; |
|
26 | 27 | foreach ($sortedSections as $key => $section) { |
|
27 | 27 | $section = new Section( |
|
28 | 27 | $key, |
|
29 | 27 | $section['title'], |
|
30 | 27 | $section['hidden'], |
|
31 | 27 | $this->config->getSectionRules($key), |
|
32 | 27 | in_array($key, $this->majorTypes, true), |
|
33 | 27 | in_array($key, $this->minorTypes, true), |
|
34 | 27 | $this->config, |
|
35 | 27 | ); |
|
36 | 27 | if ($this->defaultSection === $key) { |
|
37 | 27 | $default = $section; |
|
38 | } |
||
39 | 27 | $sections[$key] = $section; |
|
40 | } |
||
41 | |||
42 | 27 | return new CommitCollection($sections, /* @scrutinizer ignore-type */ $default); |
|
43 | } |
||
45 |