Fixed return type on UriBase64::decode.
This commit is contained in:
parent
557f089ff7
commit
553b7c4a14
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
// UriBase64.php
|
// UriBase64.php
|
||||||
// Created: 2022-01-13
|
// Created: 2022-01-13
|
||||||
// Updated: 2023-07-21
|
// Updated: 2023-08-03
|
||||||
|
|
||||||
namespace Index\Serialisation;
|
namespace Index\Serialisation;
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@ final class UriBase64 {
|
||||||
* Decodes a Base64 string back to binary data.
|
* Decodes a Base64 string back to binary data.
|
||||||
*
|
*
|
||||||
* @param Stream|string $input Input Base64 string.
|
* @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;
|
$input = (string)$input;
|
||||||
return base64_decode(str_pad(strtr($input, '-_', '+/'), strlen($input) % 4, '=', STR_PAD_RIGHT));
|
return base64_decode(str_pad(strtr($input, '-_', '+/'), strlen($input) % 4, '=', STR_PAD_RIGHT));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue