File tree Expand file tree Collapse file tree
tests/PHPStan/Rules/Comparison/data Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,25 @@ public static function notFound(int $exit = 1): void
3535 }
3636 }
3737
38+ public function test (): void
39+ {
40+ // send 404 header
41+ self ::notFound (0 );
42+ }
43+ }
44+
45+ class ReturnViaIntNonNative
46+ {
47+ /** @return ($exit is 1 ? never : void) */
48+ public static function notFound (int $ exit = 1 )
49+ {
50+ header ('HTTP/1.1 404 Not Found ' , true , 404 );
51+
52+ if ($ exit == 1 ) {
53+ echo '404 Not Found ' ;
54+ exit ;
55+ }
56+ }
3857
3958 public function test (): void
4059 {
@@ -57,7 +76,6 @@ public static function notFound(bool $exit = true)
5776 return 1 ;
5877 }
5978
60-
6179 public function test (): void
6280 {
6381 // send 404 header
@@ -80,7 +98,6 @@ public static function notFound(bool $exit = true)
8098 return 1 ;
8199 }
82100
83-
84101 public function test (): void
85102 {
86103 // send 404 header
You can’t perform that action at this time.
0 commit comments