-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Zend code generator eats last brace #6255
Comments
btw there is a hacky workaround of adding a comment between the braces:
|
I am unable to reproduce this against master. The following test was performed against the "SomeClass" provided. File: ZendTest/Code/Generator/ClassGeneratorTest.php
$ phpunit --group 6255 ZendTest/Code/Generator/ClassGeneratorTest.php |
Hi Steve, It appears that the bug is very fragile, and depends on the exact whitespace - which may or may not get eaten by Github/HTML
outputs:
I've put the code in a gist https://gist.github.com/Danack/36ab9cd01600ad71a654 to avoid HTML whitespace shenanigans. |
Strange - I copied your raw code, executed and I still get the follow output:
It appears to work for me still on master. |
Apologies - it looks like my composer is grabbing an old version, and not the latest version. I'll retest this and the other issues I raised, making sure that I have the latest version. |
Hi, I've retested against 2.3.0. (version 2.3.1 is not installable) All of the above cases pass, however the below fails:
I'll retest when 2.3.1 is installable. |
Danack, I have added a patch for this issue available here: https://github.com/steverhoades/zf2/tree/hotfix/6255. If you could please test this against your issues I would appreciate it. Steve |
@Danack you should really test latest master/develop instead of tagged versions |
Hi Steve, Yes that looks fixed in your hotfix branch. cheers |
Not sure if you wanted me to test this or not, so apologies if I'm testing something while you're still working on it, but this:
outputs:
i.e. the method body is gone. But yeah, I also think a token based approach is the only reasonable way of doing this long term. |
@Danack which branch you using to test this? It appears to work fine for me currently. |
I'm using your branch https://github.com/steverhoades/zf2/commits/hotfix/6255 but as I suspected, I'd grabbed version 3a04, which is just before your last commit. Testing your latest commit does indeed fix this issue. |
Handled in #6286 |
When there is a brace immediately before the closing brace of a method, that penultimate brace is not present in the output. e.g.
Outputs:
So the code is not valid.
The text was updated successfully, but these errors were encountered: