Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
38 | 2 | private function formatWord(string $word, array $wordFormatters): Traversable |
|
39 | { |
||
40 | 2 | $wordFormatter = array_shift($wordFormatters); |
|
41 | |||
42 | 2 | if ($wordFormatters === []) { |
|
43 | 2 | yield from $wordFormatter->apply($word); |
|
44 | 2 | return; |
|
45 | } |
||
46 | |||
47 | 1 | foreach ($wordFormatter->apply($word) as $formatted) { |
|
48 | 1 | yield from $this->formatWord($formatted, $wordFormatters); |
|
49 | } |
||
52 |