Completed
Push — master ( a1dfe7...e5d37f )
by Dusan
01:49
created

forMiddleware()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * This file is part of the http-middleware package.
4
 *
5
 * Copyright (c) Dusan Vejin
6
 *
7
 * For full copyright and license information, please refer to the LICENSE file,
8
 * located at the package root folder.
9
 */
10
11
declare(strict_types=1);
12
13
namespace WeCodeIn\Http\ServerMiddleware\Exception;
14
15
use Interop\Http\ServerMiddleware\MiddlewareInterface;
16
use Psr\Http\Message\ResponseInterface;
17
18
/**
19
 * @author Dusan Vejin <[email protected]>
20
 */
21
class InvalidMiddlewareResponseException extends OutOfBoundsException
22
{
23 1
    public static function forMiddleware(MiddlewareInterface $middleware) : self
24
    {
25 1
        return new self(sprintf(
26 1
            'Middleware %s did not return a %s', get_class($middleware), ResponseInterface::class
27
        ));
28
    }
29
}
30