Passed
Push — master ( 819f30...8ceff2 )
by Thorsten
02:22
created

Nil::makeEmpty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Daikon\Entity\ValueObject;
4
5
use Daikon\Entity\Assert\Assertion;
6
7
final class Nil implements ValueObjectInterface
8
{
9
    /**
10
     * @param null $nativeValue
11
     * @return self
12
     */
13 30
    public static function fromNative($nativeValue): self
14
    {
15 30
        Assertion::null($nativeValue);
16 30
        return new self;
17
    }
18
19
    /**
20
     * @return null
21
     */
22 2
    public function toNative()
23
    {
24 2
        return null;
25
    }
26
27 2
    public function equals(ValueObjectInterface $otherValue): bool
28
    {
29 2
        return $otherValue instanceof Nil;
30
    }
31
32 1
    public function __toString(): string
33
    {
34 1
        return "null";
35
    }
36
}
37