Commit Graph

6280 Commits

Author SHA1 Message Date
Fabien Potencier b1c22a1cee Merge branch '3.x' into 4.x
* 3.x:
  Fix tests config
  Fix tests config
2024-02-05 16:12:20 +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 e79c7a3984 Merge branch '3.x' into 4.x
* 3.x:
  Fix bug
  Tweak code
  Add a deprecation when a Node uses echo/print
  Fix tests
  Optimize code
  Add support for templates that do not have output Nodes
  -
  Remove some tests
  -
  Tweak code
  Remove the new yield nodes
  Remove usage of ob_* functions in favor of yielding
  Tweak CI output
2024-02-05 14:27:33 +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 4cb7a2464f Tweak CI output 2024-01-25 09:27:05 +01:00
Fabien Potencier 5d5ea62171 Merge branch '3.x' into 4.x
* 3.x:
  Remove support for Twig 2.x and unmaintained Symfony versions
  Clarify the behavior when a property/method does not exist
2024-01-25 09:17:53 +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 d234a60efa Merge branch '3.x' into 4.x
* 3.x:
  Bump actions/cache for CI
  Remove an obsolete comment
  Throws proper Twig exception when using cycle on an empty array
  Add tests when a template doesn't have output nodes
  Optimize TextNodes
  Remove list() usage in code
  Remove usage of list() in favor of []
2024-01-22 18:50:54 +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 82e98ceff9 Merge branch '3.x' into 4.x
* 3.x:
  rework the CaptureNode implementation
2024-01-01 15:48:17 +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 2d19b9a8f0 Merge branch '3.x' into 4.x
* 3.x:
  Abstract node capture in its own Node
2023-12-30 13:06:11 +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 14d199445a minor #3953 Remove usage of ReturnTypeWillChange (fabpot)
This PR was merged into the 4.x branch.

Discussion
----------

Remove usage of ReturnTypeWillChange

Commits
-------

13e57cb3 Remove usage of ReturnTypeWillChange
2023-12-25 10:50:04 +01: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 fa91edfcc6 Merge branch '3.x' into 4.x
* 3.x:
  Fix intl tests
  Improve error message
  Bump version
  Update CHANGELOG
2023-12-24 09:45:46 +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