LibreNMS/Alert/Transport/Victorops.php
Avoid unused local variables such as '$fault'. Open
Open
foreach ($alert_data['faults'] as $fault => $data) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Visibility must be declared on property "$protocol" Open
Open
$protocol['message_type'] = match ($alert_data['state']) {
- Exclude checks
Visibility must be declared on property "$res" Open
Open
$res = Http::client()->post($url, $protocol);
- Exclude checks
There must not be more than one property declared per statement Open
Open
public function deliverAlert(array $alert_data): bool
- Exclude checks
There must not be more than one property declared per statement Open
Open
$protocol['message_type'] = match ($alert_data['state']) {
- Exclude checks
There must not be more than one property declared per statement Open
Open
$res = Http::client()->post($url, $protocol);
- Exclude checks
Visibility must be declared on property "$protocol" Open
Open
$protocol = [
- Exclude checks
Possible parse error: non-abstract method defined as abstract Open
Open
public function deliverAlert(array $alert_data): bool
- Exclude checks
There must not be more than one property declared per statement Open
Open
$protocol = [
- Exclude checks
Visibility must be declared on property "$res" Open
Open
if ($res->successful()) {
- Exclude checks
There must not be more than one property declared per statement Open
Open
throw new AlertTransportDeliveryException($alert_data, $res->status(), $res->body(), $alert_data['msg'], $protocol);
- Exclude checks
There must not be more than one property declared per statement Open
Open
foreach ($alert_data['faults'] as $fault => $data) {
- Exclude checks
Visibility must be declared on property "$alert_data" Open
Open
foreach ($alert_data['faults'] as $fault => $data) {
- Exclude checks
Visibility must be declared on property "$alert_data" Open
Open
throw new AlertTransportDeliveryException($alert_data, $res->status(), $res->body(), $alert_data['msg'], $protocol);
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
default => match ($alert_data['severity']) {
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
Open
$protocol['state_message'] .= $data['string'];
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
Open
return true;
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
Open
return [
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
Open
foreach ($alert_data['faults'] as $fault => $data) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 16 Open
Open
default => 'CRITICAL',
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
Open
}
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
{
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
$protocol['message_type'] = match ($alert_data['state']) {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
Open
$res = Http::client()->post($url, $protocol);
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
Open
];
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
public static function configTemplate(): array
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
Open
if ($res->successful()) {
- Exclude checks