Commit Graph

355 Commits

Author SHA1 Message Date
Fabien Potencier 102bec30f6 Merge branch '3.x' into 4.x
* 3.x:
  Add the possibility to deprecate attributes and nodes on Node
2024-08-08 14:50:31 +02:00
Fabien Potencier 18894cf91e Add the possibility to deprecate attributes and nodes on Node 2024-08-08 14:48:20 +02:00
Fabien Potencier eafbee52e3 Merge branch '3.x' into 4.x
* 3.x:
  Use trigger_deprecation() instead of trigger_error() for deprecations
  Tweak docs
  clarify that macros shadow other macros/functions
2024-08-08 14:47:26 +02:00
Fabien Potencier 0ce79df5c4 Use trigger_deprecation() instead of trigger_error() for deprecations 2024-08-08 14:28:28 +02:00
Fabien Potencier 81df5161ea Merge branch '3.x' into 4.x
* 3.x:
  Remove debug info
2024-08-07 22:59:29 +02:00
Fabien Potencier 390c5a0b05 Remove debug info 2024-08-07 22:59:17 +02:00
Fabien Potencier a5882760df Fix CS 2024-08-07 19:37:53 +02:00
Fabien Potencier 0131c230c7 Merge branch '3.x' into 4.x
* 3.x:
  Fix CS
2024-08-07 19:34:39 +02:00
Fabien Potencier f5e10e10f1 Fix CS 2024-08-07 19:34:09 +02:00
Fabien Potencier 2be34fc0ce Merge branch '3.x' into 4.x
* 3.x:
  Introduce ChainCache and ReadOnlyFilesystemCache
  Add a note about how macros can override existing functions
  Fix dumping callables on Node::__toString()
2024-08-07 14:41:48 +02:00
Quentin D. 0dbe1d9f6d Introduce ChainCache and ReadOnlyFilesystemCache
Signed-off-by: Quentin Devos <4972091+Okhoshi@users.noreply.github.com>
2024-08-07 14:31:56 +02:00
Fabien Potencier fc64472145 Fix dumping callables on Node::__toString() 2024-08-04 16:35:01 +02:00
Fabien Potencier 0707f16cf3 Merge branch '3.x' into 4.x
* 3.x:
  Add new "find" filter
2024-08-04 13:40:16 +02:00
Fabien Potencier fa3c341725 feature #3963 Add new "find" filter (smnandre)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Add new "find" filter

This filter returns the first _value_ matching the given arrow function or null

Attempt to solve #3962

(open to any feedback)

Commits
-------

4e262511 Add new "find" filter
2024-08-04 13:39:13 +02:00
Simon André 4e26251193 Add new "find" filter 2024-08-04 13:39:10 +02:00
Fabien Potencier 5649de8a14 Fix usage of loop in a for else clause 2024-07-31 11:53:46 +02:00
Fabien Potencier 7324404f27 Merge branch '3.x' into 4.x
* 3.x:
  Fix various phpstan errors
  Fix EscaperRuntime namespace
2024-07-31 09:34:53 +02:00
Simon André df4e66f420 Fix EscaperRuntime namespace
From `Twig\Tests` to `Twig\Tests\Runtime`
2024-07-30 00:36:02 +02:00
Fabien Potencier b36d9bb7ed Merge branch '3.x' into 4.x
* 3.x:
  Simplify usage of RawFilter
2024-07-28 11:11:24 +02:00
Fabien Potencier 6e55b5f956 Simplify usage of RawFilter 2024-07-28 11:10:04 +02:00
Fabien Potencier e19f056326 feature #4153 Add support for recursive loops (fabpot)
This PR was squashed before being merged into the 4.x branch.

Discussion
----------

Add support for recursive loops

Fixes #3416
Fixes #4144

Commits
-------

481e7f0d Prevent infinite loops
fa1a217f Add another test
036c9943 Don't unset loop when it's not defined
1b9baa76 Remove usage of the internal _parent context variable in loops
c28f68f8 Add support for Escaper and Sandbox for Generator nodes
c1933323 Simplify implementation
8c5dd39b Use loop() to recurse instead of loop.recurse()
e95d6b2f Add support for recursive loops
2024-07-28 10:21:08 +02:00
Fabien Potencier 0298159c5f Merge branch '3.x' into 4.x
* 3.x:
  Remove magic handling of the raw filter
