Skip to content

Commit f782352

Browse files
committed
Fix return type in Authentication::lookup
1 parent c6b0df6 commit f782352

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Libraries/User/Authentication.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ public static function logout(): bool
175175
* @param string $key The unique key, ostensibly from the client,
176176
* hexadecimal-formatted and must be 64 bytes in length.
177177
* @param bool $throw Whether to throw exceptions or simply return false on error.
178-
* @return array|null The fingerprint details, or false if not found.
178+
* @return array|false The fingerprint details, or false if not found.
179179
* @throws UnexpectedValueException if key is not 64 characters in length and/or not a hexadecimal-formatted string.
180180
*/
181-
protected static function lookup(string $key, bool $throw = true): ?array
181+
protected static function lookup(string $key, bool $throw = true): array|false
182182
{
183183
if (strlen($key) !== 64 || !preg_match('/^(?:(0x|0X)?[a-fA-F0-9]+)$/', $key))
184184
{
@@ -194,7 +194,7 @@ protected static function lookup(string $key, bool $throw = true): ?array
194194
(`expires_datetime` = NULL OR `expires_datetime` > :dt)
195195
LIMIT 1;'
196196
);
197-
if (!$q || !$q->execute([':dt' => $now, ':id' => $key])) return null;
197+
if (!$q || !$q->execute([':dt' => $now, ':id' => $key])) return false;
198198
try { return $q->fetch(PDO::FETCH_ASSOC); }
199199
finally { if ($q) $q->closeCursor(); }
200200
}

0 commit comments

Comments
 (0)