* 3.x:
fix condition for running use_yield test with extra packages
fix the set of installed packages for TwigExtraBundle on PHP 8.0
simplify an iterable check
Fixed typo
Tweak code, tests, and docs for shuffle
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
----------
Rename hash to mapping and array to sequence
Commits
-------
bc19f2f4 Tweak
c44be99a Rename array to sequence
5157402a Rename hash to mapping
* 3.x:
Move some static extension methods to non-static
Add needs_charset option for filters and functions
Fix method call
Rename some internal methods
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
[Doc] Correct Order & Explanation on precedence
Following this [issue](https://github.com/twigphp/Twig/issues/3714), i worked on it trying to make it simple and easy to understand
Indeed order of the precedence was not good for ``b-and``, ``b-xor`` and ``b-and``.
Code [here ](https://github.com/twigphp/Twig/blob/3.x/src/Extension/CoreExtension.php#L280) to understand. I also added additional explanations.
Commits
-------
01e0b7ce [Doc] Correct Order & Explanation on precedence