Passed
Push — master ( c39ef6...1fc558 )
by Peter
05:09
created

ThemesMiddleware   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 1
c 3
b 0
f 1
lcom 0
cbo 0
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 1
1
<?php
2
3
namespace PeterColes\Themes;
4
5
use Closure;
6
7
class ThemesMiddleware
8
{
9
    /**
10
     * Handle an incoming request.
11
     *
12
     * @param  \Illuminate\Http\Request  $request
13
     * @param  \Closure  $next
14
     * @return mixed
15
     */
16
    public function handle($request, Closure $next)
17
    {
18
        // determine and apply the theme for this request
19
        app('themes')->setTheme($request);
20
21
        return $next($request);
22
    }
23
}
24