This PR was merged into the 3.x branch.
Discussion
----------
Deprecate Twig\ExpressionParser::parseOnlyArguments() and Twig\ExpressionParser::parseArguments()
Commits
-------
960f6762ed Deprecate Twig\ExpressionParser::parseOnlyArguments() and Twig\ExpressionParser::parseArguments()
This PR was merged into the 3.x branch.
Discussion
----------
Fix inheritance logic to be able to use instanceof ContextVariable instead of NameExpression
Commits
-------
b6d9dd62ee Fix inheritance logic to be able to use instanceof ContextVariable instead of NameExpression
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Add return type annotations on Twig 3 to prepare Twig 4
Started to add missing type annotation following `@stof` comment [here](https://github.com/twigphp/Twig/pull/4523#discussion_r1901915880).
Update: I checked here every class (but one) in the `src` directory.
But you should ~~probably~~ **certainely** have another look.
Remains:
- src/ExpressionParser.php, where i'm not confident enough about the best return types (AbstractExpression|null works almost everytime, but lack some precision)
- extra directory
- tests directory
I'm happy to let them to someone else.... this was less fun than I expected 😅
Commits
-------
82be13429c Add return type annotations on Twig 3 to prepare Twig 4
* 3.x:
Fixing minor typo in Update inline_css.rst
Ignore static properties when using the dot operator
Fix CS
Fix constant() behavior when used with ??
Finish the work
fix indentation
Apply suggestions from code review
typo
fix merge
docs and changelog
typehint instead of checkArrow
checkArrow, typehints
invoke filter
This PR was merged into the 3.x branch.
Discussion
----------
Fixing minor typo in inline_css.rst
The inline_css filter ~inline~ inlines CSS styles in HTML documents:
Commits
-------
498fb5da4c Fixing minor typo in Update inline_css.rst
This PR was merged into the 3.x branch.
Discussion
----------
Ignore static properties when using the dot operator
Fix#4547
Commits
-------
1d5180549f Ignore static properties when using the dot operator
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
-------
a998723b70 Fix constant() behavior when used with ??
* 3.x: (30 commits)
Make {} optional for the types tag
Remove the note about types mapping argument
Add a note on the types locality
Fix CS
Fix typos in the docs
Use spl_object_id() instead of spl_object_hash()
Add `LastModifiedExtensionInterface` and implementation in `AbstractExtension` to track modification of runtime classes
Bump version
Optimize NameExpression compilation
Fix typo in enum twig doc functions
Remove dead method in ModuleNode
Bump version
Prepare the 3.18.0 release
Add support for `Twig\Markup`
Fix unary operator precedence change
Replace Twigfiddle by the new Twig playground
Fix MacroNode $name argument can be overridden
Ignore exceptions from undefined handlers when using the guard tag
[Doc] Update the docs about attribute() function
Fix doc
...
This PR was merged into the 3.x branch.
Discussion
----------
Make {} optional for the types tag
Closes#4532
Commits
-------
dff6fdd675 Make {} optional for the types tag
This PR was merged into the 3.x branch.
Discussion
----------
Remove the note about types mapping argument
Refs #4532
Commits
-------
36ff3fa3b8 Remove the note about types mapping argument
This PR was merged into the 3.x branch.
Discussion
----------
Add a note on the types locality
For your information `@drjayvee` `@ruudk`
Commits
-------
e7ae984e36 Add a note on the types locality
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 https://github.com/twigphp/Twig/pull/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
-------
d8fe3bd1ec Add `LastModifiedExtensionInterface` and implementation in `AbstractExtension` to track modification of runtime classes
This PR was merged into the 3.x branch.
Discussion
----------
Use spl_object_id() instead of spl_object_hash()
Small performance tweak.
Commits
-------
51bf2ca737 Use spl_object_id() instead of spl_object_hash()
This PR was merged into the 3.x branch.
Discussion
----------
Optimize NameExpression compilation
Commits
-------
efd12ef0cc Optimize NameExpression compilation
This PR was squashed before being merged into the 4.x branch.
Discussion
----------
Add last missing type hints on Twig4
This should be the last batch
Commits
-------
122943c1a1 Add `@return` void on last public methods
24c688693b Type-hint void protected methods of (final) ModuleNode
7eae42183a Add return type on "__toString" methods
This PR was merged into the 4.x branch.
Discussion
----------
Add `@template` on RuntimeLoaderinterface (Twig 4)
Do php-stan annotation have an impact on BC promise?
The interface uses the term "class" already.. i'm guessing it's ok ?
Commits
-------
c24c71a3ca Add `@template` on RuntimeLoaderinterface (Twig 4)
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Fix typo in enum twig doc functions
Commits
-------
3889bc7b18 Fix typo in enum twig doc functions