Commit Graph

7614 Commits

Author SHA1 Message Date
Fabien Potencier bd652f3e66 Merge branch '3.x' into 4.x
* 3.x:
  Make `in_array()` calls strict
2025-02-21 19:08:53 +01:00
Fabien Potencier 1c6ac163c9 minor #4589 Make in_array() calls strict (alexandre-daubois)
This PR was merged into the 3.x branch.

Discussion
----------

Make `in_array()` calls strict

I propose to add `strict: true` to all calls to `in_array()`, making the calls faster.

Commits
-------

9c6b95f2a6 Make `in_array()` calls strict
2025-02-21 19:06:58 +01:00
Fabien Potencier 728adb4c61 Remove deprecated code 2025-02-21 19:05:11 +01:00
Fabien Potencier bec890f02f Fix bad merge 2025-02-21 19:03:49 +01:00
Fabien Potencier 4d9388dbe0 Merge branch '3.x' into 4.x
* 3.x:
  Fix testing and expression when it evaluates to an instance of Markup
  Simplify Error implementation
  Make the defined test implementation more generic
  fix typo
  fix the rst syntax of the operator precedence table
2025-02-21 18:55:21 +01:00
Fabien Potencier d187727e0b feature #4591 Fix testing and expression when it evaluates to an instance of Markup (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix testing and expression when it evaluates to an instance of Markup

Refs #3651

Commits
-------

d72c1c6b1e Fix testing and expression when it evaluates to an instance of Markup
2025-02-21 18:34:44 +01:00
Fabien Potencier d72c1c6b1e Fix testing and expression when it evaluates to an instance of Markup 2025-02-21 18:29:32 +01:00
Fabien Potencier 9f275f6ac6 feature #4590 Make the defined test implementation more generic (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Make the defined test implementation more generic

Commits
-------

2d84abfd08 Make the defined test implementation more generic
2025-02-21 18:22:44 +01:00
Fabien Potencier 9b4db2e931 minor #4592 Simplify Error implementation (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify Error implementation

Commits
-------

d10bcadd75 Simplify Error implementation
2025-02-21 15:39:18 +01:00
Fabien Potencier d10bcadd75 Simplify Error implementation 2025-02-21 11:34:30 +01:00
Fabien Potencier 2d84abfd08 Make the defined test implementation more generic 2025-02-21 08:36:21 +01:00
Alexandre Daubois 9c6b95f2a6 Make in_array() calls strict 2025-02-19 15:29:33 +01:00
Fabien Potencier 4effb660b3 minor #4587 fix typo (xabbuh)
This PR was merged into the 3.x branch.

Discussion
----------

fix typo

Commits
-------

4c818122f3 fix typo
2025-02-18 21:23:25 +01:00
Christian Flothmann 4c818122f3 fix typo 2025-02-18 15:14:50 +01:00
Fabien Potencier 0f569b8297 minor #4584 fix the rst syntax of the operator precedence table (xabbuh)
This PR was merged into the 3.x branch.

Discussion
----------

fix the rst syntax of the operator precedence table

Commits
-------

a544dc8b33 fix the rst syntax of the operator precedence table
2025-02-17 09:28:16 +01:00
Christian Flothmann a544dc8b33 fix the rst syntax of the operator precedence table 2025-02-16 22:36:01 +01:00
Fabien Potencier 82c88d367c feature #4577 Make the raw filter more "sticky" (fabpot)
This PR was merged into the 4.x branch.

Discussion
----------

Make the raw filter more "sticky"

When using `{{ foo|raw }}`, the expression won't be escaped as expected.

But if you store the result and reuse it afterwards, the value is not considered "safe" anymore:

`{% set bar = foo|raw %}{{ bar }}`

Here `bar` will be escaped.

For Twig 4.x, I propose to make the `raw` filter "sticky" by wrapping the value with `Markup`. That way, the second example won't be escaped as expected.

Commits
-------

54dea53382 Make the raw filter "sticky"
2025-02-14 16:04:53 +01:00
Fabien Potencier 3e97fc610f Merge branch '3.x' into 4.x
* 3.x:
  re-add mixed return type
2025-02-14 14:08:09 +01:00
Fabien Potencier 576b4126a6 minor #4582 re-add mixed return type (xabbuh)
This PR was merged into the 3.x branch.

Discussion
----------

re-add mixed return type

see https://github.com/twigphp/Twig/pull/4581#discussion_r1956080587 and https://github.com/symfony/symfony/actions/runs/13329105184/job/37228898654?pr=59776#step:8:2832

Commits
-------

5f6c67f838 re-add mixed return type
2025-02-14 14:06:59 +01:00
Christian Flothmann 5f6c67f838 re-add mixed return type 2025-02-14 13:47:07 +01:00
Fabien Potencier 9a0f896cd0 Fix CS 2025-02-14 13:03:18 +01:00
Fabien Potencier 38c52534cc Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
2025-02-14 13:02:29 +01:00
Fabien Potencier cfeb51b67f minor #4581 Fix CS (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix CS

Commits
-------

