Completed
Pull Request — master (#12)
by Woody
05:04
created

ContainerException::expectedInvokable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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 5
    public static function couldNotMake(string $class, InjectorException $previous): ContainerException
16
    {
17 5
        return new static("Could not make '$class'", self::COULD_NOT_MAKE, $previous);
18
    }
19
20 62
    public static function expectedInvokable(string $class): ContainerException
21
    {
22 62
        return new static("Expected '$class' to be invokable", self::EXPECTED_INVOKABLE);
23
    }
24
}
25