Completed
Push — master ( 3046ca...6411fa )
by Jesse
02:05
created

InvalidServiceType::serviceIsNotOfType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stratadox\Di;
6
7
use RuntimeException;
8
use function sprintf;
9
10
final class InvalidServiceType extends RuntimeException implements InvalidServiceDefinition
11
{
12
    public static function serviceIsNotOfType(
13
        string $serviceName,
14
        string $expectedType
15
    ) : InvalidServiceDefinition
16
    {
17
        return new static(sprintf(
18
            'Service %s is not of type %s',
19
            $serviceName,
20
            $expectedType
21
        ));
22
    }
23
}
24