IlluminateSessionStorage   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 7 1
A get() 0 7 1
A clear() 0 7 1
1
<?php
2
3
namespace Happyr\LinkedIn\Storage;
4
5
use Illuminate\Support\Facades\Session;
6
7
/**
8
 * Store data in a IlluminateSession.
9
 *
10
 * @author Andreas Creten
11
 */
12
class IlluminateSessionStorage extends BaseDataStorage
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17 2
    public function set($key, $value)
18
    {
19 2
        $this->validateKey($key);
20 1
        $name = $this->getStorageKeyId($key);
21
22 1
        return Session::put($name, $value);
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    public function get($key)
29
    {
30 1
        $this->validateKey($key);
31 1
        $name = $this->getStorageKeyId($key);
32
33 1
        return Session::get($name);
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39 2
    public function clear($key)
40
    {
41 2
        $this->validateKey($key);
42 1
        $name = $this->getStorageKeyId($key);
43
44 1
        return Session::forget($name);
45
    }
46
}
47