| 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 | 24 | public function getCollection(array $sortedSections): CommitCollection |
|
| 23 | { |
||
| 24 | 24 | $sections = []; |
|
| 25 | 24 | $default = null; |
|
| 26 | 24 | foreach ($sortedSections as $key => $section) { |
|
| 27 | 24 | $section = new Section( |
|
| 28 | 24 | $key, |
|
| 29 | 24 | $section['title'], |
|
| 30 | 24 | $section['hidden'], |
|
| 31 | 24 | $this->config->getSectionRules($key), |
|
| 32 | 24 | in_array($key, $this->majorTypes, true), |
|
| 33 | 24 | in_array($key, $this->minorTypes, true), |
|
| 34 | 24 | $this->config, |
|
| 35 | 24 | ); |
|
| 36 | 24 | if ($this->defaultSection === $key) { |
|
| 37 | 24 | $default = $section; |
|
| 38 | } |
||
| 39 | 24 | $sections[$key] = $section; |
|
| 40 | } |
||
| 41 | |||
| 42 | 24 | return new CommitCollection($sections, /* @scrutinizer ignore-type */ $default); |
|
| 43 | } |
||
| 45 |