InvalidMiddleWare   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
dl 0
loc 12
wmc 2
lcom 0
cbo 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A forMiddleware() 0 9 2
1
<?php
2
3
namespace Domain\Eventing\Exception;
4
5
class InvalidMiddleWare extends \InvalidArgumentException implements Exception
6
{
7
    public static function forMiddleware($middleware)
8
    {
9
        $name = is_object($middleware) ? get_class($middleware) : gettype($middleware);
10
        $message = sprintf(
11
            'Cannot add "%s" to middleware chain as it does not implement the Middleware interface.',
12
            $name
13
        );
14
        return new static($message);
15
    }
16
}
17