| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 2 | public function mapCachePayloadToLoadedRoutes(string $payload) : Generator |
|
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var list<array{ |
||
| 22 | * className: string, |
||
| 23 | * methodName: string, |
||
| 24 | * route: array{ |
||
| 25 | * pattern: string, |
||
| 26 | * methods: string|list<string>, |
||
| 27 | * name: null|string, |
||
| 28 | * middleware: string|list<string>, |
||
| 29 | * host: null|string, |
||
| 30 | * schemes: string|list<string>, |
||
| 31 | * httpPort: null|int, |
||
| 32 | * httpsPort: null|int, |
||
| 33 | * options: array<string, mixed> |
||
| 34 | * } |
||
| 35 | * }> $loadedRoutesPayload |
||
| 36 | */ |
||
| 37 | 2 | $loadedRoutesPayload = (array) json_decode($payload, true, flags: JSON_THROW_ON_ERROR); |
|
| 38 | |||
| 39 | 2 | yield from array_map( |
|
| 40 | 2 | static fn (array $payload) : LoadedRoute => LoadedRoute::fromPayload($payload), |
|
| 41 | 2 | $loadedRoutesPayload, |
|
| 42 | 2 | ); |
|
| 45 |