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

Breadcrumb

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

function Notifysend::generateMessage

Generate the error message to show to the user.

Parameters

string[] $checkedFiles The files checked during the run.:

int $totalErrors Total number of errors found during the run.:

int $totalWarnings Total number of warnings found during the run.:

Return value

string|null Error message or NULL if no error/warning found.

1 call to Notifysend::generateMessage()
Notifysend::generate in vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php
Generates a summary of errors and warnings for each file processed.

File

vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php, line 160

Class

Notifysend

Namespace

PHP_CodeSniffer\Reports

Code

protected function generateMessage($checkedFiles, $totalErrors, $totalWarnings) {
    if ($totalErrors === 0 && $totalWarnings === 0) {
        // Nothing to print.
        return null;
    }
    $totalFiles = count($checkedFiles);
    $msg = '';
    if ($totalFiles > 1) {
        $msg .= 'Checked ' . $totalFiles . ' files' . PHP_EOL;
    }
    else {
        $msg .= $checkedFiles[0] . PHP_EOL;
    }
    if ($totalWarnings > 0) {
        $msg .= $totalWarnings . ' warnings' . PHP_EOL;
    }
    if ($totalErrors > 0) {
        $msg .= $totalErrors . ' errors' . PHP_EOL;
    }
    return $msg;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal