Passed
Push — master ( ef93dc...4f7931 )
by
unknown
13:58
created

SessionStorage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 6 1
A get() 0 4 1
A forget() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of ibrand/laravel-sms.
5
 *
6
 * (c) iBrand <https://www.ibrand.cc>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace iBrand\Sms\Storage;
13
14
/**
15
 * Class SessionStorage.
16
 */
17
class SessionStorage implements StorageInterface
18
{
19
    /**
20
     * @param $key
21
     * @param $value
22
     */
23 7
    public function set($key, $value)
24
    {
25 7
        session([
26 7
            $key => $value,
27
        ]);
28 7
    }
29
30
    /**
31
     * @param $key
32
     * @param $default
33
     *
34
     * @return mixed
35
     */
36 6
    public function get($key, $default)
37
    {
38 6
        return session($key, $default);
39
    }
40
41
    /**
42
     * @param $key
43
     */
44 1
    public function forget($key)
45
    {
46 1
        session()->forget($key);
47 1
    }
48
}
49