Total Complexity | 7 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 5 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | abstract class TypeValue extends AbstractValue implements TypeValueInterface |
||
16 | { |
||
17 | /** |
||
18 | * {@inheritdoc} |
||
19 | */ |
||
20 | 5 | public function __toArray(): array |
|
23 | } |
||
24 | |||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | 1 | public function equals(ValueInterface $item): bool |
|
29 | { |
||
30 | 1 | return $this->value() === $item->value(); |
|
31 | } |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | 6 | public function hash(): string |
|
37 | { |
||
38 | 6 | return $this->doHash(var_export($this->value(), true)); |
|
39 | } |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | 6 | public function serialize() |
|
48 | ]); |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | 13 | public function type(): string |
|
55 | { |
||
56 | 13 | return gettype($this->value()); |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | 6 | public function unserialize($serialized) |
|
67 | 6 | } |
|
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | 7 | protected function doHash(string $string): string |
|
75 | } |
||
76 | } |
||
77 |