8000 [TwigBridge] Fix compat with Twig v3.9 · symfony/symfony@f01a7f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit f01a7f2

Browse files
[TwigBridge] Fix compat with Twig v3.9
1 parent f44d074 commit f01a7f2

File tree

13 files changed

+20
-9
lines changed

13 files changed

+20
-9
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"friendsofphp/proxy-manager-lts": "^1.0.2",
3838
"doctrine/event-manager": "~1.0",
3939
"doctrine/persistence": "^2|^3",
40-
"twig/twig": "^2.13|~3.8.0",
40+
"twig/twig": "^2.13|^3.0.4|^4.0",
4141
"psr/cache": "^1.0|^2.0",
4242
"psr/container": "^1.1.1",
4343
"psr/event-dispatcher": "^1.0",

src/Symfony/Bridge/Twig/Node/DumpNode.php

+2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
namespace Symfony\Bridge\Twig\Node;
1313

14+
use Twig\Attribute\YieldReady;
1415
use Twig\Compiler;
1516
use Twig\Node\Node;
1617

1718
/**
1819
* @author Julien Galenski <julien.galenski@gmail.com>
1920
*/
21+
#[YieldReady]
2022
final class DumpNode extends Node
2123
{
2224
private $varPrefix;

src/Symfony/Bridge/Twig/Node/FormThemeNode.php

+2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111

1212
namespace Symfony\Bridge\Twig\Node;
1313

14+
use Twig\Attribute\YieldReady;
1415
use Symfony\Component\Form\FormRenderer;
1516
use Twig\Compiler;
1617
use Twig\Node\Node;
1718

1819
/**
1920
* @author Fabien Potencier <fabien@symfony.com>
2021
*/
22+
#[YieldReady]
2123
final class FormThemeNode extends Node
2224
{
2325
public function __construct(Node $form, Node $resources, int $lineno, ?string $tag = null, bool $only = false)

src/Symfony/Bridge/Twig/Node/StopwatchNode.php

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bridge\Twig\Node;
1313

14+
use Twig\Attribute\YieldReady;
1415
use Twig\Compiler;
1516
use Twig\Node\Expression\AssignNameExpression;
1617
use Twig\Node\Node;
@@ -20,6 +21,7 @@
2021
*
2122
* @author Wouter J <wouter@wouterj.nl>
2223
*/
24+
#[YieldReady]
2325
final class StopwatchNode extends Node
2426
{
2527
public function __construct(Node $name, Node $body, AssignNameExpression $var, int $lineno = 0, ?string $tag = null)

src/Symfony/Bridge/Twig/Node/TransDefaultDomainNode.php

+2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111

1212
namespace Symfony\Bridge\Twig\Node;
1313

14+
use Twig\Attribute\YieldReady;
1415
use Twig\Compiler;
1516
use Twig\Node\Expression\AbstractExpression;
1617
use Twig\Node\Node;
1718

1819
/**
1920
* @author Fabien Potencier <fabien@symfony.com>
2021
*/
22+
#[YieldReady]
2123
final class TransDefaultDomainNode extends Node
2224
{
2325
public function __construct(AbstractExpression $expr, int $lineno = 0, ?string $tag = null)

src/Symfony/Bridge/Twig/Node/TransNode.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bridge\Twig\Node;
1313

14+
use Twig\Attribute\YieldReady;
1415
use Twig\Compiler;
1516
use Twig\Node\Expression\AbstractExpression;
1617
use Twig\Node\Expression\ArrayExpression;
@@ -22,6 +23,7 @@
2223
/**
2324
* @author Fabien Potencier <fabien@symfony.com>
2425
*/
26+
#[YieldReady]
2527
final class TransNode extends Node
2628
{
2729
public function __construct(Node $body, ?Node $domain = null, ?AbstractExpression $count = null, ?AbstractExpression $vars = null, ?AbstractExpression $locale = null, int $lineno = 0, ?string $tag = null)
@@ -53,9 +55,10 @@ public function compile(Compiler $compiler): void
5355
$vars = null;
5456
}
5557
[$msg, $defaults] = $this->compileString($this->getNode('body'), $defaults, (bool) $vars);
58+
$display = class_exists(YieldReady::class) ? 'yield' : 'echo';
5659

5760
$compiler
58-
->write('echo $this->env->getExtension(\'Symfony\Bridge\Twig\Extension\TranslationExtension\')->trans(')
61+
->write($display.' $this->env->getExtension(\'Symfony\Bridge\Twig\Extension\TranslationExtension\')->trans(')
5962
->subcompile($msg)
6063
;
6164

src/Symfony/Bridge/Twig/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php": ">=7.2.5",
2020
"symfony/polyfill-php80": "^1.16",
2121
"symfony/translation-contracts"< 10000 /span>: "^1.1|^2|^3",
22-
"twig/twig": "^2.13|~3.8.0"
22+
"twig/twig": "^2.13|^3.0.4|^4.0"
2323
},
2424
"require-dev": {
2525
"doctrine/annotations": "^1.12|^2",

src/Symfony/Bundle/FrameworkBundle/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"symfony/property-info": "^4.4|^5.0|^6.0",
6767
"symfony/web-link": "^4.4|^5.0|^6.0",
6868
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
69-
"twig/twig": "^2.10|~3.8.0"
69+
"twig/twig": "^2.10|^3.0.4|^4.0"
7070
},
7171
"conflict": {
7272
"doctrine/annotations": "<1.13.1",

src/Symfony/Bundle/SecurityBundle/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"symfony/twig-bridge": "^4.4|^5.0|^6.0",
5252
"symfony/validator": "^4.4|^5.0|^6.0",
5353
"symfony/yaml": "^4.4|^5.0|^6.0",
54-
"twig/twig": "^2.13|~3.8.0"
54+
"twig/twig": "^2.13|^3.0.4|^4.0"
5555
},
5656
"conflict": {
5757
"symfony/browser-kit": "<4.4",

src/Symfony/Bundle/TwigBundle/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"symfony/http-kernel": "^5.0|^6.0",
2525
"symfony/polyfill-ctype": "~1.8",
2626
"symfony/polyfill-php80": "^1.16",
27-
"twig/twig": "^2.13|~3.8.0"
27+
"twig/twig": "^2.13|^3.0.4|^4.0"
2828
},
2929
"require-dev": {
3030
"symfony/asset": "^4.4|^5.0|^6.0",

src/Symfony/Bundle/WebProfilerBundle/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"symfony/polyfill-php80": "^1.16",
2424
"symfony/routing": "^4.4|^5.0|^6.0",
2525
"symfony/twig-bundle": "^4.4|^5.0|^6.0",
26-
"twig/twig": "^2.13|~3.8.0"
26+
"twig/twig": "^2.13|^3.0.4|^4.0"
2727
},
2828
"require-dev": {
2929
"symfony/browser-kit": "^4.4|^5.0|^6.0",

src/Symfony/Component/HttpKernel/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"symfony/translation": "^4.4|^5.0|^6.0",
4343
"symfony/translation-contracts": "^1.1|^2|^3",
4444
"psr/cache": "^1.0|^2.0|^3.0",
45-
"twig/twig": "^2.13|~3.8.0"
45+
"twig/twig": "^2.13|^3.0.4|^4.0"
4646
},
4747
"provide": {
4848
"psr/log-implementation": "1.0|2.0"

src/Symfony/Component/VarDumper/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"symfony/http-kernel": "^4.4|^5.0|^6.0",
2727
"symfony/process": "^4.4|^5.0|^6.0",
2828
"symfony/uid": "^5.1|^6.0",
29-
"twig/twig": "^2.13|~3.8.0"
29+
"twig/twig": "^2.13|^3.0.4|^4.0"
3030
},
3131
"conflict": {
3232
"symfony/console": "<4.4"

0 commit comments

Comments
 (0)
0