Browse Source

Merge pull request #50452 from nextcloud/chore/update-stub

chore: update php intl stub and fix type issues
pull/51126/head
Joas Schilling 10 months ago
committed by GitHub
parent
commit
fed74d78ca
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      apps/files_external/lib/Command/Notify.php
  2. 8
      build/psalm-baseline.xml
  3. 4152
      build/stubs/intl.php
  4. 6
      lib/private/legacy/OC_Util.php

4
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')

8
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>

4152
build/stubs/intl.php
File diff suppressed because it is too large
View File

6
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;
}

Loading…
Cancel
Save