Commit Graph

250 Commits

Author SHA1 Message Date
Nicolas Grekas 1af9ad0c3e Merge branch '3.x' into 4.x
* 3.x:
  Add `#[YieldReady]` to allow extensions to tell when they're ready for yielding
2024-02-15 11:47:41 +01:00
Nicolas Grekas e70777405d Add #[YieldReady] to allow extensions to tell when they're ready for yielding 2024-02-15 10:27:26 +01:00
Fabien Potencier f7f11ea410 Fix CS 2024-02-10 09:52:03 +01:00
Fabien Potencier f9871531b7 Merge branch '3.x' into 4.x
* 3.x:
  Fxi some errors reported by phpstan
2024-02-05 19:00:15 +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 3daafdae98 Fix tests 2024-02-05 16:13:35 +01:00
Fabien Potencier c129040d46 Merge YieldingTemplate and Template 2024-02-05 16:13:35 +01:00
Fabien Potencier b3eeb41861 Remove obsolete code about non-yield templates 2024-02-05 16:13:35 +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 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 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 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 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 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
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 6ebbc30593 Abstract node capture in its own Node 2023-12-30 10:14:36 +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 3d849eab57 Merge branch '3.x' into 4.x
* 3.x:
  Simplify code
2023-12-20 20:48:01 +01:00
Fabien Potencier 0b9e30e3d2 Simplify code 2023-12-20 20:43:49 +01:00
Fabien Potencier 87953c0d08 Merge branch '3.x' into 4.x
* 3.x:
  Fix bad merge
  Fix test without any assertions
  Simplify tests
2023-12-20 20:37:25 +01:00
Fabien Potencier e6a98a000f Fix test without any assertions 2023-12-20 20:34:04 +01:00
Fabien Potencier fca89954f1 Simplify tests 2023-12-20 20:34:04 +01:00
Fabien Potencier d27c50850d Merge branch '3.x' into 4.x
* 3.x:
  Add SourcePolicyInterface to selectively enable the Sandbox based on a template's Source
  add docs & links
2023-12-19 08:20:44 +01:00
Fabien Potencier 204cd6f412 Merge branch '2.x' into 3.x
* 2.x:
  Add SourcePolicyInterface to selectively enable the Sandbox based on a template's Source
2023-12-19 08:19:15 +01:00
Yaakov Saxon a18da1614a Add SourcePolicyInterface to selectively enable the Sandbox based on a template's Source 2023-12-19 08:18:35 +01:00
Fabien Potencier 35640b6d2d Add type hints to private properties 2023-12-14 20:43:37 +01:00
Fabien Potencier f84c2172bf Remove deprecated code 2023-12-10 21:02:11 +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 54d34b969b Move functions for CoreExtension 2023-12-10 20:13:10 +01:00
Fabien Potencier 72071e8ece Move functions for EscaperExtension 2023-12-10 11:49:57 +01:00
Fabien Potencier 196e91dd72 Move functions for StringLoaderExtension 2023-12-10 11:38:36 +01:00
Fabien Potencier d4d016034c Move functions for DebugExtension 2023-12-10 11:35:00 +01:00
Fabien Potencier c8d6df7eb2 Remove usage of isset before array_key_exists as performance is not an issue anymore 2023-12-09 17:24:12 +01:00
Fabien Potencier bce22e4c32 Use named arguments 2023-12-09 17:18:55 +01:00
Fabien Potencier be67e9690f Use str_* when possible 2023-12-09 15:33:38 +01:00
Fabien Potencier fed8dd102b Use ::class 2023-12-09 15:33:38 +01:00