function AbstractPatternSniff::prepareError
Prepares an error for the specified patternCode.
Parameters
string $found The actual found string in the code.:
string $patternCode The expected pattern code.:
Return value
string The error message.
1 call to AbstractPatternSniff::prepareError()
- AbstractPatternSniff::processPattern in vendor/
squizlabs/ php_codesniffer/ src/ Sniffs/ AbstractPatternSniff.php - Processes the pattern and verifies the code at $stackPtr.
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Sniffs/ AbstractPatternSniff.php, line 706
Class
Namespace
PHP_CodeSniffer\SniffsCode
protected function prepareError($found, $patternCode) {
$found = str_replace("\r\n", '\\n', $found);
$found = str_replace("\n", '\\n', $found);
$found = str_replace("\r", '\\n', $found);
$found = str_replace("\t", '\\t', $found);
$found = str_replace('EOL', '\\n', $found);
$expected = str_replace('EOL', '\\n', $patternCode);
$error = "Expected \"{$expected}\"; found \"{$found}\"";
return $error;
}