Skip to content

Commit f9c29d2

Browse files
committed
fix: removed useless code
1 parent b948773 commit f9c29d2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Linna/Session/EncryptedSessionHandler.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,14 @@ public function read(string $id): string|false
134134
//get encrypted session data
135135
$ciphertext = $this->handler->read($id);
136136

137-
if ($ciphertext === false) {
138-
return "";
139-
}
140-
141137
//if session doesn't contain data, return a void string
138+
// @phpstan-ignore-next-line
142139
if (\strlen($ciphertext) === 0) {
143140
return "";
144141
}
145142

146143
//decrypt session data
144+
// @phpstan-ignore-next-line
147145
$plaintext = $this->crypto->decrypt(\sodium_base642bin($ciphertext, SODIUM_BASE64_VARIANT_ORIGINAL), $this->additionalData, $this->nonce, $this->key);
148146

149147
//return plaintext

0 commit comments

Comments
 (0)