__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Otobank\Bundle\FacebookBundle\Facebook\PersistentData;
4
5
use Facebook\PersistentData\PersistentDataInterface;
6
use Symfony\Component\HttpFoundation\Session\SessionInterface;
7
8
class FacebookSessionPersistentDataHandler implements PersistentDataInterface
9
{
10
    const SESSION_PREFIX = 'FBRLH_';
11
12
    private $session;
13
14
    /**
15
     * @param SessionInterface $session
16
     */
17
    public function __construct(SessionInterface $session)
18
    {
19
        $this->session = $session;
20
    }
21
22
    /**
23
     * {@inheritDoc}
24
     */
25
    public function get($key)
26
    {
27
        return $this->session->get(self::SESSION_PREFIX . $key);
28
    }
29
30
    /**
31
     * {@inheritDoc}
32
     */
33
    public function set($key, $value)
34
    {
35
        $this->session->set(self::SESSION_PREFIX . $key, $value);
36
    }
37
}
38