* 3.x:
Exempt test files from the void_return rule regardless of the config location
fix version in deprecation message for tag usage outside of root template
Fix array access with a Stringable key on ArrayAccess objects using object keys
Throw a SyntaxError instead of a PHP fatal error when a macro argument is defined twice
Bump version
Prepare the 3.28.0 release
Render backed enums using their backing value in the html_attr function
Tweak previous merge
Add documention note about variable scope of override blocks in {% embed ... only %}
Define the macro at the template root in the cache macro fixture
Update CHANGELOG
Fix a PHP 8.5 chr() deprecation when decoding octal string escapes
Fix Markup truthiness in boolean expressions
# Conflicts:
# CHANGELOG
# doc/deprecated.rst
# src/Environment.php
# src/Node/Expression/TempNameExpression.php
# src/Node/IfNode.php
# src/Node/MacroNode.php
# src/NodeVisitor/CorrectnessNodeVisitor.php
# tests/Fixtures/tags/inheritance/extends_in_condition.test
# tests/Fixtures/tags/inheritance/use_in_condition.test
# tests/Fixtures/tags/inheritance/use_in_macro.test
# tests/Fixtures/tags/macro/macro_in_block.test
# tests/Fixtures/tags/macro/macro_in_condition.test
PHP 8.5 deprecates passing a value outside the [0, 255] range to chr().
The string-escape decoder in the lexer accepts up to three octal digits,
so an escape such as "\777" (= 511) reaches chr() out of range and emits:
chr(): Providing a value not in-between 0 and 255 is deprecated ...
chr() already constrains the value with "% 256", so applying "% 256"
explicitly preserves the exact byte while silencing the deprecation. The
hex escape branch is unaffected because it is capped at two digits (0xff).
* 3.x:
Reduce memory usage of the context restoration compiled at the end of for loops
Clarify sandbox always-allowed trust boundary
Bump version to 3.28.0 for the always_allowed_in_sandbox feature
Add regression tests that always-allowed callables still enforce the sandbox __toString policy on arguments
Document the criteria for always-allowed sandbox items and list 4.0 built-ins
Add an always_allowed_in_sandbox flag for filters, functions, and tags
Remove issue references in tests
Avoid allocating a normalized copy when counting newlines without carriage returns
Report columns in syntax errors
Track the source offset of each token
# Conflicts:
# CHANGELOG
# doc/deprecated.rst
# doc/sandbox.rst
# src/Environment.php
# src/Error/Error.php
# src/Lexer.php
# src/Node/ForNode.php
# src/Token.php
# src/TwigCallableInterface.php
# tests/Extension/SandboxTest.php
# tests/Node/ForTest.php
* 3.x:
fix documentation typos for singular filter arguments
Add getOperatorTokens() to ExpressionParserInterface to separate operator token registration from parser identity
Ensure filters/attributes aren't mistaken for operators
* 3.x:
Fix CHANGELOG
Fix support for ignoring syntax erros in an undefined handler in guard
Add missing CHANGELOG
Fix timezone conversion on strings
Use correct lineno for ForElseNode
Add support for registered undefined element callbacks in tests
Add UnaryInterface
Add BinaryInterface
Reimplement the cache tag in an adhoc way
Fix CS
Fix wrong array index
Fix wrong array index
Bump min PHP version to 8.1
Add even more tests
Add some tests on balanced brackets
Bump version
Prepare the 3.19.0 release
Added configuration for commonmark use in twig-extra-bundle.
This PR was squashed before being merged into the 4.x branch.
Discussion
----------
[Twig 4] Add PHPUnit as dev dependency
This makes it easier to run the tests locally.
I understand we didn't do this previously (Twig 3) because of `symfony/simple-phpunit`. But that is now removed in Twig 4, so maybe we can do this as well?
Commits
-------
c352a8d283 [Twig 4] Add PHPUnit as dev dependency
* 3.x:
Deprecate using Node directly, introduce EmptyNode and Nodes
Add support for inline comments
Update plural.rst: Fixing(?) broken links
Fix CS
Add support for accessing class constants with the dot operator
Fix getting a property on an object casted to an array
Replace strtr() by strtolower()
Improve escape deprecation message
Remove useless assign in compiled code
Add fixture filename as key
Be more precise about double-escaping
Fix template name in error for an unknown dynamic extends called from an include
* 3.x:
Remove obsolete code
Deprecate Environment::mergeGlobals()
Bump version
Prepare the 3.13.0 release
Fix wrong format of `Environment::VERSION_ID` constant
Fix minor things
Fix CS
Fix isset in ForLoopNode
Fix iterable return type
Improve exception expectations reliability
* 3.x:
Validate the input of CoreExtension::map()
Rename AbstractTest to ProfilerTestCase
Make data providers static
Prepare IntegrationTestCase for static data providers