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
03:49
created

Name   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 36.36%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 25
ccs 4
cts 11
cp 0.3636
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
A validate() 0 8 2
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 $spoofchecker;
19
20
    public function __construct($locale = null)
21
    {
22
        $spoofchecker = new Spoofchecker();
23
        $spoofchecker->setChecks(Spoofchecker::SINGLE_SCRIPT | Spoofchecker::INVISIBLE);
24
25
        if (null !== $locale) {
26
            $spoofchecker->setAllowedLocales($locale);
27
        }
28
29
        $this->spoofchecker = $spoofchecker;
30
    }
31
32 233
    public function validate($input)
33
    {
34 233
        if (!is_scalar($input)) {
35 5
            return false;
36
        }
37
38 228
        return false === $this->spoofchecker->isSuspicious($input);
39
    }
40
}
41