51 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 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 c142a3268e Merge branch '3.x' into 4.x
* 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.
2025-02-09 18:23:27 +01:00
Christophe Coevoet 3794efe662 Fix support for ignoring syntax erros in an undefined handler in guard 2025-02-09 15:10:34 +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
Nicolas Grekas 1d5180549f Ignore static properties when using the dot operator 2025-01-22 09:18:31 +01:00
Fabien Potencier 63b86e3057 Merge branch '3.x' into 4.x
* 3.x:
  Fix the null coalescing operator when the test returns null
  Fix the Elvis operator when there is some space between ? and :
  Bump version
  Prepare the 3.17.0 release
  Update CHANGELOG
2024-12-12 10:28:23 +01:00
Fabien Potencier 4c5467f56a Fix the null coalescing operator when the test returns null 2024-12-12 10:17:22 +01: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
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 4a2fb5b460 Merge branch '3.x' into 4.x
* 3.x:
  Add the notion of a Twig callable
  Drop support for 8.0
  Add more tests to the Lexer
  Add a note about how to escape a string interpolation in a string
  Bump version to 3.12
  Implement the enum_cases function
  Remove deprecation arg
  Fix integration tests when a test has more than on data/expect section and deprecations
  Bump version
  Prepare the 3.11.0 release
  Update CHANGELOG
2024-08-10 18:01:24 +02:00
Fabien Potencier a5dc02bbc5 Fix integration tests when a test has more than on data/expect section and deprecations 2024-08-09 17:14:41 +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
Fabien Potencier 84bff0643c Extract the escaping logic to a runtime 2024-04-28 21:26:07 +02:00
Fabien Potencier 13e57cb3fe Remove usage of ReturnTypeWillChange 2023-12-24 11:22:05 +01:00
Fabien Potencier 2956688a95 Merge branch '3.x' into 4.x
* 3.x:
  Add missing dots at the end of exception messages
2023-12-24 11:21:54 +01:00
Fabien Potencier 6e2f2655a8 Add missing dots at the end of exception messages 2023-12-24 09:54:44 +01:00
Fabien Potencier ac423430aa Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
  Move functions for CoreExtension
  Move functions for EscaperExtension
  Move functions for StringLoaderExtension
  Move functions for DebugExtension
  Move functions for MarkdownExtension
  Move functions for InkyExtension
  Move functions for CssInlinerExtension
  Move functions for HtmlExtension
  Deprecate internal extension functions in favor of methods on the extension classes
  Tweak deprecated docs
2023-12-10 20:55:15 +01:00
Fabien Potencier 72071e8ece Move functions for EscaperExtension 2023-12-10 11:49:57 +01:00
Fabien Potencier be67e9690f Use str_* when possible 2023-12-09 15:33:38 +01:00
Fabien Potencier 5193653ecb Fix CS 2023-10-08 09:05:22 +02:00
Fabien Potencier 9ca7fb8799 Merge branch '2.x' into 3.x
* 2.x:
  Fix support for named closures
2022-05-15 08:11:13 +02:00
Nicolas Grekas 163f07400a Fix support for named closures 2022-05-13 17:01:54 +02:00
Fabien Potencier 1231fd4096 Merge branch '2.x' into 3.x
* 2.x:
  Allow null for nl2br, striptags and format filters
2022-01-03 17:03:55 +01:00
Ruud Kamphuis e9cd55def5 Allow null for nl2br, striptags and format filters
Same as https://github.com/twigphp/Twig/pull/3617
2022-01-03 14:28:28 +01:00
Fabien Potencier 464842c41f Merge branch '2.x' into 3.x
* 2.x:
  Add explicit `@return` type next to `#[ReturnTypeWillChange]`
2021-08-11 09:52:24 +02:00
Nicolas Grekas 1d0bab9d63 Add explicit @return type next to #[ReturnTypeWillChange] 2021-08-10 18:49: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 13e360972a Merge branch '2.x' into 3.x
* 2.x:
  Fix CS
  Fix CS
  Migrate to the new PHP CS Fixer config file
  Fixing links
2021-05-12 09:45:40 +02:00
Fabien Potencier 157fa56829 Merge branch '1.x' into 2.x
* 1.x:
  Fix CS
  Migrate to the new PHP CS Fixer config file
2021-05-12 09:27:30 +02:00
Fabien Potencier 59f3e8e5dc Fix CS 2021-05-12 09:19:37 +02:00
Fabien Potencier a95ec00440 Merge branch '2.x' into 3.x
* 2.x:
  Fix ambiguous syntax parsing
2020-02-21 08:37:36 +01:00
Fabien Potencier 0686ccf278 Merge branch '1.x' into 2.x
* 1.x:
  Fix ambiguous syntax parsing
2020-02-21 08:37:29 +01:00
Fabien Potencier 5724cbeddf Fix ambiguous syntax parsing 2020-02-21 08:31:42 +01:00
Fabien Potencier 41ab8b9699 Merge branch '2.x' into 3.x
* 2.x:
  moved the HTML extension to an external Composer package
2019-08-10 07:48:25 +02:00
Fabien Potencier 59bb9d1033 moved the HTML extension to an external Composer package 2019-08-08 18:10:45 +02:00
Fabien Potencier 52c633a7be Merge branch '2.x' into 3.x
* 2.x:
  fixed the "empty" test on Traversable instances
  avoid confusion between .. and ..
  fixed phpdocs
  fixed CHANGELOG
  moved css_class function to html_classes filter
  Added support for `css_class` function
  added missing docs
  fixed wrong registration
  added the data_uri filter
  bumped version
  Update CoreExtension.php
2019-08-07 17:09:29 +02:00
Fabien Potencier 220e75065a added the data_uri filter 2019-08-07 14:42:44 +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