diff --git a/composer.json b/composer.json index b00ac18df..72195dc09 100644 --- a/composer.json +++ b/composer.json @@ -56,10 +56,10 @@ "symfony/event-dispatcher": "^6.4.8", "symfony/http-foundation": "^6.4.29", "symfony/mailer": "^6.4", - "symfony/polyfill-intl-normalizer": "^1.32.0", + "symfony/polyfill-intl-normalizer": "^1.33.0", "symfony/polyfill-php82": "^1.32.0", - "symfony/polyfill-php83": "^1.32.0", - "symfony/polyfill-php84": "^1.32.0", + "symfony/polyfill-php83": "^1.33.0", + "symfony/polyfill-php84": "^1.33.0", "symfony/polyfill-php85": "^1.33", "symfony/process": "^6.4.15", "symfony/routing": "^6.4.12", diff --git a/composer.lock b/composer.lock index c2fafc82e..9c4603403 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "faf4f77815b6cc922db11856d55accc7", + "content-hash": "c7b82134d47c4e489009244fbac4ae4d", "packages": [ { "name": "aws/aws-crt-php", @@ -5041,7 +5041,7 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -5102,7 +5102,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" }, "funding": [ { @@ -5113,6 +5113,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -5122,16 +5126,16 @@ }, { "name": "symfony/polyfill-php83", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491" + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/2fb86d65e2d424369ad2905e83b236a8805ba491", - "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5", "shasum": "" }, "require": { @@ -5178,7 +5182,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.33.0" }, "funding": [ { @@ -5189,25 +5193,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-07-08T02:45:35+00:00" }, { "name": "symfony/polyfill-php84", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php84.git", - "reference": "000df7860439609837bbe28670b0be15783b7fbf" + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/000df7860439609837bbe28670b0be15783b7fbf", - "reference": "000df7860439609837bbe28670b0be15783b7fbf", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/d8ced4d875142b6a7426000426b8abc631d6b191", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191", "shasum": "" }, "require": { @@ -5254,7 +5262,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php84/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php84/tree/v1.33.0" }, "funding": [ { @@ -5265,12 +5273,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-02-20T12:04:08+00:00" + "time": "2025-06-24T13:30:11+00:00" }, { "name": "symfony/polyfill-php85", diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php index 00cc35b9c..914486b4a 100644 --- a/composer/autoload_classmap.php +++ b/composer/autoload_classmap.php @@ -1551,6 +1551,7 @@ 'Punic\\Script' => $vendorDir . '/punic/punic/src/Script.php', 'Punic\\Territory' => $vendorDir . '/punic/punic/src/Territory.php', 'Punic\\Unit' => $vendorDir . '/punic/punic/src/Unit.php', + 'ReflectionConstant' => $vendorDir . '/symfony/polyfill-php84/Resources/stubs/ReflectionConstant.php', 'SQLite3Exception' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/SQLite3Exception.php', 'Sabre\\CalDAV\\Backend\\AbstractBackend' => $vendorDir . '/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php', 'Sabre\\CalDAV\\Backend\\BackendInterface' => $vendorDir . '/sabre/dav/lib/CalDAV/Backend/BackendInterface.php', diff --git a/composer/autoload_static.php b/composer/autoload_static.php index 8f230fe69..b91eeb906 100644 --- a/composer/autoload_static.php +++ b/composer/autoload_static.php @@ -2078,6 +2078,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652 'Punic\\Script' => __DIR__ . '/..' . '/punic/punic/src/Script.php', 'Punic\\Territory' => __DIR__ . '/..' . '/punic/punic/src/Territory.php', 'Punic\\Unit' => __DIR__ . '/..' . '/punic/punic/src/Unit.php', + 'ReflectionConstant' => __DIR__ . '/..' . '/symfony/polyfill-php84/Resources/stubs/ReflectionConstant.php', 'SQLite3Exception' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/SQLite3Exception.php', 'Sabre\\CalDAV\\Backend\\AbstractBackend' => __DIR__ . '/..' . '/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php', 'Sabre\\CalDAV\\Backend\\BackendInterface' => __DIR__ . '/..' . '/sabre/dav/lib/CalDAV/Backend/BackendInterface.php', diff --git a/composer/installed.json b/composer/installed.json index 170e4d507..cdde6aa1f 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -5265,8 +5265,8 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.32.0", - "version_normalized": "1.32.0.0", + "version": "v1.33.0", + "version_normalized": "1.33.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -5329,7 +5329,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" }, "funding": [ { @@ -5340,6 +5340,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -5349,23 +5353,23 @@ }, { "name": "symfony/polyfill-php83", - "version": "v1.32.0", - "version_normalized": "1.32.0.0", + "version": "v1.33.0", + "version_normalized": "1.33.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491" + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/2fb86d65e2d424369ad2905e83b236a8805ba491", - "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5", "shasum": "" }, "require": { "php": ">=7.2" }, - "time": "2024-09-09T11:45:10+00:00", + "time": "2025-07-08T02:45:35+00:00", "type": "library", "extra": { "thanks": { @@ -5408,7 +5412,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.33.0" }, "funding": [ { @@ -5419,6 +5423,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -5428,23 +5436,23 @@ }, { "name": "symfony/polyfill-php84", - "version": "v1.32.0", - "version_normalized": "1.32.0.0", + "version": "v1.33.0", + "version_normalized": "1.33.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php84.git", - "reference": "000df7860439609837bbe28670b0be15783b7fbf" + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/000df7860439609837bbe28670b0be15783b7fbf", - "reference": "000df7860439609837bbe28670b0be15783b7fbf", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/d8ced4d875142b6a7426000426b8abc631d6b191", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191", "shasum": "" }, "require": { "php": ">=7.2" }, - "time": "2025-02-20T12:04:08+00:00", + "time": "2025-06-24T13:30:11+00:00", "type": "library", "extra": { "thanks": { @@ -5487,7 +5495,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php84/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php84/tree/v1.33.0" }, "funding": [ { @@ -5498,6 +5506,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" diff --git a/composer/installed.php b/composer/installed.php index b5af34963..ebacbc383 100644 --- a/composer/installed.php +++ b/composer/installed.php @@ -764,8 +764,8 @@ 'dev_requirement' => false, ), 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.32.0', - 'version' => '1.32.0.0', + 'pretty_version' => 'v1.33.0', + 'version' => '1.33.0.0', 'reference' => '3833d7255cc303546435cb650316bff708a1c75c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', @@ -797,18 +797,18 @@ ), ), 'symfony/polyfill-php83' => array( - 'pretty_version' => 'v1.32.0', - 'version' => '1.32.0.0', - 'reference' => '2fb86d65e2d424369ad2905e83b236a8805ba491', + 'pretty_version' => 'v1.33.0', + 'version' => '1.33.0.0', + 'reference' => '17f6f9a6b1735c0f163024d959f700cfbc5155e5', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php83', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-php84' => array( - 'pretty_version' => 'v1.32.0', - 'version' => '1.32.0.0', - 'reference' => '000df7860439609837bbe28670b0be15783b7fbf', + 'pretty_version' => 'v1.33.0', + 'version' => '1.33.0.0', + 'reference' => 'd8ced4d875142b6a7426000426b8abc631d6b191', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php84', 'aliases' => array(), diff --git a/symfony/polyfill-php83/Php83.php b/symfony/polyfill-php83/Php83.php index 3d94b6c32..8b7ee4c70 100644 --- a/symfony/polyfill-php83/Php83.php +++ b/symfony/polyfill-php83/Php83.php @@ -35,7 +35,7 @@ public static function json_validate(string $json, int $depth = 512, int $flags throw new \ValueError(sprintf('json_validate(): Argument #2 ($depth) must be less than %d', self::JSON_MAX_DEPTH)); } - json_decode($json, null, $depth, $flags); + json_decode($json, true, $depth, $flags); return \JSON_ERROR_NONE === json_last_error(); } diff --git a/symfony/polyfill-php84/Php84.php b/symfony/polyfill-php84/Php84.php index 17668e6b7..1eea63afb 100644 --- a/symfony/polyfill-php84/Php84.php +++ b/symfony/polyfill-php84/Php84.php @@ -174,4 +174,44 @@ private static function mb_internal_trim(string $regex, string $string, ?string return mb_convert_encoding($string, $encoding, 'UTF-8'); } + + public static function grapheme_str_split(string $string, int $length) + { + if (0 > $length || 1073741823 < $length) { + throw new \ValueError('grapheme_str_split(): Argument #2 ($length) must be greater than 0 and less than or equal to 1073741823.'); + } + + if ('' === $string) { + return []; + } + + $regex = ((float) \PCRE_VERSION < 10 ? (float) \PCRE_VERSION >= 8.32 : (float) \PCRE_VERSION >= 10.39) + ? '\X' + : '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; + + if (!preg_match_all('/'. $regex .'/u', $string, $matches)) { + return false; + } + + if (1 === $length) { + return $matches[0]; + } + + $chunks = array_chunk($matches[0], $length); + foreach ($chunks as &$chunk) { + $chunk = implode('', $chunk); + } + + return $chunks; + } + + public static function bcdivmod(string $num1, string $num2, ?int $scale = null): ?array + { + if (null === $quot = \bcdiv($num1, $num2, 0)) { + return null; + } + $scale = $scale ?? (\PHP_VERSION_ID >= 70300 ? \bcscale() : (ini_get('bcmath.scale') ?: 0)); + + return [$quot, \bcmod($num1, $num2, $scale)]; + } } diff --git a/symfony/polyfill-php84/Resources/stubs/ReflectionConstant.php b/symfony/polyfill-php84/Resources/stubs/ReflectionConstant.php new file mode 100644 index 000000000..f4c8448bf --- /dev/null +++ b/symfony/polyfill-php84/Resources/stubs/ReflectionConstant.php @@ -0,0 +1,158 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80400) { + /** + * @author Daniel Scherzer + */ + final class ReflectionConstant + { + /** + * @var string + * + * @readonly + */ + public $name; + + private $value; + private $deprecated; + + private static $persistentConstants = []; + + public function __construct(string $name) + { + if (!defined($name) || false !== strpos($name, '::')) { + throw new ReflectionException("Constant \"$name\" does not exist"); + } + + $this->name = ltrim($name, '\\'); + $deprecated = false; + $eh = set_error_handler(static function ($type, $msg, $file, $line) use ($name, &$deprecated, &$eh) { + if (\E_DEPRECATED === $type && "Constant $name is deprecated" === $msg) { + return $deprecated = true; + } + + return $eh && $eh($type, $msg, $file, $line); + }); + + try { + $this->value = constant($name); + $this->deprecated = $deprecated; + } finally { + restore_error_handler(); + } + } + + public function getName(): string + { + return $this->name; + } + + public function getValue() + { + return $this->value; + } + + public function getNamespaceName(): string + { + if (false === $slashPos = strrpos($this->name, '\\')) { + return ''; + } + + return substr($this->name, 0, $slashPos); + } + + public function getShortName(): string + { + if (false === $slashPos = strrpos($this->name, '\\')) { + return $this->name; + } + + return substr($this->name, $slashPos + 1); + } + + public function isDeprecated(): bool + { + return $this->deprecated; + } + + public function __toString(): string + { + // A constant is persistent if provided by PHP itself rather than + // being defined by users. If we got here, we know that it *is* + // defined, so we just need to figure out if it is defined by the + // user or not + if (!self::$persistentConstants) { + $persistentConstants = get_defined_constants(true); + unset($persistentConstants['user']); + foreach ($persistentConstants as $constants) { + self::$persistentConstants += $constants; + } + } + $persistent = array_key_exists($this->name, self::$persistentConstants); + + // Can't match the inclusion of `no_file_cache` but the rest is + // possible to match + $result = 'Constant [ '; + if ($persistent || $this->deprecated) { + $result .= '<'; + if ($persistent) { + $result .= 'persistent'; + if ($this->deprecated) { + $result .= ', '; + } + } + if ($this->deprecated) { + $result .= 'deprecated'; + } + $result .= '> '; + } + // Cannot just use gettype() to match zend_zval_type_name() + if (is_object($this->value)) { + $result .= \PHP_VERSION_ID >= 80000 ? get_debug_type($this->value) : gettype($this->value); + } elseif (is_bool($this->value)) { + $result .= 'bool'; + } elseif (is_int($this->value)) { + $result .= 'int'; + } elseif (is_float($this->value)) { + $result .= 'float'; + } elseif (null === $this->value) { + $result .= 'null'; + } else { + $result .= gettype($this->value); + } + $result .= ' '; + $result .= $this->name; + $result .= ' ] { '; + if (is_array($this->value)) { + $result .= 'Array'; + } else { + // This will throw an exception if the value is an object that + // cannot be converted to string; that is expected and matches + // the behavior of zval_get_string_func() + $result .= (string) $this->value; + } + $result .= " }\n"; + + return $result; + } + + public function __sleep(): array + { + throw new Exception("Serialization of 'ReflectionConstant' is not allowed"); + } + + public function __wakeup(): void + { + throw new Exception("Unserialization of 'ReflectionConstant' is not allowed"); + } + } +} diff --git a/symfony/polyfill-php84/bootstrap.php b/symfony/polyfill-php84/bootstrap.php index 2a9720725..4bd1c17d2 100644 --- a/symfony/polyfill-php84/bootstrap.php +++ b/symfony/polyfill-php84/bootstrap.php @@ -66,3 +66,17 @@ function mb_ltrim(string $string, ?string $characters = null, ?string $encoding function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_rtrim($string, $characters, $encoding); } } } + +if (extension_loaded('bcmath')) { + if (!function_exists('bcdivmod')) { + function bcdivmod(string $num1, string $num2, ?int $scale = null): ?array { return p\Php84::bcdivmod($num1, $num2, $scale); } + } +} + +if (\PHP_VERSION_ID >= 80200) { + return require __DIR__.'/bootstrap82.php'; +} + +if (extension_loaded('intl') && !function_exists('grapheme_str_split')) { + function grapheme_str_split(string $string, int $length = 1) { return p\Php84::grapheme_str_split($string, $length); } +} diff --git a/symfony/polyfill-php84/bootstrap82.php b/symfony/polyfill-php84/bootstrap82.php new file mode 100644 index 000000000..216ad021f --- /dev/null +++ b/symfony/polyfill-php84/bootstrap82.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php84 as p; + +if (\PHP_VERSION_ID >= 80400) { + return; +} + +if (extension_loaded('intl') && !function_exists('grapheme_str_split')) { + function grapheme_str_split(string $string, int $length = 1): array|false { return p\Php84::grapheme_str_split($string, $length); } +}