This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Fix typo in enum twig doc functions
Commits
-------
3889bc7b18 Fix typo in enum twig doc functions
This PR was merged into the 3.x branch.
Discussion
----------
Fix MacroNode $name argument can be overridden
Fix#4515
Commits
-------
dc329fd44e Fix MacroNode $name argument can be overridden
This PR was merged into the 3.x branch.
Discussion
----------
Ignore exceptions from undefined handlers when using the guard tag
Fixes#4505
Commits
-------
b53c639f7d Ignore exceptions from undefined handlers when using the guard tag
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
[Doc] Update the docs about attribute() function
I Was fixing `filter` -> `function` error, but I realized that we could expand the docs of `attribute()` a bit, even if it's deprecated 🙏
Commits
-------
84daad9a27 [Doc] Update the docs about attribute() function
This PR was merged into the 3.x branch.
Discussion
----------
Add a way to stream template rendering
Even if we're using `yield` internally, there is no easy way to stream template rendering. This new method can be used like this to HTTP stream a template with Symfony:
```php
use Symfony\Component\HttpFoundation\StreamedResponse;
use Twig\Environment;
$twig = new Environment(/* ... */);
$response = new StreamedResponse($twig->load('index')->stream([]));
$response->send();
```
Commits
-------
1915ee2812 Add a way to stream template rendering
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Use .html.twig file extension in documentation instead of .html
Use .html.twig file extensions instead of .html
Commits
-------
03792f643f Use .html.twig file extension in documentation instead of .html
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
adds support for invoking closures
- fixes#3848
Commits
-------
0a61801d9a adds support for invoking closures
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Change `=` to `:` for named arguments
Hi,
I changed `=` to `:` because it better follows best practices for named arguments.
Commits
-------
99ea35e1e8 Change `=` to `:` for named arguments
This PR was merged into the 3.x branch.
Discussion
----------
Fix the null coalescing operator when the test returns null
Closes#4499
Commits
-------
4c5467f56a Fix the null coalescing operator when the test returns null
This PR was merged into the 3.x branch.
Discussion
----------
Fix the Elvis operator when there is some space between ? and :
Commits
-------
1af334be89 Fix the Elvis operator when there is some space between ? and :
This PR was merged into the 3.x branch.
Discussion
----------
fix version numbers for deprecations
#4482 was merged after the release of 3.16.0
Commits
-------
f90105d0ac fix version numbers for deprecations
This PR was merged into the 3.x branch.
Discussion
----------
Require "erusev/parsedown": "dev-master as 1.x-dev"
Should fix the CI until https://github.com/erusev/parsedown/pull/891 is merged.
Commits
-------
5287da57cc Require "erusev/parsedown": "dev-master as 1.x-dev"
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Support underscores in number literals
```twig
{{ 1000 == 1_000 ? 'yes' : 'no' }}
# now: syntax error
# this PR: "yes"
```
> As of PHP 7.4.0, integer literals may contain underscores (_) between digits, for better readability of literals. These underscores are removed by PHP's scanner.
https://www.php.net/manual/en/language.types.integer.php
This PR replicates that behaviour, using the regexp to match the literals and then remove the "_".
I'm targeting **Twig4** but maybe 3.x would be ok?
I cannot think of a real case that
- does not trigger an error currently
- would work differently after this PR
Commits
-------
da4d96692a Support underscores in number literals