After::peel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 1
eloc 7
c 2
b 0
f 1
nc 1
nop 2
dl 0
loc 10
ccs 8
cts 8
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Middlewares;
6
7
use Nymfonya\Component\Http\Interfaces\MiddlewareInterface;
8
use Nymfonya\Component\Container;
9
10
class After implements MiddlewareInterface
11
{
12
    use \App\Middlewares\Reuse\TInit;
13
14
    const _SIGN = 'X-Middleware-After';
15
16
    /**
17
     * peel poil
18
     *
19
     * @param Container $container
20
     * @param \Closure $next
21
     * @return void
22
     */
23 2
    public function peel(Container $container, \Closure $next)
24
    {
25 2
        $res = $next($container);
26 2
        $this->init($container);
27 2
        $this->logger->debug('After middleware');
28 2
        $this->response->getHeaderManager()->add(
29 2
            self::_SIGN,
30 2
            strval(microtime(true))
31
        );
32 2
        return $res;
33
    }
34
}
35