Commit Graph

7018 Commits

Author SHA1 Message Date
Fabien Potencier c13ca48ca5 Use .html.twig in code example instead of .html 2024-12-18 11:13:19 +01:00
Fabien Potencier 834a5a1e5a minor #4507 Use .html.twig file extension in documentation instead of .html (Pepperoni1337)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Use .html.twig file extension in documentation instead of .html

Use .html.twig file extensions instead of .html

Commits
-------

03792f643f Use .html.twig file extension in documentation instead of .html
2024-12-18 11:01:29 +01:00
Pepperoni1337 03792f643f Use .html.twig file extension in documentation instead of .html 2024-12-18 11:01:27 +01:00
Fabien Potencier c72b50434d Bump version 2024-12-18 07:29:21 +01:00
Fabien Potencier 918f52e818 feature #4501 adds support for invoking closures (faizanakram99)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

adds support for invoking closures

- fixes #3848

Commits
-------

0a61801d9a adds support for invoking closures
2024-12-14 20:06:36 +01:00
Faizan Akram 0a61801d9a adds support for invoking closures 2024-12-14 20:06:34 +01:00
Fabien Potencier dc2949e88e minor #4502 Change = to : for named arguments (seb-jean)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Change `=` to `:` for named arguments

Hi,
I changed `=` to `:` because it better follows best practices for named arguments.

Commits
-------

99ea35e1e8 Change `=` to `:` for named arguments
2024-12-14 19:49:02 +01:00
seb-jean 99ea35e1e8 Change = to : for named arguments 2024-12-14 19:49:00 +01:00
Fabien Potencier fa8544ca4c Update CHANGELOG 2024-12-12 15:18:17 +01:00
Fabien Potencier 77376c9302 Bump version 2024-12-12 10:59:04 +01:00
Fabien Potencier 677ef8da64 Prepare the 3.17.1 release v3.17.1 2024-12-12 10:58:10 +01:00
Fabien Potencier 243f5f5d53 bug #4500 Fix the null coalescing operator when the test returns null (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix the null coalescing operator when the test returns null

Closes #4499

Commits
-------

4c5467f56a Fix the null coalescing operator when the test returns null
2024-12-12 10:27:04 +01:00
Fabien Potencier 4c5467f56a Fix the null coalescing operator when the test returns null 2024-12-12 10:17:22 +01:00
Fabien Potencier 47f527ef84 bug #4498 Fix the Elvis operator when there is some space between ? and : (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix the Elvis operator when there is some space between ? and :

Commits
-------

1af334be89 Fix the Elvis operator when there is some space between ? and :
2024-12-11 11:04:38 +01:00
Fabien Potencier 1af334be89 Fix the Elvis operator when there is some space between ? and : 2024-12-11 10:38:21 +01:00
Fabien Potencier 31f61bd781 Bump version 2024-12-10 16:20:20 +01:00
Fabien Potencier d3a64b742a Prepare the 3.17.0 release v3.17.0 2024-12-10 16:19:11 +01:00
Fabien Potencier e24078cd0e Update CHANGELOG 2024-12-10 16:18:27 +01:00
Fabien Potencier d8a798c2cf bug #4496 Fix ArrayAccess with objects as keys (gharlan)
This PR was merged into the 3.x branch.

Discussion
----------

Fix ArrayAccess with objects as keys

fixes #4476
The bug was introduced in 3.15 via https://github.com/twigphp/Twig/pull/4425#discussion_r1869120001

Commits
-------

32a75b7869 Fix ArrayAccess with objects as keys
2024-12-10 15:38:55 +01:00
Gregor Harlan 32a75b7869 Fix ArrayAccess with objects as keys 2024-12-05 12:31:45 +01:00
Fabien Potencier 57bf519af2 minor #4492 fix version numbers for deprecations (xabbuh)
This PR was merged into the 3.x branch.

Discussion
----------

fix version numbers for deprecations

#4482 was merged after the release of 3.16.0

Commits
-------

f90105d0ac fix version numbers for deprecations
2024-12-02 10:21:10 +01:00
Christian Flothmann f90105d0ac fix version numbers for deprecations 2024-12-02 10:21:03 +01:00
Fabien Potencier e1a5aa175e minor #4493 Require "erusev/parsedown": "dev-master as 1.x-dev" (nicolas-grekas)
This PR was merged into the 3.x branch.

Discussion
----------

Require "erusev/parsedown": "dev-master as 1.x-dev"

Should fix the CI until https://github.com/erusev/parsedown/pull/891 is merged.

Commits
-------

5287da57cc Require "erusev/parsedown": "dev-master as 1.x-dev"
2024-12-02 10:19:22 +01:00
Nicolas Grekas 5287da57cc Require "erusev/parsedown": "dev-master as 1.x-dev" 2024-12-02 09:57:02 +01:00
Fabien Potencier d894f92d12 feature #4487 Support underscores in number literals (smnandre)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Support underscores in number literals

```twig
{{ 1000 == 1_000 ? 'yes' : 'no' }}
# now: syntax error
# this PR: "yes"
```

