diff --git a/application/Espo/Core/Webhook/Manager.php b/application/Espo/Core/Webhook/Manager.php index 3216dd4528..9338f46dff 100644 --- a/application/Espo/Core/Webhook/Manager.php +++ b/application/Espo/Core/Webhook/Manager.php @@ -48,10 +48,19 @@ use Espo\Entities\{ */ class Manager { + /** + * @var string + */ private $cacheKey = 'webhooks'; + /** + * @var string[] + */ protected $skipAttributeList = ['isFollowed', 'modifiedAt', 'modifiedBy']; + /** + * @var ?array + */ private $data = null; private $config; @@ -102,6 +111,9 @@ class Manager $this->dataCache->store($this->cacheKey, $this->data); } + /** + * @return array + */ private function buildData(): array { $data = []; diff --git a/application/Espo/Core/Webhook/Queue.php b/application/Espo/Core/Webhook/Queue.php index d6ae8ac0fa..b877a7f13b 100644 --- a/application/Espo/Core/Webhook/Queue.php +++ b/application/Espo/Core/Webhook/Queue.php @@ -248,6 +248,9 @@ class Queue $this->send($webhook, $dataList, $actualItemList); } + /** + * @param string[] $forbiddenAttributeList + */ private function prepareItemData(WebhookQueueItem $item, ?User $user, array $forbiddenAttributeList): ?stdClass { $targetType = $item->get('targetType'); @@ -285,6 +288,10 @@ class Queue return $data; } + /** + * @param mixed[] $dataList + * @param WebhookQueueItem[] $itemList + */ private function send(Webhook $webhook, array $dataList, array $itemList): void { try { @@ -324,6 +331,9 @@ class Queue $this->log->debug("Webhook Queue: Webhook '" . $webhook->getId() . "' sent, response code: {$code}."); } + /** + * @param WebhookQueueItem[] $itemList + */ protected function failQueueItemList(array $itemList, bool $force = false): void { foreach ($itemList as $item) { @@ -331,6 +341,9 @@ class Queue } } + /** + * @param WebhookQueueItem[] $itemList + */ protected function succeedQueueItemList(array $itemList): void { foreach ($itemList as $item) { diff --git a/application/Espo/Core/Webhook/Sender.php b/application/Espo/Core/Webhook/Sender.php index aee4a5594a..6c8ae93b0f 100644 --- a/application/Espo/Core/Webhook/Sender.php +++ b/application/Espo/Core/Webhook/Sender.php @@ -44,13 +44,16 @@ class Sender private const TIMEOUT = 10; - private $config; + private Config $config; public function __construct(Config $config) { $this->config = $config; } + /** + * @param array $dataList + */ public function send(Webhook $webhook, array $dataList): int { $payload = json_encode($dataList);