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
It is about a 'function() use() {' which will be "fixed" into 'function() { use()', which will obviously break the code, and make it not work properly anymore.
I've listed here the errors and test case, I've used a custom standard, but I suspect the 'Squiz.Functions.MultiLineFunctionDeclaration.BraceOnNewLine' to cause this failed fix.
Thanks in advance
PHPCS
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
26 | ERROR | [x] Expected 1 space after USE keyword; found 0
| | (Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterUse)
33 | ERROR | [x] Expected 1 space after USE keyword; found 0
| | (Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterUse)
34 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
| | (Squiz.Functions.MultiLineFunctionDeclaration.BraceOnNewLine)
42 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
| | (Squiz.Functions.MultiLineFunctionDeclaration.BraceOnNewLine)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
gsherwood
changed the title
PHPCBF Fixing Squiz.Functions.MultiLineFunctionDeclaration.BraceOnNewLine wrong, in a 'function use'
PHPCBF can break function/use closure brace placement
May 25, 2015
I've found an incorrect fix of PHPCBF.
It is about a 'function() use() {' which will be "fixed" into 'function() { use()', which will obviously break the code, and make it not work properly anymore.
I've listed here the errors and test case, I've used a custom standard, but I suspect the 'Squiz.Functions.MultiLineFunctionDeclaration.BraceOnNewLine' to cause this failed fix.
Thanks in advance
PHPCS
PHPCBF
BEFORE
AFTER
The text was updated successfully, but these errors were encountered: