Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array map require array #3497

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions core/classes/Events/DiscordWebhookBuilder.php
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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');
Expand Down