Commit Graph

7282 Commits

Author SHA1 Message Date
Fabien Potencier f0cd0fdb9f minor #4695 Update replace.rst (cyphix333)
This PR was merged into the 3.x branch.

Discussion
----------

Update replace.rst

Missing `fruits` variable declaration.

Commits
-------

df3a281fc1 Update replace.rst
2025-10-07 07:46:05 +02:00
Brett df3a281fc1 Update replace.rst
Missing `fruits` variable declaration.
2025-10-07 07:09:13 +08:00
Fabien Potencier a895a3f00d minor #4694 [Doc] Tweaks in the escaping article (javiereguiluz)
This PR was merged into the 3.x branch.

Discussion
----------

[Doc] Tweaks in the escaping article

AS you can see in the redenred page (https://twig.symfony.com/doc/3.x/filters/escape.html) the tip about `html_attr` contains some uneeded line breaks.

This also tweaks another explanation to make it more clear.

Commits
-------

50327b5019 [Doc] Tweaks in the escaping article
2025-09-25 12:20:18 +02:00
Fabien Potencier dac599c320 bug #4693 Compile 'index' with repr (not string) in EmbedNode (smnandre)
This PR was merged into the 3.x branch.

Discussion
----------

Compile 'index' with repr (not string) in EmbedNode

Before this PR, the generated Template code had quotes around the index (integer) parameter value.

Commits
-------

e4d7915702 Compile 'index' with repr (not string) in EmbedNode
2025-09-25 12:17:47 +02:00
Javier Eguiluz 50327b5019 [Doc] Tweaks in the escaping article 2025-09-25 11:22:21 +02:00
Simon André e4d7915702 Compile 'index' with repr (not string) in EmbedNode
Before this fix, the generated Template code had quotes around the
index (integer) parameter value.
2025-09-25 08:28:51 +02:00
Fabien Potencier 1d866283ed feature #4687 Introduce registerUndefinedTestCallback (VincentLanglet)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Introduce registerUndefinedTestCallback

This is similar to `registerUndefinedFilterCallback` and `registerUndefinedFunctionCallback`

Commits
-------

cc12df995c Introduce registerUndefinedTestCallback
2025-09-16 07:40:30 +02:00
Vincent Langlet cc12df995c Introduce registerUndefinedTestCallback 2025-09-16 07:40:27 +02:00
Fabien Potencier fecc10cb14 minor #4692 Fix intl test (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix intl test

Let's try to make it less fragile.

Commits
-------

41bfb6bd8b Fix intl test
2025-09-15 08:07:21 +02:00
Fabien Potencier 41bfb6bd8b Fix intl test 2025-09-15 08:05:04 +02:00
Fabien Potencier d6a5a3e6d0 minor #4691 Bump minimum Commonmark requirement (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Bump minimum Commonmark requirement

All previous versions have security issues

Commits
-------

8f970764e6 Bump minimum Commonmark requirement
2025-09-15 08:00:04 +02:00
Fabien Potencier 8f970764e6 Bump minimum Commonmark requirement 2025-09-15 07:57:37 +02:00
Fabien Potencier 32f88a2368 feature #4689 Support two words test guard (VincentLanglet)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Support two words test guard

Extracted from https://github.com/twigphp/Twig/pull/4687

Commits
-------

30977bdea9 Support two words test guard
2025-09-15 07:51:44 +02:00
Vincent Langlet 30977bdea9 Support two words test guard 2025-09-15 07:51:41 +02:00
Fabien Potencier 57a2f85783 Bump version 2025-09-15 07:48:29 +02:00
Fabien Potencier 2a52ec2596 minor #4690 Improve documentation examples for enum and enum_cases (Kocal)
This PR was merged into the 3.x branch.

Discussion
----------

Improve documentation examples for `enum` and `enum_cases`

It may be obvious, but I first thought initializing an BackendEnum with a specific value could be possible with `enum(FQCN, value)`, but it does not, it always returns the first case  instance (if exists).

Instead, `enum(FQCN).from(value)` must be used, and I think it's worth to improve `enum()` examples.

Commits
-------

def4abbd5e Improve documentation examples for `enum` and `enum_cases`
2025-09-15 07:46:50 +02:00
Hugo Alliaume def4abbd5e Improve documentation examples for enum and enum_cases
It may be obvious, but I first thought initializing an BackendEnum with a certain value could be possible with `enum(FQCN, value)`, but it does not, it always returns the first case  instance (if exists).

Instead, `enum(FQCN).from(value)` must be used, I think it's worth to improve `enum()` examples.
2025-09-12 18:14:50 +02:00
Fabien Potencier 98b664a0ca bug #4688 Avoid errors when failing to guess the template info for an error (stof)
This PR was merged into the 3.x branch.

Discussion
----------

Avoid errors when failing to guess the template info for an error

Someone reported on the Symfony Slack a case where they get a TypeError in `new \ReflectionObject($template)` in the guessing logic instead of seeing the original error they have (the one for which guessing was attempted), making it impossible to know the original error: https://symfony-devs.slack.com/archives/C01FN4EQNLX/p1756762972076319?thread_ts=1756753204.711889&cid=C01FN4EQNLX
I don't have a reproducer for that case (the original case involve a Symfony form theme, where the form renderer does weird usages of Twig which might lead to the backtrace not containing the expected template).

Not guessing the template file path and the original template line is better than breaking the error reporting.

Commits
-------

62747cee27 Avoid errors when failing to guess the template info for an error
2025-09-02 14:53:38 +02:00
Christophe Coevoet 62747cee27 Avoid errors when failing to guess the template info for an error 2025-09-02 14:21:58 +02:00
Fabien Potencier 8832f6327c minor #4685 Add note to format_datetime explaining how to install required extensions (LucileDT)
This PR was merged into the 3.x branch.

Discussion
----------

Add note to format_datetime explaining how to install required extensions

Commits
-------

d0177b94cd Add note to format_datetime explaining how to install required extensions
2025-08-25 21:44:53 +02:00
LucileDT d0177b94cd Add note to format_datetime explaining how to install required extensions 2025-08-23 22:02:14 +02:00
Fabien Potencier 4bf5d2f0f6 bug #4683 Fix compatibility layer (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix compatibility layer

Closes #4652

Commits
-------

806049f7a2 Fix compatibility layer
2025-08-17 19:24:27 +02:00
Fabien Potencier 806049f7a2 Fix compatibility layer 2025-08-17 19:23:48 +02:00
Fabien Potencier 9c94bfee41 minor #4678 Add missing use statements in ExtensionInterface (KevinVanSonsbeek)
This PR was merged into the 3.x branch.

Discussion
----------

Add missing use statements in ExtensionInterface

Fixes #4677

Note: The classes were used specifically in a ``@psalm`-return` doc statement. But as the repository does not have any psalm config, and does not check it in the CI, this seems to have gone unnoticed for a few months.

Commits
-------

8c78952757 #4677: Add use statements for classes referenced in the getOperators `@psalm`-return doc
2025-08-17 19:17:46 +02:00
Fabien Potencier e2858a71fd minor #4682 Fix wrong rounding_mode documentation (bodendorfer-simplethings)
This PR was merged into the 3.x branch.

Discussion
----------

Fix wrong rounding_mode documentation

Fixes https://github.com/twigphp/Twig/issues/4681

Commits
-------

b40934891b Fix wrong rounding_mode values
2025-08-17 19:16:08 +02:00
bodendorfer-simplethings b40934891b Fix wrong rounding_mode values 2025-08-15 14:30:41 +02:00
Kevin van Sonsbeek 8c78952757 #4677: Add use statements for classes referenced in the getOperators @psalm-return doc 2025-08-04 21:13:52 +02:00
Fabien Potencier e05e818761 bug #4653 Allow usage of other Markdown converters than CommonMark in LeagueMarkdown (xJuvi)
This PR was merged into the 3.x branch.

Discussion
----------

Allow usage of other Markdown converters than CommonMark in LeagueMarkdown

Since the `CommonMarkConverter` from `League\CommonMark` doesn't allow customizing the `Environment` class at construct-time, this simple change allows providing an instance the parent class, so we can both inject a config to the converter AND a custom list of extensions (like `CommonMarkCoreExtension`) via the constructor.

This PR fixes #3581

Commits
-------

81e66e96bf Update LeagueMarkdown.php
2025-08-02 15:26:08 +02:00
Nicolas Grekas b1d2a9c20f minor #4671 Enable Fabbot as a GHA (nicolas-grekas)
This PR was merged into the 3.x branch.

Discussion
----------

Enable Fabbot as a GHA

Follows https://github.com/symfony/symfony/pull/61256

Commits
-------

a1ea8edc94 Enable Fabbot as a GHA
2025-07-29 10:10:59 +02:00
Nicolas Grekas fec73458dc minor #4664 CS fixes (nicolas-grekas)
This PR was merged into the 3.x branch.

Discussion
----------

CS fixes

Commits
-------

85a4817128 CS fixes
2025-07-29 10:10:06 +02:00
Nicolas Grekas 85a4817128 CS fixes 2025-07-29 10:07:07 +02:00
Nicolas Grekas a1ea8edc94 Enable Fabbot as a GHA 2025-07-29 09:57:34 +02:00
Fabien Potencier 1680bba422 minor #4663 Escaper performance: avoid static variables (gharlan)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Escaper performance: avoid static variables

Replace two static variables with `match` expressions.
And bypass a third static variable for the common charset `UTF-8`.

Commits
-------

823f50297b Escaper performance: avoid static variables
2025-07-12 15:47:13 +02:00
Gregor Harlan 823f50297b Escaper performance: avoid static variables 2025-07-12 15:47:09 +02:00
Fabien Potencier 115114b415 bug #4665 Fix compatibility with Symfony 8 (nicolas-grekas)
This PR was merged into the 3.x branch.

Discussion
----------

Fix compatibility with Symfony 8

Commits
-------

b6a105c952 Fix compatibility with Symfony 8
2025-07-11 15:49:59 +02:00
Nicolas Grekas b6a105c952 Fix compatibility with Symfony 8 2025-07-10 12:07:05 +02:00
Fabien Potencier 7f908ba1f4 minor #4660 Add documentation for use_yield option (hschletz)
This PR was merged into the 3.x branch.

Discussion
----------

Add documentation for use_yield option

Documentation was present in the source code, but missing in the docs.

Commits
-------

b8827b412d Add documentation for use_yield option
2025-07-06 10:42:55 +02:00
hschletz b8827b412d Add documentation for use_yield option
Documentation was present in the source code, but missing in the docs.
2025-07-02 12:45:53 +02:00
Hannes 81e66e96bf Update LeagueMarkdown.php 2025-06-17 23:57:57 +02:00
Fabien Potencier 403bd9d73c minor #4649 Coding standard suggestion about empty content (VincentLanglet)
This PR was merged into the 3.x branch.

Discussion
----------

Coding standard suggestion about empty content

Hi `@fabpot`

As suggested by `@stof` https://github.com/symfony/symfony/pull/60761#discussion_r2140647490

This would allow writing `{#--#}` rather than `{#- -#}` when following the twig coding standard.

Commits
-------

0b93a1fa5a Stof suggestion about empty content
2025-06-15 16:42:08 +02:00
Vincent Langlet 0b93a1fa5a Stof suggestion about empty content 2025-06-12 08:47:12 +02:00
Fabien Potencier 7dca48a57c minor #4645 Update templates.rst: Removing duplication (ThomasLandauer)
This PR was merged into the 3.x branch.

Discussion
----------

Update templates.rst: Removing duplication

Page: https://twig.symfony.com/doc/3.x/templates.html#dot_operator

Reason: This is repeated a few lines further down.

Commits
-------

a26f43a6a6 Update templates.rst: Removing duplication
2025-06-06 08:01:35 +02:00
Thomas Landauer a26f43a6a6 Update templates.rst: Removing duplication
Page: https://twig.symfony.com/doc/3.x/templates.html#dot_operator

Reason: This is repeated a few lines further down.
2025-06-05 23:22:30 +02:00
Fabien Potencier 5f2b1ee6de feature #4642 [CommonMark] Update configuration keys + allow extra keys for extensions (doekenorg)
This PR was merged into the 3.x branch.

Discussion
----------

[CommonMark] Update configuration keys + allow extra keys for extensions

This PR adds missing keys from the current version of CommonMark (2.7).

It also fixes a bug where extra keys are removed. The original intent was to keep the extra keys, so extensions could be configured as well. Currently, these keys are removed, meaning extensions can not be configured.

Original PR #3737.

Commits
-------

a8aadc3e99 Update configuration keys + allow extra keys for extensions
2025-05-23 04:16:20 -07:00
Doeke Norg a8aadc3e99 Update configuration keys + allow extra keys for extensions 2025-05-23 09:29:36 +02:00
Fabien Potencier 9ff927ae5d minor #4638 Update reduce.rst (AndCycle)
This PR was merged into the 3.x branch.

Discussion
----------

Update reduce.rst

remove note, better argument for example
reduce doesn't use `array_reduce` internally

https://github.com/twigphp/Twig/issues/3802
https://github.com/twigphp/Twig/commit/609794c37668989b670d79e97baf8d5ce05e0a97

Commits
-------

bb6382c1bb Update reduce.rst
2025-05-18 10:07:38 +02:00
Fabien Potencier 993fb097e7 minor #4640 replace typographic quote with straigt single quote (xabbuh)
This PR was merged into the 3.x branch.

Discussion
----------

replace typographic quote with straigt single quote

make DOCtor-RST 1.68 happy and account for OskarStark/doctor-rst#2011

Commits
-------

057ea92274 replace typographic quote with straigt single quote
2025-05-18 10:06:06 +02:00
Christian Flothmann 057ea92274 replace typographic quote with straigt single quote
make DOCtor-RST 1.68 happy and account for OskarStark/doctor-rst#2011
2025-05-17 21:08:00 +02:00
Fabien Potencier b49e1cd401 minor #4639 [Docs] Add TwigCsFixer in tools list (smnandre)
This PR was merged into the 3.x branch.

Discussion
----------

[Docs] Add TwigCsFixer in tools list

Twig CS Fixer is already present in the code style / conventions page, but it feels to me very logical we see it on the "integration / tools" page.

Commits
-------

2184db3b9b Add TwigCsFixer in tools list
2025-05-16 12:29:43 +02:00
Simon André 2184db3b9b Add TwigCsFixer in tools list
Twig CS Fixer is already present in the code style / conventions page, but it feels to me very logical we see it on the "integration / tools" page.
2025-05-16 00:37:43 +02:00