function printMsec($time, $warn = 5, $error = 10) { $str = formatMsec($time); if (!class_exists('ColorCLI')) { return $str; } $msec = msec($time); if ($msec < $warn) { return ColorCLI::lightGreen($str); } elseif ($msec < $error) { return ColorCLI::yellow($str); } return ColorCLI::red($str); }
function printMessage($violation) { $str = $violation['message']; if (!class_exists('ColorCLI')) { return $str; } $severity = $violation['severity']; if ($severity == 'error') { return ColorCLI::red($str); } elseif ($severity == 'warning') { return ColorCLI::yellow($str); } return ColorCLI::cyan($str); }
function printMessage($violation) { $str = formatMessage($violation); if (!class_exists('ColorCLI')) { return $str; } $priority = $violation['priority']; if (isHighPriority($priority)) { return ColorCLI::red($str); } elseif (isNormatPriority($priority)) { return ColorCLI::yellow($str); } return ColorCLI::cyan($str); }