InstagramMemoryPersistentDataHandler   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 3 1
A get() 0 3 2
1
<?php
2
3
namespace Maztech\PersistentData;
4
5
/**
6
 * Class InstagramMemoryPersistentDataHandler
7
 *
8
 * @package Instagram
9
 */
10
class InstagramMemoryPersistentDataHandler implements PersistentDataInterface
11
{
12
    /**
13
     * @var array The session data to keep in memory.
14
     */
15
    protected $sessionData = [];
16
17
    /**
18
     * @inheritdoc
19
     */
20
    public function get($key)
21
    {
22
        return isset($this->sessionData[$key]) ? $this->sessionData[$key] : null;
23
    }
24
25
    /**
26
     * @inheritdoc
27
     */
28
    public function set($key, $value)
29
    {
30
        $this->sessionData[$key] = $value;
31
    }
32
}
33