[PEAR-BUG] Bug #19651 [Com]: PHP 5.4 square bracket arrays indentation error
[email protected] ("greggles") Tue, 2 Jun 2015 18:31:20 +0100 (BST)
| Newsgroups | php.pear.bugs |
|---|---|
| Message-ID | <[email protected]> |
Edit report at http://pear.php.net/bugs/bug.php?id=19651&edit=1
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
<div id="changeset">
<span class="removed">-Status: Feedback</span>
<span class="added">+Status: No Feedback</span>
</div>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
<div id="changeset">
<span class="removed">-Status: Open</span>
<span class="added">+Status: Feedback</span>
<span class="removed">-Assigned To:</span>
<span class="added">+Assigned To: squiz</span>
</div>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
<div id="changeset">
<span class="removed">-Summary: PHP 5.4 square bracket arrays
indentitation error.</span>
<span class="added">+Summary: PHP 5.4 square bracket arrays indentation
error</span>
</div>
------------------------------------------------------------------------
[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 http://pear.php.net/bugs/bug.php?id=19651&edit=1