NullDriver   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 41
ccs 4
cts 4
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A erase() 0 3 1
A get() 0 3 1
A set() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of slick/http
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Http\Session\Driver;
11
12
use Slick\Http\Session\SessionDriverInterface;
13
14
/**
15
 * NullDriver
16
 *
17
 * @package Slick\Http\Session\Driver
18
*/
19
class NullDriver implements SessionDriverInterface
20
{
21
    /**
22
     * Returns the value store with provided key or the default value.
23
     *
24
     * @param string $key The key used to store the value in session.
25
     * @param string $default The default value if no value was stored.
26
     *
27
     * @return mixed The stored value or the default value if key
28
     *  was not found.
29
     */
30
    public function get($key, $default = null)
31
    {
32
        return $default;
33 2
    }
34
35 2
    /**
36
     * Set/Stores a provided values with a given key.
37
     *
38
     * @param string $key The key used to store the value in session.
39
     * @param mixed $value The value to store under the provided key.
40
     *
41
     * @return self|$this|SessionDriverInterface Self instance for
42
     *   method call chains.
43
     */
44
    public function set($key, $value)
45
    {
46
        return $this;
47 2
    }
48
49 2
    /**
50
     * Erases the values stored with the given key.
51
     *
52
     * @param string $key The key used to store the value in session.
53
     *
54
     * @return self|$this|SessionDriverInterface Self instance for
55
     *   method call chains.
56
     */
57
    public function erase($key)
58
    {
59
        return $this;
60 2
    }
61
}
62