Fabien Potencier
806049f7a2
Fix compatibility layer
2025-08-17 19:23:48 +02:00
Fabien Potencier
151aa4ecda
Fix CS
2025-02-14 12:57:03 +01:00
Fabien Potencier
79d828b09d
Fix version
2025-02-14 08:47:54 +01:00
Fabien Potencier
4b57f48a65
Use generics in ExpressionParsers
2025-02-14 08:38:53 +01:00
Fabien Potencier
f67078b5c4
Move Operators to ExpressionParsers, deprecate ExpressionParser
2025-02-14 08:38:53 +01:00
Fabien Potencier
42c82e1e9b
Extract operators logic from ExpressionParser to their own classes
2025-02-14 08:38:53 +01:00
Fabien Potencier
df877a1d53
Introduce operator classes to describe operators provided by extensions instead of arrays
2025-02-14 08:38:53 +01:00
Christophe Coevoet
3794efe662
Fix support for ignoring syntax erros in an undefined handler in guard
2025-02-09 15:10:34 +01:00
Fabien Potencier
af5f4c34fb
Fix CS
2025-02-03 08:48:19 +01:00
Fabien Potencier
f594248a40
Fix CS
2025-01-26 11:54:00 +01:00
Fabien Potencier
ade8bce516
Deprecate Token::getType()
2025-01-24 15:48:04 +01:00
Fabien Potencier
93466404b7
feature #4550 Deprecate Twig\ExpressionParser::parseOnlyArguments() and Twig\ExpressionParser::parseArguments() (fabpot)
...
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()
2025-01-24 14:36:45 +01:00
Fabien Potencier
b6d9dd62ee
Fix inheritance logic to be able to use instanceof ContextVariable instead of NameExpression
2025-01-24 13:47:29 +01:00
Fabien Potencier
960f6762ed
Deprecate Twig\ExpressionParser::parseOnlyArguments() and Twig\ExpressionParser::parseArguments()
2025-01-23 08:35:56 +01:00
Fabien Potencier
2cf1939d01
Fix unary operator precedence change
2024-12-28 11:29:38 +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
4f8ba93600
Enforce AbstractBinary for all binary operators
2024-11-29 16:51:09 +01:00
Vincent Langlet
75d48db822
Add phpstan analysis
2024-11-20 20:05:33 +01:00
Fabien Potencier
89fdc7d31d
Refactor code
2024-10-25 07:47:55 +02:00
Fabien Potencier
fc15e7ccbc
Rename Node classes related to variables
2024-10-23 12:36:57 +02:00
Fabien Potencier
af4090757b
feature #4402 Rework macros handling (fabpot)
...
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Rework macros handling
Commits
-------
f1481be00f Remove MacroAutoImportNodeVisitor
72693884c4 Simplify code
1105964873 Rework macros handling
2024-10-22 11:03:01 +02:00
Fabien Potencier
72693884c4
Simplify code
2024-10-21 07:20:17 +02:00
Fabien Potencier
1105964873
Rework macros handling
2024-10-20 21:53:20 +02:00
Christian Flothmann
26256fc488
reduce the deprecation noise when more than one argument is passed
...
When more than one argument is passed to parseArguments(), one deprecation
is triggered for each argument. Since passing any argument is deprecated
the number of triggered deprecations can be reduced for more than one
argument being passed.
2024-10-18 11:24:56 +02:00
Fabien Potencier
66658a3c1d
Check reserved names in TempNameExpression
2024-10-14 19:42:47 +02:00
Fabien Potencier
950ad5a2fc
bug #4396 Fix AssignNameExpression to forbid using names that won't work (fabpot)
...
This PR was merged into the 3.x branch.
Discussion
----------
Fix AssignNameExpression to forbid using names that won't work
Commits
-------
9af72e6323 Fix AssignNameExpression to forbid using names that won't work
2024-10-14 14:07:02 +02:00
Fabien Potencier
9af72e6323
Fix AssignNameExpression to forbid using names that won't work
2024-10-14 13:55:40 +02:00
Fabien Potencier
831e69b77e
Do not allow : as macro definition separator
2024-10-14 10:42:32 +02:00
Fabien Potencier
223d36bbae
Add support for named arguments on macro calls and dot operator arguments
2024-10-11 11:31:40 +02:00
Fabien Potencier
0ec3f4a7fe
Simplify expression parser code
2024-10-09 10:33:51 +02:00
Fabien Potencier
086c07f319
minor #4385 Refactor expression parser (fabpot)
...
This PR was merged into the 3.x branch.
Discussion
----------
Refactor expression parser
Instead of having if statements under `default`, I've moved the code to the `switch` statement, which makes more sense.
Commits
-------
2cdca8cbeb Refactor expression parser
2024-10-09 10:18:59 +02:00
Fabien Potencier
2cdca8cbeb
Refactor expression parser
2024-10-09 09:14:02 +02:00
Fabien Potencier
7bf0f6f376
Cleanup code
2024-10-08 21:51:29 +02:00
Fabien Potencier
62f0a96b68
Introduce a way to test Twig callables at compile time
2024-10-08 18:41:34 +02:00
Fabien Potencier
aca4d22e89
Allow arrow functions everywhere
2024-10-07 23:04:29 +02:00
Fabien Potencier
4f7d487a17
Fix deprecation dep feature
2024-10-06 23:17:05 +02:00
Fabien Potencier
2081b1ff74
Deprecate using the not unary operator without parenthesis
2024-10-02 14:16:34 +02:00
Fabien Potencier
f4aacafd78
Deprecate using ?? without explicit parentheses
2024-10-01 21:58:05 +02:00
Fabien Potencier
b93eb3ce58
Refactor code
2024-09-30 14:05:03 +02:00
Fabien Potencier
9f8c52d022
Add some type hints
2024-09-30 14:02:17 +02:00
Fabien Potencier
816c510cef
Deprecate using ~ with + or - in an expression without using parentheses to clarify precedence
2024-09-30 13:51:47 +02:00
Fabien Potencier
d133ab7e70
Add support for detecting if an expression had explicit parentheses
2024-09-30 11:55:38 +02:00
Fabien Potencier
1488238e32
Fix ignored parenthesis in expressions
2024-09-28 23:47:01 +02:00
Fabien Potencier
8b278986b8
Deprecate using Node directly, introduce EmptyNode and Nodes
2024-09-27 07:42:41 +02:00
Nicolas Grekas
04471ab8cd
Replace strtr() by strtolower()
2024-09-26 17:48:39 +02:00
Fabien Potencier
07b626a96f
Fix deprecation messages
2024-09-19 23:13:12 +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
112de8dcfa
Add support for argument unpacking
2024-09-11 11:55:09 +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