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

InvalidServiceType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A serviceIsNotOfType() 0 9 1
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