GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

InvalidMiddlewareException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 17
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A forMiddleware() 0 10 2
1
<?php
2
namespace SmoothPhp\CommandBus\Exception;
3
4
/**
5
 * Class InvalidMiddlewareException
6
 * @package SmoothPhp\CommandBus\Exception
7
 * @author Simon Bennett <[email protected]>
8
 */
9
final class InvalidMiddlewareException extends \InvalidArgumentException
10
{
11
    /**
12
     * @param $invalidMiddleware
13
     * @return static
14
     */
15
    public static function forMiddleware($invalidMiddleware)
16
    {
17
        $name = is_object($invalidMiddleware) ? get_class($invalidMiddleware) : gettype($invalidMiddleware);
18
        $message = sprintf(
19
            'Cannot add "%s" to Middleware chain as it does not implement the CommandBusMiddleware interface.',
20
            $name
21
        );
22
23
        return new static($message);
24
    }
25
}
26