Clean up entity and tile saveID handling

we only ever need the first entry, so there's no point storing all of them. In addition, the field is private, which guarantees that nothing else needs the array either.
This also fixes phpstan/phpstan@c50650c5dd.
This commit is contained in:
Dylan K. Taylor
2020-11-12 21:49:12 +00:00
parent 574b7f6343
commit e30b1ee2c7
4 changed files with 18 additions and 22 deletions

View File

@ -185,11 +185,6 @@ parameters:
count: 1
path: ../../../src/pocketmine/entity/Effect.php
-
message: "#^Method pocketmine\\\\entity\\\\Entity\\:\\:getSaveId\\(\\) should return string but returns mixed\\.$#"
count: 1
path: ../../../src/pocketmine/entity/Entity.php
-
message: "#^Cannot cast mixed to int\\.$#"
count: 2
@ -560,11 +555,6 @@ parameters:
count: 1
path: ../../../src/pocketmine/scheduler/AsyncTask.php
-
message: "#^Method pocketmine\\\\tile\\\\Tile\\:\\:getSaveId\\(\\) should return string but returns mixed\\.$#"
count: 1
path: ../../../src/pocketmine/tile/Tile.php
-
message: "#^Parameter \\#2 \\$timestamp of function date expects int, mixed given\\.$#"
count: 1

View File

@ -390,6 +390,11 @@ parameters:
count: 1
path: ../../../src/pocketmine/command/defaults/TimingsCommand.php
-
message: "#^Array \\(array\\<class\\-string\\<pocketmine\\\\entity\\\\Entity\\>, string\\>\\) does not accept string\\|false\\.$#"
count: 1
path: ../../../src/pocketmine/entity/Entity.php
-
message: "#^Parameter \\#1 \\$index of method pocketmine\\\\inventory\\\\BaseInventory\\:\\:setItem\\(\\) expects int, int\\|string given\\.$#"
count: 1
@ -985,6 +990,11 @@ parameters:
count: 3
path: ../../../src/pocketmine/tile/Spawnable.php
-
message: "#^Array \\(array\\<class\\-string\\<pocketmine\\\\tile\\\\Tile\\>, string\\>\\) does not accept string\\|false\\.$#"
count: 1
path: ../../../src/pocketmine/tile/Tile.php
-
message: "#^Parameter \\#2 \\$value of method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:setInt\\(\\) expects int, float\\|int given\\.$#"
count: 3