Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PHPCSUtils/Utils/UseStatements.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ public static function splitImportUseStatement(File $phpcsFile, $stackPtr)
*
* If `function` or `const` is used as the alias, the semi-colon after it would
* be tokenized as T_STRING.
* For `function` this was fixed in PHPCS 2.8.0. For `const` the issue still exists
* in PHPCS 3.5.2.
* For `function` this was fixed in PHPCS 2.8.0. For `const` the issue was fixed
* in PHPCS 3.7.0.
*
* Along the same lines, the `}` T_CLOSE_USE_GROUP would also be tokenized as T_STRING.
*/
Expand Down
2 changes: 2 additions & 0 deletions Tests/Utils/UseStatements/SplitImportUseStatementTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ use Vendor\{
// Intentional parse error - use of reserved keyword as alias.
use Vendor\YourNamespace\ClassName as const;

echo 'foo'; // Needed for consistent handling of the above test.

// Intentional parse error. This has to be the last test in the file.
/* testParseError */
use MyNS\Level\{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Utils/UseStatements/SplitImportUseStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function dataSplitImportUseStatement()
'parse-error-plain-alias-reserved-keyword-const' => [
'/* testUsePlainAliasReservedKeywordConst */',
[
'name' => [],
'name' => ['const' => 'Vendor\YourNamespace\ClassName'],
'function' => [],
'const' => [],
],
Expand Down