function File::addFixableError
Records a fixable error against a specific token in the file.
Returns true if the error was recorded and should be fixed.
Parameters
string $error The error message.:
int $stackPtr The stack position where the error occurred.:
string $code A violation code unique to the sniff message.:
array $data Replacements for the error message.:
int $severity The severity level for this error. A value of 0: will be converted into the default severity level.
Return value
boolean
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Files/ File.php, line 802
Class
Namespace
PHP_CodeSniffer\FilesCode
public function addFixableError($error, $stackPtr, $code, $data = [], $severity = 0) {
$recorded = $this->addError($error, $stackPtr, $code, $data, $severity, true);
if ($recorded === true && $this->fixer->enabled === true) {
return true;
}
return false;
}