| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 5 | trait Options |
||
| 6 | { |
||
| 7 | private $options; |
||
| 8 | |||
| 9 | 3 | public function __construct(array $options = []) |
|
| 10 | { |
||
| 11 | 3 | $this->options = $options; |
|
| 12 | } |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param int $option |
||
| 16 | * @return mixed |
||
| 17 | */ |
||
| 18 | 3 | public function getOption(int $option) |
|
| 19 | { |
||
| 20 | 3 | return $this->options[$option] ?? null; |
|
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param int $option |
||
| 25 | * @param mixed $value |
||
| 26 | * @return $this |
||
| 27 | */ |
||
| 28 | 1 | public function setOption(int $option, $value): self |
|
| 33 | } |
||
| 34 | } |
||
| 35 |