Commit Graph

6468 Commits

Author SHA1 Message Date
Fabien Potencier 15854ca9bf feature #4178 Constant expr as final (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Constant expr as final

Closes #4119

Commits
-------

230e31d3 Add a recipe about how to mark a node as safe
693693ba Mark ConstantExpression as `@final`
2024-08-07 21:01:58 +02:00
Fabien Potencier 230e31d384 Add a recipe about how to mark a node as safe 2024-08-07 21:01:18 +02:00
Fabien Potencier f5e10e10f1 Fix CS 2024-08-07 19:34:09 +02:00
Fabien Potencier 693693ba3a Mark ConstantExpression as @final 2024-08-07 19:00:30 +02:00
Fabien Potencier ea4d706da1 feature #4171 Introduce ChainCache and ReadOnlyFilesystemCache (Okhoshi)
This PR was merged into the 3.x branch.

Discussion
----------

Introduce ChainCache and ReadOnlyFilesystemCache

Following the feedback in symfony/symfony#54384, I’m proposing the two new Cache implementations in Twig directly.

Commits
-------

0dbe1d9f Introduce ChainCache and ReadOnlyFilesystemCache
2024-08-07 14:41:36 +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 6566066fab minor #4175 Add a note about how macros can override existing functions (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add a note about how macros can override existing functions

Commits
-------

cea17143 Add a note about how macros can override existing functions
2024-08-07 11:26:22 +02:00
Fabien Potencier cea1714331 Add a note about how macros can override existing functions 2024-08-07 11:25:44 +02:00
Fabien Potencier 26b1dc590c minor #4170 Fix dumping callables on Node::__toString() (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix dumping callables on Node::__toString()

Closes #3694

Commits
-------

fc644721 Fix dumping callables on Node::__toString()
2024-08-04 16:38:14 +02:00
Fabien Potencier fc64472145 Fix dumping callables on Node::__toString() 2024-08-04 16:35:01 +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 205ea9e300 minor #4164 Remove the templateClassPrefix property on Environment (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Remove the templateClassPrefix property on Environment

Commits
-------

215f9880 Remove the templateClassPrefix property on Environment
2024-07-31 22:48:26 +02:00
Fabien Potencier 0d09230b4b minor #4167 Fix various phpstan errors (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix various phpstan errors

Commits
-------

ae4f2840 Fix various phpstan errors
2024-07-31 09:30:45 +02:00
Fabien Potencier ae4f284043 Fix various phpstan errors 2024-07-30 11:17:22 +02:00
Fabien Potencier b566513ef1 minor #4166 [Tests] Fix EscaperRuntime namespace (smnandre)
This PR was merged into the 3.x branch.

Discussion
----------

[Tests] Fix EscaperRuntime namespace

From `Twig\Tests` to `Twig\Tests\Runtime`

Commits
-------

df4e66f4 Fix EscaperRuntime namespace
2024-07-30 09:30:10 +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 215f9880f1 Remove the templateClassPrefix property on Environment 2024-07-28 16:25:21 +02:00
Fabien Potencier ae04075ed1 minor #4163 Use RawFilter in cache extra (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Use RawFilter in cache extra

Commits
-------

8e72c84c Use RawFilter in cache extra
2024-07-28 11:16:28 +02:00
Fabien Potencier 8e72c84c63 Use RawFilter in cache extra 2024-07-28 11:12:39 +02:00
Fabien Potencier 76becd4246 minor #4162 Simplify usage of RawFilter (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify usage of RawFilter

Commits
-------

6e55b5f9 Simplify usage of RawFilter
2024-07-28 11:11:17 +02:00
Fabien Potencier 6e55b5f956 Simplify usage of RawFilter 2024-07-28 11:10:04 +02:00
Fabien Potencier 67c7967de2 bug #4161 Fix raw filter compat (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix raw filter compat

Commits
-------

a1789129 Fix raw filter compat
2024-07-28 10:57:43 +02:00
Fabien Potencier a17891292c Fix raw filter compat 2024-07-28 10:51:52 +02:00
Fabien Potencier de7767814b Remove deprecate feature in docs 2024-07-28 10:14:39 +02:00
Fabien Potencier 05475bf843 minor #4157 Remove magic handling of the raw filter (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Remove magic handling of the raw filter

Commits
-------

84b1b3e0 Remove magic handling of the raw filter
2024-07-28 10:10:22 +02:00
Fabien Potencier 84b1b3e0b3 Remove magic handling of the raw filter 2024-07-27 20:37:22 +02:00
Fabien Potencier 71021834cc bug #4156 Fix optimizer mode validation in OptimizerNodeVisitor (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix optimizer mode validation in OptimizerNodeVisitor

Commits
-------

