| Total Complexity | 5 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 5 | class Property |
||
| 6 | { |
||
| 7 | /** @var mixed */ |
||
| 8 | protected $value; |
||
| 9 | /** @var bool */ |
||
| 10 | protected $isDefault; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * SettingsValue constructor. |
||
| 14 | * @param mixed $defaultValue |
||
| 15 | */ |
||
| 16 | 46 | public function __construct($defaultValue = null) |
|
| 17 | { |
||
| 18 | 46 | $this->value = $defaultValue; |
|
| 19 | 46 | $this->isDefault = true; |
|
| 20 | 46 | } |
|
| 21 | |||
| 22 | /** |
||
| 23 | * @return mixed |
||
| 24 | */ |
||
| 25 | 45 | public function getValue() |
|
| 26 | { |
||
| 27 | 45 | return $this->value; |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param mixed $value |
||
| 32 | */ |
||
| 33 | 44 | public function setValue($value): void |
|
| 34 | { |
||
| 35 | 44 | $this->value = $value; |
|
| 36 | 44 | $this->isDefault = false; |
|
| 37 | 44 | } |
|
| 38 | |||
| 39 | /** |
||
| 40 | * @return bool |
||
| 41 | */ |
||
| 42 | 16 | public function isDefault(): bool |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return bool |
||
| 49 | */ |
||
| 50 | 18 | public function isNotDefault(): bool |
|
| 53 | } |
||
| 54 | } |
||
| 55 |