Skip to content

Commit 4e81b6e

Browse files
committed
PSR12.Traits.UseDeclaration: fix typo in error code
The `processUseStatement()` method checking single-line trait `use` statements checks the spacing after the `use` keyword, but the error did not have the correct error code.
1 parent b0d171b commit 4e81b6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ protected function processUseStatement(File $phpcsFile, $stackPtr)
655655
$error = 'Expected 1 space after USE in trait import statement; %s found';
656656
if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) {
657657
$data = ['0'];
658-
$fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterAs', $data);
658+
$fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterUse', $data);
659659
if ($fix === true) {
660660
$phpcsFile->fixer->addContent($stackPtr, ' ');
661661
}
@@ -668,7 +668,7 @@ protected function processUseStatement(File $phpcsFile, $stackPtr)
668668
}
669669

670670
$data = [$found];
671-
$fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterAs', $data);
671+
$fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterUse', $data);
672672
if ($fix === true) {
673673
if ($found === 'newline') {
674674
$phpcsFile->fixer->beginChangeset();

0 commit comments

Comments
 (0)