This PR was merged into the 3.x branch.
Discussion
----------
fix the set of installed packages for TwigExtraBundle on PHP 8.0
Prevents symfony/translation-contracts 3 to be installed together with symfony/string 5.4.0-RC1 (see https://github.com/twigphp/Twig/actions/runs/9804849131/job/27073398023#step:8:117). Stable releases of the String component don't suffer from this incompatibility because of symfony/symfony#44246.
Commits
-------
c79c7e7a fix the set of installed packages for TwigExtraBundle on PHP 8.0
This PR was merged into the 3.x branch.
Discussion
----------
fix condition for running use_yield test with extra packages
Commits
-------
07967dea fix condition for running use_yield test with extra packages
This PR was merged into the 3.x branch.
Discussion
----------
[templates] add shuffle filter
New feature :
The filter displays the values in an array at random.
I'm open of any feedback.
Commits
-------
2dacaadd Tweak code, tests, and docs for shuffle
17430ae5 Add shuffle filter
This PR was merged into the 3.x branch.
Discussion
----------
[String] Add singularize and pluralize filter
This PR follows up this one in Symfony https://github.com/symfony/symfony/pull/57245.
It adds 2 new filters `singularize` and `pluralize`. It uses the String component, especially `EnglishInflector` and `FrenchInflector`.
Examples:
```php
{{ 'person'|pluralize('en') }} // persons
{{ 'person'|pluralize('en', false) }} // ['persons', 'people']
{{ 'personne'|pluralize('fr') }} // personnes
{{ 'personne'|pluralize('fr', false) }} // ['personnes']
{{ 'persons'|singluarize('en') }} // person
{{ 'people'|singluarize('en') }} // person
{{ 'persons'|singluarize('en', false) }} // ['person']
{{ 'personnes'|singluarize('fr') }} // personne
{{ 'personnes'|singluarize('fr', false) }} // ['personne']
{{ 'persona'|pluralize('it') }} // \InvalidArgumentException('Language "it" is not supported.')
{{ 'persone'|singluarize('it') }} // \InvalidArgumentException('Language "it" is not supported.')
```
Commits
-------
8c969d40 Tweak code and docs
cb392489 feat(string-extra): Add singularize and pluralize filter
This PR was merged into the 3.x branch.
Discussion
----------
[Doc] Modernize Class name in examples
From "Project_Twig_Extension" to "CustomExtension"
Just a suggestion, feel free to close if you want to keep it like this :)
I found those namings only in "advanced"
Commits
-------
4a8e8ee1 [Doc] Modernize Class name in examples
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
[Doc] Replace http links with https
Commits
-------
ae429bd5 [Doc] Replace http links with https
From "Project_Twig_Extension" to "CustomExtension"
Just a suggestion, feel free to close if you want to keep it like this :)
I found those namings only in "advanced"
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Issue #3828: Add sequence and mapping tests
Add sequence and mapping tests from Jinja.
Commits
-------
c5c95a2d Issue #3828: Add sequence and mapping tests
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Rename hash to mapping and array to sequence
Commits
-------
bc19f2f4 Tweak
c44be99a Rename array to sequence
5157402a Rename hash to mapping
This PR was merged into the 3.x branch.
Discussion
----------
Optimize sprintf() calls for PHP 8.4
Commits
-------
b63bde30 Optimize sprintf() calls for PHP 8.4
This PR was merged into the 3.x branch.
Discussion
----------
Deprecate the second argument of CallExpression::compileArguments
Commits
-------
71d6c82d Deprecate CallExpression::compileArguments
This PR was merged into the 3.x branch.
Discussion
----------
Fix old escaper signature + add docs
Closes#4087Closes#4088
Commits
-------
04b1ad3c Fix old escaper signature + add docs