Completed
Push — master ( 6411fa...6ee6e0 )
by Jesse
02:41
created

CannotResolveAbstractType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A noLinkDefinedFor() 0 6 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stratadox\Di;
6
7
use ReflectionClass as Reflected;
8
use RuntimeException;
9
use function sprintf;
10
11
final class CannotResolveAbstractType extends RuntimeException implements InvalidServiceDefinition
12
{
13
    public static function noLinkDefinedFor(Reflected $theAbstractType)
14
    {
15
        return new self(sprintf(
16
            'Cannot resolve the %s `%s`. Consider adding an AutoWire link.',
17
            $theAbstractType->isInterface() ? 'interface' : 'abstract class',
18
            $theAbstractType->getName()
19
        ));
20
    }
21
}
22