| Total Complexity | 4 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class AnonymousObject extends ObjectValue |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * {@inheritdoc} |
||
| 18 | */ |
||
| 19 | 2 | public function hash(): string |
|
| 20 | { |
||
| 21 | 2 | if ($this->value() instanceof Hashable) { |
|
| 22 | 1 | return $this->doHash($this->type() . $this->value()->hash()); |
|
| 23 | } |
||
| 24 | |||
| 25 | 1 | throw new Exception('The anonymous class must implement Hashable interface.'); |
|
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | 1 | public function serialize() |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * {@inheritdoc} |
||
| 38 | */ |
||
| 39 | 1 | public function unserialize($serialized) |
|
| 42 | } |
||
| 43 | } |
||
| 44 |