Shorten names of CONSOLE_STATUS_... class constants

This commit is contained in:
Joshua Ramon Enslin 2020-08-08 22:07:39 +02:00 committed by Stefan Rohde-Enslin
parent 41fda53d58
commit bd401fa614

View File

@ -10,18 +10,18 @@
*/ */
class MDConsole { class MDConsole {
const CONSOLE_STATUS_NOTICE = 0; const STATUS_NOTICE = 0;
const CONSOLE_STATUS_UPDATE = 1; const STATUS_UPDATE = 1;
const CONSOLE_STATUS_DELETION = 2; const STATUS_DELETION = 2;
const CONSOLE_STATUS_ERROR = 3; const STATUS_ERROR = 3;
const CONSOLE_STATUS_SKIPPED = 3; const STATUS_SKIPPED = 3;
const CONSOLE_LEVEL_COLORS = [ const CONSOLE_LEVEL_COLORS = [
self::CONSOLE_STATUS_NOTICE => "", self::STATUS_NOTICE => "",
self::CONSOLE_STATUS_ERROR => "41", // 0: Red background | Problem self::STATUS_ERROR => "41", // 0: Red background | Problem
self::CONSOLE_STATUS_UPDATE => "42", // 1: Green background | Edited automatically self::STATUS_UPDATE => "42", // 1: Green background | Edited automatically
self::CONSOLE_STATUS_DELETION => "44", // 2: Blue background | Deleted self::STATUS_DELETION => "44", // 2: Blue background | Deleted
self::CONSOLE_STATUS_SKIPPED => "40", // 2: Blue background | Deleted self::STATUS_SKIPPED => "40", // 2: Blue background | Deleted
]; ];
const CONSOLE_LOG_USED_RESOURCES_ENABLED = 1; const CONSOLE_LOG_USED_RESOURCES_ENABLED = 1;
@ -83,7 +83,7 @@ class MDConsole {
* *
* @return void * @return void
*/ */
final public static function write(string $context, int $level = self::CONSOLE_STATUS_NOTICE, int $editedNo = 0, string $additionalNote = "", string $link = ""):void { final public static function write(string $context, int $level = self::STATUS_NOTICE, int $editedNo = 0, string $additionalNote = "", string $link = ""):void {
// Get parts for generating the message to log. // Get parts for generating the message to log.
$additionalNote = strtr($additionalNote, ["ä" => "ae", "ö" => "oe", "ü" => "ue"]); $additionalNote = strtr($additionalNote, ["ä" => "ae", "ö" => "oe", "ü" => "ue"]);