GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 271964...601628 )
by Brent
02:01
created

NullType   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A nullable() 0 3 1
A getType() 0 3 1
A validate() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spatie\Typed\Types;
6
7
use Spatie\Typed\Type;
8
9
final class NullType implements Type
10
{
11
    /** @var \Spatie\Typed\Type */
12
    private $type;
13
14
    public function __construct(Type $type)
15
    {
16
        $this->type = $type;
17
    }
18
19
    public function validate($value)
20
    {
21
        if ($value === null) {
22
            return;
23
        }
24
25
        return $this->type->validate($value);
26
    }
27
28
    public function getType(): Type
29
    {
30
        return $this->type;
31
    }
32
33
    public function nullable(): self
34
    {
35
        return $this;
36
    }
37
}
38