Completed
Pull Request — master (#12)
by Woody
03:00
created

ContainerException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A couldNotMake() 0 4 1
A expectedInvokable() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Northwoods\Container;
5
6
use Auryn\InjectorException;
7
use Psr\Container\ContainerExceptionInterface;
8
9
class ContainerException extends \RuntimeException implements
10
    ContainerExceptionInterface
11
{
12
    const COULD_NOT_MAKE = 1;
13
    const EXPECTED_INVOKABLE = 2;
14
15 1
    public static function couldNotMake(string $class, InjectorException $previous): ContainerException
16
    {
17 1
        return new static("Could not make '$class'", self::COULD_NOT_MAKE, $previous);
18
    }
19
20 41
    public static function expectedInvokable(string $class): ContainerException
21
    {
22 41
        return new static("Expected '$class' to be invokable", self::EXPECTED_INVOKABLE);
23
    }
24
}
25