Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
13 | final class NullValue implements ValueObjectInterface |
||
14 | { |
||
15 | /** @param null|string $value */ |
||
16 | 2 | public static function fromNative($value): self |
|
17 | { |
||
18 | 2 | Assertion::nullOrRegex($value, '#^$#', 'Trying to create NullValue VO from unsupported value.'); |
|
19 | 2 | return new self; |
|
20 | } |
||
21 | |||
22 | 3 | public static function makeEmpty(): self |
|
25 | } |
||
26 | |||
27 | /** @return null */ |
||
28 | 2 | public function toNative() |
|
29 | { |
||
30 | 2 | return null; |
|
31 | } |
||
32 | |||
33 | /** @param self $comparator */ |
||
34 | 1 | public function equals($comparator): bool |
|
35 | { |
||
36 | 1 | Assertion::isInstanceOf($comparator, self::class); |
|
37 | 1 | return $this->toNative() === $comparator->toNative(); |
|
38 | } |
||
39 | |||
40 | 1 | public function __toString(): string |
|
43 | } |
||
44 | } |
||
45 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.