CannotResolveAbstractType::noLinkDefinedFor()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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