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
Push — 3.x ( 854d93...81f322 )
by Jindřich
01:52
created

FakeAdapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 33
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 4 1
A has() 0 4 1
A get() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Skautis\SessionAdapter;
5
6
/**
7
 * Nepersestinenti adapter - vhodne jako stub pro testy nebo kdyz neni potreba ukladat
8
 */
9
class FakeAdapter implements AdapterInterface
10
{
11
    /**
12
     * Inmemory storage
13
     *
14
     * @var array
15
     */
16
    protected $data = [];
17
18
    /**
19
     * @inheritdoc
20
     */
21 1
    public function set(string $name, $object): void
22
    {
23 1
        $this->data[$name] = $object;
24 1
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29 1
    public function has(string $name): bool
30
    {
31 1
        return isset($this->data[$name]);
32
    }
33
34
    /**
35
     * @inheritdoc
36
     */
37 1
    public function get(string $name)
38
    {
39 1
        return $this->data[$name];
40
    }
41
}
42