mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
Noise: give PHPStan some help understanding SplFixedArray
This commit is contained in:
parent
4d9b97d2bb
commit
74cb0be868
@ -208,6 +208,7 @@ abstract class Noise{
|
||||
throw new \InvalidArgumentException("xSize % samplingRate must return 0");
|
||||
}
|
||||
|
||||
/** @phpstan-var \SplFixedArray<float> $noiseArray */
|
||||
$noiseArray = new \SplFixedArray($xSize + 1);
|
||||
|
||||
for($xx = 0; $xx <= $xSize; $xx += $samplingRate){
|
||||
@ -240,6 +241,7 @@ abstract class Noise{
|
||||
assert($xSize % $samplingRate === 0, new \InvalidArgumentException("xSize % samplingRate must return 0"));
|
||||
assert($zSize % $samplingRate === 0, new \InvalidArgumentException("zSize % samplingRate must return 0"));
|
||||
|
||||
/** @phpstan-var \SplFixedArray<\SplFixedArray<float>> $noiseArray */
|
||||
$noiseArray = new \SplFixedArray($xSize + 1);
|
||||
|
||||
for($xx = 0; $xx <= $xSize; $xx += $samplingRate){
|
||||
|
@ -1070,6 +1070,21 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/world/generator/hell/Nether.php
|
||||
|
||||
-
|
||||
message: "#^Offset int does not exist on SplFixedArray\\<float\\>\\|null\\.$#"
|
||||
count: 4
|
||||
path: ../../../src/world/generator/noise/Noise.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\$q0 of static method pocketmine\\\\world\\\\generator\\\\noise\\\\Noise\\:\\:linearLerp\\(\\) expects float, float\\|null given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/world/generator/noise/Noise.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\$q1 of static method pocketmine\\\\world\\\\generator\\\\noise\\\\Noise\\:\\:linearLerp\\(\\) expects float, float\\|null given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/world/generator/noise/Noise.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method getBiomeId\\(\\) on pocketmine\\\\world\\\\format\\\\Chunk\\|null\\.$#"
|
||||
count: 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user