Skip to content

Commit

Permalink
Upgraded twig/twig vendor to v3.10.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCartpenter committed May 12, 2024
1 parent f33c7c8 commit e2dae17
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 32 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions upload/system/storage/vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": [
{
Expand Down
10 changes: 5 additions & 5 deletions upload/system/storage/vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down
5 changes: 5 additions & 0 deletions upload/system/storage/vendor/twig/twig/CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 6 additions & 4 deletions upload/system/storage/vendor/twig/twig/src/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit e2dae17

Please sign in to comment.