Passed
Push — feature/container-factory ( 5aed48 )
by Chema
09:15
created

ContainerException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A notFound() 0 3 1
A serviceNotInvokable() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Framework\Container\Exception;
6
7
use Exception;
8
use Psr\Container\ContainerExceptionInterface;
9
10
final class ContainerException extends Exception implements ContainerExceptionInterface
11
{
12
    public static function notFound(string $id): self
13
    {
14
        return new self("The requested service '{$id}' was not found in the container!");
15
    }
16
17
    public static function serviceNotInvokable(): self
18
    {
19
        return new self('The passed service is not a closure and is not invokable.');
20
    }
21
}
22