From 52ad1154a2962dbba5b7a5a1e3772d6da38927e8 Mon Sep 17 00:00:00 2001 From: Partydragen Date: Sun, 24 Mar 2024 14:46:41 +0100 Subject: [PATCH] Array map require array --- core/classes/Events/DiscordWebhookBuilder.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/classes/Events/DiscordWebhookBuilder.php b/core/classes/Events/DiscordWebhookBuilder.php index 52a9b34245..2eacadd83b 100644 --- a/core/classes/Events/DiscordWebhookBuilder.php +++ b/core/classes/Events/DiscordWebhookBuilder.php @@ -13,7 +13,7 @@ class DiscordWebhookBuilder private ?string $_avatar_url = null; private ?string $_content = null; /** @var DiscordEmbed[] */ - private ?array $_embeds = null; + private ?array $_embeds = []; private function __construct() { @@ -75,10 +75,6 @@ public function getEmbeds(): ?array */ public function addEmbed(Closure $closure): self { - if ($this->_embeds === null) { - $this->_embeds = []; - } - $embed = $closure(new DiscordEmbed()); if (!($embed instanceof DiscordEmbed)) { throw new RuntimeException('Embed closure must return a DiscordEmbed instance');