From f5773d4ce4927d0961014a6a8fd33e3f71cbe3f6 Mon Sep 17 00:00:00 2001 From: Derek Illchuk Date: Wed, 1 Feb 2023 23:24:47 -0600 Subject: [PATCH] Return type string|false This avoids fatal errors when openssl_decrypt returns false. --- src/Crypto.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Crypto.php b/src/Crypto.php index e515841..9221ee6 100644 --- a/src/Crypto.php +++ b/src/Crypto.php @@ -14,9 +14,9 @@ class Crypto * @param string $path * @param string $algo * - * @return string + * @return string|false */ - public function decrypt(string $path = Constants::ENV_ENC, string $secret = '', string $algo = Constants::ALGO): string + public function decrypt(string $path = Constants::ENV_ENC, string $secret = '', string $algo = Constants::ALGO): string|false { if (!file_exists($path)) { throw new RuntimeException('File does not exist.');