67 Commits

Author SHA1 Message Date
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 971dbcfe92 Fix merge conflict resolution 2026-06-03 19:55:20 +02:00
Fabien Potencier 455be2c916 Merge branch '3.x' into 4.x
* 3.x:
  Add PHPUnit attributes alongside annotations to silence doc-comment metadata deprecations on PHPUnit 11
  Run the test suite against PHPUnit 11.3 in CI
  Make IntegrationTestCase and NodeTestCase compatible with PHPUnit 11

# Conflicts:
#	CHANGELOG
#	src/Test/IntegrationTestCase.php
#	src/Test/NodeTestCase.php
#	tests/Cache/ChainTest.php
#	tests/CustomExtensionTest.php
#	tests/DeprecatedCallableInfoTest.php
#	tests/EnvironmentTest.php
#	tests/ErrorTest.php
#	tests/ExpressionParserTest.php
#	tests/Extension/AttributeExtensionTest.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/FileExtensionEscapingStrategyTest.php
#	tests/LexerTest.php
#	tests/Loader/FilesystemTest.php
#	tests/Node/Expression/CallTest.php
#	tests/Node/Expression/ConditionalTest.php
#	tests/Node/Expression/MacroReferenceTest.php
#	tests/Node/Expression/NullCoalesceTest.php
#	tests/Node/NodeTest.php
#	tests/NodeVisitor/OptimizerTest.php
#	tests/ParserTest.php
#	tests/Resources/LegacyCoreTest.php
#	tests/Runtime/EscaperRuntimeTest.php
#	tests/TemplateTest.php
#	tests/TokenParser/TypesTokenParserTest.php
#	tests/Util/CallableArgumentsExtractorTest.php
#	tests/Util/CallableParametersTest.php
2026-06-03 19:54:02 +02:00
Fabien Potencier 8a4b77920a Add PHPUnit attributes alongside annotations to silence doc-comment metadata deprecations on PHPUnit 11 2026-06-03 18:26:39 +02:00
Fabien Potencier cdce18d02a Fix CS 2026-02-07 09:16:06 +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 b03de9de05 Merge branch '3.x' into 4.x
* 3.x:
  Update CHANGELOG
  Fix accessing arrays with stringable objects as key
  Update inky_to_html.rst: Updating link
  Update replace.rst
  [Doc] Tweaks in the escaping article
  Compile 'index' with repr (not string) in EmbedNode
  Introduce registerUndefinedTestCallback
  Fix intl test
  Bump minimum Commonmark requirement
  Support two words test guard
  Bump version
  Improve documentation examples for `enum` and `enum_cases`
  Avoid errors when failing to guess the template info for an error
  Add note to format_datetime explaining how to install required extensions
  Fix compatibility layer
2025-10-29 11:55:46 -04:00
Vincent Langlet cc12df995c Introduce registerUndefinedTestCallback 2025-09-16 07:40:27 +02:00
Nicolas Grekas c649c1658b Merge branch '3.x' into 4.x
* 3.x:
  CS fixes
  Enable Fabbot as a GHA
2025-07-29 10:27:55 +02:00
Nicolas Grekas 85a4817128 CS fixes 2025-07-29 10:07:07 +02:00
Fabien Potencier 151aa4ecda Fix CS 2025-02-14 12:57:03 +01:00
Fabien Potencier 6032fd320c Merge branch '3.x' into 4.x
* 3.x:
  Fix version
  Fix CS
  Remove obsolete code
  Use generics in ExpressionParsers
  Fix precedence rules
  Add deprecation notices in CHANGELOG and docs
  Move Operators to ExpressionParsers, deprecate ExpressionParser
  Add a script to update operator precedence documentation
  Extract operators logic from ExpressionParser to their own classes
  Introduce operator classes to describe operators provided by extensions instead of arrays
  Bump version to 3.21
2025-02-14 09:08:33 +01:00
Fabien Potencier 4b57f48a65 Use generics in ExpressionParsers 2025-02-14 08:38:53 +01:00
Fabien Potencier f67078b5c4 Move Operators to ExpressionParsers, deprecate ExpressionParser 2025-02-14 08:38:53 +01:00
Fabien Potencier df877a1d53 Introduce operator classes to describe operators provided by extensions instead of arrays 2025-02-14 08:38:53 +01:00
Fabien Potencier 28246c5d4e Merge branch '3.x' into 4.x
* 3.x:
  Fixing minor typo in Update inline_css.rst
  Ignore static properties when using the dot operator
  Fix CS
  Fix constant() behavior when used with ??
  Finish the work
  fix indentation
  Apply suggestions from code review
  typo
  fix merge
  docs and changelog
  typehint instead of checkArrow
  checkArrow, typehints
  invoke filter
2025-01-24 11:32:17 +01:00
Fabien Potencier 76062c8d51 Fix CS 2025-01-19 16:54:05 +01:00
Fabien Potencier 9d9c9d81e9 Improve YieldReady support docs 2024-11-11 09:38:36 +01:00
Fabien Potencier 14216a8d68 Merge branch '3.x' into 4.x
* 3.x:
  Deprecate using the not unary operator without parenthesis
  Deprecate using ?? without explicit parentheses
  Add support for logical `xor` operator
  Allow running CI on all branches
  [Doc] Fix enum title
  Document Twig vs PHP types
