1 | <?php |
||
12 | class CryptHelper |
||
13 | { |
||
14 | /** |
||
15 | * The storage location of the encryption keys. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | public static $keyPath; |
||
20 | |||
21 | /** |
||
22 | * Set the storage location of the encryption keys. |
||
23 | * |
||
24 | * @param string $path |
||
25 | * @return void |
||
26 | */ |
||
27 | public static function loadKeysFrom($path) |
||
31 | |||
32 | /** |
||
33 | * The location of the encryption keys. |
||
34 | * |
||
35 | * @param string $file |
||
36 | * @return string |
||
37 | */ |
||
38 | 4 | public static function keyPath($file) |
|
53 | |||
54 | /** |
||
55 | * @param null $basePath |
||
56 | * @return bool |
||
57 | */ |
||
58 | 2 | public static function generateKeys($basePath = null) |
|
76 | |||
77 | /** |
||
78 | * @param $type |
||
79 | * @return CryptKey |
||
80 | */ |
||
81 | 3 | public static function makeCryptKey($type) |
|
97 | } |
||
98 |
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.