1 | <?php |
||
2 | |||
3 | namespace ProtoneMedia\ApiHealth\Checkers; |
||
4 | |||
5 | trait SendsNotifications |
||
6 | { |
||
7 | /** |
||
8 | * Number of minutes until send the failed notification again. |
||
9 | * |
||
10 | * @var int |
||
11 | */ |
||
12 | protected $resendFailedNotificationAfterMinutes; |
||
13 | |||
14 | /** |
||
15 | * Class name of the failed notification. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $failedNotificationClass; |
||
20 | |||
21 | /** |
||
22 | * Class name of the recovered notification. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $recoveredNotificationClass; |
||
27 | |||
28 | /** |
||
29 | * Number of minutes until send the failed notification again. |
||
30 | * |
||
31 | * @return int |
||
32 | */ |
||
33 | public function resendFailedNotificationAfterMinutes(): int |
||
34 | { |
||
35 | return !is_null($this->resendFailedNotificationAfterMinutes) ? $this->resendFailedNotificationAfterMinutes : config('api-health.notifications.resend_failed_notification_after_minutes'); |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Class name of the failed notification. |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | public function failedNotificationClass(): string |
||
44 | { |
||
45 | return $this->failedNotificationClass ?: config('api-health.notifications.default_failed_notification'); |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * Class name of the recovered notification. |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | public function recoveredNotificationClass(): string |
||
54 | { |
||
55 | return $this->recoveredNotificationClass ?: config('api-health.notifications.default_recovered_notification'); |
||
56 | } |
||
57 | } |
||
58 |