SessionStore   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 53
ccs 13
cts 13
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A push() 0 4 1
A has() 0 4 1
A get() 0 4 1
A put() 0 4 1
1
<?php
2
3
namespace Rojtjo\Notifier\Laravel;
4
5
use Illuminate\Session\Store;
6
use Rojtjo\Notifier\SessionStore as NotifierSessionStore;
7
8
class SessionStore implements NotifierSessionStore
9
{
10
    /**
11
     * @var Store
12
     */
13
    private $store;
14
15
    /**
16
     * @param Store $store
17
     */
18 15
    public function __construct(Store $store)
19
    {
20 15
        $this->store = $store;
21 15
    }
22
23
    /**
24
     * @param string $key
25
     * @param array $notification
26
     * @return void
27
     */
28 3
    public function push($key, array $notification)
29
    {
30 3
        $this->store->push($key, $notification);
31 3
    }
32
33
    /**
34
     * @param string $key
35
     * @return bool
36
     */
37 3
    public function has($key)
38
    {
39 3
        return (bool) $this->store->has($key);
40
    }
41
42
    /**
43
     * @param string $key
44
     * @return array
45
     */
46 3
    public function get($key)
47
    {
48 3
        return $this->store->get($key, []);
49
    }
50
51
    /**
52
     * @param string $key
53
     * @param array $notifications
54
     * @return void
55
     */
56 3
    public function put($key, array $notifications)
57
    {
58 3
        $this->store->set($key, $notifications);
59 3
    }
60
}
61