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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 33.33%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 27
rs 10
ccs 4
cts 12
cp 0.3333

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 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 $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