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
Namespace
PHP_CodeSniffer\ReportsCode
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;
}