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::validate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
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