Skip to content
Snippets Groups Projects
Verified Commit 5a43c22f authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3441331 by andypost, longwave, alexpott, Spokje, xjm: Update to Twig 3.9

parent 338d4d04
Branches
Tags
23 merge requests!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!10602Issue #3438769 by vinmayiswamy, antonnavi, michelle, amateescu: Sub workspace does not clear,!10301Issue #3469309 by mstrelan, smustgrave, moshe weitzman: Use one-time login...,!10187Issue #3487488 by dakwamine: ExtensionMimeTypeGuesser::guessMimeType must support file names with "0" (zero) like foo.0.zip,!9944Issue #3483353: Consider making the createCopy config action optionally fail...,!9929Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9787Resolve issue 3479427 - bootstrap barrio issue under Windows,!9742Issue #3463908 by catch, quietone: Split OptionsFieldUiTest into two,!9526Issue #3458177 by mondrake, catch, quietone, godotislate, longwave, larowlan,...,!8738Issue #3424162 by camilledavis, dineshkumarbollu, smustgrave: Claro...,!8704Make greek characters available in ckeditor5,!8597Draft: Issue #3442259 by catch, quietone, dww: Reduce time of Migrate Upgrade tests...,!8533Issue #3446962 by kim.pepper: Remove incorrectly added...,!8517Issue #3443748 by NexusNovaz, smustgrave: Testcase creates false positive,!8325Update file Sort.php,!8095Expose document root on install,!7930Resolve #3427374 "Taxonomytid viewsargumentdefault plugin",!7627Issue #3439440 by nicxvan, Binoli Lalani, longwave: Remove country support from DateFormatter,!7445Issue #3440169: When using drupalGet(), provide an associative array for $headers,!6502Draft: Resolve #2938524 "Plach testing issue",!38582585169-10.1.x,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key
Pipeline #150349 passed with warnings
Pipeline: drupal

