| Total Complexity | 4 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class ImmutableHandlersList extends HandlersList |
||
| 8 | { |
||
| 9 | 1 | public function set(iterable $handlers): self |
|
| 10 | { |
||
| 11 | 1 | return new static($handlers, $this->getConstraint()); |
|
| 12 | } |
||
| 13 | |||
| 14 | 1 | public function add(object $handler): self |
|
| 17 | } |
||
| 18 | |||
| 19 | 1 | public function remove(object $handler): self |
|
| 20 | { |
||
| 21 | 1 | return new static( |
|
| 22 | 1 | array_filter($this->toArray(), fn(object $h) => $h !== $handler), |
|
| 23 | 1 | $this->getConstraint() |
|
| 24 | ); |
||
| 25 | } |
||
| 26 | |||
| 27 | 1 | public function clear(): self |
|
| 30 | } |
||
| 31 | } |
||
| 32 |