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

Breadcrumb

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

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

Runner

Namespace

PHP_CodeSniffer

Code

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}");
}
RSS feed
Powered by Drupal