Redesign macro calls and argument handling - #4851
Conversation
|
📋 PR Summary
|
There was a problem hiding this comment.
📋 Upsun Dispatch Review: full · 40 files reviewed · no issues found
Review details
Commit: Commit dd55a6e
Model: claude-opus-4-8
Panel: correctness · robustness · design
|
@stof I think I've taken all your comments into account. |
There was a problem hiding this comment.
📋 Upsun Dispatch Review: incremental · 45 files reviewed · no new issues · 2 still open
Outstanding from earlier reviews:
- #3524445781 — src/Template.php:528: Wrong version attribution misleads users about when a deprecation/feature landed.
- #3656514451 — src/Template.php:543: Duplicated resolution logic risks the defined-test and call paths drifting apart on future edits.
There was a problem hiding this comment.
📋 Upsun Dispatch Review: full · 45 files reviewed · no issues found · 1 still open
Outstanding from earlier reviews:
- #3656514451 — src/Template.php:543: Duplicated resolution logic risks the defined-test and call paths drifting apart on future edits.
stof
left a comment
There was a problem hiding this comment.
Code looks good, but some tests are failing due to deprecations.
This is my attempt to make macros "better". It uses modern PHP features that didn't exist when I designed macros a long time ago.
The first objective is to close the gap between their behavior and the behavior of Twig callables: functions, filters, and tests.
Here are some important changes:
null.varargsvariable....name.macro_*methods.The refactor introduces
TwigMacroandMacroArgumentto represent template-defined macros with an explicit signature, similar to the existing Twig callable model.