Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
murrant authored and StyleCIBot committed Nov 28, 2024
1 parent 6638e71 commit 8853b61
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions LibreNMS/Data/Source/Rrd.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function get(): array
if ($this->end) {
array_push($timeframe, '--end', $this->end);
}
foreach($this->xport as $def) {
foreach ($this->xport as $def) {
$this->options[] = "XPORT:$def";
}

Expand All @@ -45,15 +45,15 @@ public function get(): array
$timestamps = [];
$output = $proc->getOutput();
$error = $proc->getErrorOutput();
if($error) {
if ($error) {
throw new \Exception($error);
}

$data = new \SimpleXMLElement($output);
$current_timestamp = (int) $data->meta->start;
$step = (int) $data->meta->step;

foreach($data->data->row as $row) {
foreach ($data->data->row as $row) {
foreach ($this->xport as $index => $def) {
$value = (string) $row->v[$index];
$xport_data[$def][] = $value == 'NaN' ? null : Number::cast($value);
Expand Down
1 change: 0 additions & 1 deletion app/Filament/Pages/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class Dashboard extends \Filament\Pages\Dashboard
{

}
2 changes: 1 addition & 1 deletion app/Filament/Widgets/DeviceTypeCounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protected function getStats(): array
->select('type', DB::raw('count(*) total'))
->groupBy('type')
->get()
->map(fn($t) => Stat::make(Str::title($t->type ?: 'None'), $t->total))
->map(fn ($t) => Stat::make(Str::title($t->type ?: 'None'), $t->total))
->all();
}
}
6 changes: 3 additions & 3 deletions app/Filament/Widgets/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ protected function getData(): array
[
'label' => 'Out Bits/s',
'data' => $data['data']['out_bits'],
]
],
],
'labels' => array_map(fn($timestamp) => Date::createFromTimestamp($timestamp)->toDateTimeString(), $data['timestamps']),
'labels' => array_map(fn ($timestamp) => Date::createFromTimestamp($timestamp)->toDateTimeString(), $data['timestamps']),
];
}

Expand All @@ -43,7 +43,7 @@ protected function getType(): string
return 'line';
}

protected int | string | array $columnSpan = [
protected int|string|array $columnSpan = [
'md' => 2,
'xl' => 3,
];
Expand Down

0 comments on commit 8853b61

Please sign in to comment.