| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public static function decrypt(string $input, string $key): string |
||
| 18 | { |
||
| 19 | list($cipher, $iv_size, $key_size) = self::getCipher(); |
||
|
|
|||
| 20 | $iv = substr($key, 0, $iv_size); |
||
| 21 | $key = substr($key, 0, $iv_size); |
||
| 22 | |||
| 23 | mcrypt_generic_init($cipher, $key, $iv); |
||
| 24 | |||
| 25 | $data = base64_decode(str_replace("certplus", "\\+", $input)); |
||
| 26 | |||
| 27 | $data = mdecrypt_generic($cipher, $data); |
||
| 28 | self::finalizeCipher($cipher); |
||
| 29 | |||
| 30 | return trim($data); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |
This checks looks for assignemnts to variables using the
list(...)function, where not all assigned variables are subsequently used.Consider the following code example.
Only the variables
$aand$care used. There was no need to assign$b.Instead, the list call could have been.