Closed (fixed)
Project:
Coder
Version:
8.x-2.x-dev
Component:
Coder Sniffer
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 May 2016 at 20:51 UTC
Updated:
18 Jun 2016 at 09:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
anoopjohn commentedPlease find attached a patch that fixes this error. Do note that I have refactored the foreach loop that tested for param types and moved the tests that tested for the type hints outside of the loop. These tests for typehints only runs when the number of types is 1 and the type is not an invalid type. I had to re-factor the foreach because the error was earlier triggering on each type as it loops through the types. I combined these to trigger just one error message and just one fix. Fixing each type individually would have involved keeping track of the string index and imploding and replacing wrong types for each wrong type. I hope this approach is fine. This is the same approach used in return types auto fix.
Edit: Although it looks like there is a lot of changes, if you use git diff -w you can see that the logic for type hints just moved out of the loop.
Comment #3
klausiPatch does not apply anymore, can you reroll?
Comment #4
anoopjohn commentedI have rerolled the patch. Please find attached the patch and the diff.
Comment #6
klausiGreat work, thanks!