This PR was merged into the 3.x branch.
Discussion
----------
range example leads to Array to string conversion exception
In templates documentation, a range example is displayed and leads to an Array to string conversion exception without a join filter.
Commits
-------
53496507 range example leads to Array to string conversion exception
This PR was merged into the 3.x branch.
Discussion
----------
fix `NumberFormatter::TYPE_CURRENCY` being deprecated in PHP 8.3
It was never used anyway (by Twig and by PHP), so removing it should not have any side-effects.
Commits
-------
223ba6ec fix `NumberFormatter::TYPE_CURRENCY` being deprecated in PHP 8.3
This PR was merged into the 3.x branch.
Discussion
----------
Add `Twiggy` extension for VS Code to docs.
Commits
-------
81799a74 Add `Twiggy` extension for VS Code to docs.
This PR was merged into the 3.x branch.
Discussion
----------
allow Symfony 7 packages to be installed
Commits
-------
b8b0c396 allow Symfony 7 packages to be installed
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.
Discussion
----------
Add `Twig Language Server` and `Modern Twig` extension to docs
Commits
-------
a949600c Add `Twig Language Server` and `Modern Twig` extension to docs
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
Bump PHP version used by Drupal tests
Commits
-------
da38e858 Update Drupal version in tests
64543c3c Fix code
4c4f73ca Bump PHP version used by Drupal tests
This PR was merged into the 3.x branch.
Discussion
----------
Fix callable phpdoc for twig elements
Hi `@fabpot`
I made a stupid mistake in https://github.com/twigphp/Twig/pull/3856
The correct phpdoc is `array{class-string, string}` and not `array<class-string, string>`.
Code is used this way
```
$compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1]));
```
which means the key 0 is a class string, and the key 1 is a string.
`array{class-string, string}` is same as `array{0: class-string, 1: string}`
`array<class-string, string>` is saying all the keys are class-string, and values are string.
Commits
-------
1b58589d Fix callable phpdoc
This PR was merged into the 2.x branch.
Discussion
----------
add return type for Symfony 7 compatibility
Commits
-------
fac08ec7 add return type for Symfony 7 compatibility
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Adding support for the ...spread operator on arrays and hashes
Hi!
Long time user, first time contributor of a real future. I hope I didn't miss anything - but this seemed quite straightforward in the end.
Notes:
* In PHP 7.3 or lower, using the spread operator will result in a Twig syntax error.
* In 8.0 or lower, using the spread operator on a hash will result in a Twig syntax error.
fabbot failures are unrelated, so I'm not touching them.
Cheers!
Commits
-------
ba4fe3ba Adding support for the ...spread operator on arrays and hashes
This PR was merged into the 3.x branch.
Discussion
----------
Fix callable phpdoc for twig elements
Hi `@fabpot`
```
[MyRuntime::class, 'myMethod]
```
is not a valid callable in PHP 8 https://3v4l.org/tWqPs
But this syntax is supported because twig has a special behavior
```
$compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1]));
```
The PHPDoc should be updated in order to reflect the real behavior and solve static analysis errors.
A phpstan discussion can be found here: https://github.com/phpstan/phpstan/discussions/9567
Commits
-------
cd68de5e Fix callable phpdoc for twig elements
This PR was merged into the 3.x branch.
Discussion
----------
add extra example to slice filter
Commits
-------
0170dc3c add extra example to slice filter