InvalidServiceType   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A serviceIsNotOfType() 0 8 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\Di;
4
5
use RuntimeException;
6
use function sprintf;
7
8
final class InvalidServiceType extends RuntimeException implements InvalidServiceDefinition
9
{
10
    public static function serviceIsNotOfType(
11
        string $serviceName,
12
        string $expectedType
13
    ): InvalidServiceDefinition {
14
        return new static(sprintf(
15
            'Service %s is not of type %s',
16
            $serviceName,
17
            $expectedType
18
        ));
19
    }
20
}
21