From 9fc260fb1aaebba500ce771f2472d67d5c248f0d Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 4 Dec 2019 19:38:54 +0000 Subject: [PATCH 1/3] keep phpstan.neon.dist ignoreErrors sorted by file --- phpstan.neon.dist | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index b1fb36c2d..b918d5fc5 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -18,6 +18,12 @@ parameters: count: 1 path: src/pocketmine/Server.php + - + message: "#^Call to an undefined method pocketmine\\\\command\\\\CommandSender\\:\\:teleport\\(\\)\\.$#" + count: 1 + path: src/pocketmine/command/defaults/TeleportCommand.php +# comment: "not actually possible, but high cost to fix warning" + - message: "#^Constructor of class pocketmine\\\\level\\\\generator\\\\hell\\\\Nether has an unused parameter \\$options\\.$#" count: 1 @@ -70,8 +76,3 @@ parameters: message: "#^Constant pocketmine\\\\VERSION not found\\.$#" path: src/pocketmine - - - message: "#^Call to an undefined method pocketmine\\\\command\\\\CommandSender\\:\\:teleport\\(\\)\\.$#" - count: 1 - path: src/pocketmine/command/defaults/TeleportCommand.php -# comment: "not actually possible, but high cost to fix warning" From c35d91a104b332d6797233f9ba1d59c0a8b20a32 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 4 Dec 2019 19:42:18 +0000 Subject: [PATCH 2/3] phpstan: allow blanket ignoreErrors in src to reduce merge work for master --- phpstan.neon.dist | 16 ++++++++-------- tests/phpstan/configs/phpstan-bugs.neon | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index b918d5fc5..d078a7acf 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -46,33 +46,33 @@ parameters: - message: "#^Constant pocketmine\\\\COMPOSER_AUTOLOADER_PATH not found\\.$#" - path: src/pocketmine + path: src - message: "#^Constant pocketmine\\\\DATA not found\\.$#" - path: src/pocketmine + path: src - message: "#^Constant pocketmine\\\\GIT_COMMIT not found\\.$#" - path: src/pocketmine + path: src - message: "#^Constant pocketmine\\\\PATH not found\\.$#" - path: src/pocketmine + path: src - message: "#^Constant pocketmine\\\\PLUGIN_PATH not found\\.$#" - path: src/pocketmine + path: src - message: "#^Constant pocketmine\\\\RESOURCE_PATH not found\\.$#" - path: src/pocketmine + path: src - message: "#^Constant pocketmine\\\\START_TIME not found\\.$#" - path: src/pocketmine + path: src - message: "#^Constant pocketmine\\\\VERSION not found\\.$#" - path: src/pocketmine + path: src diff --git a/tests/phpstan/configs/phpstan-bugs.neon b/tests/phpstan/configs/phpstan-bugs.neon index d6503d71f..89defd52a 100644 --- a/tests/phpstan/configs/phpstan-bugs.neon +++ b/tests/phpstan/configs/phpstan-bugs.neon @@ -2,9 +2,9 @@ parameters: ignoreErrors: - message: "#^PHPDoc tag @param has invalid value \\(.+\\)\\: Unexpected token \"&\", expected variable at offset \\d+$#" - path: ../../../src/pocketmine + path: ../../../src - message: "#^Default value of the parameter \\#\\d+ \\$[A-Za-z\\d_]+ \\(\\-?\\d+\\) of method .+\\(\\) is incompatible with type float\\.$#" - path: ../../../src/pocketmine + path: ../../../src From c57eb26fd5e15b29ef3d0f00b140398ba2557309 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 4 Dec 2019 19:50:15 +0000 Subject: [PATCH 3/3] phpstan-bugs: add some extra patterns for level 3 false positives --- tests/phpstan/configs/phpstan-bugs.neon | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/phpstan/configs/phpstan-bugs.neon b/tests/phpstan/configs/phpstan-bugs.neon index 89defd52a..1f7c01b9c 100644 --- a/tests/phpstan/configs/phpstan-bugs.neon +++ b/tests/phpstan/configs/phpstan-bugs.neon @@ -8,3 +8,11 @@ parameters: message: "#^Default value of the parameter \\#\\d+ \\$[A-Za-z\\d_]+ \\(\\-?\\d+\\) of method .+\\(\\) is incompatible with type float\\.$#" path: ../../../src + - + message: "#^Cannot access an offset on Threaded\\.$#" + path: ../../../src + + - + message: "#^Cannot assign new offset to Threaded\\.$#" + path: ../../../src +