NullDriver::erase()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
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