Completed
Push — master ( 287057...b6fb01 )
by Dusan
03:04
created

InvalidMiddlewareResponseException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 11
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A forMiddleware() 0 8 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\Server\Exception;
14
15
use Interop\Http\Server\MiddlewareInterface;
16
use Psr\Http\Message\ResponseInterface;
17
18
class InvalidMiddlewareResponseException extends OutOfBoundsException
19
{
20
    public static function forMiddleware(MiddlewareInterface $middleware) : self
21
    {
22
        return new self(sprintf(
23
            'Middleware %s did not return a %s',
24
            get_class($middleware),
25
            ResponseInterface::class
26
        ));
27
    }
28
}
29