1 | <?php namespace Comodojo\Cache\Drivers; |
||
24 | class Vacuum extends AbstractDriver { |
||
25 | |||
26 | const DRIVER_NAME = "vacuum"; |
||
27 | |||
28 | public function __construct(array $configuration = []) {} |
||
29 | |||
30 | 71 | public function test() { |
|
35 | |||
36 | public function get($key, $namespace) { |
||
41 | |||
42 | public function set($key, $namespace, $value, $ttl = null) { |
||
47 | |||
48 | public function delete($key, $namespace) { |
||
53 | |||
54 | public function clear($namespace = null) { |
||
59 | |||
60 | public function getMultiple(array $keys, $namespace) { |
||
65 | |||
66 | public function setMultiple(array $key_values, $namespace, $ttl = null) { |
||
71 | |||
72 | public function deleteMultiple(array $keys, $namespace) { |
||
77 | |||
78 | public function has($key, $namespace) { |
||
83 | |||
84 | public function stats() { |
||
89 | |||
90 | } |
||
91 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
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.