@@ -12,12 +12,12 @@ |
||
| 12 | 12 | |
| 13 | 13 | namespace chillerlan\Logger\Output; |
| 14 | 14 | |
| 15 | -class ConsoleLog extends LogOutputAbstract{ |
|
| 15 | +class ConsoleLog extends LogOutputAbstract { |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * @inheritdoc |
| 19 | 19 | */ |
| 20 | - protected function __log(string $level, string $message, array $context = null){ |
|
| 20 | + protected function __log(string $level, string $message, array $context = null) { |
|
| 21 | 21 | echo $this->message($level, $message, $context); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | */ |
| 20 | -class EmailLog extends LogOutputAbstract{ |
|
| 20 | +class EmailLog extends LogOutputAbstract { |
|
| 21 | 21 | |
| 22 | 22 | protected $mailer; |
| 23 | 23 | |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | * @param \chillerlan\Traits\ImmutableSettingsInterface|null $options |
| 29 | 29 | * @param \PHPMailer\PHPMailer\PHPMailer $mailer |
| 30 | 30 | */ |
| 31 | - public function __construct(ImmutableSettingsInterface $options, PHPMailer $mailer){ |
|
| 31 | + public function __construct(ImmutableSettingsInterface $options, PHPMailer $mailer) { |
|
| 32 | 32 | $this->options = $options; |
| 33 | 33 | $this->mailer = $mailer; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - protected function __log(string $level, string $message, array $context = null){ |
|
| 36 | + protected function __log(string $level, string $message, array $context = null) { |
|
| 37 | 37 | // TODO: Implement log() method. |
| 38 | 38 | } |
| 39 | 39 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | /** |
| 19 | 19 | * |
| 20 | 20 | */ |
| 21 | -abstract class LogOutputAbstract implements LogOutputInterface{ |
|
| 21 | +abstract class LogOutputAbstract implements LogOutputInterface { |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * @var \chillerlan\Logger\LogOptions |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @param \chillerlan\Traits\ImmutableSettingsInterface|null $options |
| 32 | 32 | */ |
| 33 | - public function __construct(ImmutableSettingsInterface $options = null){ |
|
| 33 | + public function __construct(ImmutableSettingsInterface $options = null) { |
|
| 34 | 34 | $this->options = $options ?? new LogOptions; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * @inheritdoc |
| 39 | 39 | */ |
| 40 | - public function __destruct(){ |
|
| 40 | + public function __destruct() { |
|
| 41 | 41 | $this->close(); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | /** |
| 61 | 61 | * @inheritdoc |
| 62 | 62 | */ |
| 63 | - public function log(string $level, string $message, array $context = []){ // @todo: loglevel bitmask |
|
| 64 | - if((array_key_exists($level, $this::LEVELS) && $this::LEVELS[$level] >= $this::LEVELS[$this->options->minLogLevel]) || (!array_key_exists($level, $this::LEVELS) && !empty($level))){ |
|
| 63 | + public function log(string $level, string $message, array $context = []) { // @todo: loglevel bitmask |
|
| 64 | + if ((array_key_exists($level, $this::LEVELS) && $this::LEVELS[$level] >= $this::LEVELS[$this->options->minLogLevel]) || (!array_key_exists($level, $this::LEVELS) && !empty($level))) { |
|
| 65 | 65 | $this->__log($level, $message, $context); |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * |
| 74 | 74 | * @return string |
| 75 | 75 | */ |
| 76 | - protected function message(string $level, string $message, array $context = null){ |
|
| 76 | + protected function message(string $level, string $message, array $context = null) { |
|
| 77 | 77 | return sprintf($this->options->consoleFormat, date($this->options->consoleDateFormat), $level, $message).PHP_EOL; |
| 78 | 78 | } |
| 79 | 79 | |