Skip to content

Commit

Permalink
Fix: openssl_pkey_free is deprecated for PHP 8 (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
smujaddid authored Apr 8, 2021
1 parent 201d55d commit b9973cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ private static function createLocalKeyObjectUsingOpenSSL(): array
}

$details = openssl_pkey_get_details($keyResource);
openssl_pkey_free($keyResource);
if (PHP_MAJOR_VERSION < 8) {
openssl_pkey_free($keyResource);
}

if (!$details) {
throw new \RuntimeException('Unable to get the key details');
Expand Down

0 comments on commit b9973cd

Please sign in to comment.