NullDriver   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 42
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A save() 0 4 1
A driverHas() 0 4 1
A driverGet() 0 4 1
A driverDelete() 0 4 1
A driverClear() 0 4 1
1
<?php
2
/**
3
 * Phossa Project
4
 *
5
 * PHP version 5.4
6
 *
7
 * @category  Library
8
 * @package   Phossa2\Cache
9
 * @copyright Copyright (c) 2016 phossa.com
10
 * @license   http://mit-license.org/ MIT License
11
 * @link      http://www.phossa.com/
12
 */
13
/*# declare(strict_types=1); */
14
15
namespace Phossa2\Cache\Driver;
16
17
use Psr\Cache\CacheItemInterface;
18
19
/**
20
 * NullDriver
21
 *
22
 * @package Phossa2\Cache
23
 * @author  Hong Zhang <[email protected]>
24
 * @see     DriverAbstract
25
 * @version 2.0.0
26
 * @since   2.0.0 added
27
 */
28
class NullDriver extends DriverAbstract
29
{
30
    /**
31
     * {@inheritDoc}
32
     */
33
    public function save(CacheItemInterface $item)/*# : bool */
34
    {
35
        return true;
36
    }
37
38
    /**
39
     * {inheritDoc}
40
     */
41
    protected function driverHas(/*# string */ $key)/*# : array */
42
    {
43
        return [];
44
    }
45
46
    /**
47
     * {@inheritDoc}
48
     */
49
    protected function driverGet(/*# string */ $key)
50
    {
51
        return null;
52
    }
53
54
    /**
55
     * {@inheritDoc}
56
     */
57
    protected function driverDelete(CacheItemInterface $item)/*# : bool */
58
    {
59
        return true;
60
    }
61
62
    /**
63
     * {@inheritDoc}
64
     */
65
    protected function driverClear()/*# : bool */
66
    {
67
        return true;
68
    }
69
}
70