Total Complexity | 6 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | final class Changes implements IteratorAggregate |
||
11 | { |
||
12 | /** @var Change[] */ |
||
13 | private $changes = []; |
||
14 | |||
15 | private function __construct() |
||
17 | } |
||
18 | |||
19 | public static function new(): self |
||
22 | } |
||
23 | |||
24 | public static function fromArray(array $changes): self |
||
30 | } |
||
31 | |||
32 | public function mergeWith(self $other) : self |
||
39 | } |
||
40 | |||
41 | public function withAddedChange(Change $change): self |
||
42 | { |
||
43 | $new = clone $this; |
||
44 | $new->changes[] = $change; |
||
45 | return $new; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * {@inheritDoc} |
||
50 | * |
||
51 | * @return Change[] |
||
52 | */ |
||
53 | public function getIterator() : ArrayIterator |
||
56 | } |
||
57 | } |
||
58 |