Total Complexity | 4 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | abstract class ObjectValue extends AbstractValue implements ObjectValueInterface |
||
16 | { |
||
17 | /** |
||
18 | * {@inheritdoc} |
||
19 | */ |
||
20 | 4 | public function apply(callable $callable) |
|
21 | { |
||
22 | 4 | $value = clone $this->value(); |
|
23 | |||
24 | 4 | return $callable($value); |
|
25 | } |
||
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | 27 | public function class(): string |
|
31 | { |
||
32 | 27 | return get_class($this->value()); |
|
33 | } |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | 9 | public function equals(ValueInterface $item, bool $strict = true): bool |
|
39 | { |
||
40 | 9 | return $this->hash() === $item->hash(); |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | 19 | public function type(): string |
|
49 | } |
||
50 | } |
||
51 |