diff --git a/composer.json b/composer.json index 8fcda07b1..80ed582f8 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "vendor-dir": "./upload/system/storage/vendor/" }, "require": { - "php": ">=8.3", + "php": ">=8.2", "twig/twig": "^3.3", "ralouphie/getallheaders": "^3.0", "divido/divido-php": "^1.15", diff --git a/composer.lock b/composer.lock index 8f66f7f6e..445db4869 100644 --- a/composer.lock +++ b/composer.lock @@ -1324,16 +1324,16 @@ }, { "name": "twig/twig", - "version": "v3.10.0", + "version": "v3.10.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "34422f90043aba75e419dd77ee0a86e1688c28ee" + "reference": "3af5ab2e52279e5e23dc192b1a26db3b8cffa4e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/34422f90043aba75e419dd77ee0a86e1688c28ee", - "reference": "34422f90043aba75e419dd77ee0a86e1688c28ee", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/3af5ab2e52279e5e23dc192b1a26db3b8cffa4e7", + "reference": "3af5ab2e52279e5e23dc192b1a26db3b8cffa4e7", "shasum": "" }, "require": { @@ -1387,7 +1387,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.10.0" + "source": "https://github.com/twigphp/Twig/tree/v3.10.1" }, "funding": [ { @@ -1399,7 +1399,7 @@ "type": "tidelift" } ], - "time": "2024-05-11T07:44:16+00:00" + "time": "2024-05-12T06:16:18+00:00" }, { "name": "zoujingli/wechat-developer", @@ -1515,7 +1515,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.3" + "php": ">=8.2" }, "platform-dev": [], "plugin-api-version": "2.6.0" diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index b8b88dc59..a96891fe4 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -1368,17 +1368,17 @@ }, { "name": "twig/twig", - "version": "v3.10.0", - "version_normalized": "3.10.0.0", + "version": "v3.10.1", + "version_normalized": "3.10.1.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "34422f90043aba75e419dd77ee0a86e1688c28ee" + "reference": "3af5ab2e52279e5e23dc192b1a26db3b8cffa4e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/34422f90043aba75e419dd77ee0a86e1688c28ee", - "reference": "34422f90043aba75e419dd77ee0a86e1688c28ee", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/3af5ab2e52279e5e23dc192b1a26db3b8cffa4e7", + "reference": "3af5ab2e52279e5e23dc192b1a26db3b8cffa4e7", "shasum": "" }, "require": { @@ -1392,7 +1392,7 @@ "psr/container": "^1.0|^2.0", "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" }, - "time": "2024-05-11T07:44:16+00:00", + "time": "2024-05-12T06:16:18+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1434,7 +1434,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.10.0" + "source": "https://github.com/twigphp/Twig/tree/v3.10.1" }, "funding": [ { diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index bd4416041..5146455cd 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'opencart/opencart-3', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'cec67b4a511637a54d05c6ebbb5efd167aa4250b', + 'reference' => 'f33c7c81461c1826bc983a6a6742cf2e56463b40', 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), @@ -67,7 +67,7 @@ 'opencart/opencart-3' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'cec67b4a511637a54d05c6ebbb5efd167aa4250b', + 'reference' => 'f33c7c81461c1826bc983a6a6742cf2e56463b40', 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), @@ -200,9 +200,9 @@ 'dev_requirement' => false, ), 'twig/twig' => array( - 'pretty_version' => 'v3.10.0', - 'version' => '3.10.0.0', - 'reference' => '34422f90043aba75e419dd77ee0a86e1688c28ee', + 'pretty_version' => 'v3.10.1', + 'version' => '3.10.1.0', + 'reference' => '3af5ab2e52279e5e23dc192b1a26db3b8cffa4e7', 'type' => 'library', 'install_path' => __DIR__ . '/../twig/twig', 'aliases' => array(), diff --git a/upload/system/storage/vendor/twig/twig/CHANGELOG b/upload/system/storage/vendor/twig/twig/CHANGELOG index ce4f11e72..9fbdb7987 100644 --- a/upload/system/storage/vendor/twig/twig/CHANGELOG +++ b/upload/system/storage/vendor/twig/twig/CHANGELOG @@ -1,3 +1,8 @@ +# 3.10.1 (2024-05-12) + + * Fix BC break on escaper extension + * Fix constant return type + # 3.10.0 (2024-05-11) * Make `CoreExtension::formatDate`, `CoreExtension::convertDate`, and diff --git a/upload/system/storage/vendor/twig/twig/src/Environment.php b/upload/system/storage/vendor/twig/twig/src/Environment.php index 7a2bd01d9..b7cb5399b 100644 --- a/upload/system/storage/vendor/twig/twig/src/Environment.php +++ b/upload/system/storage/vendor/twig/twig/src/Environment.php @@ -43,11 +43,11 @@ */ class Environment { - public const VERSION = '3.10.0'; - public const VERSION_ID = 301000; + public const VERSION = '3.10.1'; + public const VERSION_ID = 301001; public const MAJOR_VERSION = 3; public const MINOR_VERSION = 10; - public const RELEASE_VERSION = 0; + public const RELEASE_VERSION = 1; public const EXTRA_VERSION = ''; private $charset; @@ -135,7 +135,9 @@ public function __construct(LoaderInterface $loader, $options = []) ]); $this->addExtension(new CoreExtension()); - $this->addExtension(new EscaperExtension($options['autoescape'])); + $escaperExt = new EscaperExtension($options['autoescape']); + $escaperExt->setEnvironment($this, false); + $this->addExtension($escaperExt); if (\PHP_VERSION_ID >= 80000) { $this->addExtension(new YieldNotReadyExtension($this->useYield)); } diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php index bd9552f10..d7915ef9b 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php @@ -1365,9 +1365,12 @@ public static function source(Environment $env, $name, $ignoreMissing = false): * @param string $constant The name of the constant * @param object|null $object The object to get the constant from * + * @return mixed Class constants can return many types like scalars, arrays, and + * objects depending on the PHP version (\BackedEnum, \UnitEnum, etc.) + * * @internal */ - public static function constant($constant, $object = null): string + public static function constant($constant, $object = null) { if (null !== $object) { if ('class' === $constant) { diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php index a0654cd8c..cf821c6d5 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php @@ -59,11 +59,14 @@ public function getFilters(): array /** * @deprecated since Twig 3.10 */ - public function setEnvironment(Environment $environment): void + public function setEnvironment(Environment $environment, bool $triggerDeprecation = true): void { - trigger_deprecation('twig/twig', '3.10', 'The "%s()" method is deprecated and not needed if you are using methods from "Twig\Runtime\EscaperRuntime".', __METHOD__); + if ($triggerDeprecation) { + trigger_deprecation('twig/twig', '3.10', 'The "%s()" method is deprecated and not needed if you are using methods from "Twig\Runtime\EscaperRuntime".', __METHOD__); + } $this->environment = $environment; + $this->escaper = $environment->getRuntime(EscaperRuntime::class); } /** @@ -126,9 +129,6 @@ public function setEscaper($strategy, callable $callable) if (!isset($this->environment)) { throw new \LogicException(sprintf('You must call "setEnvironment()" before calling "%s()".', __METHOD__)); } - if (!isset($this->escaper)) { - throw new \LogicException(sprintf('You must call "setEscaperRuntime()" before calling "%s()".', __METHOD__)); - } $this->escapers[$strategy] = $callable; $callable = function ($string, $charset) use ($callable) { @@ -160,7 +160,7 @@ public function setSafeClasses(array $safeClasses = []) trigger_deprecation('twig/twig', '3.10', 'The "%s()" method is deprecated, use the "Twig\Runtime\EscaperRuntime::setSafeClasses()" method instead.', __METHOD__); if (!isset($this->escaper)) { - throw new \LogicException(sprintf('You must call "setEscaperRuntime()" before calling %s().', __METHOD__)); + throw new \LogicException(sprintf('You must call "setEnvironment()" before calling "%s()".', __METHOD__)); } $this->escaper->setSafeClasses($safeClasses); @@ -174,7 +174,7 @@ public function addSafeClass(string $class, array $strategies) trigger_deprecation('twig/twig', '3.10', 'The "%s()" method is deprecated, use the "Twig\Runtime\EscaperRuntime::addSafeClass()" method instead.', __METHOD__); if (!isset($this->escaper)) { - throw new \LogicException(sprintf('You must call setEscaperRuntime() before calling %s().', __METHOD__)); + throw new \LogicException(sprintf('You must call "setEnvironment()" before calling "%s()".', __METHOD__)); } $this->escaper->addSafeClass($class, $strategies);