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 — 0.9 ( 7d978d...1ce8ac )
by Henrique
07:01 queued 01:39
created

Slug::validate()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 16
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 4
Metric Value
dl 0
loc 16
ccs 8
cts 8
cp 1
rs 9.2
cc 4
eloc 8
nc 4
nop 1
crap 4
1
<?php
2
namespace Respect\Validation\Rules;
3
4
class Slug extends AbstractRule
5
{
6 13
    public function validate($input)
7
    {
8 13
        if (strstr($input, '--')) {
9 2
            return false;
10
        }
11
12 11
        if (!preg_match('@^[0-9a-z\-]+$@', $input)) {
13 5
            return false;
14
        }
15
16 6
        if (preg_match('@^-|-$@', $input)) {
17 2
            return false;
18
        }
19
20 4
        return true;
21
    }
22
}
23