Skip to content

Commit

Permalink
remove 'smml' property when null
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Oct 5, 2024
1 parent b88a5b2 commit 5f08bf5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/LitCalFeedItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use LiturgicalCalendar\AlexaNewsBrief\Festivity;

class LitCalFeedItem
class LitCalFeedItem implements \JsonSerializable
{
public string $uid;
public string $titleText;
Expand All @@ -24,4 +24,12 @@ public function __construct(string $key, Festivity $festivity, \DateTime $publis
$this->mainText = $mainText;
$this->redirectionUrl = "https://litcal.johnromanodorazio.com/";
}

public function jsonSerialize(): array
{
if (null === $this->smml) {
unset($this->smml);
}
return get_object_vars($this);
}
}

0 comments on commit 5f08bf5

Please sign in to comment.