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

Breadcrumb

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

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

File

Namespace

PHP_CodeSniffer\Files

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal