It seems like you are loosely comparing $this->iv of type null|string against null; this is ambiguous if the string can be empty. Consider using a strict comparison === instead.
Loading history...
52
return $encrypted . ':' . $iv;
53
}
54
return $encrypted;
55
}
56
57
/**
58
* Decrypt the given data.
59
*
60
* @param string $data
61
* @param bool $randomIv
62
* @return string
63
*/
64
public function decrypt($data, $randomIv = false)
65
{
66
if ($randomIv) {
67
// To decrypt, separate the encrypted data from the initialization vector ($iv).