Passed
Push — feature/min-php-8.0 ( 8ccbb1...a816af )
by Chema
05:40 queued 02:58
created

ContainerException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
c 2
b 0
f 0
dl 0
loc 15
wmc 3
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A serviceFrozen() 0 3 1
A serviceNotExtendable() 0 3 1
A serviceProtected() 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 serviceNotExtendable(): self
13
    {
14
        return new self('The passed service is not extendable.');
15
    }
16
17
    public static function serviceFrozen(string $id): self
18
    {
19
        return new self("The service '{$id}' is frozen and cannot be extendable.");
20
    }
21
22
    public static function serviceProtected(string $id): self
23
    {
24
        return new self("The service '{$id}' is protected and cannot be extendable.");
25
    }
26
}
27