diff --git a/app/Services/Servers/NetworkService.php b/app/Services/Servers/NetworkService.php index 44ff6893e22..83b019462f8 100644 --- a/app/Services/Servers/NetworkService.php +++ b/app/Services/Servers/NetworkService.php @@ -1,17 +1,17 @@ getAddresses($server); @@ -159,7 +161,7 @@ public function updateRateLimit(Server $server, ?int $mebibytes = null): void // If no model key exists, add the default model with the MAC address if (!$modelFound) { - $parsedConfig[] = (object) ['key' => 'virtio', 'value' => $macAddress]; + $parsedConfig[] = (object)['key' => 'virtio', 'value' => $macAddress]; } // Update or create the bridge value @@ -173,7 +175,7 @@ public function updateRateLimit(Server $server, ?int $mebibytes = null): void } if (!$bridgeFound) { - $parsedConfig[] = (object) ['key' => 'bridge', 'value' => $server->node->network]; + $parsedConfig[] = (object)['key' => 'bridge', 'value' => $server->node->network]; } // Update or create the firewall key @@ -187,7 +189,7 @@ public function updateRateLimit(Server $server, ?int $mebibytes = null): void } if (!$firewallFound) { - $parsedConfig[] = (object) ['key' => 'firewall', 'value' => 1]; + $parsedConfig[] = (object)['key' => 'firewall', 'value' => 1]; } // Handle the rate limit @@ -206,12 +208,14 @@ public function updateRateLimit(Server $server, ?int $mebibytes = null): void } if (!$rateUpdated) { - $parsedConfig[] = (object) ['key' => 'rate', 'value' => $mebibytes]; + $parsedConfig[] = (object)['key' => 'rate', 'value' => $mebibytes]; } } // Rebuild the configuration string - $newConfig = implode(',', array_map(fn ($item) => "{$item->key}={$item->value}", $parsedConfig)); + $newConfig = implode( + ',', array_map(fn ($item) => "{$item->key}={$item->value}", $parsedConfig), + ); // Update the Proxmox configuration $this->allocationRepository->setServer($server)->update(['net0' => $newConfig]); @@ -230,7 +234,7 @@ private function parseConfig(string $config): array [$key, $value] = explode('=', $component); // Create an associative array (or object) for key-value pairs - $parsedObjects[] = (object) ['key' => $key, 'value' => $value]; + $parsedObjects[] = (object)['key' => $key, 'value' => $value]; } return $parsedObjects;