function File::addWarning
Records a warning against a specific token in the file.
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.
boolean $fixable Can the warning be fixed by the sniff?:
Return value
boolean
4 calls to File::addWarning()
- File::addFixableWarning in vendor/
squizlabs/ php_codesniffer/ src/ Files/ File.php - Records a fixable warning against a specific token in the file.
- File::getMemberProperties in vendor/
squizlabs/ php_codesniffer/ src/ Files/ File.php - Returns the visibility and implementation properties of a class member var.
- File::parse in vendor/
squizlabs/ php_codesniffer/ src/ Files/ File.php - Tokenizes the file and prepares it for the test run.
- File::process in vendor/
squizlabs/ php_codesniffer/ src/ Files/ File.php - Starts the stack traversal and tells listeners when tokens are found.
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Files/ File.php, line 719
Class
Namespace
PHP_CodeSniffer\FilesCode
public function addWarning($warning, $stackPtr, $code, $data = [], $severity = 0, $fixable = false) {
if ($stackPtr === null) {
$line = 1;
$column = 1;
}
else {
$line = $this->tokens[$stackPtr]['line'];
$column = $this->tokens[$stackPtr]['column'];
}
return $this->addMessage(false, $warning, $line, $column, $code, $data, $severity, $fixable);
}