From: ("greggles")
Date:  03 Jun 2015 01:31:20 Hong Kong Time

[PEAR-BUG] Bug #19651 [Com]: PHP 5.4 square bracket arrays indentation error

NNTP-Posting-Host:  null

Edit report at

 ID:               19651
 Comment by:       greggles
 Reported By:      greg dot knaddison at gmail dot com
 Summary:          PHP 5.4 square bracket arrays indentation error
 Status:           No Feedback
 Type:             Bug
 Package:          PHP_CodeSniffer
 Operating System: Windows 7 x64
 Package Version:  1.4.0
 PHP Version:      5.4.7
 Assigned To:      squiz
 New Comment:

I still see this issue on squizlabs/php_codesniffer 1.5.6.

Previous Comments:

[2012-12-04 00:02:24] squiz

-Status: Feedback +Status: No Feedback
Let me know if you have time to try the newer version. ------------------------------------------------------------------------ [2012-11-12 10:22:38] drumsibumsi Will check later. ------------------------------------------------------------------------ [2012-11-12 03:54:36] squiz
-Status: Open +Status: Feedback -Assigned To: +Assigned To: squiz
I can only replicate this issue on PHPCS versions < 1.4.0 (I tried 1.3.6, for example). 1.4.0+ do not report any errors about indentation for the code in your test case. Are you able to try with the latest version (1.4.2) and see if the problem still occurs. If so, can you please show me the output of the following command on your test script: phpcs --standard=[whatever standard you use] -s /path/to/example.php ------------------------------------------------------------------------ [2012-10-16 23:43:57] squiz
-Summary: PHP 5.4 square bracket arrays indentitation error. +Summary: PHP 5.4 square bracket arrays indentation error
------------------------------------------------------------------------ [2012-10-13 12:42:42] drumsibumsi Description: ------------ CodeSniffer wrongly reports errors on array indentitation when using PHP 5.4 short notation for arrays in function calls. See test script. Test script: --------------- call_some_function( 'argument_1', 'argument_2', [ 'array_item_1', 'array_item_2', 'array_item_3', ] ); Expected result: ---------------- No errors. Actual result: -------------- Error on indentitation level: "Multi-line function call not indented correctly". CodeSniffer expects array items to be aligned inline with square brackets. ------------------------------------------------------------------------ -- Edit this bug report at