> As of PHP 7.4.0, integer literals may contain underscores (_) between digits, for better readability of literals. These underscores are removed by PHP's scanner.

https://www.php.net/manual/en/language.types.integer.php

This PR replicates that behaviour, using the regexp to match the literals and then remove the "_".

I'm targeting **Twig4** but maybe 3.x would be ok?

I cannot think of a real case that
- does not trigger an error currently
- would work differently after this PR

Commits
-------

da4d96692a Support underscores in number literals
2024-12-02 09:47:00 +01:00
Simon André da4d96692a Support underscores in number literals 2024-12-02 09:46:54 +01:00
Fabien Potencier 6cc64f2357 minor #4489 Remove deprecate usage of AssignNameExpression in For Node (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Remove deprecate usage of AssignNameExpression in For Node

Commits
-------

616cd06914 Remove deprecate usage of AssignNameExpression in For Node
2024-12-01 14:37:18 +01:00
Fabien Potencier 616cd06914 Remove deprecate usage of AssignNameExpression in For Node 2024-12-01 10:44:44 +01:00
Fabien Potencier c5ebc12cde minor #4488 Update coding standards (VincentLanglet)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Update coding standards

Commits
-------

07a4ed17d2 Update coding standards
2024-11-30 10:52:06 +01:00
Vincent Langlet 07a4ed17d2 Update coding standards 2024-11-30 10:52:04 +01:00
Fabien Potencier 14fc89ebea Fix CS 2024-11-30 09:42:13 +01:00
Fabien Potencier 44516133e2 Fix CS 2024-11-30 09:33:57 +01:00
Fabien Potencier f0066c8682 minor #4474 Add more coding standard rules (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add more coding standard rules

Commits
-------

c96aefdf04 Add more coding standard rules
2024-11-30 09:31:25 +01:00
Fabien Potencier 101d181cc1 minor #4486 Use [] instead of array() to represent a constant value in compiled code (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Use [] instead of array() to represent a constant value in compiled code

Commits
-------

49f384f107 Use [] instead of array() to represent a constant value in compiled code
2024-11-30 09:30:56 +01:00
Fabien Potencier 49f384f107 Use [] instead of array() to represent a constant value in compiled code 2024-11-29 21:57:12 +01:00
Fabien Potencier c96aefdf04 Add more coding standard rules 2024-11-29 21:26:34 +01:00
Fabien Potencier 3eed037eed minor #4485 Update phpdoc for operators (VincentLanglet)
This PR was merged into the 3.x branch.

Discussion
----------

Update phpdoc for operators

Commits
-------

fab565ca34 Update phpdoc for operators
2024-11-29 21:19:27 +01:00
Vincent Langlet fab565ca34 Update phpdoc for operators 2024-11-29 19:30:47 +01:00
Fabien Potencier d1d8e3c62a feature #4482 Enforce AbstractBinary for all binary operators (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Enforce AbstractBinary for all binary operators

Commits
-------

4f8ba93600 Enforce AbstractBinary for all binary operators
2024-11-29 19:21:56 +01:00
Fabien Potencier 4f8ba93600 Enforce AbstractBinary for all binary operators 2024-11-29 16:51:09 +01:00
Fabien Potencier 4e1cbc74ef Fix CHANGELOG 2024-11-29 09:29:04 +01:00
Fabien Potencier 5307894b0c Bump version 2024-11-29 09:28:25 +01:00
Fabien Potencier 475ad2dc97 Prepare the 3.16.0 release v3.16.0 2024-11-29 09:27:05 +01:00
Fabien Potencier ef3dbab6b1 minor #4481 Simplify code even more (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify code even more

More simplifications

Commits
-------

2337c7f812 Simplify code even more
2024-11-28 16:07:17 +01:00
Fabien Potencier 2337c7f812 Simplify code even more 2024-11-28 14:36:54 +01:00
Fabien Potencier ae82e8bd0d feature #4479 Simplify EscaperNodeVisitor code (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify EscaperNodeVisitor code

This PR simplifies how we escape the ternary operator, and simplifies the whole strategy.
Instead of replacing the `PrintNode`s, we instead "just" wrap the inner expressions.

For the ternary operator, the `InlinePrint` expression is useless and even weird as printing something in the middle of an expression looks very wrong. This is not done anymore and the node is deprecated.

Overall, this PR makes fewer changes to the Node tree which should make things use a bit less memory.

Commits
-------

02cec77619 Simplify EscaperNodeVisitor code
2024-11-28 12:30:00 +01:00
Fabien Potencier 02cec77619 Simplify EscaperNodeVisitor code 2024-11-28 11:53:08 +01:00
Fabien Potencier c384fb4d8c bug #4475 Fix having macro variables starting with an underscore (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix having macro variables starting with an underscore

Closes #4452

Commits
-------

bdb0f3c042 Fix having macro variables starting with an underscore
2024-11-26 21:41:33 +01:00
Fabien Potencier bdb0f3c042 Fix having macro variables starting with an underscore 2024-11-26 16:59:45 +01:00
Fabien Potencier 0176de0fa9 Fix CS 2024-11-26 16:57:59 +01:00