From cfd975009e97e74f5431c450962c9286d33678fa Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 20 Jan 2020 11:52:11 +0000 Subject: [PATCH 1/2] Leaves: fix decay performance issue this code was written with references in mind, but it looks like someone forgot the reference. --- src/pocketmine/block/Leaves.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/block/Leaves.php b/src/pocketmine/block/Leaves.php index 25cf33c458..aa0bd4e919 100644 --- a/src/pocketmine/block/Leaves.php +++ b/src/pocketmine/block/Leaves.php @@ -69,7 +69,7 @@ class Leaves extends Transparent{ } - protected function findLog(Block $pos, array $visited, int $distance, ?int $fromSide = null) : bool{ + protected function findLog(Block $pos, array &$visited, int $distance, ?int $fromSide = null) : bool{ $index = $pos->x . "." . $pos->y . "." . $pos->z; if(isset($visited[$index])){ return false; From e5d62ec901237e8b3429618aafd82c1958e0dcd5 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 20 Jan 2020 17:26:48 +0000 Subject: [PATCH 2/2] phpstan 0.12.6 --- tests/phpstan/configs/phpstan-bugs.neon | 5 ----- tests/travis.sh | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/phpstan/configs/phpstan-bugs.neon b/tests/phpstan/configs/phpstan-bugs.neon index 562ed05deb..d7ad3310ed 100644 --- a/tests/phpstan/configs/phpstan-bugs.neon +++ b/tests/phpstan/configs/phpstan-bugs.neon @@ -43,8 +43,3 @@ parameters: message: "#^Call to function assert\\(\\) with false and 'unknown hit type' will always evaluate to false\\.$#" count: 1 path: ../../../src/pocketmine/entity/projectile/Projectile.php - - - - message: "#^Strict comparison using \\=\\=\\= between int\\<1, max\\> and 0 will always evaluate to false\\.$#" - count: 1 - path: ../../../src/pocketmine/utils/Config.php diff --git a/tests/travis.sh b/tests/travis.sh index 4e0b9db58c..f0c2d4644d 100755 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -14,7 +14,7 @@ while getopts "p:t:" OPTION 2> /dev/null; do esac done -[ ! -f phpstan.phar ] && echo "Downloading PHPStan..." && curl -sSLO https://github.com/phpstan/phpstan/releases/download/0.12.5/phpstan.phar +[ ! -f phpstan.phar ] && echo "Downloading PHPStan..." && curl -sSLO https://github.com/phpstan/phpstan/releases/download/0.12.6/phpstan.phar "$PHP_BINARY" phpstan.phar analyze --no-progress --memory-limit=2G || exit 1 echo "PHPStan scan succeeded"