mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 01:51:51 +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");
|
throw new \InvalidArgumentException("xSize % samplingRate must return 0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @phpstan-var \SplFixedArray<float> $noiseArray */
|
||||||
$noiseArray = new \SplFixedArray($xSize + 1);
|
$noiseArray = new \SplFixedArray($xSize + 1);
|
||||||
|
|
||||||
for($xx = 0; $xx <= $xSize; $xx += $samplingRate){
|
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($xSize % $samplingRate === 0, new \InvalidArgumentException("xSize % samplingRate must return 0"));
|
||||||
assert($zSize % $samplingRate === 0, new \InvalidArgumentException("zSize % 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);
|
$noiseArray = new \SplFixedArray($xSize + 1);
|
||||||
|
|
||||||
for($xx = 0; $xx <= $xSize; $xx += $samplingRate){
|
for($xx = 0; $xx <= $xSize; $xx += $samplingRate){
|
||||||
|
@ -1070,6 +1070,21 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../../src/world/generator/hell/Nether.php
|
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\\.$#"
|
message: "#^Cannot call method getBiomeId\\(\\) on pocketmine\\\\world\\\\format\\\\Chunk\\|null\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user