GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 5892ba...e25f6a )
by Baptiste
03:37 queued 29s
created

Command::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Server\Status\Server\Process;
5
6
use Innmind\Server\Status\Exception\EmptyCommandNotAllowed;
7
use Innmind\Immutable\{
8
    RegExp,
9
    Str,
10
};
11
12
final class Command
13
{
14
    private string $value;
15
16 21
    public function __construct(string $value)
17
    {
18 21
        if ($value === '') {
19 3
            throw new EmptyCommandNotAllowed;
20
        }
21
22 18
        $this->value = $value;
23 18
    }
24
25 3
    public function matches(RegExp $pattern): bool
26
    {
27 3
        return $pattern->matches(Str::of($this->value));
28
    }
29
30 3
    public function toString(): string
31
    {
32 3
        return $this->value;
33
    }
34
}
35