Commit Graph

1144 Commits

Author SHA1 Message Date
Fabien Potencier fea6cc344e minor #4346 Remove useless assign in compiled code (ruudk)
This PR was merged into the 3.x branch.

Discussion
----------

Remove useless assign in compiled code

It's already unset / initialized on catch.

Having it this way, is a bit easier for me when analyzing this in TwigStan.

Commits
-------

5c73c6695c Remove useless assign in compiled code
2024-09-26 15:10:13 +02:00
Ruud Kamphuis 7256713c86 Improve escape deprecation message 2024-09-26 15:09:41 +02:00
Ruud Kamphuis 5c73c6695c Remove useless assign in compiled code 2024-09-26 14:36:01 +02:00
Fabien Potencier f83c844b7d Add start/end time accessors on Profile 2024-09-26 08:19:38 +02:00
Fabien Potencier 09790a7542 Fix 'ignore missing' when used on an 'embed' tag 2024-09-26 07:55:44 +02:00
Fabien Potencier 588a5c5676 bug #4339 Fix the possibility to override an aliased block (via use) (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix the possibility to override an aliased block (via use)

Closes #3709

Commits
-------

955611d5bb Fix the possibility to override an aliased block (via use)
2024-09-25 22:17:13 +02:00
Fabien Potencier c203b27db2 feature #4334 Improve how trim behaves (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Improve how trim behaves

Closes #3651

Commits
-------

10c3142d3b Improve how trim behaves
2024-09-25 22:10:15 +02:00
Fabien Potencier 955611d5bb Fix the possibility to override an aliased block (via use) 2024-09-25 22:08:16 +02:00
Fabien Potencier dca5099aad Add hot cache reload for templates 2024-09-25 17:28:51 +02:00
Fabien Potencier 786a67b1a9 Add RemovableCacheInterface 2024-09-25 17:28:51 +02:00
Fabien Potencier 9855e35d44 Optimize compiled code for "set" tag 2024-09-24 16:47:02 +02:00
Fabien Potencier 10c3142d3b Improve how trim behaves 2024-09-24 13:35:40 +02:00
Fabien Potencier d3a0717ab0 minor #4330 Add compile-time checks for the "matches" operator (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add compile-time checks for the "matches" operator

Commits
-------

d1beac4dfa Add compile-time checks for the "matches" operator
2024-09-23 18:11:23 +02:00
Ruud Kamphuis 15279ca8ee Add return types in FileystemLoader 2024-09-23 12:30:37 +02:00
Fabien Potencier d1beac4dfa Add compile-time checks for the "matches" operator 2024-09-21 10:29:51 +02:00
Vincent Langlet 3be417d2eb Improve date methods phpdoc 2024-09-20 11:43:16 +02:00
Fabien Potencier 07b626a96f Fix deprecation messages 2024-09-19 23:13:12 +02:00
Fabien Potencier 30aac6d2f2 bug #4323 Fix the handling of predefined arguments in CallExpression (stof)
This PR was merged into the 3.x branch.

Discussion
----------

Fix the handling of predefined arguments in CallExpression

Commits
-------

37fa03681e fix the handling of predefined arguments in CallExpression
2024-09-19 23:11:28 +02:00
Christophe Coevoet ebbbaf7069 Use a more precise return type in AbstractTwigCallable 2024-09-19 13:46:59 +02:00
Christophe Coevoet 37fa03681e fix the handling of predefined arguments in CallExpression 2024-09-19 11:48:28 +02:00
Fabien Potencier 52ded207d3 Allow Twig callable arguments to use camel or snake names 2024-09-18 19:19:20 +02:00
Fabien Potencier 1b9df761b6 feature #4310 Allow to use a dynamic attribute on the . operator via () (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Allow to use a dynamic attribute on the . operator via ()

Closes #3598

As one can think that the `attribute` function has some special power compared to the `.` operator (like using Symfony PropertyAccess), I think it's better to use the `.` operator for dynamic attributes as well.

