Commit Graph

6238 Commits

Author SHA1 Message Date
Christian Flothmann d9d7e136c1 fix TwigExtraBundle tests with Symfony 6.0/6.1 2024-02-07 09:24:24 +01:00
Fabien Potencier 7e1945a618 minor #3991 Fix some errors reported by phpstan (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix some errors reported by phpstan

Commits
-------

2b2ac80d Fxi some errors reported by phpstan
2024-02-05 18:59:35 +01:00
Fabien Potencier 2b2ac80d34 Fxi some errors reported by phpstan 2024-02-05 17:48:36 +01:00
Fabien Potencier 84bb846172 Fix tests config 2024-02-05 16:10:51 +01:00
Fabien Potencier d3b5922620 Fix tests config 2024-02-05 16:08:29 +01:00
Fabien Potencier edf5808144 feature #3950 Deprecate usage of ob_* functions in favor of yielding (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Deprecate usage of ob_* functions in favor of yielding

Still a work in progress, but everything works fine in both modes.

Commits
-------

a93723ea Fix bug
0d3a2839 Tweak code
14d38036 Add a deprecation when a Node uses echo/print
210e2d2b Fix tests
1591aa5c Optimize code
1469e6a6 Add support for templates that do not have output Nodes
72922a36 -
71e90fab Remove some tests
4fd62abb -
a9c7307b Tweak code
15879406 Remove the new yield nodes
3b6cbf98 Remove usage of ob_* functions in favor of yielding
2024-02-05 14:24:44 +01:00
Fabien Potencier a93723eae2 Fix bug 2024-01-25 13:09:58 +01:00
Fabien Potencier 0d3a283907 Tweak code 2024-01-25 13:09:58 +01:00
Fabien Potencier 14d3803647 Add a deprecation when a Node uses echo/print 2024-01-25 13:09:58 +01:00
Fabien Potencier 210e2d2b9e Fix tests 2024-01-25 13:09:58 +01:00
Fabien Potencier 1591aa5c7d Optimize code 2024-01-25 13:09:58 +01:00
Fabien Potencier 1469e6a6bc Add support for templates that do not have output Nodes 2024-01-25 13:09:58 +01:00
Fabien Potencier 72922a3612 - 2024-01-25 13:09:58 +01:00
Fabien Potencier 71e90fab7b Remove some tests 2024-01-25 13:09:58 +01:00
Fabien Potencier 4fd62abb87 - 2024-01-25 13:09:58 +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 594c548b92 Tweak CI output 2024-01-25 09:27:19 +01:00
Fabien Potencier 95c3ef4d5c minor #3972 Remove support for Twig 2.x and unmaintained Symfony versions (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Remove support for Twig 2.x and unmaintained Symfony versions

Commits
-------

b1a8feaa Remove support for Twig 2.x and unmaintained Symfony versions
2024-01-25 09:16:54 +01:00
Fabien Potencier b1a8feaa55 Remove support for Twig 2.x and unmaintained Symfony versions 2024-01-25 08:19:28 +01:00
Fabien Potencier 8812664775 minor #3968 Clarify the behavior when a property/method does not exist (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Clarify the behavior when a property/method does not exist

Alternative to #3964

Commits
-------

1ed424d5 Clarify the behavior when a property/method does not exist
2024-01-24 07:17:10 +01:00
Fabien Potencier 1ed424d565 Clarify the behavior when a property/method does not exist 2024-01-24 07:16:36 +01:00
Fabien Potencier 284a510651 Bump actions/cache for CI 2024-01-22 18:49:50 +01:00
Fabien Potencier 4c179c8a64 bug #3961 Throws proper Twig exception when using cycle on an empty array (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Throws proper Twig exception when using cycle on an empty array

Closes #3925

Commits
-------

d21666f7 Throws proper Twig exception when using cycle on an empty array
2024-01-12 12:20:12 +01:00
Fabien Potencier 9ef031efdc Remove an obsolete comment 2024-01-12 08:20:25 +01:00
Fabien Potencier d21666f728 Throws proper Twig exception when using cycle on an empty array 2024-01-11 21:47:04 +01:00
Fabien Potencier 433189bb5a feature #3959 Optimize TextNodes (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Optimize TextNodes

Not a great perf optimization, but it makes the node graph simpler which helps when we need to debug templates.

Commits
-------

c44bd1ff Optimize TextNodes
2024-01-11 14:01:35 +01:00
Fabien Potencier cccf8b7e20 minor #3960 Add tests when a template doesn't have output nodes (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add tests when a template doesn't have output nodes

refs #3950 cc `@smnandre`

Commits
-------

