Passed
Push — feature/container-extend ( d5ded5 )
by Chema
04:29 queued 29s
created

ContainerException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 15
rs 10
c 1
b 0
f 0
eloc 4
ccs 4
cts 6
cp 0.6667
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A notFound() 0 3 1
A serviceNotInvokable() 0 3 1
A serviceNotExtendable() 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 1
    public static function serviceNotInvokable(): self
18
    {
19 1
        return new self('The passed service is not invokable.');
20
    }
21
22 1
    public static function serviceNotExtendable(): self
23
    {
24 1
        return new self('The passed service is not extendable.');
25
    }
26
}
27