ApplyTemplate::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 3
1
<?php
2
3
namespace SoufieneSlimi\TemplateOperation;
4
use Template;
5
6
use Closure;
7
8
class ApplyTemplate
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param \Illuminate\Http\Request $request
14
     * @param \Closure                 $next
15
     * @param string|null              $guard
16
     *
17
     * @return mixed
18
     */
19
    public function handle($request, Closure $next, $guard = null)
0 ignored issues
show
Unused Code introduced by
The parameter $guard is not used and could be removed.

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

Loading history...
20
    {
21
        $template = Template::find($request->template_id);
22
23
        if ($template) {
24
            $template->apply();
25
        }
26
27
        return $next($request);
28
    }
29
}
30