function Runner::handleErrors
Converts all PHP errors into exceptions.
This method forces a sniff to stop processing if it is not able to handle a specific piece of code, instead of continuing and potentially getting into a loop.
Parameters
int $code The level of error raised.:
string $message The error message.:
string $file The path of the file that raised the error.:
int $line The line number the error was raised at.:
Return value
bool
Throws
\PHP_CodeSniffer\Exceptions\RuntimeException
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Runner.php, line 617
Class
Namespace
PHP_CodeSnifferCode
public function handleErrors($code, $message, $file, $line) {
if ((error_reporting() & $code) === 0) {
// This type of error is being muted.
return true;
}
throw new RuntimeException("{$message} in {$file} on line {$line}");
}