This PR was merged into the 3.x branch.
Discussion
----------
Require correct twig core version
This changes the composer version constraint of the internationalisation extension on the core twig library, to require atleast version 3.9.0. This is necessary since twig/intl-extra now depends on CoreExtension::dateConverter() which was only introduced with the release of version 3.9 (see: twigphp/Twig@54d34b9).
Commits
-------
5d903b63 Require correct twig core version
This PR was merged into the 3.x branch.
Discussion
----------
Fix CaptureNode for some use cases
Closes#4022
Commits
-------
64cebe0e Fix CaptureNode for some use cases
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Add PHP 8.4 support
Commits
-------
fdfc5ddd Fix compat with PHP 8.4
11511e18 Add PHP 8.4 to CI
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Deprecate passing a Template instance in Environment::resolveTemplate() and Template::loadTemplate()
Commits
-------
dbe9456f Fix incompatibility with old PHP versions
a62581ae Fix typo
61031d6c Deprecate passing a Template instance in Environment::resolveTemplate() and Template::loadTemplate()
This PR was merged into the 3.x branch.
Discussion
----------
Add a deprecation notice when using AbstractNodeVisitor (deprecated since 2.9)
Commits
-------
41d702d6 Add a deprecation notice when using AbstractNodeVisitor (deprecated since 2.9)
This PR was merged into the 3.x branch.
Discussion
----------
Add a reference to the Twig CS fixer tool
Commits
-------
b6ae45c3 Add a reference to the Twig CS fixer tool
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Fix exception when timezone is false
When passing `false` in the timezone param, twig returns an exception:
> An exception has been thrown during the rendering of a template ("Twig\Extra\Intl\IntlExtension::createDateFormatter(): Argument 5 ($timezone) must be of type ?DateTimeZone, bool given
Passing `false` is supported and allows to skip the timezone conversion.
Regression introduced by https://github.com/twigphp/Twig/pull/3903
Commits
-------
7e8f5eb1 Fix exception when timezone is false
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Fix param name in docblock (minor)
Fix wrong var name in Docblock
[CoreExtension::striptags()](https://github.com/twigphp/Twig/commit/dd81f28507de5c45b99e91dafa5a9908c2686dde#diff-29e85e483c6ec4a9c2fd144820b6722c86df60d54175b355d85e806253313c1aL1221)
```diff
* Strips HTML and PHP tags from a string.
*
* `@param` string|null $string
- * `@param` string[]|string|null $string
+ * `@param` string[]|string|null $allowable_tags
*
*/
public static function striptags($string, $allowable_tags = null)
{
```
--
Also added some missing nullable in `@param` annotations, not sure if expected :|
Commits
-------
2d262bc3 Fix param name in docblock (minor)
This PR was merged into the 3.x branch.
Discussion
----------
Add `#[YieldReady]` to allow extensions to tell when they're ready for yielding
The current opt-in based on "use_yield" doesn't work, because there is no decider to enable the flag:
the flag can be turned on only when all extensions are compatible, and this is fragile, because extensions currently don't have a way to signal that they are ready for yielding.
This PR takes the following approach instead:
- Between each "yield", the output buffer is checked and emptied.
- Extensions need to label their node implementations with `#[YieldReady]`. If they don't, a deprecation is raised.
On Twig 4, we could then just remove this output buffer check and possibly throw when a node is not "YieldReady".
(Classes that extend `AbstractExpression` are implicitly considered "YieldReady".)
Best reviewed [ignoring whitespaces](https://github.com/twigphp/Twig/pull/3999/files?w=1).
Commits
-------
e7077740 Add `#[YieldReady]` to allow extensions to tell when they're ready for yielding
This PR was merged into the 3.x branch.
Discussion
----------
fix TwigExtraBundle tests with Symfony 6.0/6.1
Commits
-------
d9d7e136 fix TwigExtraBundle tests with Symfony 6.0/6.1
This PR was merged into the 3.x branch.
Discussion
----------
Fix some errors reported by phpstan
Commits
-------
2b2ac80d Fxi some errors reported by phpstan
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Deprecate usage of ob_* functions in favor of yielding
Still a work in progress, but everything works fine in both modes.
Commits
-------
a93723ea Fix bug
0d3a2839 Tweak code
14d38036 Add a deprecation when a Node uses echo/print
210e2d2b Fix tests
1591aa5c Optimize code
1469e6a6 Add support for templates that do not have output Nodes
72922a36 -
71e90fab Remove some tests
4fd62abb -
a9c7307b Tweak code
15879406 Remove the new yield nodes
3b6cbf98 Remove usage of ob_* functions in favor of yielding