119 Commits

Author SHA1 Message Date
Fabien Potencier cabb305b5a Fix merge conflict resolution 2026-08-29 08:27:21 +02:00
Fabien Potencier f640320202 Merge branch '3.x' into 4.x
* 3.x: (26 commits)
  Remove the documentation comments compilation overhead
  Clarify source function trust requirements
  Throw on PCRE errors in the matches operator
  Document that reusing a non-rewindable iterator after destructuring is unsupported
  Release destructuring temporaries after assignment
  Deprecate prefixed macro definedness checks
  Fix duplicate macro deprecation wording
  Throw when list formatting fails
  Document that sequence destructuring consumes one value per pattern slot
  Fix the html_attr documentation about iterables in data attributes
  Warn about untrusted input with the default Tempest markdown converter
  Document that overriding MacroNode::compile() is not supported anymore
  Merge overlapping CHANGELOG entries for the destructuring fatal error fix
  Document that include_only keeps global variables available
  Remove lazy macro import resolution
  Honor date formatter prototype calendars
  Fix Stringable keys for ArrayAccess implementations
  Fix repeated object destructuring evaluation
  Restore void return type compatibility for extension points
  Reject destructuring patterns containing no variables
  ...

# Conflicts:
#	CHANGELOG
#	doc/deprecated.rst
#	doc/filters/format_datetime.rst
#	extra/twig-extra-bundle/DependencyInjection/Compiler/MissingExtensionSuggestorPass.php
#	extra/twig-extra-bundle/DependencyInjection/TwigExtraExtension.php
#	extra/twig-extra-bundle/TwigExtraBundle.php
#	src/MacroNamespace.php
#	src/Node/MacrosNode.php
#	src/Parser.php
#	src/Test/IntegrationTestCase.php
#	src/Test/NodeTestCase.php
#	tests/CallMacroTest.php
#	tests/ExpressionParserTest.php
#	tests/Fixtures/macros/duplicate_definition.legacy.test
#	tests/Node/MacrosTest.php
#	tests/ParserTest.php
2026-08-29 00:25:20 +02:00
Hugo Alliaume 9b18e3757d Extract htmlAttrValue() from html_attr for standalone attribute rendering 2026-08-26 16:46:53 +02:00
Fabien Potencier 5ca7debf6e Fix merge conflict resolution 2026-07-12 15:08:38 +02:00
Fabien Potencier 0b6e824ea8 Merge branch '3.x' into 4.x
* 3.x:
  Add void return type hint even in tests
  Run php-cs-fixer sequentially so the void_return src-only customiser is applied
  Fix CHANGELOG
  [Intl] Add format_list filter using PHP 8.5's IntlListFormatter

# Conflicts:
#	.github/workflows/ci.yml
#	CHANGELOG
#	extra/cssinliner-extra/Tests/LegacyFunctionsTest.php
#	extra/html-extra/Tests/CvaTest.php
#	extra/html-extra/Tests/HtmlAttrMergeTest.php
#	extra/html-extra/Tests/HtmlAttrTest.php
#	extra/html-extra/Tests/LegacyFunctionsTest.php
#	extra/inky-extra/Tests/LegacyFunctionsTest.php
#	extra/markdown-extra/Tests/FunctionalTest.php
#	extra/markdown-extra/Tests/LegacyFunctionsTest.php
#	extra/twig-extra-bundle/DependencyInjection/Compiler/MissingExtensionSuggestorPass.php
#	extra/twig-extra-bundle/DependencyInjection/TwigExtraExtension.php
#	extra/twig-extra-bundle/TwigExtraBundle.php
#	src/Extension/CoreExtension.php
#	src/Extension/EscaperExtension.php
#	src/Node/CheckSecurityCallNode.php
#	src/Node/Expression/FunctionExpression.php
#	src/Node/ModuleNode.php
#	src/Node/Node.php
#	src/Node/TypesNode.php
#	src/Resources/core.php
#	src/Resources/debug.php
#	src/Test/IntegrationTestCase.php
#	tests/CustomExtensionTest.php
#	tests/EnvironmentTest.php
#	tests/ExpressionParserTest.php
#	tests/Extension/CoreTest.php
#	tests/Extension/EscaperTest.php
#	tests/Extension/LegacyDebugFunctionsTest.php
#	tests/Extension/LegacyStringLoaderFunctionsTest.php
#	tests/Extension/SandboxStateChangeTest.php
#	tests/Extension/SandboxTest.php
#	tests/LexerTest.php
#	tests/Node/Expression/CallTest.php
#	tests/Node/Expression/ConditionalTest.php
#	tests/Node/NodeTest.php
#	tests/Resources/LegacyCoreTest.php
#	tests/TemplateTest.php
#	tests/Util/CallableArgumentsExtractorTest.php
2026-07-12 13:55:37 +02:00
Fabien Potencier 9c6d76b61c Add void return type hint even in tests 2026-07-12 13:43:08 +02:00
Fabien Potencier ea8aadf94d Merge branch '3.x' into 4.x
* 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
2026-07-08 21:22:49 +02:00
Fabien Potencier 9323a82eb9 Render backed enums using their backing value in the html_attr function 2026-06-25 08:50:01 +02:00
Fabien Potencier 11d5cb5bd1 Replace @dataProvider annotations with #[DataProvider] attributes 2026-05-23 11:36:24 +02:00
Fabien Potencier 76df51b6af Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
  Add two tests for error conditions in #3930
