-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Get rid of duplicated code in TemplateProcessor.php #1161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Why not ... And thank you for helping out. |
This is a late static binding feature allowing to overwrite Actually replacing |
Aha.. I did a complete rewrite of TemplateProcessor .
|
While you are at cleanups, do not forget: in function setValue():
Because the Headers and Footers are arrays. (current code works, but Travis complains about it, even with explicit typecast, but it's been a while and maybe it works)
Yeah, I am fairly confident that by changing I did not bother too much with unset, the current code does not bite itself, and when the function ends, they are out of scope and cleaned up automatically. It IS, however, good practice. Unfortunately, the is_array can not be joined, as you are doing different things:
|
I am not sure where the code |
I mean that PHP as a language is not THAT broken, this works perfectly fine:
Prints [3,5,7] and [11,21,31], as expected Granted, at the end of both and within the same function, you should never use item, because:
(Prints [11,21,100]) But in our case, we are in a function, and when the function ends, the variable goes out of scope and all is fine:
|
FYI: Existing bugs in TemplateProcessor I've ironed them out in my branch. |
No description provided.