diff --git a/composer.json b/composer.json index 5f022429..f6a8b475 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "psr/http-message": "^1.0", "psr/http-message-implementation": "^1.0", "psr/http-server-handler": "^1.0", - "psr/log": "^1.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/console": "^5.0 || ^6.0", "webmozart/assert": "^1.9" }, diff --git a/composer.lock b/composer.lock index 0dd41238..a922eceb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1f14c198921f84d49af0d725e86788f0", + "content-hash": "6fe6b790d99a9fe4d4a92d3932d30550", "packages": [ { "name": "dflydev/fig-cookies", diff --git a/src/Log/Psr3AccessLogDecorator.php b/src/Log/Psr3AccessLogDecorator.php index 65b9ce5f..f646220e 100644 --- a/src/Log/Psr3AccessLogDecorator.php +++ b/src/Log/Psr3AccessLogDecorator.php @@ -61,7 +61,7 @@ public function logAccessForPsr7Resource(Request $request, ResponseInterface $re /** * {@inheritDoc} */ - public function emergency($message, array $context = []) + public function emergency($message, array $context = []): void { $this->logger->emergency($message, $context); } @@ -69,7 +69,7 @@ public function emergency($message, array $context = []) /** * {@inheritDoc} */ - public function alert($message, array $context = []) + public function alert($message, array $context = []): void { $this->logger->alert($message, $context); } @@ -77,7 +77,7 @@ public function alert($message, array $context = []) /** * {@inheritDoc} */ - public function critical($message, array $context = []) + public function critical($message, array $context = []): void { $this->logger->critical($message, $context); } @@ -85,7 +85,7 @@ public function critical($message, array $context = []) /** * {@inheritDoc} */ - public function error($message, array $context = []) + public function error($message, array $context = []): void { $this->logger->error($message, $context); } @@ -93,7 +93,7 @@ public function error($message, array $context = []) /** * {@inheritDoc} */ - public function warning($message, array $context = []) + public function warning($message, array $context = []): void { $this->logger->warning($message, $context); } @@ -101,7 +101,7 @@ public function warning($message, array $context = []) /** * {@inheritDoc} */ - public function notice($message, array $context = []) + public function notice($message, array $context = []): void { $this->logger->notice($message, $context); } @@ -109,7 +109,7 @@ public function notice($message, array $context = []) /** * {@inheritDoc} */ - public function info($message, array $context = []) + public function info($message, array $context = []): void { $this->logger->info($message, $context); } @@ -117,7 +117,7 @@ public function info($message, array $context = []) /** * {@inheritDoc} */ - public function debug($message, array $context = []) + public function debug($message, array $context = []): void { $this->logger->debug($message, $context); } @@ -125,7 +125,7 @@ public function debug($message, array $context = []) /** * {@inheritDoc} */ - public function log($level, $message, array $context = []) + public function log($level, $message, array $context = []): void { $this->logger->log($level, $message, $context); } diff --git a/src/Log/StdoutLogger.php b/src/Log/StdoutLogger.php index 8a3110a6..cbd2d7e0 100644 --- a/src/Log/StdoutLogger.php +++ b/src/Log/StdoutLogger.php @@ -31,72 +31,64 @@ class StdoutLogger implements LoggerInterface { /** * @param string $message - * @return void */ - public function emergency($message, array $context = []) + public function emergency($message, array $context = []): void { $this->log(LogLevel::EMERGENCY, $message, $context); } /** * @param string $message - * @return void */ - public function alert($message, array $context = []) + public function alert($message, array $context = []): void { $this->log(LogLevel::ALERT, $message, $context); } /** * @param string $message - * @return void */ - public function critical($message, array $context = []) + public function critical($message, array $context = []): void { $this->log(LogLevel::CRITICAL, $message, $context); } /** * @param string $message - * @return void */ - public function error($message, array $context = []) + public function error($message, array $context = []): void { $this->log(LogLevel::ERROR, $message, $context); } /** * @param string $message - * @return void */ - public function warning($message, array $context = []) + public function warning($message, array $context = []): void { $this->log(LogLevel::WARNING, $message, $context); } /** * @param string $message - * @return void */ - public function notice($message, array $context = []) + public function notice($message, array $context = []): void { $this->log(LogLevel::NOTICE, $message, $context); } /** * @param string $message - * @return void */ - public function info($message, array $context = []) + public function info($message, array $context = []): void { $this->log(LogLevel::INFO, $message, $context); } /** * @param string $message - * @return void */ - public function debug($message, array $context = []) + public function debug($message, array $context = []): void { $this->log(LogLevel::DEBUG, $message, $context); } @@ -104,9 +96,8 @@ public function debug($message, array $context = []) /** * @param mixed $level Generally a string from a LogLevel constant. * @param string $message - * @return void */ - public function log($level, $message, array $context = []) + public function log($level, $message, array $context = []): void { foreach ($context as $key => $value) { $value = is_string($value) || is_array($value) ? $value : (string) $value;