| Total Complexity | 8 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 64.71% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class ActionParametersCollector implements ActionParametersCollectorInterface |
||
| 8 | { |
||
| 9 | private array $params; |
||
| 10 | |||
| 11 | 16 | public function __construct(array $params = []) |
|
| 14 | 16 | } |
|
| 15 | |||
| 16 | 1 | public function addParameter(array $parameter): void |
|
| 17 | { |
||
| 18 | 1 | foreach ($parameter as $key => $value) { |
|
| 19 | 1 | if (is_int($key)) { |
|
| 20 | $this->params[] = $parameter; |
||
| 21 | 1 | } elseif (is_string($key)) { |
|
| 22 | 1 | $this->params[$key] = $value; |
|
| 23 | } |
||
| 24 | } |
||
| 25 | 1 | } |
|
| 26 | |||
| 27 | public function hasParameter($parameter): bool |
||
| 28 | { |
||
| 29 | return in_array($this->params, $parameter, true); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function removeParameter($parameter): void |
||
| 33 | { |
||
| 34 | unset($this->params[array_search($parameter, $this->params, true)]); |
||
| 35 | } |
||
| 36 | |||
| 37 | 8 | public function getParameters(): array |
|
| 40 | } |
||
| 41 | } |
||
| 42 |