Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2018-04-08 17:54:08 +00:00 committed by StyleCI Bot
parent c97aced309
commit 1f8ec931e7

View File

@ -38,8 +38,6 @@ class Logger
const ERROR = 1;
const FATAL_ERROR = 0;
/*
* Constructor function
* Accepts various logger modes:
@ -50,9 +48,11 @@ class Logger
* 4 - Call callable provided in logger_param. logger_param must accept two parameters: array $message, int $level
* $message is an array containing the messages the log, $level, is the logging level
*/
public static function constructor($mode, $optional = null, $prefix = '', $level = self::NOTICE) {
self::$default = new Logger($mode, $optional, $prefix, $level);
public static function constructor($mode, $optional = null, $prefix = '', $level = self::NOTICE)
{
self::$default = new self($mode, $optional, $prefix, $level);
}
public function __construct($mode, $optional = null, $prefix = '', $level = self::NOTICE)
{
if ($mode === null) {
@ -63,12 +63,12 @@ class Logger
$this->prefix = $prefix === '' ? '' : ', '.$prefix;
$this->level = $level;
$this->colors[Logger::ULTRA_VERBOSE] = implode(';', [Logger::foreground['light_gray'], Logger::set['dim']]);
$this->colors[Logger::VERBOSE] = implode(';', [Logger::foreground['green'], Logger::set['bold']]);
$this->colors[Logger::NOTICE] = implode(';', [Logger::foreground['yellow'], Logger::set['bold']]);
$this->colors[Logger::WARNING] = implode(';', [Logger::foreground['white'], Logger::set['dim'], Logger::background['red']]);
$this->colors[Logger::ERROR] = implode(';', [Logger::foreground['white'], Logger::set['bold'], Logger::background['red']]);
$this->colors[Logger::FATAL_ERROR] = implode(';', [Logger::foreground['red'], Logger::set['bold'], Logger::background['light_gray']]);
$this->colors[self::ULTRA_VERBOSE] = implode(';', [self::foreground['light_gray'], self::set['dim']]);
$this->colors[self::VERBOSE] = implode(';', [self::foreground['green'], self::set['bold']]);
$this->colors[self::NOTICE] = implode(';', [self::foreground['yellow'], self::set['bold']]);
$this->colors[self::WARNING] = implode(';', [self::foreground['white'], self::set['dim'], self::background['red']]);
$this->colors[self::ERROR] = implode(';', [self::foreground['white'], self::set['bold'], self::background['red']]);
$this->colors[self::FATAL_ERROR] = implode(';', [self::foreground['red'], self::set['bold'], self::background['light_gray']]);
}
public static function log($param, $level = self::NOTICE)
@ -77,7 +77,9 @@ class Logger
self::$default->logger($param, $level, basename(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1)[0]['file'], '.php'));
}
}
public function logger($param, $level = self::NOTICE, $file = null) {
public function logger($param, $level = self::NOTICE, $file = null)
{
if ($level > $this->level || $this->mode === 0) {
return false;
}