From cf06b5b8cffb4ee3a4c1e88b7be9e35fca74a89e Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 15 Jun 2020 21:24:19 +0100 Subject: [PATCH] Player: explicitly check for false return of dataPacket() fixes a phpstan error on l7 this won't ever actually be a problem, but this isn't obvious from the type system. --- src/pocketmine/Player.php | 2 +- tests/phpstan/configs/l7-baseline.neon | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 472eb0453..3e2f2b27a 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -3523,7 +3523,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $pk = new ModalFormRequestPacket(); $pk->formId = $id; $pk->formData = $formData; - if($this->dataPacket($pk)){ + if($this->dataPacket($pk) !== false){ $this->forms[$id] = $form; } } diff --git a/tests/phpstan/configs/l7-baseline.neon b/tests/phpstan/configs/l7-baseline.neon index 7409fb871..d3634af84 100644 --- a/tests/phpstan/configs/l7-baseline.neon +++ b/tests/phpstan/configs/l7-baseline.neon @@ -45,11 +45,6 @@ parameters: count: 1 path: ../../../src/pocketmine/Player.php - - - message: "#^Only booleans are allowed in an if condition, bool\\|int given\\.$#" - count: 1 - path: ../../../src/pocketmine/Player.php - - message: "#^Parameter \\#1 \\$haystack of function substr_count expects string, string\\|false given\\.$#" count: 1