Skip to content

Commit 6f9fbbf

Browse files
committed
Variable always exists and is not nullable.
1 parent 09d2ff1 commit 6f9fbbf

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

resources/lib/UnityHTTPD.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,12 @@ public static function errorHandler(int $severity, string $message, string $file
226226

227227
public static function getPostData(string $key): mixed
228228
{
229-
if (!isset($_SERVER)) {
230-
throw new RuntimeException('$_SERVER is unset');
231-
}
232229
if (!array_key_exists("REQUEST_METHOD", $_SERVER)) {
233230
throw new RuntimeException('$_SERVER has no array key "REQUEST_METHOD"');
234231
}
235232
if ($_SERVER["REQUEST_METHOD"] !== "POST") {
236233
self::badRequest('$_SERVER["REQUEST_METHOD"] != "POST"');
237234
}
238-
if (!isset($_POST)) {
239-
self::badRequest('$_POST is unset');
240-
}
241235
if (!array_key_exists($key, $_POST)) {
242236
self::badRequest("\$_POST has no array key '$key'");
243237
}

0 commit comments

Comments
 (0)