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 (#904)
by Jens
02:11
created

Nullable::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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
namespace Respect\Validation\Rules;
13
14
use Respect\Validation\Validatable;
15
16
class Nullable extends AbstractWrapper
17
{
18 22
    public function __construct(Validatable $rule)
19
    {
20 22
        $this->validatable = $rule;
21 22
    }
22
23 2
    public function assert($input)
24
    {
25 2
        if ($input === null) {
26 1
            return true;
27
        }
28
29 1
        return parent::assert($input);
30
    }
31
32 2
    public function check($input)
33
    {
34 2
        if ($input === null) {
35 1
            return true;
36
        }
37
38 1
        return parent::check($input);
39
    }
40
41 17
    public function validate($input)
42
    {
43 17
        if ($input === null) {
44 1
            return true;
45
        }
46
47 16
        return parent::validate($input);
48
    }
49
}
50