Liquid: mark getSmallestFlowDecay() as impure

this fixes two bogus PHPStan warnings.
This commit is contained in:
Dylan K. Taylor 2021-02-25 22:41:07 +00:00
parent fcfd51dfc7
commit fac2bd3379
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 3 additions and 10 deletions

View File

@ -418,6 +418,9 @@ abstract class Liquid extends Transparent{
return $isOptimalFlowDirection;
}
/**
* @phpstan-impure This function modifies the adjacent sources count (premature optimisation)
*/
private function getSmallestFlowDecay(Block $block, int $decay) : int{
$blockDecay = $this->getFlowDecay($block);

View File

@ -1,15 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^Comparison operation \"\\>\\=\" between 0 and 2 is always false\\.$#"
count: 1
path: ../../../src/pocketmine/block/Liquid.php
-
message: "#^If condition is always false\\.$#"
count: 1
path: ../../../src/pocketmine/block/Liquid.php
-
message: "#^Call to function is_resource\\(\\) with resource will always evaluate to true\\.$#"
count: 3