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
03:56 queued 01:10
created

Nullable::isValid()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 10
c 0
b 0
f 0
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