Skip to content

Commit c184d07

Browse files
committed
Default to empty string; Scrutinizer warns us to do additional type check now, but the default value is never returned anyway
1 parent 753866e commit c184d07

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Backend/OpenSSL.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function encrypt(AbstractKey $key, string $plaintext): string
8080
$fn = 'openssl_private_encrypt';
8181
}
8282

83-
$ciphertext = null;
83+
$ciphertext = '';
8484
if (!$fn($plaintext, $ciphertext, $key->get(), $this->padding)) {
8585
throw new RuntimeException('Cannot encrypt data: ' . openssl_error_string());
8686
}
@@ -125,7 +125,7 @@ public function decrypt(AbstractKey $key, string $ciphertext): string
125125
$fn = 'openssl_private_decrypt';
126126
}
127127

128-
$plaintext = null;
128+
$plaintext = '';
129129
if (!$fn($ciphertext, $plaintext, $key->get(), $this->padding)) {
130130
throw new RuntimeException('Cannot decrypt data: ' . openssl_error_string());
131131
}

0 commit comments

Comments
 (0)