diff --git a/CHANGELOG-WIP.md b/CHANGELOG-WIP.md index 9b4b1dd6124..ae5107a1219 100644 --- a/CHANGELOG-WIP.md +++ b/CHANGELOG-WIP.md @@ -22,3 +22,4 @@ - Relations for fields that are no longer included in an element’s field layout are now deleted after element save. ([#13956](https://github.com/craftcms/cms/issues/13956)) - The Sendmail email transport type now uses the `sendmail_path` PHP ini setting by default. ([#14433](https://github.com/craftcms/cms/pull/14433)) - Fixed a bug where the Updates utility and Updates widget weren’t handling update check failures. +- Updated Twig to 3.8. diff --git a/composer.json b/composer.json index 2d04b02a28a..8115a6593b4 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "symfony/var-dumper": "^5.0|^6.0", "symfony/yaml": "^5.2.3", "theiconic/name-parser": "^1.2", - "twig/twig": "~3.4.3", + "twig/twig": "~3.8.0", "voku/stringy": "^6.4.0", "webonyx/graphql-php": "~14.11.5", "yiisoft/yii2": "~2.0.48.1", diff --git a/composer.lock b/composer.lock index 167f9cb6f36..d9b8a1b7889 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": "1a1cf007ed10360541eaa9eb77b7a122", + "content-hash": "c8414f1566ad594c1d9310383746c319", "packages": [ { "name": "cebe/markdown", @@ -5332,33 +5332,29 @@ }, { "name": "twig/twig", - "version": "v3.4.3", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58" + "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/c38fd6b0b7f370c198db91ffd02e23b517426b58", - "reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", + "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php80": "^1.22" }, "require-dev": { - "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + "psr/container": "^1.0|^2.0", + "symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Twig\\": "src/" @@ -5392,7 +5388,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.4.3" + "source": "https://github.com/twigphp/Twig/tree/v3.8.0" }, "funding": [ { @@ -5404,7 +5400,7 @@ "type": "tidelift" } ], - "time": "2022-09-28T08:42:51+00:00" + "time": "2023-11-21T18:54:41+00:00" }, { "name": "voku/anti-xss", diff --git a/tests/unit/web/twig/ExtensionTest.php b/tests/unit/web/twig/ExtensionTest.php index 14b27db06d4..34375c61dec 100644 --- a/tests/unit/web/twig/ExtensionTest.php +++ b/tests/unit/web/twig/ExtensionTest.php @@ -8,7 +8,6 @@ namespace crafttests\unit\web\twig; use ArrayObject; -use Codeception\Test\Unit; use Craft; use craft\elements\Address; use craft\elements\Entry; @@ -22,8 +21,8 @@ use DateInterval; use DateTime; use Twig\Error\LoaderError; +use Twig\Error\RuntimeError; use Twig\Error\SyntaxError; -use TypeError; use yii\base\ErrorException; use yii\base\Exception; use yii\base\InvalidConfigException; @@ -724,7 +723,7 @@ public function testGroupFilter(): void ); // invalid value - self::expectException(TypeError::class); + self::expectException(RuntimeError::class); $this->view->renderString('{% do "foo"|group("bar") %}'); }