Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
35 | 7 | protected function applyCurrent(CharTree $charTree): CharTree |
|
36 | { |
||
37 | 7 | if ($charTree->getRoot() === null) { |
|
38 | 1 | return $charTree; |
|
39 | } |
||
40 | |||
41 | 6 | $formatted = []; |
|
42 | |||
43 | 6 | foreach ($this->charExtractor->cut($charTree, 1) as [$root, $tree]) { |
|
44 | 5 | assert(is_string($root)); |
|
45 | 5 | assert(is_object($tree)); |
|
46 | |||
47 | 5 | $branches = [$this->lowerCaseConverter->apply($tree)]; |
|
48 | 5 | $formatted[] = CharTree::fromString(mb_strtoupper($root), $branches); |
|
49 | } |
||
50 | |||
51 | 6 | return CharTree::fromString('', $formatted); |
|
52 | } |
||
54 |