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
This happens both in 3.2.3 and master. I didn't see any similar issues after a quick search for ArrayDeclaration or commas. It looks like it's related to the length of the keys/values found in the array.
Expected: Either a valid AST is created, or the fix is not saved.
Observed: The fix suggested by phpcbf for ArrayDeclaration is invalid PHP code
gsherwood
changed the title
phpcbf fix for Squiz.Arrays.ArrayDeclaration produces invalid PHP AST. The comma is in an invalid position.
Squiz.Arrays.ArrayDeclaration fixer sometimes puts a comma in front of the last array value
Apr 5, 2018
Thanks for reporting this. The fix has now been corrected and the comma is placed after the array value. This looks to have only happened when the array end brace came immediately after the last array value. This fix will be in the 3.3.0 release.
This happens both in 3.2.3 and master. I didn't see any similar issues after a quick search for ArrayDeclaration or commas. It looks like it's related to the length of the keys/values found in the array.
Expected: Either a valid AST is created, or the fix is not saved.
Observed: The fix suggested by
phpcbf
for ArrayDeclaration is invalid PHP codeThe input file:
The invalid output (Note that
=>,false
is generated)The below config can be used to reproduce this issue
The text was updated successfully, but these errors were encountered: