1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Arp\EventDispatcher\Event; |
6
|
|
|
|
7
|
|
|
final class ImmutableParameters implements ParametersInterface |
8
|
|
|
{ |
9
|
|
|
public function __construct(private readonly ParametersInterface $parameters) |
10
|
|
|
{ |
11
|
|
|
} |
12
|
|
|
|
13
|
|
|
public function count(): int |
14
|
|
|
{ |
15
|
|
|
return $this->parameters->count(); |
16
|
|
|
} |
17
|
|
|
|
18
|
|
|
public function isEmpty(): bool |
19
|
|
|
{ |
20
|
|
|
return $this->parameters->isEmpty(); |
21
|
|
|
} |
22
|
|
|
|
23
|
13 |
|
public function hasParam(string $name): bool |
24
|
|
|
{ |
25
|
13 |
|
return $this->parameters->hasParam($name); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function getParam(string $name, mixed $default = null): mixed |
29
|
|
|
{ |
30
|
|
|
return $this->parameters->getParam($name, $default); |
31
|
1 |
|
} |
32
|
|
|
|
33
|
1 |
|
public function getParams(): array |
34
|
|
|
{ |
35
|
|
|
return $this->parameters->getParams(); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function setParams(array $params): void |
39
|
1 |
|
{ |
40
|
|
|
// Ignore any updates to parameters to respect immutability |
41
|
1 |
|
} |
42
|
|
|
|
43
|
|
|
public function setParam(string $name, mixed $value): void |
44
|
|
|
{ |
45
|
|
|
// Ignore any updates to parameters to respect immutability |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function removeParams(array $params = []): void |
49
|
|
|
{ |
50
|
1 |
|
// Ignore any updates to parameters to respect immutability |
51
|
|
|
} |
52
|
1 |
|
|
53
|
|
|
public function removeParam(string $name): bool |
54
|
|
|
{ |
55
|
|
|
// Ignore any updates to parameters to respect immutability |
56
|
|
|
return false; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function getKeys(): array |
60
|
|
|
{ |
61
|
1 |
|
return $this->parameters->getKeys(); |
62
|
|
|
} |
63
|
1 |
|
|
64
|
|
|
public function getValues(): array |
65
|
|
|
{ |
66
|
|
|
return $this->parameters->getValues(); |
67
|
|
|
} |
68
|
|
|
|
69
|
2 |
|
public function getIterator(): \Traversable |
70
|
|
|
{ |
71
|
2 |
|
return $this->parameters->getIterator(); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
public function offsetExists(mixed $offset): bool |
75
|
|
|
{ |
76
|
|
|
return $this->parameters->offsetExists($offset); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
public function offsetGet(mixed $offset): mixed |
80
|
|
|
{ |
81
|
|
|
return $this->parameters->offsetGet($offset); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
public function offsetSet(mixed $offset, mixed $value): void |
85
|
|
|
{ |
86
|
|
|
// Ignore any updates to parameters to respect immutability |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
public function offsetUnset(mixed $offset): void |
90
|
|
|
{ |
91
|
|
|
// Ignore any updates to parameters to respect immutability |
92
|
|
|
} |
93
|
|
|
} |
94
|
|
|
|