#150355

    ...@@ -495,7 +495,7 @@ ...@@ -495,7 +495,7 @@
    "dist": { "dist": {
    "type": "path", "type": "path",
    "url": "core", "url": "core",
    "reference": "52e04d4f59d5d77f898e4a3d2a63c1d809f139f7" "reference": "b8ae3e330a6035450fa1578a5d2d30388cb98314"
    }, },
    "require": { "require": {
    "asm89/stack-cors": "^2.1", "asm89/stack-cors": "^2.1",
    ...@@ -540,7 +540,7 @@ ...@@ -540,7 +540,7 @@
    "symfony/serializer": "^6.4", "symfony/serializer": "^6.4",
    "symfony/validator": "^6.4", "symfony/validator": "^6.4",
    "symfony/yaml": "^6.4", "symfony/yaml": "^6.4",
    "twig/twig": "^3.5.0" "twig/twig": "^3.9.3"
    }, },
    "conflict": { "conflict": {
    "drush/drush": "<12.4.3" "drush/drush": "<12.4.3"
    ...@@ -4367,30 +4367,37 @@ ...@@ -4367,30 +4367,37 @@
    }, },
    { {
    "name": "twig/twig", "name": "twig/twig",
    "version": "v3.8.0", "version": "v3.9.3",
    "source": { "source": {
    "type": "git", "type": "git",
    "url": "https://github.com/twigphp/Twig.git", "url": "https://github.com/twigphp/Twig.git",
    "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d" "reference": "a842d75fed59cdbcbd3a3ad7fb9eb768fc350d58"
    }, },
    "dist": { "dist": {
    "type": "zip", "type": "zip",
    "url": "https://api.github.com/repos/twigphp/Twig/zipball/9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", "url": "https://api.github.com/repos/twigphp/Twig/zipball/a842d75fed59cdbcbd3a3ad7fb9eb768fc350d58",
    "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", "reference": "a842d75fed59cdbcbd3a3ad7fb9eb768fc350d58",
    "shasum": "" "shasum": ""
    }, },
    "require": { "require": {
    "php": ">=7.2.5", "php": ">=7.2.5",
    "symfony/deprecation-contracts": "^2.5|^3",
    "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-ctype": "^1.8",
    "symfony/polyfill-mbstring": "^1.3", "symfony/polyfill-mbstring": "^1.3",
    "symfony/polyfill-php80": "^1.22" "symfony/polyfill-php80": "^1.22"
    }, },
    "require-dev": { "require-dev": {
    "psr/container": "^1.0|^2.0", "psr/container": "^1.0|^2.0",
    "symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0" "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0"
    }, },
    "type": "library", "type": "library",
    "autoload": { "autoload": {
    "files": [
    "src/Resources/core.php",
    "src/Resources/debug.php",
    "src/Resources/escaper.php",
    "src/Resources/string_loader.php"
    ],
    "psr-4": { "psr-4": {
    "Twig\\": "src/" "Twig\\": "src/"
    } }
    ...@@ -4423,7 +4430,7 @@ ...@@ -4423,7 +4430,7 @@
    ], ],
    "support": { "support": {
    "issues": "https://github.com/twigphp/Twig/issues", "issues": "https://github.com/twigphp/Twig/issues",
    "source": "https://github.com/twigphp/Twig/tree/v3.8.0" "source": "https://github.com/twigphp/Twig/tree/v3.9.3"
    }, },
    "funding": [ "funding": [
    { {
    ...@@ -4435,7 +4442,7 @@ ...@@ -4435,7 +4442,7 @@
    "type": "tidelift" "type": "tidelift"
    } }
    ], ],
    "time": "2023-11-21T18:54:41+00:00" "time": "2024-04-18T11:59:33+00:00"
    } }
    ], ],
    "packages-dev": [ "packages-dev": [
    ......
    ...@@ -61,6 +61,6 @@ ...@@ -61,6 +61,6 @@
    "symfony/var-dumper": "~v6.4.0", "symfony/var-dumper": "~v6.4.0",
    "symfony/var-exporter": "~v6.4.1", "symfony/var-exporter": "~v6.4.1",
    "symfony/yaml": "~v6.4.3", "symfony/yaml": "~v6.4.3",
    "twig/twig": "~v3.8.0" "twig/twig": "~v3.9.3"
    } }
    } }
    ...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
    "symfony/process": "^6.4", "symfony/process": "^6.4",
    "symfony/polyfill-iconv": "^1.26", "symfony/polyfill-iconv": "^1.26",
    "symfony/yaml": "^6.4", "symfony/yaml": "^6.4",
    "twig/twig": "^3.5.0", "twig/twig": "^3.9.3",
    "doctrine/annotations": "^1.14", "doctrine/annotations": "^1.14",
    "guzzlehttp/guzzle": "^7.5", "guzzlehttp/guzzle": "^7.5",
    "guzzlehttp/psr7": "^2.4.5", "guzzlehttp/psr7": "^2.4.5",
    ......
    ...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
    namespace Drupal\Core\Template; namespace Drupal\Core\Template;
    use Twig\Attribute\YieldReady;
    use Twig\Compiler; use Twig\Compiler;
    use Twig\Error\SyntaxError; use Twig\Error\SyntaxError;
    use Twig\Node\CheckToStringNode; use Twig\Node\CheckToStringNode;
    ...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
    * @see https://twig-extensions.readthedocs.io/en/latest/i18n.html * @see https://twig-extensions.readthedocs.io/en/latest/i18n.html
    * @see https://github.com/fabpot/Twig-extensions * @see https://github.com/fabpot/Twig-extensions
    */ */
    #[YieldReady]
    class TwigNodeTrans extends Node { class TwigNodeTrans extends Node {
    /** /**
    ...@@ -59,7 +61,7 @@ public function compile(Compiler $compiler) { ...@@ -59,7 +61,7 @@ public function compile(Compiler $compiler) {
    } }
    // Start writing with the function to be called. // Start writing with the function to be called.
    $compiler->write('echo ' . (empty($plural) ? 't' : '\Drupal::translation()->formatPlural') . '('); $compiler->write('yield ' . (empty($plural) ? 't' : '\Drupal::translation()->formatPlural') . '(');
    // Move the count to the beginning of the parameters list. // Move the count to the beginning of the parameters list.
    if (!empty($plural)) { if (!empty($plural)) {
    ......
    ...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
    use Twig\Node\Expression\FunctionExpression; use Twig\Node\Expression\FunctionExpression;
    use Twig\Node\Node; use Twig\Node\Node;
    use Twig\Node\PrintNode; use Twig\Node\PrintNode;
    use Twig\NodeVisitor\AbstractNodeVisitor; use Twig\NodeVisitor\NodeVisitorInterface;
    /** /**
    * Provides a TwigNodeVisitor to change the generated parse-tree. * Provides a TwigNodeVisitor to change the generated parse-tree.
    ...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
    * *
    * @see twig_render * @see twig_render
    */ */
    class TwigNodeVisitor extends AbstractNodeVisitor { class TwigNodeVisitor implements NodeVisitorInterface {
    /** /**
    * Tracks whether there is a render array aware filter active already. * Tracks whether there is a render array aware filter active already.
    ...@@ -28,14 +28,14 @@ class TwigNodeVisitor extends AbstractNodeVisitor { ...@@ -28,14 +28,14 @@ class TwigNodeVisitor extends AbstractNodeVisitor {
    /** /**
    * {@inheritdoc} * {@inheritdoc}
    */ */
    protected function doEnterNode(Node $node, Environment $env) { public function enterNode(Node $node, Environment $env): Node {
    return $node; return $node;
    } }
    /** /**
    * {@inheritdoc} * {@inheritdoc}
    */ */
    protected function doLeaveNode(Node $node, Environment $env) { public function leaveNode(Node $node, Environment $env): ?Node {
    // We use this to inject a call to render_var -> TwigExtension->renderVar() // We use this to inject a call to render_var -> TwigExtension->renderVar()
    // before anything is printed. // before anything is printed.
    if ($node instanceof PrintNode) { if ($node instanceof PrintNode) {
    ......
    ...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
    use Twig\Node\Expression\NameExpression; use Twig\Node\Expression\NameExpression;
    use Twig\Node\ModuleNode; use Twig\Node\ModuleNode;
    use Twig\Node\Node; use Twig\Node\Node;
    use Twig\NodeVisitor\AbstractNodeVisitor; use Twig\NodeVisitor\NodeVisitorInterface;
    /** /**
    * Provides a Node Visitor to trigger errors if deprecated variables are used. * Provides a Node Visitor to trigger errors if deprecated variables are used.
    ...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
    * *
    * @see \Drupal\Core\Template\TwigNodeCheckDeprecations * @see \Drupal\Core\Template\TwigNodeCheckDeprecations
    */ */
    class TwigNodeVisitorCheckDeprecations extends AbstractNodeVisitor { class TwigNodeVisitorCheckDeprecations implements NodeVisitorInterface {
    /** /**
    * The named variables used in the template from the context. * The named variables used in the template from the context.
    ...@@ -33,7 +33,7 @@ class TwigNodeVisitorCheckDeprecations extends AbstractNodeVisitor { ...@@ -33,7 +33,7 @@ class TwigNodeVisitorCheckDeprecations extends AbstractNodeVisitor {
    /** /**
    * {@inheritdoc} * {@inheritdoc}
    */ */
    protected function doEnterNode(Node $node, Environment $env) { public function enterNode(Node $node, Environment $env): Node {
    if ($node instanceof ModuleNode) { if ($node instanceof ModuleNode) {
    $this->usedNames = []; $this->usedNames = [];
    $this->assignedNames = []; $this->assignedNames = [];
    ...@@ -55,7 +55,7 @@ protected function doEnterNode(Node $node, Environment $env) { ...@@ -55,7 +55,7 @@ protected function doEnterNode(Node $node, Environment $env) {
    /** /**
    * {@inheritdoc} * {@inheritdoc}
    */ */
    protected function doLeaveNode(Node $node, Environment $env) { public function leaveNode(Node $node, Environment $env): ?Node {
    // At the end of the template, check the used variables are not deprecated. // At the end of the template, check the used variables are not deprecated.
    if ($node instanceof ModuleNode) { if ($node instanceof ModuleNode) {
    if (!empty($this->usedNames)) { if (!empty($this->usedNames)) {
    ......
    ...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
    use Twig\Node\SetNode; use Twig\Node\SetNode;
    use Twig\Node\TextNode; use Twig\Node\TextNode;
    use Twig\Node\Expression\AbstractExpression; use Twig\Node\Expression\AbstractExpression;
    use Twig\NodeVisitor\AbstractNodeVisitor; use Twig\NodeVisitor\NodeVisitorInterface;
    /** /**
    * Defines a Twig node visitor for testing help topics. * Defines a Twig node visitor for testing help topics.
    ...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
    * See static::setStateValue() for information on the special processing * See static::setStateValue() for information on the special processing
    * this class can do. * this class can do.
    */ */
    class HelpTestTwigNodeVisitor extends AbstractNodeVisitor { class HelpTestTwigNodeVisitor implements NodeVisitorInterface {
    /** /**
    * Delimiter placed around single translated chunks. * Delimiter placed around single translated chunks.
    ...@@ -32,14 +32,14 @@ class HelpTestTwigNodeVisitor extends AbstractNodeVisitor { ...@@ -32,14 +32,14 @@ class HelpTestTwigNodeVisitor extends AbstractNodeVisitor {
    /** /**
    * {@inheritdoc} * {@inheritdoc}
    */ */
    protected function doEnterNode(Node $node, Environment $env) { public function enterNode(Node $node, Environment $env): Node {
    return $node; return $node;
    } }
    /** /**
    * {@inheritdoc} * {@inheritdoc}
    */ */
    protected function doLeaveNode(Node $node, Environment $env) { public function leaveNode(Node $node, Environment $env): ?Node {
    $processing = static::getState(); $processing = static::getState();
    if (!$processing['manner']) { if (!$processing['manner']) {
    return $node; return $node;
    ......
    ...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
    namespace Drupal\sdc_other_node_visitor\Twig\Profiler; namespace Drupal\sdc_other_node_visitor\Twig\Profiler;
    use Twig\Attribute\YieldReady;
    use Twig\Compiler; use Twig\Compiler;
    use Twig\Node\Node; use Twig\Node\Node;
    /** /**
    * Represents a profile enter node. * Represents a profile enter node.
    */ */
    #[YieldReady]
    class EnterProfileNode extends Node { class EnterProfileNode extends Node {
    public function __construct(string $extensionName, string $varName) { public function __construct(string $extensionName, string $varName) {
    ......
    ...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
    namespace Drupal\sdc_other_node_visitor\Twig\Profiler; namespace Drupal\sdc_other_node_visitor\Twig\Profiler;
    use Twig\Attribute\YieldReady;
    use Twig\Compiler; use Twig\Compiler;
    use Twig\Node\Node; use Twig\Node\Node;
    /** /**
    * Represents a profile leave node. * Represents a profile leave node.
    */ */
    #[YieldReady]
    class LeaveProfileNode extends Node { class LeaveProfileNode extends Node {
    public function __construct(string $varName) { public function __construct(string $varName) {
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment