Skip to content

Commit b8671d7

Browse files
Bump symfony/polyfill-intl-normalizer from 1.20.0 to 1.22.0
Bumps [symfony/polyfill-intl-normalizer](https://github.com/symfony/polyfill-intl-normalizer) from 1.20.0 to 1.22.0. - [Release notes](https://github.com/symfony/polyfill-intl-normalizer/releases) - [Commits](symfony/polyfill-intl-normalizer@v1.20.0...v1.22.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1 parent c814ae5 commit b8671d7

10 files changed

Lines changed: 84 additions & 59 deletions

File tree

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer/InstalledVersions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class InstalledVersions
2929
'aliases' =>
3030
array (
3131
),
32-
'reference' => '7f30b1d37a82519fb482a957fdc19e3cea0c2896',
32+
'reference' => '263574371f59d50a62558ac9a3adeb2acf3f5025',
3333
'name' => 'nextcloud/3rdparty',
3434
),
3535
'versions' =>
@@ -302,7 +302,7 @@ class InstalledVersions
302302
'aliases' =>
303303
array (
304304
),
305-
'reference' => '7f30b1d37a82519fb482a957fdc19e3cea0c2896',
305+
'reference' => '263574371f59d50a62558ac9a3adeb2acf3f5025',
306306
),
307307
'nextcloud/lognormalizer' =>
308308
array (
@@ -768,12 +768,12 @@ class InstalledVersions
768768
),
769769
'symfony/polyfill-intl-normalizer' =>
770770
array (
771-
'pretty_version' => 'v1.20.0',
772-
'version' => '1.20.0.0',
771+
'pretty_version' => 'v1.22.0',
772+
'version' => '1.22.0.0',
773773
'aliases' =>
774774
array (
775775
),
776-
'reference' => '727d1096295d807c309fb01a851577302394c897',
776+
'reference' => '6e971c891537eb617a00bb07a43d182a6915faba',
777777
),
778778
'symfony/polyfill-mbstring' =>
779779
array (

composer/installed.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4939,17 +4939,17 @@
49394939
},
49404940
{
49414941
"name": "symfony/polyfill-intl-normalizer",
4942-
"version": "v1.20.0",
4943-
"version_normalized": "1.20.0.0",
4942+
"version": "v1.22.0",
4943+
"version_normalized": "1.22.0.0",
49444944
"source": {
49454945
"type": "git",
49464946
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
4947-
"reference": "727d1096295d807c309fb01a851577302394c897"
4947+
"reference": "6e971c891537eb617a00bb07a43d182a6915faba"
49484948
},
49494949
"dist": {
49504950
"type": "zip",
4951-
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/727d1096295d807c309fb01a851577302394c897",
4952-
"reference": "727d1096295d807c309fb01a851577302394c897",
4951+
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/6e971c891537eb617a00bb07a43d182a6915faba",
4952+
"reference": "6e971c891537eb617a00bb07a43d182a6915faba",
49534953
"shasum": ""
49544954
},
49554955
"require": {
@@ -4958,11 +4958,11 @@
49584958
"suggest": {
49594959
"ext-intl": "For best performance"
49604960
},
4961-
"time": "2020-10-23T14:02:19+00:00",
4961+
"time": "2021-01-07T17:09:11+00:00",
49624962
"type": "library",
49634963
"extra": {
49644964
"branch-alias": {
4965-
"dev-main": "1.20-dev"
4965+
"dev-main": "1.22-dev"
49664966
},
49674967
"thanks": {
49684968
"name": "symfony/polyfill",
@@ -5006,7 +5006,7 @@
50065006
"shim"
50075007
],
50085008
"support": {
5009-
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.20.0"
5009+
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.0"
50105010
},
50115011
"funding": [
50125012
{

composer/installed.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'aliases' =>
77
array (
88
),
9-
'reference' => '7f30b1d37a82519fb482a957fdc19e3cea0c2896',
9+
'reference' => '263574371f59d50a62558ac9a3adeb2acf3f5025',
1010
'name' => 'nextcloud/3rdparty',
1111
),
1212
'versions' =>
@@ -279,7 +279,7 @@
279279
'aliases' =>
280280
array (
281281
),
282-
'reference' => '7f30b1d37a82519fb482a957fdc19e3cea0c2896',
282+
'reference' => '263574371f59d50a62558ac9a3adeb2acf3f5025',
283283
),
284284
'nextcloud/lognormalizer' =>
285285
array (
@@ -745,12 +745,12 @@
745745
),
746746
'symfony/polyfill-intl-normalizer' =>
747747
array (
748-
'pretty_version' => 'v1.20.0',
749-
'version' => '1.20.0.0',
748+
'pretty_version' => 'v1.22.0',
749+
'version' => '1.22.0.0',
750750
'aliases' =>
751751
array (
752752
),
753-
'reference' => '727d1096295d807c309fb01a851577302394c897',
753+
'reference' => '6e971c891537eb617a00bb07a43d182a6915faba',
754754
),
755755
'symfony/polyfill-mbstring' =>
756756
array (

composer/package-versions-deprecated/src/PackageVersions/Versions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ final class Versions
104104
'symfony/polyfill-iconv' => 'v1.20.0@c536646fdb4f29104dd26effc2fdcb9a5b085024',
105105
'symfony/polyfill-intl-grapheme' => 'v1.22.0@267a9adeb8ecb8071040a740930e077cdfb987af',
106106
'symfony/polyfill-intl-idn' => 'v1.20.0@3b75acd829741c768bc8b1f84eb33265e7cc5117',
107-
'symfony/polyfill-intl-normalizer' => 'v1.20.0@727d1096295d807c309fb01a851577302394c897',
107+
'symfony/polyfill-intl-normalizer' => 'v1.22.0@6e971c891537eb617a00bb07a43d182a6915faba',
108108
'symfony/polyfill-mbstring' => 'v1.20.0@39d483bdf39be819deabf04ec872eb0b2410b531',
109109
'symfony/polyfill-php72' => 'v1.20.0@cede45fcdfabdd6043b3592e83678e42ec69e930',
110110
'symfony/polyfill-php73' => 'v1.20.0@8ff431c517be11c78c48a39a66d37431e26a6bed',
@@ -118,7 +118,7 @@ final class Versions
118118
'web-auth/cose-lib' => 'v3.3.1@eea6fae63ff5c81bf98c115b1be5f38a69682c16',
119119
'web-auth/metadata-service' => 'v3.3.1@8488d3a832a38cc81c670fce05de1e515c6e64b1',
120120
'web-auth/webauthn-lib' => 'v3.3.1@e411527a41c1013512fccdfce61681eb36484c77',
121-
'nextcloud/3rdparty' => 'dev-master@7f30b1d37a82519fb482a957fdc19e3cea0c2896',
121+
'nextcloud/3rdparty' => 'dev-master@263574371f59d50a62558ac9a3adeb2acf3f5025',
122122
);
123123

124124
private function __construct()

symfony/polyfill-intl-normalizer/Normalizer.php

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,27 @@
2323
*/
2424
class Normalizer
2525
{
26-
const FORM_D = \Normalizer::FORM_D;
27-
const FORM_KD = \Normalizer::FORM_KD;
28-
const FORM_C = \Normalizer::FORM_C;
29-
const FORM_KC = \Normalizer::FORM_KC;
30-
const NFD = \Normalizer::NFD;
31-
const NFKD = \Normalizer::NFKD;
32-
const NFC = \Normalizer::NFC;
33-
const NFKC = \Normalizer::NFKC;
26+
public const FORM_D = \Normalizer::FORM_D;
27+
public const FORM_KD = \Normalizer::FORM_KD;
28+
public const FORM_C = \Normalizer::FORM_C;
29+
public const FORM_KC = \Normalizer::FORM_KC;
30+
public const NFD = \Normalizer::NFD;
31+
public const NFKD = \Normalizer::NFKD;
32+
public const NFC = \Normalizer::NFC;
33+
public const NFKC = \Normalizer::NFKC;
3434

3535
private static $C;
3636
private static $D;
3737
private static $KD;
3838
private static $cC;
39-
private static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4);
39+
private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4];
4040
private static $ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
4141

42-
public static function isNormalized($s, $form = self::NFC)
42+
public static function isNormalized(string $s, int $form = self::FORM_C)
4343
{
44-
if (!\in_array($form, array(self::NFD, self::NFKD, self::NFC, self::NFKC))) {
44+
if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) {
4545
return false;
4646
}
47-
$s = (string) $s;
4847
if (!isset($s[strspn($s, self::$ASCII)])) {
4948
return true;
5049
}
@@ -55,9 +54,8 @@ public static function isNormalized($s, $form = self::NFC)
5554
return self::normalize($s, $form) === $s;
5655
}
5756

58-
public static function normalize($s, $form = self::NFC)
57+
public static function normalize(string $s, int $form = self::FORM_C)
5958
{
60-
$s = (string) $s;
6159
if (!preg_match('//u', $s)) {
6260
return false;
6361
}
@@ -72,7 +70,11 @@ public static function normalize($s, $form = self::NFC)
7270
return $s;
7371
}
7472

75-
return false;
73+
if (80000 > \PHP_VERSION_ID) {
74+
return false;
75+
}
76+
77+
throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form');
7678
}
7779

7880
if ('' === $s) {
@@ -152,7 +154,7 @@ private static function recompose($s)
152154
|| $lastUcls) {
153155
// Table lookup and combining chars composition
154156

155-
$ucls = isset($combClass[$uchr]) ? $combClass[$uchr] : 0;
157+
$ucls = $combClass[$uchr] ?? 0;
156158

157159
if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) {
158160
$lastUchr = $compMap[$lastUchr.$uchr];
@@ -204,7 +206,7 @@ private static function decompose($s, $c)
204206
$compatMap = self::$KD;
205207
}
206208

207-
$c = array();
209+
$c = [];
208210
$i = 0;
209211
$len = \strlen($s);
210212

@@ -215,7 +217,7 @@ private static function decompose($s, $c)
215217
if ($c) {
216218
ksort($c);
217219
$result .= implode('', $c);
218-
$c = array();
220+
$c = [];
219221
}
220222

221223
$j = 1 + strspn($s, $ASCII, $i + 1);
@@ -231,7 +233,7 @@ private static function decompose($s, $c)
231233
if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) {
232234
// Table lookup
233235

234-
if ($uchr !== $j = isset($compatMap[$uchr]) ? $compatMap[$uchr] : (isset($decompMap[$uchr]) ? $decompMap[$uchr] : $uchr)) {
236+
if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) {
235237
$uchr = $j;
236238

237239
$j = \strlen($uchr);
@@ -283,7 +285,7 @@ private static function decompose($s, $c)
283285
if ($c) {
284286
ksort($c);
285287
$result .= implode('', $c);
286-
$c = array();
288+
$c = [];
287289
}
288290

289291
$result .= $uchr;

symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ class Normalizer extends Symfony\Polyfill\Intl\Normalizer\Normalizer
55
/**
66
* @deprecated since ICU 56 and removed in PHP 8
77
*/
8-
const NONE = 1;
9-
const FORM_D = 2;
10-
const FORM_KD = 3;
11-
const FORM_C = 4;
12-
const FORM_KC = 5;
13-
const NFD = 2;
14-
const NFKD = 3;
15-
const NFC = 4;
16-
const NFKC = 5;
8+
public const NONE = 2;
9+
public const FORM_D = 4;
10+
public const FORM_KD = 8;
11+
public const FORM_C = 16;
12+
public const FORM_KC = 32;
13+
public const NFD = 4;
14+
public const NFKD = 8;
15+
public const NFC = 16;
16+
public const NFKC = 32;
1717
}

symfony/polyfill-intl-normalizer/bootstrap.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111

1212
use Symfony\Polyfill\Intl\Normalizer as p;
1313

14+
if (\PHP_VERSION_ID >= 80000) {
15+
return require __DIR__.'/bootstrap80.php';
16+
}
17+
1418
if (!function_exists('normalizer_is_normalized')) {
15-
function normalizer_is_normalized($input, $form = p\Normalizer::NFC) { return p\Normalizer::isNormalized($input, $form); }
19+
function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); }
1620
}
1721
if (!function_exists('normalizer_normalize')) {
18-
function normalizer_normalize($input, $form = p\Normalizer::NFC) { return p\Normalizer::normalize($input, $form); }
22+
function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); }
1923
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
use Symfony\Polyfill\Intl\Normalizer as p;
13+
14+
if (!function_exists('normalizer_is_normalized')) {
15+
function normalizer_is_normalized(string $string, int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized($string, $form); }
16+
}
17+
if (!function_exists('normalizer_normalize')) {
18+
function normalizer_normalize(string $string, int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize($string, $form); }
19+
}

symfony/polyfill-intl-normalizer/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"minimum-stability": "dev",
3030
"extra": {
3131
"branch-alias": {
32-
"dev-main": "1.20-dev"
32+
"dev-main": "1.22-dev"
3333
},
3434
"thanks": {
3535
"name": "symfony/polyfill",

0 commit comments

Comments
 (0)