From b57f0a2b7e0d15474d2c0cb489c8ecc636b7ed68 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 6 Jun 2022 17:23:10 +0100 Subject: [PATCH] Fixed uninitialized typed properties --- src/inventory/transaction/CraftingTransaction.php | 4 ++-- src/thread/CommonThreadPartsTrait.php | 2 +- src/world/utils/SubChunkExplorer.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/inventory/transaction/CraftingTransaction.php b/src/inventory/transaction/CraftingTransaction.php index c7f71723f..5a36061f7 100644 --- a/src/inventory/transaction/CraftingTransaction.php +++ b/src/inventory/transaction/CraftingTransaction.php @@ -48,8 +48,8 @@ use function intdiv; * results, with no remainder. Any leftovers are expected to be emitted back to the crafting grid. */ class CraftingTransaction extends InventoryTransaction{ - protected ?CraftingRecipe $recipe; - protected ?int $repetitions; + protected ?CraftingRecipe $recipe = null; + protected ?int $repetitions = null; /** @var Item[] */ protected array $inputs = []; diff --git a/src/thread/CommonThreadPartsTrait.php b/src/thread/CommonThreadPartsTrait.php index 8085cf8d6..283d4ea39 100644 --- a/src/thread/CommonThreadPartsTrait.php +++ b/src/thread/CommonThreadPartsTrait.php @@ -30,7 +30,7 @@ use function error_reporting; trait CommonThreadPartsTrait{ /** @var \Threaded|\ClassLoader[]|null */ private ?\Threaded $classLoaders = null; - protected ?string $composerAutoloaderPath; + protected ?string $composerAutoloaderPath = null; protected bool $isKilled = false; diff --git a/src/world/utils/SubChunkExplorer.php b/src/world/utils/SubChunkExplorer.php index d4275e951..97ba3cff5 100644 --- a/src/world/utils/SubChunkExplorer.php +++ b/src/world/utils/SubChunkExplorer.php @@ -28,8 +28,8 @@ use pocketmine\world\format\Chunk; use pocketmine\world\format\SubChunk; class SubChunkExplorer{ - public ?Chunk $currentChunk; - public ?SubChunk $currentSubChunk; + public ?Chunk $currentChunk = null; + public ?SubChunk $currentSubChunk = null; protected int $currentX; protected int $currentY;