Completed
Push — master ( 925392...306f13 )
by ARCANEDEV
16s queued 10s
created

SaveSettings   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 54
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 4 1
A terminate() 0 4 1
1
<?php namespace Arcanedev\LaravelSettings\Middleware;
2
3
use Arcanedev\LaravelSettings\Contracts\Store;
4
use Closure;
5
6
/**
7
 * Class     SaveSettings
8
 *
9
 * @package  Arcanedev\LaravelSettings\Middleware
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class SaveSettings
13
{
14
    /* -----------------------------------------------------------------
15
     |  Properties
16
     | -----------------------------------------------------------------
17
     */
18
19
    /** @var  \Arcanedev\LaravelSettings\Contracts\Store */
20
    protected $settings;
21
22
    /* -----------------------------------------------------------------
23
     |  Constructor
24
     | -----------------------------------------------------------------
25
     */
26
27
    /**
28
     * SaveSettings constructor.
29
     *
30
     * @param  \Arcanedev\LaravelSettings\Contracts\Store  $settings
31
     */
32 8
    public function __construct(Store $settings)
33
    {
34 8
        $this->settings = $settings;
35 8
    }
36
37
    /* -----------------------------------------------------------------
38
     |  Main Methods
39
     | -----------------------------------------------------------------
40
     */
41
42
    /**
43
     * Handle an incoming request.
44
     *
45
     * @param  \Illuminate\Http\Request  $request
46
     * @param  Closure                   $next
47
     *
48
     * @return mixed
49
     */
50 8
    public function handle($request, Closure $next)
51
    {
52 8
        return $next($request);
53
    }
54
55
    /**
56
     * Hasta la vista, baby.
57
     *
58
     * @param  \Illuminate\Http\Request                    $request
59
     * @param  \Symfony\Component\HttpFoundation\Response  $response
60
     */
61 8
    public function terminate($request, $response)
0 ignored issues
show
Unused Code introduced by
The parameter $request 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...
Unused Code introduced by
The parameter $response 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...
62
    {
63 8
        $this->settings->save();
64 8
    }
65
}
66