Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
15 | 1 | public function getMap(CharTree $charTree): array |
|
16 | { |
||
17 | 1 | $codeMap = []; |
|
18 | 1 | foreach ($charTree->getTreeTrimmedToLength(1) as $char) { |
|
19 | 1 | $lowerCase = mb_strtolower($char); |
|
20 | 1 | $upperCase = mb_strtoupper($char); |
|
21 | |||
22 | 1 | $codeMap[$char] = [$lowerCase]; |
|
23 | |||
24 | 1 | if ($lowerCase !== $upperCase) { |
|
25 | 1 | $codeMap[$char][] = $upperCase; |
|
26 | } |
||
27 | } |
||
28 | 1 | return $codeMap; |
|
29 | } |
||
31 |