33 Commits

Author SHA1 Message Date
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 cdce18d02a Fix CS 2026-02-07 09:16:06 +01:00
Fabien Potencier 861215c507 Fix CS 2026-02-07 09:07:38 +01: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 ef63506239 Merge branch '3.x' into 4.x
* 3.x:
  Improve ImportNode impl
  Rename Node classes related to variables
2024-10-24 07:57:29 +02:00
Fabien Potencier fc15e7ccbc Rename Node classes related to variables 2024-10-23 12:36:57 +02:00
Fabien Potencier 0c6bd47d6b Merge branch '3.x' into 4.x
* 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
2024-09-27 07:59:52 +02:00
Fabien Potencier 8b278986b8 Deprecate using Node directly, introduce EmptyNode and Nodes 2024-09-27 07:42:41 +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 9855e35d44 Optimize compiled code for "set" tag 2024-09-24 16:47:02 +02:00
Fabien Potencier fe7bac8989 Merge branch '3.x' into 4.x
* 3.x:
  Migrate NodeTestCase to static data providers
2024-09-03 14:51:02 +02:00
Fabien Potencier dd9af8ec25 feature #4265 Migrate NodeTestCase to static data providers (derrabus)
This PR was merged into the 3.x branch.

Discussion
----------

Migrate NodeTestCase to static data providers

PHPUnit 11 requires data providers to be static. This PR prepares our abstract `NodeTestCase` by deprecating the non-static `getTests()` and adding a static `provideTests()` as a replacement. I've also added PHPUnit attributes which newer PHPUnit releases prefer over PHPDoc annotations.

Commits
-------

f555a33c Migrate NodeTestCase to static data providers
2024-09-03 14:03:04 +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 f555a33caf Migrate NodeTestCase to static data providers 2024-09-03 13:51:42 +02:00
Ruud Kamphuis 09a43a9f6f Replace return; yield with yield from []
This has the same effect, but looks less hacky and makes PHPStan happy.
https://phpstan.org/r/df7fcc88-1df8-428e-b675-5dc6965c34d6

Previously this was needed to work properly with output capturing.
2024-09-03 09:55:58 +02:00
Fabien Potencier a5882760df Fix CS 2024-08-07 19:37:53 +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
Gildas de Cadoudal f7121a23bc fix: #4029 when use_yield is true CaptureNode use iterator_to_array preserveKeys argument to false 2024-04-18 09:45:09 +02:00
Nicolas Grekas 1af9ad0c3e Merge branch '3.x' into 4.x
* 3.x:
  Add `#[YieldReady]` to allow extensions to tell when they're ready for yielding
2024-02-15 11:47:41 +01:00
Nicolas Grekas e70777405d Add #[YieldReady] to allow extensions to tell when they're ready for yielding 2024-02-15 10:27:26 +01:00
Fabien Potencier f7f11ea410 Fix CS 2024-02-10 09:52:03 +01:00
Fabien Potencier 3daafdae98 Fix tests 2024-02-05 16:13:35 +01:00
Fabien Potencier b3eeb41861 Remove obsolete code about non-yield templates 2024-02-05 16:13:35 +01:00
Fabien Potencier a9c7307b5c Tweak code 2024-01-25 13:09:58 +01:00
Fabien Potencier 15879406c8 Remove the new yield nodes 2024-01-25 13:09:58 +01:00
Fabien Potencier 3b6cbf98d8 Remove usage of ob_* functions in favor of yielding 2024-01-25 13:09:52 +01:00
Fabien Potencier 9c0897fa2c Remove usage of list() in favor of [] 2024-01-05 09:48:24 +01:00
Fabien Potencier 6ebbc30593 Abstract node capture in its own Node 2023-12-30 10:14:36 +01:00
Fabien Potencier 6823b64cad moved test under tests/ 2019-06-30 14:56:12 +02:00