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 — master ( 03ea1b...fbbab7 )
by Henrique
02:54
created

Version   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 12
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 7 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
declare(strict_types=1);
13
14
namespace Respect\Validation\Rules;
15
16
use function is_string;
17
use function preg_match;
18
19
/**
20
 * Validates version numbers using Semantic Versioning.
21
 *
22
 * @see http://semver.org/
23
 *
24
 * @author Danilo Correa <[email protected]>
25
 * @author Henrique Moody <[email protected]>
26
 */
27
final class Version extends AbstractRule
28
{
29
    /**
30
     * {@inheritdoc}
31
     */
32 15
    public function validate($input): bool
33
    {
34 15
        if (!is_string($input)) {
35
            return false;
36
        }
37
38 15
        return preg_match('/^[0-9]+\.[0-9]+\.[0-9]+([+-][^+-][0-9A-Za-z-.]*)?$/', $input) > 0;
39
    }
40
}
41