mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 04:45:12 +00:00
added SplFixedArray generics for phpstan 0.12.9
This commit is contained in:
parent
32d6ea0fba
commit
3f7e7352fb
@ -391,6 +391,7 @@ class BlockFactory{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
|
* @phpstan-return \SplFixedArray<Block>
|
||||||
*/
|
*/
|
||||||
public static function getBlockStatesArray() : \SplFixedArray{
|
public static function getBlockStatesArray() : \SplFixedArray{
|
||||||
return self::$fullList;
|
return self::$fullList;
|
||||||
|
@ -46,7 +46,10 @@ abstract class BaseInventory implements Inventory{
|
|||||||
protected $name;
|
protected $name;
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $title;
|
protected $title;
|
||||||
/** @var \SplFixedArray|(Item|null)[] */
|
/**
|
||||||
|
* @var \SplFixedArray|(Item|null)[]
|
||||||
|
* @phpstan-var \SplFixedArray<Item|null>
|
||||||
|
*/
|
||||||
protected $slots;
|
protected $slots;
|
||||||
/** @var Player[] */
|
/** @var Player[] */
|
||||||
protected $viewers = [];
|
protected $viewers = [];
|
||||||
|
@ -43,7 +43,10 @@ use function trim;
|
|||||||
*/
|
*/
|
||||||
class ItemFactory{
|
class ItemFactory{
|
||||||
|
|
||||||
/** @var \SplFixedArray */
|
/**
|
||||||
|
* @var \SplFixedArray
|
||||||
|
* @phpstan-var \SplFixedArray<Item>
|
||||||
|
*/
|
||||||
private static $list = null;
|
private static $list = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,7 +94,10 @@ class Enchantment{
|
|||||||
public const SLOT_ELYTRA = 0x4000;
|
public const SLOT_ELYTRA = 0x4000;
|
||||||
public const SLOT_TRIDENT = 0x8000;
|
public const SLOT_TRIDENT = 0x8000;
|
||||||
|
|
||||||
/** @var \SplFixedArray|Enchantment[] */
|
/**
|
||||||
|
* @var \SplFixedArray|Enchantment[]
|
||||||
|
* @phpstan-var \SplFixedArray<Enchantment>
|
||||||
|
*/
|
||||||
protected static $enchantments;
|
protected static $enchantments;
|
||||||
|
|
||||||
public static function init() : void{
|
public static function init() : void{
|
||||||
|
@ -25,7 +25,10 @@ namespace pocketmine\item\enchantment;
|
|||||||
|
|
||||||
class EnchantmentList{
|
class EnchantmentList{
|
||||||
|
|
||||||
/** @var \SplFixedArray|EnchantmentEntry[] */
|
/**
|
||||||
|
* @var \SplFixedArray|EnchantmentEntry[]
|
||||||
|
* @phpstan-var \SplFixedArray<EnchantmentEntry>
|
||||||
|
*/
|
||||||
private $enchantments;
|
private $enchantments;
|
||||||
|
|
||||||
public function __construct(int $size){
|
public function __construct(int $size){
|
||||||
|
@ -247,7 +247,10 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
/** @var Vector3 */
|
/** @var Vector3 */
|
||||||
private $temporalVector;
|
private $temporalVector;
|
||||||
|
|
||||||
/** @var \SplFixedArray */
|
/**
|
||||||
|
* @var \SplFixedArray
|
||||||
|
* @phpstan-var \SplFixedArray<Block>
|
||||||
|
*/
|
||||||
private $blockStates;
|
private $blockStates;
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
@ -1038,6 +1041,9 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
unset($this->chunkCache[Level::chunkHash($chunkX, $chunkZ)]);
|
unset($this->chunkCache[Level::chunkHash($chunkX, $chunkZ)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @phpstan-return \SplFixedArray<Block>
|
||||||
|
*/
|
||||||
public function getRandomTickedBlocks() : \SplFixedArray{
|
public function getRandomTickedBlocks() : \SplFixedArray{
|
||||||
return $this->randomTickBlocks;
|
return $this->randomTickBlocks;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,10 @@ abstract class Biome{
|
|||||||
|
|
||||||
public const MAX_BIOMES = 256;
|
public const MAX_BIOMES = 256;
|
||||||
|
|
||||||
/** @var Biome[]|\SplFixedArray */
|
/**
|
||||||
|
* @var Biome[]|\SplFixedArray
|
||||||
|
* @phpstan-var \SplFixedArray<Biome>
|
||||||
|
*/
|
||||||
private static $biomes;
|
private static $biomes;
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
|
@ -72,7 +72,10 @@ class Chunk{
|
|||||||
/** @var int */
|
/** @var int */
|
||||||
protected $height = Chunk::MAX_SUBCHUNKS;
|
protected $height = Chunk::MAX_SUBCHUNKS;
|
||||||
|
|
||||||
/** @var \SplFixedArray|SubChunkInterface[] */
|
/**
|
||||||
|
* @var \SplFixedArray|SubChunkInterface[]
|
||||||
|
* @phpstan-var \SplFixedArray<SubChunkInterface>
|
||||||
|
*/
|
||||||
protected $subChunks;
|
protected $subChunks;
|
||||||
|
|
||||||
/** @var EmptySubChunk */
|
/** @var EmptySubChunk */
|
||||||
@ -86,7 +89,10 @@ class Chunk{
|
|||||||
/** @var Entity[] */
|
/** @var Entity[] */
|
||||||
protected $entities = [];
|
protected $entities = [];
|
||||||
|
|
||||||
/** @var \SplFixedArray|int[] */
|
/**
|
||||||
|
* @var \SplFixedArray|int[]
|
||||||
|
* @phpstan-var \SplFixedArray<int>
|
||||||
|
*/
|
||||||
protected $heightMap;
|
protected $heightMap;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
@ -784,6 +790,7 @@ class Chunk{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \SplFixedArray|SubChunkInterface[]
|
* @return \SplFixedArray|SubChunkInterface[]
|
||||||
|
* @phpstan-return \SplFixedArray<SubChunkInterface>
|
||||||
*/
|
*/
|
||||||
public function getSubChunks() : \SplFixedArray{
|
public function getSubChunks() : \SplFixedArray{
|
||||||
return $this->subChunks;
|
return $this->subChunks;
|
||||||
|
@ -34,7 +34,10 @@ abstract class BiomeSelector{
|
|||||||
/** @var Simplex */
|
/** @var Simplex */
|
||||||
private $rainfall;
|
private $rainfall;
|
||||||
|
|
||||||
/** @var Biome[]|\SplFixedArray */
|
/**
|
||||||
|
* @var Biome[]|\SplFixedArray
|
||||||
|
* @phpstan-var \SplFixedArray<Biome>
|
||||||
|
*/
|
||||||
private $map = null;
|
private $map = null;
|
||||||
|
|
||||||
public function __construct(Random $random){
|
public function __construct(Random $random){
|
||||||
|
@ -247,6 +247,10 @@ abstract class Noise{
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \SplFixedArray|float[]
|
||||||
|
* @phpstan-return \SplFixedArray<float>
|
||||||
|
*/
|
||||||
public function getFastNoise1D(int $xSize, int $samplingRate, int $x, int $y, int $z) : \SplFixedArray{
|
public function getFastNoise1D(int $xSize, int $samplingRate, int $x, int $y, int $z) : \SplFixedArray{
|
||||||
if($samplingRate === 0){
|
if($samplingRate === 0){
|
||||||
throw new \InvalidArgumentException("samplingRate cannot be 0");
|
throw new \InvalidArgumentException("samplingRate cannot be 0");
|
||||||
@ -271,6 +275,10 @@ abstract class Noise{
|
|||||||
return $noiseArray;
|
return $noiseArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \SplFixedArray|float[][]
|
||||||
|
* @phpstan-return \SplFixedArray<\SplFixedArray<float>>
|
||||||
|
*/
|
||||||
public function getFastNoise2D(int $xSize, int $zSize, int $samplingRate, int $x, int $y, int $z) : \SplFixedArray{
|
public function getFastNoise2D(int $xSize, int $zSize, int $samplingRate, int $x, int $y, int $z) : \SplFixedArray{
|
||||||
assert($samplingRate !== 0, new \InvalidArgumentException("samplingRate cannot be 0"));
|
assert($samplingRate !== 0, new \InvalidArgumentException("samplingRate cannot be 0"));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user