Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LocalFile.php

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

LocalFile

Namespace

PHP_CodeSniffer\Files

Code

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;
}
RSS feed
Powered by Drupal