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

Nil   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 30
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A fromNative() 0 5 1
A toNative() 0 4 1
A equals() 0 4 1
A __toString() 0 4 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