Skip to content

Commit 3930195

Browse files
authored
phpstan level 1 (#421)
1 parent da8f905 commit 3930195

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

phpstan.neon

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
parameters:
2-
level: 0
2+
level: 1
33
paths:
44
- resources
55
- test
6+
ignoreErrors:
7+
- messages:
8+
- '#Variable \$this might not be defined.#'
9+
- '#Variable \$data might not be defined.#'
10+
paths:
11+
- resources/mail/*

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)