| Total Complexity | 4 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class DateTimeObject extends ObjectValue |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * DateTimeObject constructor. |
||
| 16 | * |
||
| 17 | * @param DateTime $value |
||
| 18 | */ |
||
| 19 | 6 | public function __construct(DateTime $value) |
|
| 22 | 6 | } |
|
| 23 | |||
| 24 | /** |
||
| 25 | * {@inheritdoc} |
||
| 26 | */ |
||
| 27 | 2 | public function hash(): string |
|
| 28 | { |
||
| 29 | 2 | return $this->doHash($this->type() . $this->class() . $this->value()->getTimestamp()); |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * {@inheritdoc} |
||
| 34 | */ |
||
| 35 | 1 | public function serialize() |
|
| 36 | { |
||
| 37 | 1 | return serialize([ |
|
| 38 | 1 | 'value' => $this->value()->getTimestamp(), |
|
| 39 | ]); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * {@inheritdoc} |
||
| 44 | */ |
||
| 45 | 1 | public function unserialize($serialized) |
|
| 51 | ); |
||
| 52 | 1 | } |
|
| 53 | } |
||
| 54 |