Skip to content

Commit

Permalink
Improving webhook entity types
Browse files Browse the repository at this point in the history
  • Loading branch information
escopecz committed Feb 8, 2024
1 parent 1ff2536 commit 4fac15a
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions app/bundles/WebhookBundle/Entity/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class Webhook extends FormEntity
public const LOGS_DISPLAY_LIMIT = 100;

/**
* @var int
* @var ?int
*/
private $id;

/**
* @var string
* @var ?string
*/
private $name;

Expand All @@ -35,7 +35,7 @@ class Webhook extends FormEntity
private $description;

/**
* @var string
* @var ?string
*/
private $webhookUrl;

Expand All @@ -45,17 +45,17 @@ class Webhook extends FormEntity
private $secret;

/**
* @var \Mautic\CategoryBundle\Entity\Category|null
* @var Category|null
**/
private $category;

/**
* @var ArrayCollection<int, \Mautic\WebhookBundle\Entity\Event>
* @var ArrayCollection<int, Event>
*/
private $events;

/**
* @var ArrayCollection<int, \Mautic\WebhookBundle\Entity\Log>
* @var ArrayCollection<int, Log>
*/
private $logs;

Expand Down Expand Up @@ -297,22 +297,24 @@ public function getCategory()
}

/**
* @return mixed
* @return ArrayCollection<int,Event>
*/
public function getEvents()
{
return $this->events;
}

/**
* @param ArrayCollection<int,Event> $events
*
* @return $this
*/
public function setEvents($events)
{
$this->isChanged('events', $events);

$this->events = $events;
/** @var \Mautic\WebhookBundle\Entity\Event $event */

foreach ($events as $event) {
$event->setWebhook($this);
}
Expand Down Expand Up @@ -421,15 +423,15 @@ public function getEventsOrderbyDir()
/**
* Get log entities.
*
* @return ArrayCollection
* @return ArrayCollection<int,Log>
*/
public function getLogs()
{
return $this->logs;
}

/**
* @return Collection<int, \Mautic\WebhookBundle\Entity\Log>
* @return Collection<int,Log>
*/
public function getLimitedLogs(): Collection
{
Expand All @@ -440,6 +442,8 @@ public function getLimitedLogs(): Collection
}

/**
* @param ArrayCollection<int,Log> $logs
*
* @return $this
*/
public function addLogs($logs)
Expand Down

0 comments on commit 4fac15a

Please sign in to comment.