You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.
<an:href="show#mail$mail->id $mail->root->id, tree => true">Zobrazit ve stromu</a>
---
<an:href='"show#mail{$mail->id}" $mail->root->id, tree => true'>Zobrazit ve stromu</a>
At the moment, Latte 2.x does not support AST, so this is done with regex.
If you can come up with regex for this use case, implement LatteUpgraderInterface and process the file contents.
Thinking about it, it probably be too hard – the variable string can be in any n:attribute as well as in any macro and filter, so we would first need to find all of those, and then tokenize them and run a state machine on that. So it might be easier to just run analyze.
But it turns out analyze is fine with the second example. In fact Latte is too, when compiling, only crashing at runtime with “Unsupported operand types: string - int” because it parsed the string as a subtraction.
I guess we could also fuzz templates using something like QuickCheck against types described by templateType class introduced in Latte 2.7. There is a PHP port but it does not look very active and would require some plumbing like creating generators for the template classes.
Edit: Thinking about it a bit more, templates can depend on extra macros which would require running the application for them to be registered, which could have side effects. Unless we use type inference to find the types of the used macros and helpers and then generate mocks for them. Or maybe the check could just require all functions to be declared in the class using the new attributes.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Upgrading to Latte 2.11, I get the following deprecation:
It would be nice if this could upgrade these as suggested by David:
Similarly for a component with multiplier:
The text was updated successfully, but these errors were encountered: