| Total Complexity | 4 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | final class Results |
||
| 13 | { |
||
| 14 | /** @param array<string, mixed> $results URI => result mapping */ |
||
| 15 | public function __construct( |
||
| 16 | private readonly array $results, |
||
| 17 | ) { |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Get result for a specific URI |
||
| 22 | */ |
||
| 23 | public function get(string $uri): mixed |
||
| 24 | { |
||
| 25 | return $this->results[$uri] ?? null; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Check if result exists for a URI |
||
| 30 | */ |
||
| 31 | public function has(string $uri): bool |
||
| 32 | { |
||
| 33 | return array_key_exists($uri, $this->results); |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Get all results as array |
||
| 38 | * |
||
| 39 | * @return array<string, mixed> |
||
| 40 | */ |
||
| 41 | public function toArray(): array |
||
| 44 | } |
||
| 45 | } |
||
| 46 |