* 3.x:
[Doc] Document about `html` and `html_attr` strategies
Improve date methods phpdoc
Fix deprecation messages
Use a more precise return type in AbstractTwigCallable
fix the handling of predefined arguments in CallExpression
Allow Twig callable arguments to use camel or snake names
fix intl-extra tests
fix typo
This PR was merged into the 3.x branch.
Discussion
----------
[Doc] Document about `html` and `html_attr` strategies
Ref #4322
Commits
-------
ac88c9ae75 [Doc] Document about `html` and `html_attr` strategies
This PR was merged into the 3.x branch.
Discussion
----------
Fix the handling of predefined arguments in CallExpression
Commits
-------
37fa03681e fix the handling of predefined arguments in CallExpression
This PR was merged into the 3.x branch.
Discussion
----------
Use a more precise return type in AbstractTwigCallable
This method is not expected to change the type of callable.
As using it is the only way to configure arguments for a Twig callable (there is no constructor argument for them), it avoids getting static analysis errors in `Extension::getFunctions()` when using it.
Commits
-------
ebbbaf7069 Use a more precise return type in AbstractTwigCallable
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Allow Twig callable arguments to use camel or snake names
Closes#3475
Twig callables (functions/filters/tests) now accept snake and camel argument names independently of the name of the underlying PHP callable parameter names.
Commits
-------
52ded207d3 Allow Twig callable arguments to use camel or snake names
This PR was merged into the 3.x branch.
Discussion
----------
fix intl-extra tests
The Caribbean guilder was added in symfony/symfony#58183.
Commits
-------
c5486b07b9 fix intl-extra tests
This PR was merged into the 3.x branch.
Discussion
----------
[Doc] Provide an alternative for the deprecated spaceless filter
When a feature is deprecated, it's recommended to provide an alternative for it (or mention that there's no alternative).
So, let's mention the whitespace control features in the deprecation message of the `spaceless` filter.
Commits
-------
5a94ddc76e Suggest wording
b5d19ee4be [Doc] Provide an alternative for the deprecated spaceless filter
* 3.x:
Rename a variable for more clarity
Set IteratorAggregate generics for Node
Add cross-link
Let's no deprecate the attribute function yet
Add more precise types for the registration of safe classes
Clarify coding standards
Fix markup
Fix markup
Clarify docs for the u filter
Allow to use a dynamic attribute on the . operator via ()
Remove most usage of foo/bar/baz in the docs
Tweak docs
Add StringCastUnary
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Allow to use a dynamic attribute on the . operator via ()
Closes#3598
As one can think that the `attribute` function has some special power compared to the `.` operator (like using Symfony PropertyAccess), I think it's better to use the `.` operator for dynamic attributes as well.
Using `()` makes it clear that the behavior is the same as the `.` operator (using `()` is similar to the way one can use dynamic mapping names (like in `{ (name): value }`).
Commits
-------
048183eaa6 Add cross-link
8d1af0fc03 Let's no deprecate the attribute function yet
333638e8e6 Allow to use a dynamic attribute on the . operator via ()
This PR was merged into the 3.x branch.
Discussion
----------
Set IteratorAggregate generics for Node
This will help PHPStan and Psalm to understand what happens when iterating over a Node.
/cc `@fabpot`
Commits
-------
ba6e856d92 Set IteratorAggregate generics for Node
This PR was merged into the 4.x branch.
Discussion
----------
Optimize and shorten some array_merge ops
See https://wiki.php.net/rfc/spread_operator_for_array (Advantages over array_merge)
Commits
-------
2821ada20a Optimize and shorten some array_merge ops
This PR was merged into the 3.x branch.
Discussion
----------
Clarify docs for the u filter
Closes#3299
Commits
-------
7961788224 Clarify docs for the u filter
This PR was merged into the 3.x branch.
Discussion
----------
Add more precise types for the registration of safe classes
Safe classes only impact the auto-escaping of the string casting of instance of those classes.
By defining that this method only expects names of stringable classes, it allows static analysis tools to report non-working configurations (for instance for people thinking this would impact the auto-escaping for values returned by getters of a safe class, as in https://github.com/twigphp/Twig/issues/4113 for instance).
The method technically support prefixing the class name with a `\`. Static analyzers would reject such string when checking for `class-string`. However, I think this is fine. Projects wanting to use a SA tool are probably already using the `::class` constant anyway to refer to class names (and otherwise, removing the leading `\` in their string literal is easy)
Commits
-------
8330936415 Add more precise types for the registration of safe classes
Safe classes only impact the auto-escaping of the string casting of instance of those classes.
By defining that this method only expects names of stringable classes, it allows static analysis tools to report non-working configurations (for instance for people thinking this would impact the auto-escaping for values returned by getters of a safe class).
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Doc tweaks
Commits
-------
08f28fd06c Remove most usage of foo/bar/baz in the docs
b1c35cd1fc Tweak docs
* 3.x:
Fix typo
Add support for argument unpacking
Fix CS
Add JSON support for the file extension escaping strategy
Stringify dynamic mapping keys
Replace most empty() calls
Simplify parser calls when possible
This PR was merged into the 3.x branch.
Discussion
----------
Add support for argument unpacking
Closes#3291
Commits
-------
112de8dcfa Add support for argument unpacking