ContainerException   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
eloc 4
dl 0
loc 15
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A findType() 0 3 2
A circularDependency() 0 3 1
A shareOnMake() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gravatalonga\Container;
6
7
use Exception;
8
use Psr\Container\ContainerExceptionInterface;
9
10
final class ContainerException extends Exception implements ContainerExceptionInterface
11
{
12
    public static function circularDependency(): ContainerException
13
    {
14
        return new self('Detect Circular Dependency');
15
    }
16
17
    public static function findType(?string $type): ContainerException
18
    {
19
        return new self(sprintf('Unable to find type hint (%s)', ($type ?: '')));
20
    }
21
22
    public static function shareOnMake(string $id): ContainerException
23
    {
24
        return new self(sprintf('Entry is shared and cannot be called on make: %s', $id));
25
    }
26
}
27