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

Breadcrumb

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

function File::addFixableWarning

Records a fixable warning against a specific token in the file.

Returns true if the warning was recorded and should be fixed.

Parameters

string $warning 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 warning message.:

int $severity The severity level for this warning. 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 833

Class

File

Namespace

PHP_CodeSniffer\Files

Code

public function addFixableWarning($warning, $stackPtr, $code, $data = [], $severity = 0) {
    $recorded = $this->addWarning($warning, $stackPtr, $code, $data, $severity, true);
    if ($recorded === true && $this->fixer->enabled === true) {
        return true;
    }
    return false;
}
RSS feed
Powered by Drupal