createRequest('GET', '/ogboot/v1/oglives/isos'); if (isset($content['error']) && $content['code'] === Response::HTTP_INTERNAL_SERVER_ERROR ) { throw new BadRequestHttpException('An error occurred while fetching ISOs: ' . $content['error']. ' (' . $content['details'] . ')'); } $isos = array_map(function ($iso) { $filename = $this->simplifyOgLiveFilenameService->__invoke($iso['filename']); return [ 'id' => $iso['id'], 'filename' => $filename, 'url' => $iso['url'], 'installed' => $iso['installed'], 'compatible' => $iso['compatible'], ]; }, $content['message']); usort($isos, fn($a, $b) => $b['id'] <=> $a['id']); return new JsonResponse(data: ['success' => 'ISOs retrieved successfully', 'message' => $isos], status: Response::HTTP_OK); } }