mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Chunk: stop exposing SplFixedArray<SubChunk> to the API
this fixes a large number of PHPStan errors, and also brings us a step closer to negative-build-height readiness.
This commit is contained in:
@ -299,11 +299,11 @@ class Chunk{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \SplFixedArray|SubChunk[]
|
||||
* @phpstan-return \SplFixedArray<SubChunk>
|
||||
* @return SubChunk[]
|
||||
* @phpstan-return array<int, SubChunk>
|
||||
*/
|
||||
public function getSubChunks() : \SplFixedArray{
|
||||
return $this->subChunks;
|
||||
public function getSubChunks() : array{
|
||||
return $this->subChunks->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,7 +67,7 @@ final class FastChunkSerializer{
|
||||
|
||||
//subchunks
|
||||
$subChunks = $chunk->getSubChunks();
|
||||
$count = $subChunks->count();
|
||||
$count = count($subChunks);
|
||||
$stream->putByte($count);
|
||||
|
||||
foreach($subChunks as $y => $subChunk){
|
||||
|
Reference in New Issue
Block a user