Completed
Push — master ( d3629a...99177e )
by Dusan
02:35
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
<?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 1
    public static function forMiddleware(MiddlewareInterface $middleware) : self
21
    {
22 1
        return new self(sprintf(
23 1
            'Middleware %s did not return a %s',
24 1
            get_class($middleware),
25 1
            ResponseInterface::class
26
        ));
27
    }
28
}
29