NullMap   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 55.56%

Importance

Changes 0
Metric Value
wmc 9
lcom 0
cbo 0
dl 0
loc 70
ccs 10
cts 18
cp 0.5556
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A clear() 0 3 1
A count() 0 4 1
A get() 0 4 1
A getIterator() 0 4 1
A merge() 0 3 1
A offsetExists() 0 4 1
A offsetGet() 0 4 1
A offsetSet() 0 3 1
A offsetUnset() 0 3 1
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Caridea
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7
 * use this file except in compliance with the License. You may obtain a copy of
8
 * the License at
9
 *
10
 * http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
 * License for the specific language governing permissions and limitations under
16
 * the License.
17
 *
18
 * @copyright 2015-2018 LibreWorks contributors
19
 * @license   Apache-2.0
20
 */
21
namespace Caridea\Session;
22
23
/**
24
 * A no-op key-value Map.
25
 *
26
 * @copyright 2015-2018 LibreWorks contributors
27
 * @license   Apache-2.0
28
 */
29
class NullMap implements Map
30
{
31
    /**
32
     * {@inheritDoc}
33
     */
34
    public function clear(): void
35
    {
36
    }
37
38
    /**
39
     * {@inheritDoc}
40
     */
41 1
    public function count(): int
42
    {
43 1
        return 0;
44
    }
45
46
    /**
47
     * {@inheritDoc}
48
     */
49 1
    public function get(string $key, $alt = null)
50
    {
51 1
        return $alt;
52
    }
53
54
    /**
55
     * {@inheritDoc}
56
     */
57 1
    public function getIterator(): \Iterator
58
    {
59 1
        return new \EmptyIterator();
60
    }
61
62
    /**
63
     * {@inheritDoc}
64
     */
65
    public function merge(Map $values): void
66
    {
67
    }
68
69
    /**
70
     * {@inheritDoc}
71
     */
72 1
    public function offsetExists($offset): bool
73
    {
74 1
        return false;
75
    }
76
77
    /**
78
     * {@inheritDoc}
79
     */
80 1
    public function offsetGet($offset)
81
    {
82 1
        return null;
83
    }
84
85
    /**
86
     * {@inheritDoc}
87
     */
88
    public function offsetSet($offset, $value)
89
    {
90
    }
91
92
    /**
93
     * {@inheritDoc}
94
     */
95
    public function offsetUnset($offset)
96
    {
97
    }
98
}
99