Failed Conditions
Pull Request — master (#256)
by Michael
02:08
created

NullType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 4
dl 0
loc 21
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A describe() 0 3 1
A validate() 0 3 1
A getValue() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Annotations\Type\Constant;
6
7
use Doctrine\Annotations\Type\ConstantScalarType;
8
9
/**
10
 * @internal
11
 */
12
final class NullType implements ConstantScalarType
13
{
14 2
    public function describe() : string
15
    {
16 2
        return 'null';
17
    }
18
19
    /**
20
     * @return null
21
     */
22 1
    public function getValue()
23
    {
24 1
        return null;
25
    }
26
27
    /**
28
     * @param mixed $value
29
     */
30 9
    public function validate($value) : bool
31
    {
32 9
        return $value === null;
33
    }
34
}
35