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

forExtensionIdentifier()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 5
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Version\Exception;
6
7
use DomainException;
8
use Version\Extension\BaseExtension;
9
10
/**
11
 * @author Nikola Posa <[email protected]>
12
 */
13
class InvalidIdentifierException extends DomainException implements ExceptionInterface
14
{
15 3
    public static function forExtensionIdentifier(BaseExtension $extension, string $identifier) : self
16
    {
17 3
        return new self(sprintf(
18 3
            '%s identifier: %s is not valid; it must comprise only ASCII alphanumerics and hyphen',
19 3
            get_class($extension),
20 3
            $identifier
21
        ));
22
    }
23
}
24