151aa4ecda Fix CS
2025-02-14 12:59:29 +01:00
Fabien Potencier 151aa4ecda Fix CS 2025-02-14 12:57:03 +01:00
Fabien Potencier 655b00c624 Fix CS 2025-02-14 12:53:03 +01:00
Fabien Potencier 831219425d Remove deprecated code 2025-02-14 12:51:21 +01:00
Fabien Potencier 9bccdf438d Merge branch '3.x' into 4.x
* 3.x:
  Add a proper prefix spread operator
  Avoid storing expression parser instances in Node attributes
2025-02-14 12:51:14 +01:00
Fabien Potencier 640b382a51 feature #4580 Add a proper prefix spread operator (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add a proper prefix spread operator

Now that 3.x has bumped the PHP min version to 8.1, we can move the spread operator to a real one.

Commits
-------

3964aeba78 Add a proper prefix spread operator
2025-02-14 12:46:44 +01:00
Fabien Potencier 3964aeba78 Add a proper prefix spread operator 2025-02-14 11:45:39 +01:00
Fabien Potencier 2f3150579f minor #4578 Avoid storing expression parser instances in Node attributes (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Avoid storing expression parser instances in Node attributes

That avoids polluting Node instances and exposing a purely internal state.

Commits
-------

d6f539bb01 Avoid storing expression parser instances in Node attributes
2025-02-14 11:36:16 +01:00
Fabien Potencier d8f42cd681 Merge branch '3.x' into 4.x
* 3.x:
  Fix docs
2025-02-14 11:33:35 +01:00
Fabien Potencier 20e677b6c9 Fix docs 2025-02-14 11:33:18 +01:00
Fabien Potencier d6f539bb01 Avoid storing expression parser instances in Node attributes 2025-02-14 11:32:12 +01:00
Fabien Potencier 69b191f486 Merge branch '3.x' into 4.x
* 3.x:
  Fix cache-extra impl
2025-02-14 11:30:46 +01:00
Fabien Potencier 613d6b9498 bug #4579 Fix cache-extra impl (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix cache-extra impl

Commits
-------

4695e33f73 Fix cache-extra impl
2025-02-14 11:30:33 +01:00
Fabien Potencier 4695e33f73 Fix cache-extra impl 2025-02-14 11:27:48 +01:00
Fabien Potencier 892e0bda58 Fix CI 2025-02-14 09:57:28 +01:00
Fabien Potencier 171262ca24 Remove deprecated code 2025-02-14 09:54:25 +01:00
Fabien Potencier 6032fd320c Merge branch '3.x' into 4.x
* 3.x:
  Fix version
  Fix CS
  Remove obsolete code
  Use generics in ExpressionParsers
  Fix precedence rules
  Add deprecation notices in CHANGELOG and docs
  Move Operators to ExpressionParsers, deprecate ExpressionParser
  Add a script to update operator precedence documentation
  Extract operators logic from ExpressionParser to their own classes
  Introduce operator classes to describe operators provided by extensions instead of arrays
  Bump version to 3.21
2025-02-14 09:08:33 +01:00
Fabien Potencier 1ea5ac600d feature #4543 Move operator definitions to objects (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Move operator definitions to objects

Commits
-------

79d828b09d Fix version
251c0b5da9 Fix CS
561c6629e1 Remove obsolete code
4b57f48a65 Use generics in ExpressionParsers
8ff19090f3 Fix precedence rules
0cb5c0e8d0 Add deprecation notices in CHANGELOG and docs
f67078b5c4 Move Operators to ExpressionParsers, deprecate ExpressionParser
9334a7064a Add a script to update operator precedence documentation
42c82e1e9b Extract operators logic from ExpressionParser to their own classes
df877a1d53 Introduce operator classes to describe operators provided by extensions instead of arrays
2025-02-14 08:51:09 +01:00
Fabien Potencier 79d828b09d Fix version 2025-02-14 08:47:54 +01:00
Fabien Potencier 251c0b5da9 Fix CS 2025-02-14 08:45:28 +01:00
Fabien Potencier 561c6629e1 Remove obsolete code 2025-02-14 08:38:53 +01:00
Fabien Potencier 4b57f48a65 Use generics in ExpressionParsers 2025-02-14 08:38:53 +01:00
Fabien Potencier 8ff19090f3 Fix precedence rules 2025-02-14 08:38:53 +01:00
Fabien Potencier 0cb5c0e8d0 Add deprecation notices in CHANGELOG and docs 2025-02-14 08:38:53 +01:00
Fabien Potencier f67078b5c4 Move Operators to ExpressionParsers, deprecate ExpressionParser 2025-02-14 08:38:53 +01:00
Fabien Potencier 9334a7064a Add a script to update operator precedence documentation 2025-02-14 08:38:53 +01:00
Fabien Potencier 42c82e1e9b Extract operators logic from ExpressionParser to their own classes 2025-02-14 08:38:53 +01:00
Fabien Potencier df877a1d53 Introduce operator classes to describe operators provided by extensions instead of arrays 2025-02-14 08:38:53 +01:00