0e6d717f Fix optimizer mode validation in OptimizerNodeVisitor
2024-07-27 20:27:56 +02:00
Fabien Potencier 0e6d717f2d Fix optimizer mode validation in OptimizerNodeVisitor 2024-07-27 20:27:31 +02:00
Fabien Potencier 1920e284a9 feature #4155 Add support for yielding from a generator in PrintNode (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add support for yielding from a generator in PrintNode

Commits
-------

27f6171f Add support for yielding from a generator in PrintNode
2024-07-27 17:01:03 +02:00
Fabien Potencier 27f6171f2f Add support for yielding from a generator in PrintNode 2024-07-27 16:57:14 +02:00
Fabien Potencier 3c52cd9814 feature #4148 Deprecate NameExpression internal methods (smnandre)
This PR was merged into the 3.x branch.

Discussion
----------

Deprecate NameExpression internal methods

Deprecate two methods from `Twig\Node\Expression\NameExpression`:
* `isSimple()`: did not find any usage in Twig (or even Symfony) repositories
* `isSpecial()`: inlined for better performance ($name is available in the method)

Commits
-------

3531f959 Deprecate NameExpression internal methods
2024-07-27 15:43:19 +02:00
Fabien Potencier af90f88802 minor #4154 [Doc] Fix code syntax in deprecated.rst (smnandre)
This PR was merged into the 3.x branch.

Discussion
----------

[Doc] Fix code syntax in deprecated.rst

Add missing backticks

https://twig.symfony.com/doc/3.x/deprecated.html#extensions

<img width="846" alt="Capture d’écran 2024-07-27 à 14 22 26" src="https://github.com/user-attachments/assets/4dfaa859-778e-4a34-86a9-acc2eb9eccb6">

Commits
-------

343fefae [Doc] Fix code syntax in deprecated.rst
2024-07-27 15:41:30 +02:00
Simon André 343fefae10 [Doc] Fix code syntax in deprecated.rst
Add missing backticks
2024-07-27 14:21:54 +02:00
Fabien Potencier 51e7e5c405 minor #4151 Refactor some tests (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Refactor some tests

Commits
-------

ebcd5034 Refactor some tests
2024-07-24 12:55:18 +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 3401ddfc10 minor #4147 [Doc] Fix javascript code-block (smnandre)
This PR was merged into the 3.x branch.

Discussion
----------

[Doc] Fix javascript code-block

Fix code-block syntax (double space)

Visible there:

<img width="900" alt="Capture d’écran 2024-07-21 à 21 04 22" src="https://github.com/user-attachments/assets/389d8ec5-7caa-4a5c-b8de-f54040462269">

https://twig.symfony.com/doc/3.x/recipes.html#using-twig-and-angularjs-in-the-same-templates

Commits
-------

b0cd5dc5 [Doc] Fix javascript code-block
2024-07-22 14:39:41 +02:00
Simon André 3531f959d3 Deprecate NameExpression internal methods
Deprecate two methods from NameExpression:
* isSimple(): did not find any usage in Twig (or even Symfony) repositories
* isSpecial(): inlined for better performance ($name is available in the method)
2024-07-22 01:25:30 +02:00
Simon André b0cd5dc5a8 [Doc] Fix javascript code-block
Fix code-block syntax (double space)
2024-07-21 21:05:07 +02:00
Fabien Potencier 1377f2da4e feature #4140 Add support for first class callables (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add support for first class callables

Commits
-------

d2eab12e Add support for first class callables
2024-07-14 13:59:09 +02:00
Fabien Potencier d2eab12e70 Add support for first class callables 2024-07-14 13:56:14 +02:00
Fabien Potencier 5036ab2a4a minor #4139 Extract ReflectionCallable to make it reusable (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Extract ReflectionCallable to make it reusable

Commits
-------

bb967b3d Make compatible with PHP<8
093f51a8 Extract ReflectionCallable to make it reusable
2024-07-14 12:16:15 +02:00
Fabien Potencier bb967b3dd3 Make compatible with PHP<8 2024-07-14 12:13:12 +02:00
Fabien Potencier 093f51a8b9 Extract ReflectionCallable to make it reusable 2024-07-14 12:06:15 +02:00
Fabien Potencier e7334b588b minor #4138 Make a small optimization (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Make a small optimization

The optimization itself is not significant, but this is the only case where we're not using the array of extensions in the code base. So, let's make things consistent here.

Commits
-------

6f12d008 Make a small optimization
2024-07-14 11:21:16 +02:00
Fabien Potencier 6f12d008be Make a small optimization 2024-07-14 11:04:52 +02:00
Fabien Potencier 6b6aca5206 minor #4132 [Doc] Fix do tag label in link (smnandre)
This PR was merged into the 3.x branch.

Discussion
----------

[Doc] Fix `do` tag label in link

Commits
-------

10deb732 [Doc] Fix `do` tag label in link
2024-07-10 07:46:18 +02:00
Simon André 10deb7328c [Doc] Fix do tag label in link 2024-07-10 00:23:00 +02:00