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
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
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
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
This PR was merged into the 3.x branch.
Discussion
----------
Fix support for ignoring syntax erros in an undefined handler in guard
This fixes the issue discussed in https://github.com/twigphp/Twig/pull/4511#issuecomment-2598774060 so that ignoring SyntaxError from undefined handlers wanting to provide a custom message actually works in the `{% guard %}` tag.
This adds an integration test covering that behavior to ensure it works.
Commits
-------
3794efe662 Fix support for ignoring syntax erros in an undefined handler in guard
This PR was merged into the 3.x branch.
Discussion
----------
Added configuration for commonmark use in twig-extra-bundle.
Following this tweet: https://twitter.com/ramsey/status/1561894460560138241, this PR adds the configuration options for `commonmark` to the `twig-extra-bundle`.
The configuration is added to the `LeagueCommonMarkConverterFactory` and in turn injected in the `CommonMarkConverter`. This way a user can provide the configuration for usage inside twig.
I'm not sure if adding the configuration inside the extension is the way to go.
Hope this helps out at least `@ramsey` :-)
Added `ignoreExtraKeys` to be somewhat future proof in case extra configuration is added later on, and also to be able to provide de configuration for extensions.
Commits
-------
6f20629622 Added configuration for commonmark use in twig-extra-bundle.
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Fix timezone conversion on strings
When setting a default application timezone, and a display timezone:
```php
date_default_timezone_set('UTC');
$twig->getExtension(\Twig\Extension\CoreExtension::class)->setTimezone('Europe/Paris');
```
Date objects get converted, but strings don't. See #4545.
For most other paths in `convertDate`, the dateTime object is initialized, and afterwards the timezone gets set. For strings, the timezone is passed as a constructor argument before having the timezone set again, losing its converting behaviour. This makes the convertDate method work identical for DateTime objects as strings. This different behaviour was already spotted in #3568.
Fixes#4545#3568#2819
Commits
-------
f69531fa00 Fix timezone conversion on strings
This PR was merged into the 3.x branch.
Discussion
----------
Use correct lineno for ForElseNode
It should take the line number of the `{% else %}` block.
Commits
-------
a84e602b4f Use correct lineno for ForElseNode
This PR was merged into the 3.x branch.
Discussion
----------
Add support for registered undefined element callbacks in tests
This also defines the proper type for the callable arguments in those methods, allowing to know the expected signature (and allowing static analysis tools to check it) instead of having to inspect the implementation to see how those callables are used.
Commits
-------
198fc1a9f9 Add support for registered undefined element callbacks in tests
This PR was merged into the 3.x branch.
Discussion
----------
Reimplement the cache tag in an adhoc way
Commits
-------
3288d8d98d Reimplement the cache tag in an adhoc way