Using `()` makes it clear that the behavior is the same as the `.` operator (using `()` is similar to the way one can use dynamic mapping names (like in `{ (name): value }`).

Commits
-------

048183eaa6 Add cross-link
8d1af0fc03 Let's no deprecate the attribute function yet
333638e8e6 Allow to use a dynamic attribute on the . operator via ()
2024-09-14 10:41:58 +02:00
Fabien Potencier 4c9526a31d Rename a variable for more clarity 2024-09-14 10:31:13 +02:00
Ruud Kamphuis ba6e856d92 Set IteratorAggregate generics for Node
This will help PHPStan and Psalm to understand what happens when iterating over a Node.
2024-09-13 15:04:20 +02:00
Fabien Potencier 8d1af0fc03 Let's no deprecate the attribute function yet 2024-09-13 13:56:05 +02:00
Christophe Coevoet 8330936415 Add more precise types for the registration of safe classes
Safe classes only impact the auto-escaping of the string casting of instance of those classes.
By defining that this method only expects names of stringable classes, it allows static analysis tools to report non-working configurations (for instance for people thinking this would impact the auto-escaping for values returned by getters of a safe class).
2024-09-13 12:58:50 +02:00
Fabien Potencier 333638e8e6 Allow to use a dynamic attribute on the . operator via () 2024-09-12 21:44:45 +02:00
Fabien Potencier bfafa5b613 Add StringCastUnary 2024-09-11 22:23:33 +02:00
Fabien Potencier 112de8dcfa Add support for argument unpacking 2024-09-11 11:55:09 +02:00
Fabien Potencier 1a20e96174 Fix CS 2024-09-11 10:45:54 +02:00
Fabien Potencier c616783674 Add JSON support for the file extension escaping strategy 2024-09-11 10:01:22 +02:00
Fabien Potencier 8b421f58aa feature #4301 Stringify dynamic mapping keys (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Stringify dynamic mapping keys

Closes #3696

Commits
-------

ccfe6ad26e Stringify dynamic mapping keys
2024-09-11 09:51:54 +02:00
Fabien Potencier a7e924f36e minor #4298 Replace all empty() calls (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Replace all empty() calls

Commits
-------

9e9f8110bd Replace most empty() calls
2024-09-11 09:22:35 +02:00
Fabien Potencier 366e038359 minor #4299 Simplify parser calls when possible (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify parser calls when possible

Commits
-------

3f07d2c034 Simplify parser calls when possible
2024-09-11 09:19:24 +02:00
Fabien Potencier ccfe6ad26e Stringify dynamic mapping keys 2024-09-11 08:58:53 +02:00
Fabien Potencier 9e9f8110bd Replace most empty() calls 2024-09-11 07:44:00 +02:00
Fabien Potencier 3f07d2c034 Simplify parser calls when possible 2024-09-10 23:42:58 +02:00
Fabien Potencier d571e8bc92 feature #4293 Deprecate the sandbox tag (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Deprecate the sandbox tag

Closes #3168

Commits
-------

9369a48c53 Deprecate the sandbox tag
2024-09-10 22:42:18 +02:00
Fabien Potencier 9369a48c53 Deprecate the sandbox tag 2024-09-10 22:41:00 +02:00
Fabien Potencier 194cced47b Removed @internal on Environment::getGlobals() 2024-09-10 17:11:21 +02:00
Fabien Potencier 34ae0311d9 Improve the way one can deprecate a Twig callable 2024-09-09 21:14:40 +02:00
Fabien Potencier 247ee93df9 Bump version 2024-09-09 21:04:19 +02:00
Fabien Potencier 126b2c9781 Prepare the 3.14.0 release 2024-09-09 19:55:12 +02:00
Fabien Potencier 11f68e2aeb Fix a security issue when an included sandboxed template has been loaded before without the sandbox context 2024-09-09 19:04:10 +02:00
Fabien Potencier 540b54e0d5 minor #4290 fix the version mergeGlobals() is deprecated since (xabbuh)
This PR was merged into the 3.x branch.

Discussion
----------

fix the version mergeGlobals() is deprecated since

Commits
-------

f72c93db fix the version mergeGlobals() is deprecated since
2024-09-09 11:41:27 +02:00
Christian Flothmann f72c93dbd2 fix the version mergeGlobals() is deprecated since 2024-09-09 10:58:08 +02:00
Fabien Potencier 064e079654 Tweak code 2024-09-09 10:51:41 +02:00
Fabien Potencier 995e7c2270 Fix CS 2024-09-09 08:49:09 +02:00
Fabien Potencier 28dc912c0e Remove unused private methods 2024-09-09 08:24:03 +02:00
Fabien Potencier bf6b7ae53d Bump version 2024-09-08 17:26:18 +02:00