diff --git a/PHPCSUtils/Utils/UseStatements.php b/PHPCSUtils/Utils/UseStatements.php index 7e371da6..2aa35ec9 100644 --- a/PHPCSUtils/Utils/UseStatements.php +++ b/PHPCSUtils/Utils/UseStatements.php @@ -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. */ diff --git a/Tests/Utils/UseStatements/SplitImportUseStatementTest.inc b/Tests/Utils/UseStatements/SplitImportUseStatementTest.inc index 29e01e6a..02566171 100644 --- a/Tests/Utils/UseStatements/SplitImportUseStatementTest.inc +++ b/Tests/Utils/UseStatements/SplitImportUseStatementTest.inc @@ -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\{ diff --git a/Tests/Utils/UseStatements/SplitImportUseStatementTest.php b/Tests/Utils/UseStatements/SplitImportUseStatementTest.php index 28f7edf6..50dc0095 100644 --- a/Tests/Utils/UseStatements/SplitImportUseStatementTest.php +++ b/Tests/Utils/UseStatements/SplitImportUseStatementTest.php @@ -276,7 +276,7 @@ public function dataSplitImportUseStatement() 'parse-error-plain-alias-reserved-keyword-const' => [ '/* testUsePlainAliasReservedKeywordConst */', [ - 'name' => [], + 'name' => ['const' => 'Vendor\YourNamespace\ClassName'], 'function' => [], 'const' => [], ],