Skip to content

Commit

Permalink
Fix PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
dries-c committed Dec 5, 2024
1 parent 0420e77 commit 41d9f43
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/network/mcpe/CachedChunk.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@
use function strlen;

class CachedChunk{
/** @var int[] */
/**
* @var int[]
* @phpstan-var array<int, int>
*/
protected array $hashes = [];
/** @var string[] */
/**
* @var string[]
* @phpstan-var array<int, string>
*/
protected array $blobs = [];

protected string $biomes;
Expand Down
5 changes: 4 additions & 1 deletion src/network/mcpe/cache/ChunkCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ public static function pruneCaches() : void{
}
}

/** @var CachedChunkPromise[][] */
/**
* @var CachedChunkPromise[][]
* @phpstan-var array<int, array<int, CachedChunkPromise>>
*/
private array $caches = [];

private int $hits = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/network/mcpe/convert/TypeConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public function netItemStackToCore(ItemStack $itemStack) : Item{
/**
* @param Player[] $players
*
* @phpstan-return array{TypeConverter[], Player[][]}
* @phpstan-return array{array<int, TypeConverter>, array<int, array<int, Player>>}
*/
public static function sortByConverter(array $players) : array{
/** @var TypeConverter[] $typeConverters */
Expand Down

0 comments on commit 41d9f43

Please sign in to comment.