2026-03-17 11:30:36 +01:00
Matthias Pigulla 25bfb5957c Add two tests for error conditions in #3930 2026-03-17 08:24:08 +01:00
Fabien Potencier b2204b9a72 Merge branch '3.x' into 4.x
* 3.x:
  Add an `html_attr` function to make outputting HTML attributes easier
  fix MatchesBinary namespace in changelog
2026-03-17 07:40:40 +01:00
Matthias Pigulla 42c12fa720 Add an html_attr function to make outputting HTML attributes easier 2026-03-17 07:39:33 +01:00
Fabien Potencier 0facb551b0 Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
2026-02-07 09:12:05 +01:00
Fabien Potencier 861215c507 Fix CS 2026-02-07 09:07:38 +01:00
Fabien Potencier 9ac4a2dd9c Merge branch '3.x' into 4.x
* 3.x:
  Fix tiny typo in CI workflow label
  Fix typo
  Fix opcache preload warning for unlinked anonymous class
  Bump version
  Prepare the 3.22.2 release
  Add .gitignore & .gitattributes to all .gitattributes
2026-01-07 16:24:12 +01:00
jmsche ff327e4163 Add .gitignore & .gitattributes to all .gitattributes 2025-12-02 15:45:16 +01:00
Fabien Potencier 83f264bcd8 Merge branch '3.x' into 4.x
* 3.x:
  Allow Symfony 8 packages in Twig extra packages
  Fix array typehint for $variants in HtmlExtension
2025-11-02 20:03:33 +01:00
Javier Eguiluz 9a8a1dc1dd Allow Symfony 8 packages in Twig extra packages 2025-11-02 12:00:49 +01:00
Younes ENNAJI 64c87eeaa3 Fix array typehint for $variants in HtmlExtension 2025-10-30 01:26:03 +01:00
Fabien Potencier bd652f3e66 Merge branch '3.x' into 4.x
* 3.x:
  Make `in_array()` calls strict
2025-02-21 19:08:53 +01:00
Alexandre Daubois 9c6b95f2a6 Make in_array() calls strict 2025-02-19 15:29:33 +01:00
Fabien Potencier 151aa4ecda Fix CS 2025-02-14 12:57:03 +01:00
Fabien Potencier dc6356268b Bump min PHP version to 8.1 2025-01-31 21:45:36 +01:00
Fabien Potencier ef7ade8ee3 Merge branch '3.x' into 4.x
* 3.x: (30 commits)
  Make {} optional for the types tag
  Remove the note about types mapping argument
  Add a note on the types locality
  Fix CS
  Fix typos in the docs
  Use spl_object_id() instead of spl_object_hash()
  Add `LastModifiedExtensionInterface` and implementation in `AbstractExtension` to track modification of runtime classes
  Bump version
  Optimize NameExpression compilation
  Fix typo in enum twig doc functions
  Remove dead method in ModuleNode
  Bump version
  Prepare the 3.18.0 release
  Add support for `Twig\Markup`
  Fix unary operator precedence change
  Replace Twigfiddle by the new Twig playground
  Fix MacroNode $name argument can be overridden
  Ignore exceptions from undefined handlers when using the guard tag
  [Doc] Update the docs about attribute() function
  Fix doc
  ...