2024-10-02 14:19:28 +02:00
Fabien Potencier 2081b1ff74 Deprecate using the not unary operator without parenthesis 2024-10-02 14:16:34 +02:00
Fabien Potencier f4aacafd78 Deprecate using ?? without explicit parentheses 2024-10-01 21:58:05 +02:00
Fabien Potencier 4dd20ba005 Merge branch '3.x' into 4.x
* 3.x:
  Add start/end time accessors on Profile
  Fix 'ignore missing' when used on an 'embed' tag
  Fix the possibility to override an aliased block (via use)
  Add test
  Add hot cache reload for templates
  Add RemovableCacheInterface
  Add some tests
  Optimize compiled code for "set" tag
  Improve how trim behaves
  Add more tests
  Add return types in FileystemLoader
  Add compile-time checks for the "matches" operator
2024-09-26 09:28:03 +02:00
Fabien Potencier 00ba8046b0 Add test 2024-09-25 17:28:51 +02:00
Fabien Potencier 76ef266cd7 Merge branch '3.x' into 4.x
* 3.x:
  Add the possibility to reset globals
2024-09-07 17:16:15 +02:00
Fabien Potencier fa1c9f0bf9 Merge branch '3.x' into 4.x
* 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
2024-09-07 17:03:10 +02:00
Fabien Potencier ef58791fa4 Add the possibility to reset globals 2024-09-07 16:47:00 +02:00
Fabien Potencier f5300784df bug #4281 Fix wrong format of Environment::VERSION_ID constant (emodric)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Fix wrong format of `Environment::VERSION_ID` constant

It seems that format of `Environment::VERSION_ID` constant was (erroneously?) changed with Twig 3.10.0.

Commits
-------

a219d9e7 Fix wrong format of `Environment::VERSION_ID` constant
2024-09-06 13:47:41 +02:00
Edi Modrić a219d9e77f Fix wrong format of Environment::VERSION_ID constant 2024-09-06 13:47:39 +02:00
Fabien Potencier 2ae0c0d38c Fix CS 2024-09-06 12:33:38 +02:00
Alexandre Daubois 797e490356 Improve exception expectations reliability 2024-09-04 15:22:48 +02:00
Fabien Potencier cc1045e4e4 Merge branch '3.x' into 4.x
* 3.x:
  Replace `return; yield` with `yield from []`
  Fix testExtensionsAreNotInitializedWhenRenderingACompiledTemplate
  Fix MacroTest
2024-09-03 13:55:51 +02:00
Alexander M. Turek 3a4d513ffe Fix testExtensionsAreNotInitializedWhenRenderingACompiledTemplate 2024-09-02 20:07:39 +02:00
Fabien Potencier e2f0128774 Merge branch '3.x' into 4.x
* 3.x:
  Deprecate the fact that the `extends` and `use` tags are always allowed in a sandboxed template
  Clarify block function
2024-08-28 13:56:42 +02:00
Fabien Potencier 5fca700cbd Deprecate the fact that the extends and use tags are always allowed in a sandboxed template 2024-08-28 13:40:53 +02:00
Fabien Potencier 5820fba263 Merge branch '3.x' into 4.x
* 3.x:
  Update CHANGELOG and docs
  Swap BC layer for yield-ready and reclaim perf loss
  Add test about version
2024-08-19 20:19:25 +02:00
Vincent Langlet 254abc8c4c Add test about version 2024-08-18 18:25:33 +02:00
Simon André 470965fcc2 Add missing return types in 4.0 2024-08-17 23:10:07 +02:00
Fabien Potencier 76dcc75982 Merge branch '3.x' into 4.x
* 3.x:
  Replace template loader mocks by ArrayLoader
  [Doc] Fix javascript code-block
2024-07-24 09:53:24 +02:00
Fabien Potencier e4e95f5b86 Replace template loader mocks by ArrayLoader 2024-07-24 08:27:23 +02:00
Fabien Potencier 6f4e6e7b8e Make Environment::getGlobals() private 2024-07-05 08:05:37 +02:00
Fabien Potencier 0093bbf918 Merge branch '3.x' into 4.x
* 3.x:
  Fix EscaperExtension constructor to not change from previous releases (will be the same in 4.x as well)
2024-05-04 18:32:36 +02:00
Fabien Potencier f2c9795b26 Fix EscaperExtension constructor to not change from previous releases (will be the same in 4.x as well) 2024-05-04 18:27:46 +02:00
Fabien Potencier f582a3e381 Fix CS 2024-05-01 16:41:44 +02:00
Fabien Potencier 5b0a843db7 Remove deprecated methods 2024-05-01 09:45:20 +02:00
Fabien Potencier 8bebf01858 Merge branch '3.x' into 4.x
* 3.x:
  -
  Fix capturing output from extensions that still use echo
  Add missing @deprecated tags
  Add more information about migrating away from twig_escape_filter()
  Fix compat with older versions of PHP
  Extract the escaping logic to a runtime
2024-05-01 09:18:31 +02:00
Nicolas Grekas 8c43456ac6 Fix capturing output from extensions that still use echo 2024-04-30 16:48:10 +02:00
Fabien Potencier 9a11ee1c64 Merge branch '3.x' into 4.x
* 3.x:
  Bump version to 3.9.4-DEV
  Fix a warning
  Use ::class everywhere
  Auto-close PRs on subtree-splits
  Bump version
  Prepare the 3.9.3 release
  Update CHANGELOG
  Ensure Lexer:: is always initialized
  fix: #4033 add missing unwrap call when a TemplateWrapper instance can be present
  change extended DI extension class
  fix: #4029 when use_yield is true CaptureNode use iterator_to_array preserveKeys argument to false
2024-04-24 08:25:00 +02:00