Edit report at https://pear.php.net/bugs/bug.php?id=21029&edit=1
ID: 21029
Comment by: john@kleijnweb.nl
Reported By: john at kleijnweb dot nl
Summary: Curly braces in namespace declarations
Status: Open
Type: Bug
Package: PHP_CodeSniffer
Operating System: Ubuntu
Package Version: 2.5.1
PHP Version: Irrelevant
Roadmap Versions:
New Comment:
I guess strictly this is correct ("there mus be one use statement per
declaration"), but that wasn't written with PHP7 in mind. I've asked the
question on FIG GitHub:
https://github.com/php-fig/fig-standards/issues/743
Previous Comments:
------------------------------------------------------------------------
[2016-02-15 12:10:16] kleijnweb
Description:
------------
Misinterprets new PHP7 namespace syntax.
Test script:
---------------
echo -e '<?php\nnamespace Foo\{Bar, Boo};' | phpcs --standard=PSR2
Expected result:
----------------
No output
Actual result:
--------------
FILE: STDIN
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
2 | ERROR | [x] Closing brace must be on a line by itself
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Time: 18ms; Memory: 4Mb
------------------------------------------------------------------------