diff --git a/LibreNMS/Data/ChartData.php b/LibreNMS/Data/ChartData.php index b7f66e38445a..882907490015 100644 --- a/LibreNMS/Data/ChartData.php +++ b/LibreNMS/Data/ChartData.php @@ -4,12 +4,12 @@ class ChartData { - protected function __construct( protected string $format, protected array $data, protected array $map = [], - ) {} + ) { + } public static function createFromRrd(array $legend, array $data): static { @@ -23,7 +23,7 @@ public static function createFromRrd(array $legend, array $data): static } /** - * @param ChartDataset[] $chartDatasets + * @param ChartDataset[] $chartDatasets * @return array */ public function forChartJs(array $chartDatasets): array @@ -34,15 +34,15 @@ public function forChartJs(array $chartDatasets): array $timestamp_index = $this->map['_timestamp']; $ds = array_diff_key($this->map, ['_timestamp' => null]); - foreach($this->data as $point) { - foreach($ds as $name => $index) { + foreach ($this->data as $point) { + foreach ($ds as $name => $index) { $data[$name][] = ['x' => (int) $point[$timestamp_index], 'y' => $point[$index]]; } } } $datasets = []; - foreach($chartDatasets as $ds) { + foreach ($chartDatasets as $ds) { $datasets[] = [ 'label' => $ds->label, 'data' => $data[$ds->name], diff --git a/LibreNMS/Data/ChartDataset.php b/LibreNMS/Data/ChartDataset.php index 6d6a08bd2e4d..45cb41694317 100644 --- a/LibreNMS/Data/ChartDataset.php +++ b/LibreNMS/Data/ChartDataset.php @@ -9,5 +9,6 @@ public function __construct( public string $label, public ?string $color = null, public ?string $fill = null, - ){} + ) { + } } diff --git a/LibreNMS/Data/Source/Rrd.php b/LibreNMS/Data/Source/Rrd.php index b1e1df4898c5..ec4933d18a0d 100644 --- a/LibreNMS/Data/Source/Rrd.php +++ b/LibreNMS/Data/Source/Rrd.php @@ -24,7 +24,6 @@ public static function make(int $start, ?int $end = null): static public function get(): array { - } public function def(string $label, string $dataset, string $rrd = null, RrdCF $consolidationFunction = RrdCF::AVERAGE): static @@ -55,7 +54,7 @@ public function graph(): string public function xport(array $defs): ChartData { // set up XPORT options either ds only or ds => label - foreach($defs as $def) { + foreach ($defs as $def) { $this->options[] = "XPORT:$def:$def"; } @@ -86,7 +85,7 @@ private function run(string $command): string $proc->run(); $error = $proc->getErrorOutput(); - if($error) { + if ($error) { throw new \Exception($error); } diff --git a/app/Filament/Pages/Dashboard.php b/app/Filament/Pages/Dashboard.php index 21b551dd449e..898c3c2c4935 100644 --- a/app/Filament/Pages/Dashboard.php +++ b/app/Filament/Pages/Dashboard.php @@ -4,5 +4,4 @@ class Dashboard extends \Filament\Pages\Dashboard { - } diff --git a/app/Filament/Widgets/DeviceTypeCounts.php b/app/Filament/Widgets/DeviceTypeCounts.php index 0c431f91fad9..e39fd2cca288 100644 --- a/app/Filament/Widgets/DeviceTypeCounts.php +++ b/app/Filament/Widgets/DeviceTypeCounts.php @@ -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(); } } diff --git a/app/Filament/Widgets/Graph.php b/app/Filament/Widgets/Graph.php index 7bdf6980f0d0..08c3eb008df6 100644 --- a/app/Filament/Widgets/Graph.php +++ b/app/Filament/Widgets/Graph.php @@ -5,7 +5,6 @@ use App\Models\Device; use Filament\Widgets\ChartWidget; use LibreNMS\Data\ChartDataset; -use LibreNMS\Data\ChartDatasets; use LibreNMS\Data\Source\Rrd; class Graph extends ChartWidget @@ -44,7 +43,7 @@ protected function getType(): string return 'line'; } - protected int | string | array $columnSpan = [ + protected int|string|array $columnSpan = [ 'md' => 2, 'xl' => 3, ]; diff --git a/app/Filament/Widgets/NetworkChart.php b/app/Filament/Widgets/NetworkChart.php index 0f3f2eb11de1..4f2d6210ce54 100644 --- a/app/Filament/Widgets/NetworkChart.php +++ b/app/Filament/Widgets/NetworkChart.php @@ -20,8 +20,6 @@ class NetworkChart extends ApexChartWidget */ protected static ?string $heading = 'NetworkChart'; - - /** * Chart options (series, labels, types, size, animations...) * https://apexcharts.com/docs/options diff --git a/app/Providers/Filament/LibrenmsPanelProvider.php b/app/Providers/Filament/LibrenmsPanelProvider.php index 50506b7eae77..da3e7cd1e12f 100644 --- a/app/Providers/Filament/LibrenmsPanelProvider.php +++ b/app/Providers/Filament/LibrenmsPanelProvider.php @@ -31,7 +31,7 @@ public function panel(Panel $panel): Panel 'primary' => Color::Amber, ]) ->plugins([ - FilamentApexChartsPlugin::make() + FilamentApexChartsPlugin::make(), ]) ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources') ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')