bookStackApiService->listShelves(); } catch (BookStackApiException $e) { throw new BadRequestHttpException($e->getMessage(), $e); } return array_map(static function (array $shelf): BookStackShelf { $dto = new BookStackShelf(); $dto->id = $shelf['id'] ?? 0; $dto->name = $shelf['name'] ?? ''; return $dto; }, $shelves); } }