Skip to content

Commit adfe70f

Browse files
authored
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()
1 parent cd891d5 commit adfe70f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Pecee/Http/Response.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public function httpCode(int $code): self
3232
*
3333
* @param string $url
3434
* @param ?int $httpCode
35+
*
36+
* @return never
3537
*/
3638
public function redirect(string $url, ?int $httpCode = null): void
3739
{
@@ -127,4 +129,4 @@ public function headers(array $headers): self
127129
return $this;
128130
}
129131

130-
}
132+
}

0 commit comments

Comments
 (0)