This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Adjust `cycle` implementation
Update code following [#4158](https://github.com/twigphp/Twig/issues/4158)
* return mixed
* trigger when non countable
* type the position argument
Add doc precisions
Commits
-------
7c3c1615 Adjust `cycle` implementation
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Add more types to Template class and compiled templates
Similar to https://github.com/twigphp/Twig/pull/4250.
Commits
-------
7e52a680 Add more types to Template class and compiled templates
* 3.x:
Fix doc markup
Add an example on how to iterate over a string
Remove NodeCaptureInterface from TypesNode
Use CPP in full code base
Add types tag
Bump version
Bump version
Prepare the 3.12.0 release
Fix CS
Add conditional return types to `ensureTraversable`
Add return type `isTraitable`
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Document how to iterate over a string
Commits
-------
2f8c6218 Fix doc markup
a68804d6 Add an example on how to iterate over a string
This PR was merged into the 3.x branch.
Discussion
----------
Remove NodeCaptureInterface from TypesNode
This was accidentally copied from SetNode
Commits
-------
5e3f9d9f Remove NodeCaptureInterface from TypesNode
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Use CPP in full code base
Commits
-------
28923f42 Use CPP in full code base
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Add types tag
The is a draft implementation for #4165.
Commits
-------
67dabd81 Add types tag
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Add conditional return types to `ensureTraversable`
This way, static analyzers can understand what the output of this call will be.
Commits
-------
956d09bf Add conditional return types to `ensureTraversable`
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Add return type `isTraitable`
I'd like to do this for more methods that are exposed in the compiled code. This will ease static analysis as there are less errors that are coming from Twig.
This is just a first small PR to see if this is acceptable 😊
Commits
-------
bb8b9c19 Add return type `isTraitable`
This PR was merged into the 4.x branch.
Discussion
----------
Add back the if condition on for loops
Now that the `for` tag implementation has been improved, I think we can add back the `if` condition on `for` loops.
Commits
-------
47d745b7 Add back the if condition on for loops
This PR was merged into the 3.x branch.
Discussion
----------
Only unset loop when with_loop
Even though PHP does not complain, PHPStan does.
> Cannot unset offset 'loop' on array{ ... the context values ... }
Since this is compiled code, we can easily produce a bit more valid code in the eyes of PHPStan.
Commits
-------
42245310 Only unset loop when with_loop
This PR was merged into the 3.x branch.
Discussion
----------
deprecate passing a tag to ImportNode
following #4244
Commits
-------
70396d75 deprecate passing a tag to ImportNode
This PR was merged into the 3.x branch.
Discussion
----------
Deprecate the fact that the `extends` and `use` tags are always allowed in a sandboxed template
Commits
-------
5fca700c Deprecate the fact that the `extends` and `use` tags are always allowed in a sandboxed template
This PR was merged into the 3.x branch.
Discussion
----------
Clarify block function
It actually renders the block again.
Commits
-------
8c3df0c0 Clarify block function