From 9a5da2cf074b77beb4327748e2bfaf5c15eac3ec Mon Sep 17 00:00:00 2001 From: Natan Felles Date: Fri, 23 Aug 2024 21:09:24 -0300 Subject: [PATCH] Upgrade coding standard --- composer.json | 2 +- src/Logger.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index efec4da..7292ab3 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ }, "require-dev": { "ext-xdebug": "*", - "aplus/coding-standard": "^2.0", + "aplus/coding-standard": "^2.8", "ergebnis/composer-normalize": "^2.25", "jetbrains/phpstorm-attributes": "^1.0", "phpmd/phpmd": "^2.13", diff --git a/src/Logger.php b/src/Logger.php index 79b6c23..a0b3caf 100644 --- a/src/Logger.php +++ b/src/Logger.php @@ -33,19 +33,19 @@ abstract class Logger * Active log level. */ protected LogLevel $level = LogLevel::DEBUG; - protected Log | null $lastLog = null; + protected ?Log $lastLog = null; protected LogCollector $debugCollector; /** * Logger constructor. * * @param string $destination - * @param int|LogLevel $level + * @param LogLevel|int $level * @param array $config */ public function __construct( string $destination, - LogLevel|int $level = LogLevel::DEBUG, + LogLevel | int $level = LogLevel::DEBUG, array $config = [] ) { $this->setDestination($destination); @@ -86,13 +86,13 @@ protected function getConfig() : array /** * Logs with an arbitrary level. * - * @param int|LogLevel $level + * @param LogLevel|int $level * @param string $message * @param array $context * * @return bool */ - public function log(LogLevel|int $level, string $message, array $context = []) : bool + public function log(LogLevel | int $level, string $message, array $context = []) : bool { $debug = isset($this->debugCollector); if ($debug) { @@ -266,7 +266,7 @@ public function getLevel() : LogLevel return $this->level; } - public function setLevel(LogLevel|int $level) : static + public function setLevel(LogLevel | int $level) : static { if (\is_int($level)) { $level = LogLevel::from($level);