Conditions | 3 |
Paths | 3 |
Total Lines | 7 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
43 | 4 | public function apply(string $word): Traversable |
|
44 | { |
||
45 | 4 | for ($start = 0; $start < mb_strlen($word); ++$start) { |
|
46 | 4 | $substring = mb_substr($word, $start, $this->maxLength); |
|
47 | |||
48 | 4 | for ($length = mb_strlen($substring); $this->minLength <= $length; --$length) { |
|
49 | 4 | yield mb_substr($substring, 0, $length); |
|
50 | } |
||
54 |