1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 18:48:03 +01:00

Merge pull request #8431 from LeSuisse/bin2hex-base64-stub

Allow *bin2hex and *bin2base64 functions to keep non-empty-string type
This commit is contained in:
AndrolGenhald 2022-08-23 09:47:18 -05:00 committed by GitHub
commit 034a796f84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -334,6 +334,22 @@ function fclose(&$stream) : bool
{
}
/**
* @psalm-pure
* @template T as string
* @param T $string
* @return (T is non-empty-string ? non-empty-string : string)
*/
function sodium_bin2base64(string $string, int $id): string
/**
* @psalm-pure
* @template T as string
* @param T $string
* @return (T is non-empty-string ? non-empty-string : string)
*/
function sodium_bin2hex(string $string): string {}
/**
* @param string $string
* @param-out null $string
@ -1308,9 +1324,21 @@ function base64_decode(string $string, bool $strict = false) {}
* @psalm-pure
*
* @psalm-flow ($string) -> return
* @template T as string
* @param T $string
* @return (T is non-empty-string ? non-empty-string : string)
*/
function base64_encode(string $string) : string {}
/**
* @psalm-pure
*
* @template T as string
* @param T $string
* @return (T is non-empty-string ? non-empty-string : string)
*/
function bin2hex(string $string): string {}
/**
* @psalm-pure
*