Total Complexity | 6 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | final class Changes implements IteratorAggregate, ArrayAccess |
||
27 | { |
||
28 | /** |
||
29 | * @var array<string, FileChange>|FileChange[] |
||
30 | */ |
||
31 | private array $changes = []; |
||
32 | |||
33 | /** |
||
34 | * @inheritDoc |
||
35 | */ |
||
36 | 4 | public function getIterator(): Traversable |
|
39 | } |
||
40 | |||
41 | 5 | public function add(string $string, FileChange $fileChange): Changes |
|
42 | { |
||
43 | 5 | $this->changes[$string] = $fileChange; |
|
44 | 5 | return $this; |
|
45 | } |
||
46 | |||
47 | 2 | public function offsetExists(mixed $offset): bool |
|
48 | { |
||
49 | 2 | return array_key_exists($offset, $this->changes); |
|
50 | } |
||
51 | |||
52 | 2 | public function offsetGet(mixed $offset): FileChange |
|
53 | { |
||
54 | 2 | return $this->changes[$offset]; |
|
55 | } |
||
56 | |||
57 | 1 | public function offsetSet(mixed $offset, mixed $value): void |
|
60 | } |
||
61 | |||
62 | 1 | public function offsetUnset(mixed $offset): void |
|
65 | } |
||
66 | } |
||
67 |