| Total Complexity | 6 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class DefaultsHandler implements DefaultsHandlerInterface |
||
| 10 | { |
||
| 11 | private array $defaults = []; |
||
| 12 | |||
| 13 | 95 | public function __construct(array $data = []) |
|
| 16 | } |
||
| 17 | |||
| 18 | 95 | public function setData(array $data = []): void |
|
| 19 | { |
||
| 20 | 95 | $this->defaults = $data; |
|
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * |
||
| 25 | * @return mixed |
||
| 26 | */ |
||
| 27 | 4 | public function getDefaults(): mixed |
|
| 28 | { |
||
| 29 | 4 | return $this->get(); |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * |
||
| 34 | * @return mixed |
||
| 35 | */ |
||
| 36 | 95 | public function getValue(?string $param): mixed |
|
| 37 | { |
||
| 38 | 95 | return $this->get($param); |
|
| 39 | } |
||
| 40 | |||
| 41 | |||
| 42 | 95 | private function get(?string $param = null): mixed |
|
| 48 | } |
||
| 49 | } |
||
| 50 |