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

SaveSettings::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
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