| 1 | <?php |
||
| 17 | { |
||
| 18 | private array $parameters = []; |
||
|
|
|||
| 19 | |||
| 20 | public function hasParameter(string $name): bool |
||
| 21 | { |
||
| 22 | return isset($this->parameters[$name]); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function removeParameter(string $name): void |
||
| 26 | { |
||
| 27 | if ($this->hasParameter($name)) { |
||
| 28 | unset($this->parameters[$name]); |
||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | public function getParameter(string $name): mixed |
||
| 33 | { |
||
| 34 | return $this->parameters[$name]; |
||
| 35 | } |
||
| 36 | |||
| 37 | public function getParameters(): array |
||
| 38 | { |
||
| 39 | return $this->parameters; |
||
| 40 | } |
||
| 41 | |||
| 42 | public function addParameter(string $name, mixed $value): void |
||
| 43 | { |
||
| 44 | $this->parameters[$name] = $value; |
||
| 45 | } |
||
| 46 | |||
| 47 | public function setParameters(array $parameters): static |
||
| 48 | { |
||
| 49 | $this->parameters = $parameters; |
||
| 50 | |||
| 51 | return $this; |
||
| 52 | } |
||
| 53 | |||
| 54 | protected function processArray(array $array = []): array |
||
| 55 | { |
||
| 56 | return array_merge($array, $this->parameters); |
||
| 57 | } |
||
| 58 | } |
||
| 59 |