Skip to content

Commit da438b5

Browse files
committed
Allow null for params in encrypt/decrypt methods
Updated the type hint for the $params argument in encrypt and decrypt methods to ?array, allowing null values. This improves compatibility with optional parameters.
1 parent 410dda7 commit da438b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

system/libraries/Encryption.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public function create_key($length)
369369
* @param array $params Input parameters
370370
* @return string
371371
*/
372-
public function encrypt($data, array $params = NULL)
372+
public function encrypt($data, ?array $params = NULL)
373373
{
374374
if (($params = $this->_get_params($params)) === FALSE)
375375
{
@@ -504,7 +504,7 @@ protected function _openssl_encrypt($data, $params)
504504
* @param array $params Input parameters
505505
* @return string
506506
*/
507-
public function decrypt($data, array $params = NULL)
507+
public function decrypt($data, ?array $params = NULL)
508508
{
509509
if (($params = $this->_get_params($params)) === FALSE)
510510
{

0 commit comments

Comments
 (0)