Completed
Push — master ( 3ebd9f...ed37c4 )
by Woody
02:43
created

MiddlewareException::notInvokable()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.0932

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
ccs 5
cts 7
cp 0.7143
rs 9.4285
cc 2
eloc 6
nc 2
nop 1
crap 2.0932
1
<?php
2
3
namespace Equip\Exception;
4
5
use DomainException;
6
7
class MiddlewareException extends DomainException
8
{
9
    /**
10
     * @param string|object $spec
11
     *
12
     * @return static
13
     */
14 1
    public static function notInvokable($spec)
15
    {
16 1
        if (is_object($spec)) {
17
            $spec = get_class($spec);
18
        }
19
20 1
        return new static(sprintf(
21 1
            'Middleware `%s` is not invokable',
22
            $spec
23 1
        ));
24
    }
25
}
26