Completed
Push — master ( 1b2d0a...89ea1a )
by Oscar
03:00
created

AuraSession   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 25
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A get() 0 4 1
A set() 0 4 1
1
<?php
2
3
namespace Psr7Middlewares\Storage;
4
5
use Aura\Session\Session;
6
use Psr7Middlewares\Middleware;
7
8
/**
9
 * Wrapper for Aura.Session
10
 */
11
class AuraSession implements StorageInterface
12
{
13
    protected $storage;
14
15
    public function __construct(Session $session)
16
    {
17
        $this->storage = $session->getSegment(Middleware::KEY);
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function get($key)
24
    {
25
        return $this->storage->get($key);
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function set($key, $value)
32
    {
33
        $this->storage->set($key, $value);
34
    }
35
}
36