Total Complexity | 10 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | final class Simple implements Dictionary |
||
15 | { |
||
16 | /** |
||
17 | * @param array<mixed, E> $values |
||
18 | */ |
||
19 | public function __construct(private readonly string $name, private array $values) {} |
||
20 | |||
21 | public function getName(): string |
||
22 | { |
||
23 | return $this->name; |
||
24 | } |
||
25 | |||
26 | public function getValues(): array |
||
27 | { |
||
28 | return $this->values; |
||
29 | 20 | } |
|
30 | |||
31 | 20 | public function getKeys(): array |
|
32 | 20 | { |
|
33 | 20 | return array_keys($this->values); |
|
34 | } |
||
35 | 13 | ||
36 | public function offsetExists(mixed $offset): bool |
||
39 | } |
||
40 | 12 | ||
41 | public function offsetGet(mixed $offset): mixed |
||
42 | 12 | { |
|
43 | return $this->values[$offset]; |
||
44 | } |
||
45 | 8 | ||
46 | public function offsetSet(mixed $offset, mixed $value): void |
||
47 | 8 | { |
|
48 | $this->values[$offset] = $value; |
||
49 | } |
||
50 | 1 | ||
51 | public function offsetUnset(mixed $offset): void |
||
52 | 1 | { |
|
53 | unset($this->values[$offset]); |
||
54 | } |
||
55 | 2 | ||
56 | public function getIterator(): \Traversable |
||
57 | 2 | { |
|
58 | yield from $this->values; |
||
59 | } |
||
60 | 1 | ||
61 | public function count(): int |
||
64 | } |
||
65 | } |
||
66 |