L10n phpdoc updates

This commit is contained in:
Clemens Schwaighofer
2026-05-12 11:46:19 +09:00
parent 22806d6add
commit 1e3ce162e5
3 changed files with 45 additions and 21 deletions
+15 -1
View File
@@ -1,7 +1,8 @@
<phpunit <phpunit
cacheResultFile="/tmp/phpunit-corelibs-composer.result.cache" cacheResultFile="/tmp/phpunit-corelibs-composer.result.cache"
colors="true" colors="true"
verbose="true" verbose="false"
convertDeprecationsToExceptions="true"
bootstrap="test/phpunit/bootstrap.php" bootstrap="test/phpunit/bootstrap.php"
> >
<testsuites> <testsuites>
@@ -9,4 +10,17 @@
<directory>test/phpunit</directory> <directory>test/phpunit</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./www/lib/CoreLibs</directory>
</include>
<!-- <report>
<html outputDirectory="build/coverage-report"/>
</report> -->
</coverage>
<!-- <source>
<include>
<directory>./src</directory>
</include>
</source> -->
</phpunit> </phpunit>
+28 -18
View File
@@ -31,30 +31,39 @@ function gitea_publish
[ -n "${_GITEA_URL_DL}" ] && [ -n "${_GITEA_URL_PUSH}" ] && [ -n "${_GITEA_URL_DL}" ] && [ -n "${_GITEA_URL_PUSH}" ] &&
[ -n "${_GITEA_USER}" ] && [ -n "${_GITEA_TOKEN}" ]; then [ -n "${_GITEA_USER}" ] && [ -n "${_GITEA_TOKEN}" ]; then
echo "> Publish ${_GITEA_UPLOAD_FILENAME} with ${_VERSION} to: ${_GITEA_URL_PUSH}"; echo "> Publish ${_GITEA_UPLOAD_FILENAME} with ${_VERSION} to: ${_GITEA_URL_PUSH}";
error=0;
if [ ! -f "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip" ]; then if [ ! -f "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip" ]; then
echo "> Download: ${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip"; echo "> Download: ${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip";
curl -LJO \ http_response=$(curl -LJO \
-w "%{http_code}" \
--output-dir "${_PACKAGE_DOWNLOAD}" \ --output-dir "${_PACKAGE_DOWNLOAD}" \
-H "Authorization: token ${_GITEA_TOKEN}" \ -H "Authorization: token ${_GITEA_TOKEN}" \
"${_GITEA_URL_DL}/v${_VERSION}.zip"; "${_GITEA_URL_DL}/v${_VERSION}.zip"
);
if [ "$http_response" -eq 200 ]; then
echo "[!] Error downloading file: ${http_response}";
error=1;
fi;
fi; fi;
# if this is the short name, if long down load does not work if [ $error -eq 0 ]; then
if [ -f "${_PACKAGE_DOWNLOAD}v${_VERSION}.zip" ]; then # if this is the short name rename to long name, if long name down load does not work
mv "${_PACKAGE_DOWNLOAD}v${_VERSION}.zip" "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip"; if [ -f "${_PACKAGE_DOWNLOAD}v${_VERSION}.zip" ]; then
fi; mv "${_PACKAGE_DOWNLOAD}v${_VERSION}.zip" "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip";
if [ ! -f "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip" ]; then fi;
echo "[!] Package file does not exist for version: ${_VERSION}"; if [ ! -f "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip" ]; then
else echo "[!] Package file does not exist for version: ${_VERSION}";
response=$(curl --user "${_GITEA_USER}":"${_GITEA_TOKEN}" \
--upload-file "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip" \
"${_GITEA_URL_PUSH}"?version="${_VERSION}");
status=$(echo "${response}" | jq .errors[].status);
message=$(echo "${response}" | jq .errors[].message);
if [ -n "${status}" ]; then
echo "[!] Error ${status}: ${message}";
else else
echo "> Publish completed"; response=$(curl --user "${_GITEA_USER}":"${_GITEA_TOKEN}" \
echo "${_VERSION}" > "${_file_last_published}"; --upload-file "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip" \
"${_GITEA_URL_PUSH}"?version="${_VERSION}");
status=$(echo "${response}" | jq .errors[].status);
message=$(echo "${response}" | jq .errors[].message);
if [ -n "${status}" ]; then
echo "[!] Error ${status}: ${message}";
else
echo "> Publish completed";
echo "${_VERSION}" > "${_file_last_published}";
fi;
fi; fi;
fi; fi;
else else
@@ -96,6 +105,7 @@ if [ -f "${file_last_published}" ]; then
LAST_PUBLISHED_VERSION=$(cat "${file_last_published}"); LAST_PUBLISHED_VERSION=$(cat "${file_last_published}");
if dpkg --compare-versions "${VERSION}" le "${LAST_PUBLISHED_VERSION}"; then if dpkg --compare-versions "${VERSION}" le "${LAST_PUBLISHED_VERSION}"; then
echo "[!] git tag version ${VERSION} is not newer than previous published version ${LAST_PUBLISHED_VERSION}"; echo "[!] git tag version ${VERSION} is not newer than previous published version ${LAST_PUBLISHED_VERSION}";
exit;
fi; fi;
fi; fi;
+2 -2
View File
@@ -301,7 +301,7 @@ class L10n
* Get the local as array same to the GetLocale::setLocale return * 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 * 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 public function getLocaleAsArray(): array
{ {
@@ -321,7 +321,7 @@ class L10n
* parse the locale string for further processing * parse the locale string for further processing
* *
* @param string $locale Locale to parse * @param string $locale Locale to parse
* @return array<string,string|null> 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 public static function parseLocale(string $locale = ''): array
{ {