diff --git a/src/block/tile/Barrel.php b/src/block/tile/Barrel.php index ae8d6dfa8..5b71f00f0 100644 --- a/src/block/tile/Barrel.php +++ b/src/block/tile/Barrel.php @@ -53,7 +53,6 @@ class Barrel extends Spawnable implements Container, Nameable{ public function close() : void{ if(!$this->closed){ $this->inventory->removeAllViewers(); - $this->inventory = null; parent::close(); } } diff --git a/src/block/tile/BrewingStand.php b/src/block/tile/BrewingStand.php index f10c47f79..bccc10a27 100644 --- a/src/block/tile/BrewingStand.php +++ b/src/block/tile/BrewingStand.php @@ -90,7 +90,6 @@ class BrewingStand extends Spawnable implements Container, Nameable{ public function close() : void{ if(!$this->closed){ $this->inventory->removeAllViewers(); - $this->inventory = null; parent::close(); } diff --git a/src/block/tile/Chest.php b/src/block/tile/Chest.php index 40ba79cd5..f7c9b765c 100644 --- a/src/block/tile/Chest.php +++ b/src/block/tile/Chest.php @@ -108,8 +108,6 @@ class Chest extends Spawnable implements Container, Nameable{ $this->doubleInventory = null; } - $this->inventory = null; - parent::close(); } } diff --git a/src/block/tile/Furnace.php b/src/block/tile/Furnace.php index 756e23ff9..83f7ff1d8 100644 --- a/src/block/tile/Furnace.php +++ b/src/block/tile/Furnace.php @@ -98,7 +98,6 @@ class Furnace extends Spawnable implements Container, Nameable{ public function close() : void{ if(!$this->closed){ $this->inventory->removeAllViewers(); - $this->inventory = null; parent::close(); } diff --git a/src/block/tile/Hopper.php b/src/block/tile/Hopper.php index 6a0988dcf..fe1501c15 100644 --- a/src/block/tile/Hopper.php +++ b/src/block/tile/Hopper.php @@ -63,7 +63,6 @@ class Hopper extends Spawnable implements Container, Nameable{ public function close() : void{ if(!$this->closed){ $this->inventory->removeAllViewers(); - $this->inventory = null; parent::close(); } diff --git a/src/block/tile/Tile.php b/src/block/tile/Tile.php index 59406a74a..368c2f28b 100644 --- a/src/block/tile/Tile.php +++ b/src/block/tile/Tile.php @@ -134,7 +134,6 @@ abstract class Tile{ if($this->pos->isValid()){ $this->pos->getWorld()->removeTile($this); } - $this->pos = null; } } } diff --git a/src/entity/Entity.php b/src/entity/Entity.php index a020c56d6..d123fd446 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -1587,7 +1587,6 @@ abstract class Entity{ * It is expected that the object is unusable after this is called. */ protected function destroyCycles() : void{ - $this->location = null; $this->lastDamageCause = null; } diff --git a/src/world/World.php b/src/world/World.php index 4bdcb7e40..0f613fe03 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -521,7 +521,6 @@ class World implements ChunkManager{ $this->unregisterGenerator(); $this->provider->close(); - $this->provider = null; $this->blockCache = []; $this->unloaded = true; diff --git a/tests/phpstan/configs/gc-hacks.neon b/tests/phpstan/configs/gc-hacks.neon index adf69ad5d..4e854c21b 100644 --- a/tests/phpstan/configs/gc-hacks.neon +++ b/tests/phpstan/configs/gc-hacks.neon @@ -1,40 +1,5 @@ parameters: ignoreErrors: - - - message: "#^Property pocketmine\\\\block\\\\tile\\\\Barrel\\:\\:\\$inventory \\(pocketmine\\\\block\\\\inventory\\\\BarrelInventory\\) does not accept null\\.$#" - count: 1 - path: ../../../src/block/tile/Barrel.php - - - - message: "#^Property pocketmine\\\\block\\\\tile\\\\BrewingStand\\:\\:\\$inventory \\(pocketmine\\\\block\\\\inventory\\\\BrewingStandInventory\\) does not accept null\\.$#" - count: 1 - path: ../../../src/block/tile/BrewingStand.php - - - - message: "#^Property pocketmine\\\\block\\\\tile\\\\Chest\\:\\:\\$inventory \\(pocketmine\\\\block\\\\inventory\\\\ChestInventory\\) does not accept null\\.$#" - count: 1 - path: ../../../src/block/tile/Chest.php - - - - message: "#^Property pocketmine\\\\block\\\\tile\\\\Furnace\\:\\:\\$inventory \\(pocketmine\\\\block\\\\inventory\\\\FurnaceInventory\\) does not accept null\\.$#" - count: 1 - path: ../../../src/block/tile/Furnace.php - - - - message: "#^Property pocketmine\\\\block\\\\tile\\\\Hopper\\:\\:\\$inventory \\(pocketmine\\\\block\\\\inventory\\\\HopperInventory\\) does not accept null\\.$#" - count: 1 - path: ../../../src/block/tile/Hopper.php - - - - message: "#^Property pocketmine\\\\block\\\\tile\\\\Tile\\:\\:\\$pos \\(pocketmine\\\\world\\\\Position\\) does not accept null\\.$#" - count: 1 - path: ../../../src/block/tile/Tile.php - - - - message: "#^Property pocketmine\\\\entity\\\\Entity\\:\\:\\$location \\(pocketmine\\\\entity\\\\Location\\) does not accept null\\.$#" - count: 1 - path: ../../../src/entity/Entity.php - - message: "#^Property pocketmine\\\\entity\\\\Human\\:\\:\\$enderInventory \\(pocketmine\\\\inventory\\\\PlayerEnderInventory\\) does not accept null\\.$#" count: 1 @@ -80,8 +45,3 @@ parameters: count: 1 path: ../../../src/player/Player.php - - - message: "#^Property pocketmine\\\\world\\\\World\\:\\:\\$provider \\(pocketmine\\\\world\\\\format\\\\io\\\\WritableWorldProvider\\) does not accept null\\.$#" - count: 1 - path: ../../../src/world/World.php -