Commit Graph

33 Commits

Author SHA1 Message Date
Guillaume f2e549a92b ⚰️ Drop useless php comparisons 2026-07-18 18:06:34 +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 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 a8e9d3b14a Fix merge conflict resolution 2026-06-02 14:10:55 +02:00
Fabien Potencier 19099de78e Merge branch '3.x' into 4.x
* 3.x:
  Skip the sandbox `__toString` check on arguments whose PHP parameter type cannot implicitly coerce to string
  Fix  CS
  Bump version
  Prepare the 3.27.1 release
  Fix inconsistent array access with a Stringable key
  Preserve IteratorAggregate identity in sandbox __toString walker
  Fix tests
  Bump version
  Prepare the 3.27.0 release
  Fix sandbox filter/tag/function allow-list bypass when sandbox state changes between renders
  Document new support for any expression as a dynamic mapping key
  Fix sandbox __toString policy bypass via dynamic mapping keys
  Fix deprecation notices in tests
  Guard sandbox `__toString` walker against self-referencing iterables
  Fix sandbox `__toString` bypass via `Stringable` + `Traversable` containers
  Fix sandbox `__toString` bypass via the `in` and `not in` operators
  Fix sandbox __toString bypass via Traversable in join/replace filters
  Mark new SourcePolicyInterface column filter tests as @group legacy
  Fix sandbox bypass in the "column" filter under SourcePolicyInterface
  Fix sandbox bypass in deprecated internal wrappers

# Conflicts:
#	CHANGELOG
#	src/Environment.php
#	src/Node/Expression/ArrayExpression.php
#	src/Node/Expression/CallExpression.php
#	src/Resources/core.php
#	src/Template.php
#	src/Util/CallableArgumentsExtractor.php
#	src/Util/ReflectionCallable.php
#	tests/Extension/SandboxTest.php
#	tests/Resources/LegacyCoreTest.php
#	tests/TemplateTest.php
2026-06-02 14:05:57 +02:00
Fabien Potencier 6d5ef30436 Skip the sandbox __toString check on arguments whose PHP parameter type cannot implicitly coerce to string 2026-06-02 13:58:24 +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
Ruud Kamphuis c352a8d283 [Twig 4] Add PHPUnit as dev dependency 2024-12-01 10:29:08 +01:00
Fabien Potencier 6d9103ec91 Tweak tests 2024-09-28 23:44:36 +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 70d9cec591 Remove deprecated features 2024-09-21 09:19:32 +02:00
Fabien Potencier 4074410313 Merge branch '3.x' into 4.x
* 3.x:
  [Doc] Document about `html` and `html_attr` strategies
  Improve date methods phpdoc
  Fix deprecation messages
  Use a more precise return type in AbstractTwigCallable
  fix the handling of predefined arguments in CallExpression
  Allow Twig callable arguments to use camel or snake names
  fix intl-extra tests
  fix typo
2024-09-21 09:17:48 +02:00
Fabien Potencier 52ded207d3 Allow Twig callable arguments to use camel or snake names 2024-09-18 19:19:20 +02:00
Fabien Potencier 6beff61db4 Merge branch '3.x' into 4.x
* 3.x:
  Improve the way one can deprecate a Twig callable
  Bump version
  Prepare the 3.14.0 release
  Fix a security issue when an included sandboxed template has been loaded before without the sandbox context
  Fix test
  fix the version mergeGlobals() is deprecated since
  Tweak code
  Fix CS
  Add more tests
  Remove unused private methods
  Bump version
2024-09-09 21:19:33 +02:00
Fabien Potencier 34ae0311d9 Improve the way one can deprecate a Twig callable 2024-09-09 21:14:40 +02:00
Alexander M. Turek fe2803d245 Remove obsolete "requires PHP" annotation 2024-09-03 13:58:34 +02:00
Fabien Potencier 0823d23488 Throw a SyntaxError exception at compile time when a Twig callable has not the minimum number of required arguments 2024-08-15 23:00:02 +02:00
Fabien Potencier e1705f8831 Extract a new CallableArgumentsExtractor class 2024-08-15 20:37:59 +02:00
Fabien Potencier 0ce79df5c4 Use trigger_deprecation() instead of trigger_error() for deprecations 2024-08-08 14:28:28 +02:00
Fabien Potencier e4e95f5b86 Replace template loader mocks by ArrayLoader 2024-07-24 08:27:23 +02:00
Fabien Potencier 5148d10515 Fix some inconsistencies 2024-04-28 13:15:26 +02:00
Fabien Potencier d9ac797190 Merge branch '2.x' into 3.x
* 2.x:
  Twig2 PHP 8.1 beta compatibility
2021-07-29 09:09:30 +02:00
Alex Pott 98c2233e47 Twig2 PHP 8.1 beta compatibility 2021-07-28 09:49:43 +01:00
Fabien Potencier 879fb0adcc Merge branch '2.x' into 3.x
* 2.x:
  removed usage of getmockBuilder() when not needed
  removed usage of getmockBuilder() when not needed
2019-08-08 13:35:34 +02:00
Fabien Potencier 656c295ed9 Merge branch '1.x' into 2.x
* 1.x:
  removed usage of getmockBuilder() when not needed
2019-08-08 13:33:07 +02:00
Fabien Potencier 5861a539e4 removed usage of getmockBuilder() when not needed 2019-08-08 11:59:51 +02:00
Fabien Potencier 6823b64cad moved test under tests/ 2019-06-30 14:56:12 +02:00
Fabien Potencier 1e3bb75010 moved test under tests/ 2019-06-30 14:51:54 +02:00
Fabien Potencier 22a1317249 moved tests under tests/ 2019-06-30 14:48:27 +02:00