ApplyTemplate   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 10 2
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