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.
Completed
Push — develop ( 870d79...a1e45f )
by Baptiste
05:29
created

NullableType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 19
ccs 7
cts 7
cp 1
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 2
A __construct() 0 3 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Immutable\ValidateArgument;
5
6
use Innmind\Immutable\ValidateArgument;
7
8
final class NullableType implements ValidateArgument
9
{
10
    private $validate;
11
12 4
    public function __construct(ValidateArgument $validate)
13
    {
14 4
        $this->validate = $validate;
15 4
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20 3
    public function __invoke($value, int $position): void
21
    {
22 3
        if (\is_null($value)) {
23 1
            return;
24
        }
25
26 2
        ($this->validate)($value, $position);
27 2
    }
28
}
29