function LocalFile::replayErrors
Clears and replays error and warnings for the file.
Replaying errors and warnings allows for filtering rules to be changed and then errors and warnings to be reapplied with the new rules. This is particularly useful while caching.
Parameters
array $errors The list of errors to replay.:
array $warnings The list of warnings to replay.:
Return value
void
1 call to LocalFile::replayErrors()
- LocalFile::process in vendor/
squizlabs/ php_codesniffer/ src/ Files/ LocalFile.php - Processes the file.
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Files/ LocalFile.php, line 168
Class
Namespace
PHP_CodeSniffer\FilesCode
private function replayErrors($errors, $warnings) {
$this->errors = [];
$this->warnings = [];
$this->errorCount = 0;
$this->warningCount = 0;
$this->fixableCount = 0;
$this->replayingErrors = true;
foreach ($errors as $line => $lineErrors) {
foreach ($lineErrors as $column => $colErrors) {
foreach ($colErrors as $error) {
$this->activeListener = $error['listener'];
$this->addMessage(true, $error['message'], $line, $column, $error['source'], [], $error['severity'], $error['fixable']);
}
}
}
foreach ($warnings as $line => $lineErrors) {
foreach ($lineErrors as $column => $colErrors) {
foreach ($colErrors as $error) {
$this->activeListener = $error['listener'];
$this->addMessage(false, $error['message'], $line, $column, $error['source'], [], $error['severity'], $error['fixable']);
}
}
}
$this->replayingErrors = false;
}