Passed
Push — master ( b6a195...1e79f7 )
by mcfog
03:21
created

NoopMiddleware::instance()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lit\Nimo\Middlewares;
6
7
use Psr\Http\Message\ResponseInterface;
8
9
final class NoopMiddleware extends AbstractMiddleware
10
{
11 1
    public static function instance()
12
    {
13 1
        static $instance;
14 1
        if (!isset($instance)) {
15 1
            $instance = new self();
16
        }
17 1
        return $instance;
18
    }
19
20 2
    protected function main(): ResponseInterface
21
    {
22 2
        return $this->delegate();
23
    }
24
}
25