2025-01-10 08:41:31 +01:00
Nicolas Lemoine 8158dabc17 Add support for Twig\Markup
Co-authored-by: Fabien Potencier <fabien@potencier.org>
2024-12-29 11:29:59 +01:00
Fabien Potencier 2a6c986e85 Add a test 2024-12-18 07:46:55 +01:00
Fabien Potencier 82cde4edcb Fix CS 2024-11-30 09:45:07 +01:00
Fabien Potencier 5194101f12 Merge branch '3.x' into 4.x
* 3.x:
  Refactor code
  Add some type hints
  Deprecate using ~ with + or - in an expression without using parentheses to clarify precedence
  Change some type hints to be more precise
  Deprecate not passing AbstractExpression args to most constructor arguments for classes extending AbstractExpression
  Remove obsolete method
  Add support for detecting if an expression had explicit parentheses
  Fix tests
  Unify error messages when a filter expects a mapping/sequence
2024-09-30 22:46:04 +02:00
Fabien Potencier 4e08e3ef5f Fix tests 2024-09-30 08:41:48 +02:00
Fabien Potencier 69f8cf7092 Merge branch '3.x' into 4.x
* 3.x:
  Add missing is_iterable() checks
  Fix tests
  Add quotes on filters/functions in CoreExtension
  Use get_debug_type() everywhere
2024-09-29 18:26:00 +02:00
Fabien Potencier 0da899d911 Use get_debug_type() everywhere 2024-09-29 18:08:29 +02:00
Alexander M. Turek f2053bbea0 PHPUnit 11 2024-09-04 12:11:51 +02:00
Fabien Potencier a789eca738 Merge branch '3.x' into 4.x
* 3.x:
  Validate the input of CoreExtension::map()
  Rename AbstractTest to ProfilerTestCase
  Make data providers static
  Prepare IntegrationTestCase for static data providers
2024-09-03 22:20:28 +02:00
Alexander M. Turek 18f4203827 Prepare IntegrationTestCase for static data providers 2024-09-03 15:08:40 +02:00
Fabien Potencier 06ac86e3dd Merge branch '3.x' into 4.x
* 3.x:
  Fix tests
  Allow extra extensions to use Twig 4
2024-09-01 23:00:16 +02:00
Fabien Potencier 031c7bda4d Allow extra extensions to use Twig 4 2024-09-01 22:39:12 +02:00
Fabien Potencier 4b671fa38d Fix typo 2024-08-28 22:03:32 +02:00
Fabien Potencier 38082c67b1 Fix CS 2024-08-28 22:02:38 +02:00
Fabien Potencier 15c0adb3ed Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
2024-08-18 19:26:04 +02:00
Fabien Potencier 675cb2d141 Fix CS 2024-08-18 19:25:19 +02:00
Fabien Potencier 9e48502555 Merge branch '3.x' into 4.x
* 3.x:
  Fix html_cva docs
  Fix html_cva docs
  Introduce CVA to html-extra
  Move some methods to static calls
2024-08-18 09:40:33 +02:00
Matheo Daninos e3ac14e1c8 Introduce CVA to html-extra 2024-08-18 09:36:16 +02:00
Fabien Potencier 91f29731d4 Merge branch '3.x' into 4.x
* 3.x:
  Optimize stripcslashes
  (minor) Prefer `className` over `classname`
  Remove escape
  Deprecate unnecessary escape characters
  Micro-micro optimization
  Simplify tests
2024-08-12 09:28:43 +02:00
Ruud Kamphuis 8ef12588ea Remove escape 2024-08-11 18:59:31 +02:00
Fabien Potencier c070cd719c Drop support for 8.0 2024-08-10 12:32:24 +02:00
Fabien Potencier 8b47fc319a Use first class callable syntax 2024-07-14 14:01:33 +02:00
Fabien Potencier 67cb9a06fe Merge branch '3.x' into 4.x
* 3.x:
  Update PHPUnit config
  Optimize sprintf() calls for PHP 8.4
2024-06-21 08:27:27 +02:00
Fabien Potencier da4592793b minor #4109 Update PHPUnit config (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Update PHPUnit config

Commits
-------

b78dee86 Update PHPUnit config
2024-06-21 08:25:01 +02:00
Fabien Potencier b78dee8682 Update PHPUnit config 2024-06-21 08:22:31 +02:00