| Conditions | 3 |
| Paths | 5 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 13 | 2 | public static function read(string $cacheFile): iterable |
|
| 14 | { |
||
| 15 | try { |
||
| 16 | 2 | $mapping = json_try_decode(file_get_contents($cacheFile)); |
|
| 17 | 1 | foreach ($mapping as $command => $handler) { |
|
| 18 | 1 | yield $command => new Handler($handler); |
|
| 19 | } |
||
| 20 | 1 | } catch (DecodeErrorException $decodeErrorException) { |
|
| 21 | 1 | yield from []; |
|
| 22 | } |
||
| 23 | 2 | } |
|
| 24 | |||
| 34 |