FacebookSessionPersistentDataHandler   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 30
rs 10
c 0
b 0
f 0

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 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