Skip to content

Commit 43640c8

Browse files
committed
fix typing errors
1 parent 258942e commit 43640c8

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

monitor_controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ function monitorRenderAjaxStatusTooltip(array $host, string $size, string $links
11721172
</tr>
11731173
<tr>
11741174
<td>' . __('Availability:', 'monitor') . '</td>
1175-
<td>' . round($host['availability'], 2) . ' %</td>
1175+
<td>' . round((float) $host['availability'], 2) . ' %</td>
11761176
</tr>' . ($host['snmp_version'] > 0 && ($host['status'] == 3 || $host['status'] == 2) ? '
11771177
<tr>
11781178
<td>' . __('Agent Uptime:', 'monitor') . '</td>

poller_functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ function monitorAddEmails(array &$reboot_emails, array $alert_emails, int|string
5353
*
5454
* @return void
5555
*/
56-
function monitorAddNotificationList(array &$reboot_emails, int|string $notify_list, int|string $host_id, array $notification_lists): void
56+
function monitorAddNotificationList(array &$reboot_emails, int|string|null $notify_list, int|string $host_id, array $notification_lists): void
5757
{
58-
if ($notify_list > 0 && isset($notification_lists[$notify_list])) {
58+
if ($notify_list !== null && $notify_list > 0 && isset($notification_lists[$notify_list])) {
5959
$emails = explode(',', $notification_lists[$notify_list]);
6060
monitorAddEmails($reboot_emails, $emails, $host_id);
6161
}

sonar-project.properties

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sonar.projectKey=plugin_monitor
2+
sonar.sources=.
3+
sonar.exclusions=vendor/**
4+
5+
# php:S4833 - "Use namespaces instead of include/require"
6+
# This is a Cacti plugin with a required procedural architecture.
7+
# Namespaces cannot be used; include_once is the correct and only mechanism.
8+
sonar.issue.ignore.multicriteria=e1
9+
sonar.issue.ignore.multicriteria.e1.ruleKey=php:S4833
10+
sonar.issue.ignore.multicriteria.e1.resourceKey=**/*.php

0 commit comments

Comments
 (0)