From 9c79e2bfbcf2d985b4da647c08ece085a4cce725 Mon Sep 17 00:00:00 2001 From: elmariss <53705290+YaRissi@users.noreply.github.com> Date: Mon, 13 Oct 2025 22:41:13 +0200 Subject: [PATCH] simplify the getCpuVendorInfo method --- app/Livewire/Server/New/ByHetzner.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Livewire/Server/New/ByHetzner.php b/app/Livewire/Server/New/ByHetzner.php index 9033df6a8..a77c5df78 100644 --- a/app/Livewire/Server/New/ByHetzner.php +++ b/app/Livewire/Server/New/ByHetzner.php @@ -290,21 +290,21 @@ private function loadHetznerData(string $token) } } - private function getCpuVendorInfo(array $serverType): array + private function getCpuVendorInfo(array $serverType): string|null { $name = strtolower($serverType['name'] ?? ''); if (str_starts_with($name, 'ccx')) { - return ['vendor_info' => 'AMD Milan EPYC™']; + return 'AMD Milan EPYC™'; } elseif (str_starts_with($name, 'cpx')) { - return ['vendor_info' => 'AMD EPYC™']; + return 'AMD EPYC™'; } elseif (str_starts_with($name, 'cx')) { - return ['vendor_info' => 'Intel® Xeon®']; + return 'Intel® Xeon®'; } elseif (str_starts_with($name, 'cax')) { - return ['vendor_info' => 'Ampere® Altra®']; + return 'Ampere® Altra®'; } - return ['vendor_info' => null]; + return null; } public function getAvailableServerTypesProperty() @@ -329,8 +329,7 @@ public function getAvailableServerTypesProperty() return in_array($this->selected_location, $locationNames); }) ->map(function ($serverType) { - $cpuInfo = $this->getCpuVendorInfo($serverType); - $serverType['cpu_vendor_info'] = $cpuInfo['vendor_info']; + $serverType['cpu_vendor_info'] = $this->getCpuVendorInfo($serverType); return $serverType; })