d53509d4 Add tests when a template doesn't have output nodes
2024-01-11 08:39:22 +01:00
Fabien Potencier d53509d457 Add tests when a template doesn't have output nodes 2024-01-11 08:19:14 +01:00
Fabien Potencier c44bd1ff62 Optimize TextNodes 2024-01-10 20:22:00 +01:00
Fabien Potencier 8b4aa84fe1 minor #3958 Remove usage of list() in favor of [] (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Remove usage of list() in favor of []

Commits
-------

af8ec178 Remove list() usage in code
9c0897fa Remove usage of list() in favor of []
2024-01-05 18:52:53 +01:00
Fabien Potencier af8ec178b6 Remove list() usage in code 2024-01-05 12:46:24 +01:00
Fabien Potencier 9c0897fa2c Remove usage of list() in favor of [] 2024-01-05 09:48:24 +01:00
Fabien Potencier b4c3c1c448 bug #3957 rework the CaptureNode implementation (xabbuh)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

rework the CaptureNode implementation

fixes #3955

Commits
-------

665dce89 rework the CaptureNode implementation
2024-01-01 15:44:03 +01:00
Christian Flothmann 665dce899f rework the CaptureNode implementation 2024-01-01 15:43:59 +01:00
Fabien Potencier 3f70efae53 feature #3954 Abstract node capture in its own Node (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Abstract node capture in its own Node

To prepare the work for #3950, I'd like to abstract the usage of `echo` into a single node that can be reused by other nodes.

The cache node is a good example of defining something that is more semantic are reusable as well. The node itself now just generates the wrapper that can then be returned, echoed, yielded, ...

Commits
-------

6ebbc305 Abstract node capture in its own Node
2023-12-30 13:02:32 +01:00
Fabien Potencier 6ebbc30593 Abstract node capture in its own Node 2023-12-30 10:14:36 +01:00
Fabien Potencier 6e2f2655a8 Add missing dots at the end of exception messages 2023-12-24 09:54:44 +01:00
Fabien Potencier 61fff2dba2 minor #3952 Fix intl tests (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix intl tests

Commits
-------

44b3bac5 Fix intl tests
2023-12-24 09:45:15 +01:00
Fabien Potencier 44b3bac552 Fix intl tests 2023-12-24 09:42:15 +01:00
Fabien Potencier e7261632f3 minor #3853 Improve error message for constant(FQCN::class) (MalteWunsch)
This PR was merged into the 3.x branch.

Discussion
----------

Improve error message for `constant(FQCN::class)`

It is not obvious that you cannot use the Twig function `constant` to get the special `::class` constants of classes like so: `{{ constant('Twig\\Extension\\CoreExtension::class') }}`, due to the underlying PHP function `\constant()`.

The previous error message
> Constant "Twig\Extension\CoreExtension::class" is undefined.

was generally helpful, but in this special case it was a bit misleading.

An alternative might be to determine and return the FCQN (e.g. via `substr($constant, 0, -7)`), but I'm not sure if this would be too much of a guess.

Commits
-------

3963851a Improve error message
2023-12-22 08:51:32 +01:00
Malte Wunsch 3963851a41 Improve error message
It is not obvious that you cannot use the Twig function `constant` to get the special `::class` constants of classes like so: `{{ constant('Twig\\Extension\\CoreExtension::class') }}`, due to the underlying PHP function `\constant()`.

The previous error message in this case: 'Constant "Twig\Extension\CoreExtension::class" is undefined.' was not very helpful.
2023-12-22 08:51:25 +01:00
Fabien Potencier 4c621adb49 Bump version 2023-12-22 08:35:50 +01:00
Fabien Potencier d77586da99 Update CHANGELOG 2023-12-22 08:34:46 +01:00
Fabien Potencier 7072a7256e bug #3949 Simplify code when using ob_* functions (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify code when using `ob_*` functions

And fixed an edge case (see the modified test).

Commits
-------

0b9e30e3 Simplify code
2023-12-20 20:46:37 +01:00
Fabien Potencier 0b9e30e3d2 Simplify code 2023-12-20 20:43:49 +01:00
Fabien Potencier 83dfc0f823 bug #3948 Simplify sandbox tests (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Simplify sandbox tests

This allows to remove some unneeded assertions and fix static analysis checks.

Commits
-------

bc22e38c Fix bad merge
e6a98a00 Fix test without any assertions
fca89954 Simplify tests
2023-12-20 20:37:13 +01:00
Fabien Potencier bc22e38ce6 Fix bad merge 2023-12-20 20:34:40 +01:00
Fabien Potencier e6a98a000f Fix test without any assertions 2023-12-20 20:34:04 +01:00