Skip to content

Commit 64ed03a

Browse files
committed
Added fix
1 parent e175269 commit 64ed03a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CodeSniffer/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
126126
strtolower($keyword),
127127
$keyword,
128128
);
129-
$phpcsFile->addError($error, $stackPtr, 'Found', $data);
129+
130+
$fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found', $data);
131+
if ($fix === true && $phpcsFile->fixer->enabled === true) {
132+
$phpcsFile->fixer->replaceToken($stackPtr, strtolower($keyword));
133+
}
130134
}
131135

132136
}//end process()

0 commit comments

Comments
 (0)