Fixed return type on UriBase64::decode.

This commit is contained in:
Pachira 2023-08-03 01:29:57 +00:00
parent 557f089ff7
commit 553b7c4a14
2 changed files with 4 additions and 4 deletions

View file

@ -1 +1 @@
0.2307.221425
0.2308.30129

View file

@ -1,7 +1,7 @@
<?php
// UriBase64.php
// Created: 2022-01-13
// Updated: 2023-07-21
// Updated: 2023-08-03
namespace Index\Serialisation;
@ -25,9 +25,9 @@ final class UriBase64 {
* Decodes a Base64 string back to binary data.
*
* @param Stream|string $input Input Base64 string.
* @return string Binary data.
* @return string|false Binary data.
*/
public static function decode(Stream|string $input): mixed {
public static function decode(Stream|string $input): string|bool {
$input = (string)$input;
return base64_decode(str_pad(strtr($input, '-_', '+/'), strlen($input) % 4, '=', STR_PAD_RIGHT));
}