This PR was merged into the 3.x branch.
Discussion
----------
fix: #4033 add missing unwrap call on TemplateWrapper instance
Commits
-------
6c631526fix: #4033 add missing unwrap call when a TemplateWrapper instance can be present
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Ensure Lexer:: is always initialized
I'm using Symfony Bridge `LintCommand` with `--show-deprecations` flag.
While Twig is initializing, if an deprecation error is thrown by `Lexer::getOperatorRegex()` method, the `Lexer::$regexes` will remain `null` but `$isInitialized` will be set to TRUE.
This PR ensures that `$regexes` will be initialized.
Commits
-------
5a79652e Ensure Lexer:: is always initialized
This PR was merged into the 3.x branch.
Discussion
----------
change extended DI extension class
Commits
-------
b61a4224 change extended DI extension class
This PR was merged into the 3.x branch.
Discussion
----------
fix: #4029 CaptureNode iterator_to_array preserveKeys false
Commits
-------
f7121a23fix: #4029 when use_yield is true CaptureNode use iterator_to_array preserveKeys argument to false
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Add twig_escape_filter_is_safe() as deprecated.
Fix for #4031
Commits
-------
1170144f Add twig_escape_filter_is_safe() as deprecated.
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