From 3dd05968a1b0f0fedc22573a09e492c76360cb09 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 10 Nov 2022 17:10:28 +0100 Subject: [PATCH] Fix e2e tests --- src/Psl/Env/current_exec.php | 2 +- src/Psl/Hash/Context.php | 1 + src/Psl/Iter/enumerate.php | 2 +- src/Psl/Password/get_information.php | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Psl/Env/current_exec.php b/src/Psl/Env/current_exec.php index a9be59b..5060374 100644 --- a/src/Psl/Env/current_exec.php +++ b/src/Psl/Env/current_exec.php @@ -11,7 +11,7 @@ use Psl\Filesystem; */ function current_exec(): string { - $executable = (string) Filesystem\canonicalize((string) $_SERVER['SCRIPT_NAME']); + $executable = (string) Filesystem\canonicalize($_SERVER['SCRIPT_NAME'] ?? ''); // @codeCoverageIgnoreStart if (Filesystem\is_symbolic_link($executable)) { /** @psalm-suppress MissingThrowsDocblock */ diff --git a/src/Psl/Hash/Context.php b/src/Psl/Hash/Context.php index e3c39c1..a69d7f3 100644 --- a/src/Psl/Hash/Context.php +++ b/src/Psl/Hash/Context.php @@ -92,6 +92,7 @@ final class Context $internal_context = hash_copy($this->internalContext); // @codeCoverageIgnoreStart + /** @psalm-suppress ImpureFunctionCall */ if (!hash_update($internal_context, $data)) { throw new Exception\RuntimeException('Unable to pump data into the active hashing context.'); } diff --git a/src/Psl/Iter/enumerate.php b/src/Psl/Iter/enumerate.php index beac792..c1e196d 100644 --- a/src/Psl/Iter/enumerate.php +++ b/src/Psl/Iter/enumerate.php @@ -15,7 +15,7 @@ use Psl\Vec; * * @param iterable $iterable * - * @return Iterator + * @return Iterator * * @deprecated use `Vec\enumerate` instead. * @see Vec\enumerate() diff --git a/src/Psl/Password/get_information.php b/src/Psl/Password/get_information.php index 832118e..ae36bbf 100644 --- a/src/Psl/Password/get_information.php +++ b/src/Psl/Password/get_information.php @@ -14,9 +14,9 @@ use function password_get_info; * When passed in a valid hash created by an algorithm supported by `Psl\Password\hash()`, * this function will return an array of information about that hash. * - * @return array{ + * @return strict-array{ * algorithm: string, - * options: array{cost: int}|array{memory_cost: int, time_cost: int, threads: int} + * options: strict-array{cost: int}|strict-array{memory_cost: int, time_cost: int, threads: int} * } * * @pure