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

Completed
Push — 1.1 ( fca464...0e73bc )
by Henrique
09:36 queued 06:14
created

NotBlank::validate()   A

Complexity

Conditions 5
Paths 9

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 5

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 13
cts 13
cp 1
rs 9.2888
c 0
b 0
f 0
cc 5
nc 9
nop 1
crap 5
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 stdClass;
15
16
class NotBlank extends AbstractRule
17
{
18 23
    public function validate($input)
19
    {
20 23
        if (is_numeric($input)) {
21 12
            return $input != 0;
22
        }
23
24 16
        if (is_string($input)) {
25 6
            $input = trim($input);
26 6
        }
27
28 16
        if ($input instanceof stdClass) {
29 2
            $input = (array) $input;
30 2
        }
31
32 16
        if (is_array($input)) {
33 11
            $input = array_filter($input, __METHOD__);
34 11
        }
35
36 16
        return !empty($input);
37
    }
38
}
39