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

InvalidMiddlewareResponseException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 9
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A forMiddleware() 0 6 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