aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-02-27 19:07:39 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2025-02-27 19:07:39 +0100
commitc82337f3b98b8ccf5b774c43213ae56b8d4bd920 (patch)
treecbf5f16f4e564d74ad5135d295680f8b37a35075
parent0be4239c41fec66735c9c9c9bc840ee6ab986992 (diff)
downloadnextcloud-server-chore/update-stub.tar.gz
nextcloud-server-chore/update-stub.zip
fix: incorrect types detected by updated stubschore/update-stub
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
-rw-r--r--apps/files_external/lib/Command/Notify.php4
-rw-r--r--build/psalm-baseline.xml8
-rw-r--r--lib/private/legacy/OC_Util.php6
3 files changed, 5 insertions, 13 deletions
diff --git a/apps/files_external/lib/Command/Notify.php b/apps/files_external/lib/Command/Notify.php
index cd1889264b3..0982aa5598b 100644
--- a/apps/files_external/lib/Command/Notify.php
+++ b/apps/files_external/lib/Command/Notify.php
@@ -168,7 +168,7 @@ class Notify extends StorageAuthBase {
}
private function getStorageIds(int $mountId, string $path): array {
- $pathHash = md5(trim((string)\OC_Util::normalizeUnicode($path), '/'));
+ $pathHash = md5(trim(\OC_Util::normalizeUnicode($path), '/'));
$qb = $this->connection->getQueryBuilder();
return $qb
->select('storage_id', 'user_id')
@@ -181,7 +181,7 @@ class Notify extends StorageAuthBase {
}
private function updateParent(array $storageIds, string $parent): int {
- $pathHash = md5(trim((string)\OC_Util::normalizeUnicode($parent), '/'));
+ $pathHash = md5(trim(\OC_Util::normalizeUnicode($parent), '/'));
$qb = $this->connection->getQueryBuilder();
return $qb
->update('filecache')
diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml
index 18df1f058da..768df9f0562 100644
--- a/build/psalm-baseline.xml
+++ b/build/psalm-baseline.xml
@@ -1744,9 +1744,6 @@
<InvalidNullableReturnType>
<code><![CDATA[array]]></code>
</InvalidNullableReturnType>
- <InvalidScalarArgument>
- <code><![CDATA[\OC_Util::normalizeUnicode($path)]]></code>
- </InvalidScalarArgument>
<NullableReturnStatement>
<code><![CDATA[null]]></code>
<code><![CDATA[null]]></code>
@@ -1999,11 +1996,6 @@
</NoInterfaceProperties>
</file>
<file src="lib/private/Files/Storage/Wrapper/Encoding.php">
- <InvalidArgument>
- <code><![CDATA[\Normalizer::FORM_C]]></code>
- <code><![CDATA[\Normalizer::FORM_C]]></code>
- <code><![CDATA[\Normalizer::FORM_D]]></code>
- </InvalidArgument>
<UndefinedInterfaceMethod>
<code><![CDATA[$this->namesCache]]></code>
<code><![CDATA[$this->namesCache]]></code>
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php
index f82082d3d12..bf60fed0389 100644
--- a/lib/private/legacy/OC_Util.php
+++ b/lib/private/legacy/OC_Util.php
@@ -940,15 +940,15 @@ class OC_Util {
* Normalize a unicode string
*
* @param string $value a not normalized string
- * @return bool|string
+ * @return string The normalized string or the input if the normalization failed
*/
- public static function normalizeUnicode($value) {
+ public static function normalizeUnicode(string $value): string {
if (Normalizer::isNormalized($value)) {
return $value;
}
$normalizedValue = Normalizer::normalize($value);
- if ($normalizedValue === null || $normalizedValue === false) {
+ if ($normalizedValue === false) {
\OCP\Server::get(LoggerInterface::class)->warning('normalizing failed for "' . $value . '"', ['app' => 'core']);
return $value;
}