PHPStan 1.9 features

This commit is contained in:
Dylan K. Taylor
2022-11-04 20:23:34 +00:00
parent bfd1b2c635
commit 2fdc46c165
13 changed files with 40 additions and 1 deletions

View File

@ -396,6 +396,9 @@ class World implements ChunkManager{
/**
* @phpstan-param BlockPosHash $hash
* @phpstan-param-out int $x
* @phpstan-param-out int $y
* @phpstan-param-out int $z
*/
public static function getBlockXYZ(int $hash, ?int &$x, ?int &$y, ?int &$z) : void{
[$baseX, $baseY, $baseZ] = morton3d_decode($hash);
@ -410,6 +413,8 @@ class World implements ChunkManager{
/**
* @phpstan-param ChunkPosHash $hash
* @phpstan-param-out int $x
* @phpstan-param-out int $z
*/
public static function getXZ(int $hash, ?int &$x, ?int &$z) : void{
[$x, $z] = morton2d_decode($hash);
@ -1764,6 +1769,7 @@ class World implements ChunkManager{
* It'll try to lower the durability if Item is a tool, and set it to Air if broken.
*
* @param Item $item reference parameter (if null, can break anything)
* @phpstan-param-out Item $item
*/
public function useBreakOn(Vector3 $vector, Item &$item = null, ?Player $player = null, bool $createParticles = false) : bool{
$vector = $vector->floor();