InvalidServiceType::serviceIsNotOfType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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