Fixed build

This commit is contained in:
Dylan K. Taylor 2025-01-06 23:01:14 +00:00
parent 0358b7dce4
commit 357dfb5c7e
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
4 changed files with 8 additions and 8 deletions

View File

@ -506,8 +506,8 @@ class Config{
} }
/** /**
* @param string[] $entries * @param string[]|int[] $entries
* @phpstan-param list<string> $entries * @phpstan-param list<int|string> $entries
*/ */
public static function writeList(array $entries) : string{ public static function writeList(array $entries) : string{
return implode("\n", $entries); return implode("\n", $entries);
@ -515,11 +515,11 @@ class Config{
/** /**
* @param string[]|int[]|float[]|bool[] $config * @param string[]|int[]|float[]|bool[] $config
* @phpstan-param array<string, string|int|float|bool> $config * @phpstan-param array<int|string, string|int|float|bool> $config
*/ */
public static function writeProperties(array $config) : string{ public static function writeProperties(array $config) : string{
$content = "#Properties Config file\r\n#" . date("D M j H:i:s T Y") . "\r\n"; $content = "#Properties Config file\r\n#" . date("D M j H:i:s T Y") . "\r\n";
foreach(Utils::stringifyKeys($config) as $k => $v){ foreach(Utils::promoteKeys($config) as $k => $v){
if(is_bool($v)){ if(is_bool($v)){
$v = $v ? "on" : "off"; $v = $v ? "on" : "off";
} }
@ -531,7 +531,7 @@ class Config{
/** /**
* @return string[]|int[]|float[]|bool[] * @return string[]|int[]|float[]|bool[]
* @phpstan-return array<string, string|int|float|bool> * @phpstan-return array<int|string, string|int|float|bool>
*/ */
public static function parseProperties(string $content) : array{ public static function parseProperties(string $content) : array{
$result = []; $result = [];

View File

@ -1364,7 +1364,7 @@ class World implements ChunkManager{
* TODO: phpstan can't infer these types yet :( * TODO: phpstan can't infer these types yet :(
* @phpstan-var array<int, LightArray> $blockLight * @phpstan-var array<int, LightArray> $blockLight
* @phpstan-var array<int, LightArray> $skyLight * @phpstan-var array<int, LightArray> $skyLight
* @phpstan-var array<int, int> $heightMap * @phpstan-var non-empty-list<int> $heightMap
*/ */
if($this->unloaded || ($chunk = $this->getChunk($chunkX, $chunkZ)) === null || $chunk->isLightPopulated() === true){ if($this->unloaded || ($chunk = $this->getChunk($chunkX, $chunkZ)) === null || $chunk->isLightPopulated() === true){
return; return;

View File

@ -791,7 +791,7 @@ parameters:
path: ../../../src/utils/Config.php path: ../../../src/utils/Config.php
- -
message: "#^Parameter \\#1 \\$config of static method pocketmine\\\\utils\\\\Config\\:\\:writeProperties\\(\\) expects array\\<string, bool\\|float\\|int\\|string\\>, array\\<string, mixed\\> given\\.$#" message: "#^Parameter \\#1 \\$config of static method pocketmine\\\\utils\\\\Config\\:\\:writeProperties\\(\\) expects array\\<int\\|string, bool\\|float\\|int\\|string\\>, array\\<int\\|string, mixed\\> given\\.$#"
count: 1 count: 1
path: ../../../src/utils/Config.php path: ../../../src/utils/Config.php

View File

@ -16,7 +16,7 @@ parameters:
path: ../../../src/world/format/Chunk.php path: ../../../src/world/format/Chunk.php
- -
message: "#^Method pocketmine\\\\world\\\\format\\\\HeightArray\\:\\:getValues\\(\\) should return array\\<int, int\\> but returns array\\<int, int\\|null\\>\\.$#" message: "#^Method pocketmine\\\\world\\\\format\\\\HeightArray\\:\\:getValues\\(\\) should return non\\-empty\\-array\\<int, int\\> but returns array\\<int, int\\|null\\>\\.$#"
count: 1 count: 1
path: ../../../src/world/format/HeightArray.php path: ../../../src/world/format/HeightArray.php