bavix /
laravel-prof
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace Bavix\Prof\Middleware; |
||||
| 4 | |||||
| 5 | use Bavix\Prof\Services\ProfileLogService; |
||||
| 6 | use Illuminate\Http\Request; |
||||
| 7 | use Closure; |
||||
| 8 | |||||
| 9 | class TerminateMiddleware |
||||
| 10 | { |
||||
| 11 | |||||
| 12 | /** |
||||
| 13 | * @param Request $request |
||||
| 14 | * @param Closure $next |
||||
| 15 | * @return mixed |
||||
| 16 | */ |
||||
| 17 | public function handle(Request $request, Closure $next) |
||||
| 18 | { |
||||
| 19 | /** |
||||
| 20 | * Note from the beginning of the application... |
||||
| 21 | */ |
||||
| 22 | if (\config('prof.globalMiddleware', false)) { |
||||
| 23 | app(ProfileLogService::class) |
||||
| 24 | ->tick('app:init'); |
||||
| 25 | } |
||||
| 26 | |||||
| 27 | return $next($request); |
||||
| 28 | } |
||||
| 29 | |||||
| 30 | /** |
||||
| 31 | * @param $request |
||||
| 32 | * @param $response |
||||
| 33 | */ |
||||
| 34 | public function terminate($request, $response): void |
||||
|
0 ignored issues
–
show
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
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...
|
|||||
| 35 | { |
||||
| 36 | /** |
||||
| 37 | * If there are started ticks, but not completed, we complete it. |
||||
| 38 | */ |
||||
| 39 | app(ProfileLogService::class) |
||||
| 40 | ->recordAllTicks(); |
||||
| 41 | } |
||||
| 42 | |||||
| 43 | } |
||||
| 44 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.