'QIF', 'csv' => 'CSV', ]; /** Kurze Beschreibung für die Formatwahl. */ public const BESCHREIBUNGEN = [ 'qif' => 'Das Format des Lexware FinanzManagers – Klassen, Kategorien, Konten und Buchungen in einer Datei.', 'csv' => 'Tabelle mit Semikolon als Trenner, für Tabellenkalkulationen. Nur Buchungen, dafür überall lesbar.', ]; public static function gueltig(string $format): bool { return isset(self::ALLE[strtolower(trim($format))]); } /** Der geprüfte Schlüssel, oder null. */ public static function pruefe(string $format): ?string { $format = strtolower(trim($format)); return isset(self::ALLE[$format]) ? $format : null; } public static function name(string $format): string { return self::ALLE[strtolower(trim($format))] ?? strtoupper($format); } /** Format zu einem Dateinamen – anhand der Endung. */ public static function ausDateiname(string $name): ?string { return self::pruefe(pathinfo($name, PATHINFO_EXTENSION)); } }