diff --git a/app/Actions/Device/SetDeviceAvailability.php b/app/Actions/Device/SetDeviceAvailability.php index 85200c871b..37c238df57 100644 --- a/app/Actions/Device/SetDeviceAvailability.php +++ b/app/Actions/Device/SetDeviceAvailability.php @@ -21,7 +21,7 @@ public function execute(Device $device, array $results): bool $connectivity = new ConnectivityHelper($device); // Determine which sources are currently enabled on this device - $enabled = collect(['icmp', 'snmp'])->filter(fn($source) => $connectivity->{"{$source}IsEnabled"}()); + $enabled = collect(['icmp', 'snmp'])->filter(fn ($source) => $connectivity->{"{$source}IsEnabled"}()); // Normalize keys: AvailabilitySource enum values or plain strings $checked = collect($results)->mapWithKeys(function ($passed, $source) { @@ -31,11 +31,11 @@ public function execute(Device $device, array $results): bool }); // Previously failing sources that weren't checked this run are still considered failing - $previously_failed = collect(explode(',', (string) $device->status_reason))->map(fn($s) => trim($s))->filter(); + $previously_failed = collect(explode(',', (string) $device->status_reason))->map(fn ($s) => trim($s))->filter(); $unchecked_failures = $previously_failed->diff($checked->keys()); // A source is failing if it failed in this run, or was previously failing and wasn't re-checked - $failing = $checked->filter(fn($passed) => ! $passed)->keys()->merge($unchecked_failures); + $failing = $checked->filter(fn ($passed) => ! $passed)->keys()->merge($unchecked_failures); // Only report failures for sources that are currently enabled $failed_sources = $failing->intersect($enabled)->sort()->values();