Completed
Push — master ( 8e5216...cac524 )
by Nikola
10s
created

Build::validate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 3
nc 2
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Version\Extension;
6
7
use Version\Exception\InvalidIdentifierException;
8
9
class Build extends BaseExtension
10
{
11 18
    protected function validate(string $identifier) : void
12
    {
13 18
        if (! preg_match('/^[0-9A-Za-z\-]+$/', $identifier)) {
14 1
            throw InvalidIdentifierException::forExtensionIdentifier($this, $identifier);
15
        }
16 17
    }
17
}
18