GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — 2.x (#78)
by Jindřich
02:01
created

SessionAdapter   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 41
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 4 1
A has() 0 4 1
A get() 0 4 1
A __construct() 0 8 2
1
<?php
2
3
namespace Skautis\SessionAdapter;
4
5
/**
6
 * Adapter pro pouziti $_SESSION ve SkautISu
7
 */
8
class SessionAdapter implements AdapterInterface
9
{
10
11
    /**
12
     * @var array
13
     */
14
    protected $session;
15
16 2
    public function __construct()
17
    {
18 2
        if (!isset($_SESSION["__" . __CLASS__])) {
19 1
            $_SESSION["__" . __CLASS__] = [];
20
        }
21
22 2
        $this->session = &$_SESSION["__" . __CLASS__];
23 2
    }
24
25
    /**
26
     * @inheritdoc
27
     */
28 2
    public function set($name, $object)
29
    {
30 2
        $this->session[$name] = $object;
31 2
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36 3
    public function has($name)
37
    {
38 3
        return isset($this->session[$name]);
39
    }
40
41
    /**
42
     * @inheritdoc
43
     */
44 2
    public function get($name)
45
    {
46 2
        return $this->session[$name];
47
    }
48
}
49