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

AuraSession::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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