Completed
Push — master ( 235051...2cc243 )
by Nikola
01:12
created

PreRelease::compareTo()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 11
cts 11
cp 1
rs 9.6
c 0
b 0
f 0
cc 3
nc 3
nop 1
crap 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Version\Extension;
6
7
use Version\Assert\VersionAssert;
8
9
class PreRelease extends Extension
10
{
11 30
    protected function validate(array $identifiers): void
12
    {
13 30
        VersionAssert::that($identifiers)
14 30
            ->minCount(1, 'Pre-release version must contain at least one identifier')
15 29
            ->all()
16 29
            ->regex('/^[0-9A-Za-z\-]+$/', 'Pre-release version identifiers can include only alphanumerics and hyphen');
17 27
    }
18
}
19