'pdf', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'excel', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'word', default => 'download', }; return $this->renderIcon($environment, $icon, $classes); } public function formatBytes(int $bytes, ?int $precision = 2): string { $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; $factor = floor((strlen($bytes) - 1) / 3); return sprintf("%.{$precision}f", $bytes / (1024 ** $factor)).@$size[$factor]; } public function formatMoney(int $amount): string { // Amounts are stored as integers so divide by 100 first $amount = $amount / 100; return $this->intlExtension->formatCurrency($amount, 'EUR'); } public function renderIcon(Environment $environment, string $icon, string $classes = 'w-5 h-5'): string { return $environment->render('_partials/_icon.html.twig', [ 'icon' => $icon, 'class' => $classes, ]); } public function mapStatus(string $status): string { $status = strtoupper($status); return match ($status) { 'F', 'F/S' => 'Festbuchung', 'S' => 'Stornierung', 'O' => 'Option', 'U' => 'Umbuchung', default => '', }; } public function mapGender(string $gender): string { $gender = strtoupper($gender); return match ($gender) { 'M' => 'männlich', 'W' => 'weiblich', 'D' => 'divers', default => '', }; } public function mapCountry(?string $country): ?string { if (null === $country) { return null; } return $this->countryDataProvider->get($country)?->name; } public function mapNationality(?string $nationality): ?string { if (null === $nationality) { return null; } return $this->countryDataProvider->get($nationality)?->nationality; } }