CannotResolveAbstractType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

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

1 Method

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