Completed
Push — 2.0 ( b5e900...ba9d42 )
by Marco
05:08
created

Vacuum::set()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 2
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 4
crap 2
1
<?php namespace Comodojo\Cache\Drivers;
2
3
use \Comodojo\Cache\Components\UniqueId;
4
use \Exception;
5
6
/**
7
 * Apcu provider
8
 *
9
 * @package     Comodojo Spare Parts
10
 * @author      Marco Giovinazzi <[email protected]>
11
 * @license     MIT
12
 *
13
 * LICENSE:
14
 *
15
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
 * THE SOFTWARE.
22
 */
23
24
class Vacuum extends AbstractDriver {
25
26
    const DRIVER_NAME = "vacuum";
27
28
    public function __construct(array $configuration = []) {}
29
30 71
    public function test() {
31
32 71
        return true;
33
34
    }
35
36
    public function get($key, $namespace) {
37
38
        return null;
39
40
    }
41
42
    public function set($key, $namespace, $value, $ttl = null) {
43
44
        return true;
45
46
    }
47
48
    public function delete($key, $namespace) {
49
50
        return false;
51
52
    }
53
54
    public function clear($namespace = null) {
55
56
        return true;
57
58
    }
59
60
    public function getMultiple(array $keys, $namespace) {
61
62
        $keypad = array_combine($keys, array_fill(0, count($keys), null));
0 ignored issues
show
Unused Code introduced by
$keypad is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
63
64
    }
65
66
    public function setMultiple(array $key_values, $namespace, $ttl = null) {
67
68
        return true;
69
70
    }
71
72
    public function deleteMultiple(array $keys, $namespace) {
73
74
        return true;
75
76
    }
77
78
    public function has($key, $namespace) {
79
80
        return false;
81
82
    }
83
84
    public function stats() {
85
86
        return [];
87
88
    }
89
90
}
91