2024-07-28 10:13:17 +02:00
Fabien Potencier 481e7f0d81 Prevent infinite loops 2024-07-28 10:08:38 +02:00
Fabien Potencier fa1a217f1a Add another test 2024-07-28 10:08:38 +02:00
Fabien Potencier 036c9943db Don't unset loop when it's not defined 2024-07-28 10:08:38 +02:00
Fabien Potencier 1b9baa764b Remove usage of the internal _parent context variable in loops 2024-07-28 10:08:38 +02:00
Fabien Potencier c28f68f807 Add support for Escaper and Sandbox for Generator nodes 2024-07-28 10:08:38 +02:00
Fabien Potencier e95d6b2f21 Add support for recursive loops 2024-07-28 10:08:35 +02:00
Fabien Potencier 84b1b3e0b3 Remove magic handling of the raw filter 2024-07-27 20:37:22 +02:00
Fabien Potencier 212c03eb6c Merge branch '3.x' into 4.x
* 3.x:
  Fix optimizer mode validation in OptimizerNodeVisitor
2024-07-27 20:28:15 +02:00
Fabien Potencier 0e6d717f2d Fix optimizer mode validation in OptimizerNodeVisitor 2024-07-27 20:27:31 +02:00
Fabien Potencier 03fbac566a Fix test 2024-07-27 17:07:17 +02:00
Fabien Potencier 02ab3a185e Merge branch '3.x' into 4.x
* 3.x:
  Add support for yielding from a generator in PrintNode
2024-07-27 17:01:23 +02:00
Fabien Potencier 27f6171f2f Add support for yielding from a generator in PrintNode 2024-07-27 16:57:14 +02:00
Fabien Potencier 8951b8f73a Remove unneeded PHP version check 2024-07-24 13:08:43 +02:00
Fabien Potencier 6b0f2e78c2 Merge branch '3.x' into 4.x
* 3.x:
  Refactor some tests
2024-07-24 13:03:11 +02:00
Fabien Potencier 76dcc75982 Merge branch '3.x' into 4.x
* 3.x:
  Replace template loader mocks by ArrayLoader
  [Doc] Fix javascript code-block
2024-07-24 09:53:24 +02:00
Fabien Potencier ebcd5034ee Refactor some tests 2024-07-24 08:44:11 +02:00
Fabien Potencier a656293915 minor #4150 Replace template loader mocks by ArrayLoader (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Replace template loader mocks by ArrayLoader

Commits
-------

e4e95f5b Replace template loader mocks by ArrayLoader
2024-07-24 08:31:51 +02:00
Fabien Potencier e4e95f5b86 Replace template loader mocks by ArrayLoader 2024-07-24 08:27:23 +02:00
Fabien Potencier 7f0f313f1a Make some small internal tweaks to loops 2024-07-18 08:26:46 +02:00
Fabien Potencier c93daeee73 Fix support for IteratorAggregate and EmptyIterator objects in loops 2024-07-16 18:39:04 +02:00
Fabien Potencier fcb36ec18a Merge branch '3.x' into 4.x
* 3.x:
  Add support for first class callables
2024-07-14 13:59:52 +02:00
Fabien Potencier d2eab12e70 Add support for first class callables 2024-07-14 13:56:14 +02:00
Fabien Potencier 65b4ea4394 Add loop.changed, loop.previous, loop.next, and loop.cycle variables 2024-07-12 11:13:02 +02:00
Fabien Potencier 2e8de1d110 Make loop.last always available 2024-07-11 12:08:50 +02:00
Fabien Potencier 437ad31dfa Move some code to LoopContext 2024-07-11 09:35:26 +02:00
Fabien Potencier 0c2a69ceb3 Simplify Loop code 2024-07-11 08:47:22 +02:00
Fabien Potencier 17ef0bef4b Introduce a Loop object 2024-07-11 08:03:08 +02:00
Fabien Potencier c40faf766b Merge branch '3.x' into 4.x
* 3.x:
  Add more tests
2024-07-09 10:24:05 +02:00