From adfe70f191c5f8fe435c9fcc1d3aea07a43ba472 Mon Sep 17 00:00:00 2001 From: ATC-4K <84913633+ATC-4K@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:16:32 +0200 Subject: [PATCH] Added @return never to Response.php In PHP8.1 instead of :void :never would be returned. As this project is PHP7.4 compatible, we add it as a PHPDOC, so IDEs using this project will no longer complain and automatic checks will successfully detect dead code after calling a redirect() --- src/Pecee/Http/Response.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Pecee/Http/Response.php b/src/Pecee/Http/Response.php index 0c4b910..5e6ca47 100644 --- a/src/Pecee/Http/Response.php +++ b/src/Pecee/Http/Response.php @@ -32,6 +32,8 @@ class Response * * @param string $url * @param ?int $httpCode + * + * @return never */ public function redirect(string $url, ?int $httpCode = null): void { @@ -127,4 +129,4 @@ class Response return $this; } -} \ No newline at end of file +}