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
Pull Request — master (#817)
by Henrique
06:24
created

Name::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
ccs 0
cts 8
cp 0
cc 2
eloc 7
nc 2
nop 1
crap 6
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 Spoofchecker;
15
16
class Name extends AbstractRule
17
{
18
    public $locale;
19
    public $spoofchecker;
20
21
    public function __construct($locale = null)
22
    {
23
        $spoofchecker = new Spoofchecker();
24
        $spoofchecker->setChecks(Spoofchecker::SINGLE_SCRIPT | Spoofchecker::INVISIBLE);
25
26
        if (null !== $locale) {
27
            $spoofchecker->setAllowedLocales($locale);
28
        }
29
30
        $this->locale = $locale;
31
        $this->spoofchecker = $spoofchecker;
32
    }
33
34 233
    public function validate($input)
35
    {
36 233
        if (!is_scalar($input)) {
37 5
            return false;
38
        }
39
40 228
        return false === $this->spoofchecker->isSuspicious($input);
41
    }
42
}
43