Closed
Description
Overview
If the last USE statement has a comment, an incorrect PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse
error is reported.
Steps to reproduce
Run phpcs --standard=PSR2
on a file with the following contents:
<?php
use Foo\Bar; //comment
// This should pass.
Expected output
None. This should validate correctly.
Actual output
FILE: /Users/matt/Projects/PHP_CodeSniffer/tests/TestCommentAfterLastUse.php
-------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------
2 | ERROR | [x] There must be one blank line after the last USE statement; 0 found;
-------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------
Time: 114ms; Memory: 6Mb