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   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 23
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 20 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