From 82ba2a189aeb052854a4f6fa1ba06ce948d331fd Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Tue, 12 May 2026 11:39:19 +0900 Subject: [PATCH] L10n update for PHPdoc array descriptions Make the PHPdoc array description detailed for the parseLocale method --- www/admin/class_test.file.php | 16 +++++++++++++++- www/lib/CoreLibs/Language/L10n.php | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/www/admin/class_test.file.php b/www/admin/class_test.file.php index 52050903..bf1f8a18 100644 --- a/www/admin/class_test.file.php +++ b/www/admin/class_test.file.php @@ -39,11 +39,25 @@ $file = getcwd() . DIRECTORY_SEPARATOR . 'class_test.file.php'; print "GETLINESFROMFILE: $file: " . File::getLinesFromFile($file) . "
"; print "MIMEINFO: $file: " . File::getMimeType($file) . "
"; try { - print "MIMEINFO: $file: " . File::getMimeType("does_not_exists.txt") . "
"; + print "MIMEINFO: does_not_exists.txt " . File::getMimeType("does_not_exists.txt") . "
"; } catch (\Exception $e) { print "Error: " . get_class($e) . ": " . $e->getMessage() . "
"; } +$files = [ + 'layout/css/edit.css', + 'layout/javascript/edit.jq.js', + 'class_test.file.php', + getcwd() . DIRECTORY_SEPARATOR . 'class_test.file.php', +]; +foreach ($files as $file) { + try { + print "MIMEINFO: $file: " . File::getMimeType($file) . "
"; + } catch (\Exception $e) { + print "Error: " . get_class($e) . ": " . $e->getMessage() . "
"; + } +} + print ""; // __END__ diff --git a/www/lib/CoreLibs/Language/L10n.php b/www/lib/CoreLibs/Language/L10n.php index 2703415b..14dad30b 100644 --- a/www/lib/CoreLibs/Language/L10n.php +++ b/www/lib/CoreLibs/Language/L10n.php @@ -301,7 +301,7 @@ class L10n * Get the local as array same to the GetLocale::setLocale return * This does not set from outside, but only what is set in the l10n class * - * @return array{locale: string, lang: string, lang_short: string, domain: string, encoding: string, path: string} + * @return array{locale:string,lang:string,lang_short:string,domain:string,encoding:string,path:string} */ public function getLocaleAsArray(): array { @@ -321,7 +321,7 @@ class L10n * parse the locale string for further processing * * @param string $locale Locale to parse - * @return array array with lang, country, charset, modifier + * @return array{lang:string|null,country:string|null,charset:string|null,modifier:string|null} parsed locale */ public static function parseLocale(string $locale = ''): array {