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

InvalidIdentifierException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A forExtensionIdentifier() 0 8 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