ContainerException   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 5
c 1
b 0
f 0
dl 0
loc 20
rs 10
ccs 8
cts 8
cp 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A instanceNotExtendable() 0 3 1
A frozenInstanceOverride() 0 3 1
A instanceProtected() 0 3 1
A frozenInstanceExtend() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Container\Exception;
6
7
use Exception;
8
use Psr\Container\ContainerExceptionInterface;
9
10
final class ContainerException extends Exception implements ContainerExceptionInterface
11
{
12 1
    public static function instanceNotExtendable(): self
13
    {
14 1
        return new self('The passed instance is not extendable.');
15
    }
16
17 4
    public static function frozenInstanceExtend(string $id): self
18
    {
19 4
        return new self("The instance '{$id}' is frozen and cannot be extended.");
20
    }
21
22 1
    public static function frozenInstanceOverride(string $id): self
23
    {
24 1
        return new self("The instance '{$id}' is frozen and cannot be overridden.");
25
    }
26
27 1
    public static function instanceProtected(string $id): self
28
    {
29 1
        return new self("The instance '{$id}' is protected and cannot be extended.");
30
    }
31
}
32