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::forMiddleware()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 10
ccs 0
cts 9
cp 0
crap 6
rs 9.9332
c 0
b 0
f 0
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