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

MiddlewareException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 71.43%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 19
ccs 5
cts 7
cp 0.7143
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A notInvokable() 0 11 2
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