| Total Complexity | 6 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class ValueState |
||
| 16 | { |
||
| 17 | protected $value; |
||
| 18 | |||
| 19 | 1 | public function __construct() { |
|
| 20 | 1 | $this->clear(); |
|
| 21 | } |
||
| 22 | |||
| 23 | 2 | public function set($value) : void |
|
| 24 | { |
||
| 25 | 2 | $this->value = $value; |
|
| 26 | } |
||
| 27 | |||
| 28 | 1 | public function get() |
|
| 29 | { |
||
| 30 | 1 | if(!$this->isChanged()) |
|
| 31 | 1 | return null; |
|
| 32 | |||
| 33 | 1 | return $this->value; |
|
| 34 | } |
||
| 35 | |||
| 36 | 1 | public function isChanged() : bool |
|
| 37 | { |
||
| 38 | 1 | return !$this->value instanceof ValueEmpty; |
|
| 39 | } |
||
| 40 | |||
| 41 | 1 | public function clear() : void |
|
| 44 | } |
||
| 45 | } |
||
| 46 |