From 5fbc842f7abdd02345d8cecd632c4d526453bb44 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 6 Sep 2020 16:18:47 +0100 Subject: [PATCH] LightArray: do not accept NULL in the constructor it makes more sense to pass LightArray::ZERO or just use LightArray::fill(0) if a zeroed light array is desired. --- src/world/format/LightArray.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/world/format/LightArray.php b/src/world/format/LightArray.php index 8752e8494..38137b920 100644 --- a/src/world/format/LightArray.php +++ b/src/world/format/LightArray.php @@ -45,12 +45,12 @@ final class LightArray{ /** @var string */ private $data; - public function __construct(?string $payload){ - if($payload !== null and ($len = strlen($payload)) !== 2048){ + public function __construct(string $payload){ + if(($len = strlen($payload)) !== 2048){ throw new \InvalidArgumentException("Payload size must be 2048 bytes, but got $len bytes"); } - $this->data = $payload ?? self::ZERO; + $this->data = $payload; $this->collectGarbage(); }