Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#1087)
by Henrique
09:28
created

Nullable   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
eloc 10
dl 0
loc 36
c 0
b 0
f 0
ccs 14
cts 14
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A check() 0 7 2
A assert() 0 7 2
A isValid() 0 7 2
1
<?php
2
3
/*
4
 * This file is part of Respect/Validation.
5
 *
6
 * (c) Alexandre Gomes Gaigalas <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the "LICENSE.md"
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Respect\Validation\Rules;
15
16
/**
17
 * Validates the given input with a defined rule when input is not NULL.
18
 *
19
 * @author Jens Segers <[email protected]>
20
 */
21
final class Nullable extends AbstractWrapper
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26 17
    public function assert($input): void
27
    {
28 17
        if (null === $input) {
29 1
            return;
30
        }
31
32 16
        parent::assert($input);
33 16
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38 17
    public function check($input): void
39
    {
40 17
        if (null === $input) {
41 1
            return;
42
        }
43
44 16
        parent::check($input);
45 16
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50 17
    public function isValid($input): bool
51
    {
52 17
        if (null === $input) {
53 1
            return true;
54
        }
55
56 16
        return parent::isValid($input);
57
    }
58
}
59