* 3.x:
Add support for named arguments on macro calls and dot operator arguments
Improve deprecation messages
Simplify expression parser code
Refactor expression parser
chore: fix version added
Cleanup code
This PR was merged into the 3.x branch.
Discussion
----------
Add support for named arguments on macro calls and dot operator arguments
Closes#929Closes#3635
Commits
-------
223d36bbae Add support for named arguments on macro calls and dot operator arguments
This PR was merged into the 3.x branch.
Discussion
----------
Refactor expression parser
Instead of having if statements under `default`, I've moved the code to the `switch` statement, which makes more sense.
Commits
-------
2cdca8cbeb Refactor expression parser
This PR was merged into the 3.x branch.
Discussion
----------
chore: fix version added
comming from slack message of `@javiereguiluz`
nice addition!
Commits
-------
309d3f50cb chore: fix version added
This PR was merged into the 3.x branch.
Discussion
----------
Add a new guard tag that allows to test if some Twig callables are available at compilation time
Closes#3655
~~`@javiereguiluz` Would that help?~~
~~Usage:~~
~~```php~~
~~$twig->registerFunctionStub('csrf_token', fn (string $tokenId) => '');~~
~~$twig->registerFunctionStub('importmap', fn (string|array $entryPoint = 'app', array $attributes = []): string => '');~~
~~$twig->registerTestStub('random', fn (string $value) => false);~~
~~```~~
See the docs on the new `guard` tag in the diff.
Commits
-------
62f0a96b68 Introduce a way to test Twig callables at compile time
This PR was merged into the 3.x branch.
Discussion
----------
Allow arrow functions everywhere
Closes#3192Closes#3402
Arrow functions are now supported for all Twig callables (filters, functions, and tests), macro arguments, and method call arguments.
Arrow functions can also be stored in variables.
Commits
-------
aca4d22e89 Allow arrow functions everywhere
This PR was merged into the 4.x branch.
Discussion
----------
Fix getting nodes with int names
Commits
-------
14b5de7e54 Fix getting nodes with int names
This PR was merged into the 4.x branch.
Discussion
----------
Remove remaining usages of get_class()
Commits
-------
cf603b19c1 Remove remaining usages of get_class()
* 3.x:
Move sandbox docs to its own chapter in the docs
Deprecate passing a string or an array to Twig callable arguments accepting arrow functions (pass a Closure)
Fix markup
Update html_cva.rst
Fix markup
Fix markup
Added informations in format_currency and format_number docs
Clarify docs for some operators
This PR was merged into the 3.x branch.
Discussion
----------
Move sandbox docs to its own chapter in the docs
I've also added more information about potential security issues when exposing something that takes a callable as an argument.
Commits
-------
6688a8df16 Move sandbox docs to its own chapter in the docs
This PR was merged into the 3.x branch.
Discussion
----------
Deprecate passing a string or an array to Twig callable arguments accepting arrow functions (pass a Closure)
Instead of restricting callable arguments only in sandbox mode, let's deprecate using functions/arrays as callables.
Commits
-------
5e9448310d Deprecate passing a string or an array to Twig callable arguments accepting arrow functions (pass a Closure)
This PR was merged into the 3.x branch.
Discussion
----------
[Doc] html_cva
Juste rename defaultVariant without "s".
Commits
-------
86b23eba23 Update html_cva.rst
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Added informations in format_currency and format_number docs
Commits
-------
e08ca837df Added informations in format_currency and format_number docs
This PR was merged into the 3.x branch.
Discussion
----------
Clarify docs for some operators
Closes#3922
Commits
-------
0d73fd232a Clarify docs for some operators
* 3.x:
Deprecate using the not unary operator without parenthesis
Deprecate using ?? without explicit parentheses
Add support for logical `xor` operator
Allow running CI on all branches
[Doc] Fix enum title
Document Twig vs PHP types
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Trigger deprecations when using "??" and "not" without explicit parentheses when precedence will change in 4.0
Closes#3387Closes#3642
Commits
-------
2081b1ff74 Deprecate using the not unary operator without parenthesis
f4aacafd78 Deprecate using ?? without explicit parentheses
This PR was merged into the 3.x branch.
Discussion
----------
Add support for logical `xor` operator
Adds support for the logical `xor` operator
Commits
-------
8893944e0c Add support for logical `xor` operator
This PR was merged into the 3.x branch.
Discussion
----------
Allow running CI on all branches
This allows contributors to verify if the CI passes on their forks before opening a PR.
Commits
-------
6276d143c3 Allow running CI on all branches
This PR was merged into the 3.x branch.
Discussion
----------
Document Twig vs PHP types
Refs #4256
Commits
-------
9690e7bbbf Document Twig vs PHP types