2828/**
2929 * Add a host id to each recipient entry in the reboot recipient map.
3030 *
31- * @param array $reboot_emails Recipient map keyed by email, then host id.
32- * @param array $alert_emails List of raw email addresses.
33- * @param int $host_id Host id to associate with each recipient.
31+ * @param array $reboot_emails Recipient map keyed by email, then host id.
32+ * @param array $alert_emails List of raw email addresses.
33+ * @param int|string $host_id Host id to associate with each recipient.
3434 *
3535 * @return void
3636 */
37- function monitorAddEmails (array &$ reboot_emails , array $ alert_emails , int | string $ host_id ): void {
37+ function monitorAddEmails (array &$ reboot_emails , array $ alert_emails , mixd $ host_id ): void {
3838 if (cacti_sizeof ($ alert_emails )) {
3939 foreach ($ alert_emails as $ email ) {
4040 $ reboot_emails [trim (strtolower ($ email ))][$ host_id ] = $ host_id ;
@@ -45,14 +45,14 @@ function monitorAddEmails(array &$reboot_emails, array $alert_emails, int|string
4545/**
4646 * Add a host id to recipients coming from a notification list id.
4747 *
48- * @param array $reboot_emails Recipient map keyed by email, then host id.
49- * @param int $notify_list Notification list id.
50- * @param int $host_id Host id to add.
51- * @param array $notification_lists Map of list id to comma-delimited emails.
48+ * @param array $reboot_emails Recipient map keyed by email, then host id.
49+ * @param int|string|null $notify_list Notification list id.
50+ * @param int|string $host_id Host id to add.
51+ * @param array $notification_lists Map of list id to comma-delimited emails.
5252 *
5353 * @return void
5454 */
55- function monitorAddNotificationList (array &$ reboot_emails , int | string | null $ notify_list , int | string $ host_id , array $ notification_lists ): void {
55+ function monitorAddNotificationList (array &$ reboot_emails , mixed $ notify_list , mixed $ host_id , array $ notification_lists ): void {
5656 if ($ notify_list !== null && $ notify_list > 0 && isset ($ notification_lists [$ notify_list ])) {
5757 $ emails = explode (', ' , $ notification_lists [$ notify_list ]);
5858 monitorAddEmails ($ reboot_emails , $ emails , $ host_id );
@@ -130,14 +130,14 @@ function getNotificationListsMap(): array {
130130/**
131131 * Add reboot recipients based on host threshold notification settings.
132132 *
133- * @param array $reboot_emails Recipient map keyed by email, then host id.
134- * @param int $host_id Host id being processed.
135- * @param array $alert_emails Global alert email list.
136- * @param array $notification_lists Map of notification list id to emails.
133+ * @param array $reboot_emails Recipient map keyed by email, then host id.
134+ * @param int|string $host_id Host id being processed.
135+ * @param array $alert_emails Global alert email list.
136+ * @param array $notification_lists Map of notification list id to emails.
137137 *
138138 * @return void
139139 */
140- function addTholdRebootRecipients (array &$ reboot_emails , int | string $ host_id , array $ alert_emails , array $ notification_lists ): void {
140+ function addTholdRebootRecipients (array &$ reboot_emails , mixed $ host_id , array $ alert_emails , array $ notification_lists ): void {
141141 $ notify = db_fetch_row_prepared (
142142 'SELECT thold_send_email, thold_host_email
143143 FROM host
@@ -490,11 +490,11 @@ function normalizeAndLogNotificationHosts(array &$alert_hosts, array &$warn_host
490490/**
491491 * Build shared intro copy for ping threshold email and text output.
492492 *
493- * @param int $freq Resend frequency in minutes.
493+ * @param int|string $freq Resend frequency in minutes.
494494 *
495495 * @return array{string, string}
496496 */
497- function buildPingNotificationIntro (int | string $ freq ): array {
497+ function buildPingNotificationIntro (mixed $ freq ): array {
498498 $ body = '<h1> ' . __ (MONITOR_PING_NOTIFICATION_SUBJECT , 'monitor ' ) . '</h1> ' . PHP_EOL ;
499499 $ body_txt = __ (MONITOR_PING_NOTIFICATION_SUBJECT , 'monitor ' ) . PHP_EOL ;
500500
@@ -819,15 +819,15 @@ function addGroupedNotificationEntry(string $type, array $entry, array &$global_
819819/**
820820 * Query and group threshold-breached hosts for one severity type.
821821 *
822- * @param string $type Severity key (`alert` or `warn`).
823- * @param int $criticality Minimum criticality threshold.
824- * @param array $global_list Global grouped bucket, updated in place.
825- * @param array $notify_list Per-list grouped bucket, updated in place.
826- * @param array $lists Set of notification list ids, updated in place.
822+ * @param int| string $type Severity key (`alert` or `warn`).
823+ * @param int $criticality Minimum criticality threshold.
824+ * @param array $global_list Global grouped bucket, updated in place.
825+ * @param array $notify_list Per-list grouped bucket, updated in place.
826+ * @param array $lists Set of notification list ids, updated in place.
827827 *
828828 * @return void
829829 */
830- function getHostsByListType (string $ type , int | string $ criticality , array &$ global_list , array &$ notify_list , array &$ lists ): void {
830+ function getHostsByListType (string $ type , mixed $ criticality , array &$ global_list , array &$ notify_list , array &$ lists ): void {
831831 $ last_time = date (MONITOR_DATE_TIME_FORMAT , time () - read_config_option ('monitor_resend_frequency ' ) * 60 );
832832
833833 $ hosts = db_fetch_cell_prepared (
@@ -954,7 +954,7 @@ function flattenLists(array &$global_list, array &$notify_list): void {
954954 *
955955 * @return void
956956 */
957- function addEmailsToNotificationMap (array &$ notification_emails , array $ emails , string | int $ scope_key ): void {
957+ function addEmailsToNotificationMap (array &$ notification_emails , array $ emails , mixed $ scope_key ): void {
958958 foreach ($ emails as $ user ) {
959959 $ user = trim ($ user );
960960
0 commit comments