This PR was merged into the 2.x branch.
Discussion
----------
do not clean up whitespace text nodes inside if tags
Commits
-------
c8ec092c do not clean up whitespace text nodes inside if tags
This PR was merged into the 3.x branch.
Discussion
----------
Update .gitattributes
`.github` directory and `.editorconfig`, `.gitattributes`, `.gitignore` and `.php-cs-fixer.dist.php` are present in dist package. I added `export-ignore` attribute to them.
Commits
-------
849d6832 Update .gitattributes
This PR was merged into the 2.x branch.
Discussion
----------
Updates CoreExtension::twig_constant to check for definition first to avoid hard crash
The behaviour of PHP's constant() method has been updated after https://github.com/php/php-src/issues/9905 was accepted and fixed in PHP 8.1 (and previously changed post PHP 8.0) . This PR prevents a fatal error in the case a constant is supplied that doesn't actually exist.
Commits
-------
56b31224 Updates CoreExtension::twig_constant to check for definition first to avoid hard crash
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.
Discussion
----------
Cycle function: Add output to example code
At first I couldn't grasp the concept of the cycle function, but after I saw the output in twigfiddle it was clear. I can imagine other readers having the same issue. Therefore I suggest to add the output to the example code.
Commits
-------
1e3b126c Add output
This PR was merged into the 2.x branch.
Discussion
----------
Add missing argument for the cycle function
Commits
-------
883fb333 Add missing argument for the cycle function
This PR was merged into the 2.x branch.
Discussion
----------
Fix optimizing closures callbacks
Follows https://github.com/twigphp/Twig/pull/3722 and https://github.com/php/php-src/issues/8932
Uses a dedicated method added to PHP 8.1.11 (and 8.0.24, but I feel like there is no need to make the check too complex for an outdated version. We just need a marker to make the code simpler when we'll bump to PHP >= 8.1.11.)
Commits
-------
406b3e59 Fix optimizing closures callbacks
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Improve phpdoc of ExtensionInterface/Environment/Expressionparser arrays
Binary and Unary operator have a really specific format
```
array<string, array{precedence: int, class: class-string}>,
array<string, array{precedence: int, class: class-string, associativity: int}>
```
so it's worth to mention that in the phpdoc rather than `array<array>`
Commits
-------
e98a652a Improve phpdoc of ExtensionInterface/Environment/Expressionparser arrays
This PR was merged into the 3.x branch.
Discussion
----------
Remove internal from ExpressionParser
In the advanced doc, it's explained how to write TokenParser:
https://github.com/twigphp/Twig/blob/3.x/doc/advanced.rst#defining-a-token-parser
Such an implementation rely on method like
ExpressionParser::parseExpression or Expression::parseMultitargetExpression,
Currently the ExpressionParser is marked as internal, implying all the method are also internal.
It would be great to promise BC about those methods since they are require/usefull for custom TokenParser.
I dunno if the ``@internal`` tag is still needed for some methods of the ExpressionParser (like the constructor ?).
This would also
Closes https://github.com/twigphp/Twig/issues/3443
Commits
-------
de0f947e Remove internal from ExpressionParser
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.
Discussion
----------
Update templates.rst
Changed "an other strategy" to "another strategy". I assume this latter should be the intended sentence structure.
Commits
-------
4904f38e Update templates.rst
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.
Discussion
----------
Update michelf/php-markdown require-dev to allow v2
This new release should work fine: https://github.com/michelf/php-markdown#version-history
Commits
-------
1a8ac1d8 Update michelf/php-markdown require-dev to allow v2