XHProfMiddleware   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A terminate() 0 3 1
A handle() 0 4 1
1
<?php
2
3
namespace Bavix\XHProf\Middleware;
4
5
use Bavix\XHProf\Services\XHProfService;
6
use Closure;
7
8
class XHProfMiddleware
9
{
10
11
    /**
12
     * @param $request
13
     * @param Closure $next
14
     * @return mixed
15
     */
16
    public function handle($request, Closure $next)
17
    {
18
        app(XHProfService::class)->enable();
19
        return $next($request);
20
    }
21
22
    /**
23
     * @param $request
24
     * @param $response
25
     */
26
    public function terminate($request, $response)
0 ignored issues
show
Unused Code introduced by
The parameter $response is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
    public function terminate($request, /** @scrutinizer ignore-unused */ $response)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
    public function terminate(/** @scrutinizer ignore-unused */ $request, $response)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
    {
28
        app(XHProfService::class)->disable();
29
    }
30
31
}
32