ref_csv::OO_FLAVOUR, "ooffice" => ref_csv::OO_FLAVOUR, ref_csv::OO_NAME => ref_csv::OO_FLAVOUR, "xl" => ref_csv::XL_FLAVOUR, "excel" => ref_csv::XL_FLAVOUR, ref_csv::XL_NAME => ref_csv::XL_FLAVOUR, ]; const ENCODINGS = [ ref_csv::OO_FLAVOUR => ref_csv::OO_ENCODING, ref_csv::XL_FLAVOUR => ref_csv::XL_ENCODING, ]; static final function verifix(string $flavour): string { $lflavour = strtolower($flavour); if (array_key_exists($lflavour, self::MAP)) { $flavour = self::MAP[$lflavour]; } if (strlen($flavour) < 1) $flavour .= ","; if (strlen($flavour) < 2) $flavour .= "\""; if (strlen($flavour) < 3) $flavour .= "\\"; return $flavour; } static final function get_name(string $flavour): string { if ($flavour == ref_csv::OO_FLAVOUR) return ref_csv::OO_NAME; elseif ($flavour == ref_csv::XL_FLAVOUR) return ref_csv::XL_NAME; else return $flavour; } static final function get_params(string $flavour): array { return [$flavour[0], $flavour[1], $flavour[2]]; } static final function get_encoding(string $flavour): ?string { return cl::get(self::ENCODINGS, $flavour); } }