Skip to content

Updates#2

Closed
felipemarcos wants to merge 1330 commits intosoflyy:3.xfrom
twigphp:3.x
Closed

Updates#2
felipemarcos wants to merge 1330 commits intosoflyy:3.xfrom
twigphp:3.x

Conversation

@felipemarcos
Copy link

No description provided.

GromNaN and others added 30 commits January 2, 2025 14:50
…xtension` to track modification of runtime classes
This PR was merged into the 3.x branch.

Discussion
----------

Fix typo in the docs

Commits
-------

f2f03d7 Fix typos in the docs
This PR was merged into the 3.x branch.

Discussion
----------

Use spl_object_id() instead of spl_object_hash()

Small performance tweak.

Commits
-------

51bf2ca Use spl_object_id() instead of spl_object_hash()
This PR was merged into the 3.x branch.

Discussion
----------

Add `getLastModified()` to extensions

Give to extensions the ability to set a last modification date for cache invalidation.

### Runtime

Currently, the cache is not invalidated when the signature of a runtime method is modified. This is an issue for templates that use named arguments, as argument names have an impact on the generated class.

With this change, extensions using runtime classes can compute a modification date by including the files on which they depend.

By default, the `AbstractExtension` checks if there is a file for the runtime class with the same name of the
This is the convention applied in [Symfony](https://github.com/symfony/symfony/tree/7.3/src/Symfony/Bridge/Twig/Extension) and Twig Extra: `MarkdownExtension` has `MarkdownRuntime`.

### Attribute

Contributing to #3916.

The extension class that will get the configuration from attributes will be able to track the classes having attributes to find the last modification date of all this classes.

### ~BC break~

~In Twig 4.0, the method `getLastModified` will be added to `ExtensionInterface`. It is extremely rare to implement this interface without extending `AbstractExtension`. So adding this method to the interface shouldn't be a problem as the base class has an implementation.~

Commits
-------

d8fe3bd Add `LastModifiedExtensionInterface` and implementation in `AbstractExtension` to track modification of runtime classes
This PR was merged into the 3.x branch.

Discussion
----------

Add a note on the types locality

For your information `@drjayvee` `@ruudk`

Commits
-------

e7ae984 Add a note on the types locality
This PR was merged into the 3.x branch.

Discussion
----------

Remove the note about types mapping argument

Refs #4532

Commits
-------

36ff3fa Remove the note about types mapping argument
This PR was merged into the 3.x branch.

Discussion
----------

Make {} optional for the types tag

Closes #4532

Commits
-------

dff6fdd Make {} optional for the types tag
Co-authored-by: Christian Flothmann <christian.flothmann@gmail.com>
Co-authored-by: Fabien Potencier <fabien@potencier.org>
This PR was merged into the 3.x branch.

Discussion
----------

Add invoke filter

Adds a new filter `invoke`, to invoke arrow functions and other php callables.

See the discussion here: #4378 (comment)

Commits
-------

3e93e91 Finish the work
c4fd25f fix indentation
dacbe51 Apply suggestions from code review
2b95bd6 typo
09c30c3 fix merge
d58ac9a docs and changelog
edecc13 typehint instead of checkArrow
f271158 checkArrow, typehints
8b43275 invoke filter
This PR was merged into the 3.x branch.

Discussion
----------

Fix constant() behavior when used with ??

The fix is broader than just this bug. Basically, it happens when we clone a Node for which an referenced Node will be modified later on.

Commits
-------

a998723 Fix constant() behavior when used with ??
This PR was merged into the 3.x branch.

Discussion
----------

Fix CS

Commits
-------

76062c8 Fix CS
…as-grekas)

This PR was merged into the 3.x branch.

Discussion
----------

Ignore static properties when using the dot operator

Fix #4547

Commits
-------

1d51805 Ignore static properties when using the dot operator
fabpot and others added 29 commits September 15, 2025 07:46
…` (Kocal)

This PR was merged into the 3.x branch.

Discussion
----------

Improve documentation examples for `enum` and `enum_cases`

It may be obvious, but I first thought initializing an BackendEnum with a specific value could be possible with `enum(FQCN, value)`, but it does not, it always returns the first case  instance (if exists).

Instead, `enum(FQCN).from(value)` must be used, and I think it's worth to improve `enum()` examples.

Commits
-------

def4abb Improve documentation examples for `enum` and `enum_cases`
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Support two words test guard

Extracted from #4687

Commits
-------

30977bd Support two words test guard
This PR was merged into the 3.x branch.

Discussion
----------

Bump minimum Commonmark requirement

All previous versions have security issues

Commits
-------

8f97076 Bump minimum Commonmark requirement
This PR was merged into the 3.x branch.

Discussion
----------

Fix intl test

Let's try to make it less fragile.

Commits
-------

41bfb6b Fix intl test
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Introduce registerUndefinedTestCallback

This is similar to `registerUndefinedFilterCallback` and `registerUndefinedFunctionCallback`

Commits
-------

cc12df9 Introduce registerUndefinedTestCallback
Before this fix, the generated Template code had quotes around the
index (integer) parameter value.
This PR was merged into the 3.x branch.

Discussion
----------

Compile 'index' with repr (not string) in EmbedNode

Before this PR, the generated Template code had quotes around the index (integer) parameter value.

Commits
-------

e4d7915 Compile 'index' with repr (not string) in EmbedNode
This PR was merged into the 3.x branch.

Discussion
----------

[Doc] Tweaks in the escaping article

AS you can see in the redenred page (https://twig.symfony.com/doc/3.x/filters/escape.html) the tip about `html_attr` contains some uneeded line breaks.

This also tweaks another explanation to make it more clear.

Commits
-------

50327b5 [Doc] Tweaks in the escaping article
Missing `fruits` variable declaration.
This PR was merged into the 3.x branch.

Discussion
----------

Update replace.rst

Missing `fruits` variable declaration.

Commits
-------

df3a281 Update replace.rst
This PR was merged into the 3.x branch.

Discussion
----------

Update inky_to_html.rst: Updating link

Page: https://twig.symfony.com/doc/3.x/filters/inky_to_html.html

Commits
-------

b9a4e04 Update inky_to_html.rst: Updating link
…s-grekas)

This PR was merged into the 3.x branch.

Discussion
----------

Fix accessing arrays with stringable objects as key

Fix #4701

Commits
-------

9ae75d3 Fix accessing arrays with stringable objects as key
This PR was merged into the 3.x branch.

Discussion
----------

Fix array typehint for $variants in HtmlExtension

This PR corrects the array typehint for the `$variants` parameter in the `HtmlExtension::htmlCva` method. It was missing a closing angle bracket (`>`).

Commits
-------

64c87ee Fix array typehint for $variants in HtmlExtension
…uiluz)

This PR was merged into the 3.x branch.

Discussion
----------

Allow Symfony 8 packages in Twig extra packages

I'm testing the upcoming Symfony 8 in some apps, and I have some issues with some Twig extra packages that don't allow installing Symfony 8 packages.

Commits
-------

9a8a1dc Allow Symfony 8 packages in Twig extra packages
This PR was merged into the 3.x branch.

Discussion
----------

Add caution note for random function usage

See https://www.php.net/manual/en/function.array-rand.php and https://www.php.net/manual/en/function.mt-rand.php. Users should know that the Twig function is a convenience feature, but unusable e.g. for serious gaming/gambling apps due to the potential predictability and limited value range.

Commits
-------

02c5a4b Add caution note for random function usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.