From 69931fa544a202efe105f7bd4b500fb746c64162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barto=C5=A1?= Date: Wed, 15 Sep 2021 18:37:06 +0200 Subject: [PATCH] Compatibility with psr/log ^2.0 and ^3.0 --- composer.json | 2 +- src/Bridges/Psr/TracyToPsrLoggerAdapter.php | 2 +- tests/Tracy.Bridges/PsrToTracyLoggerAdapter.phpt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index de37e604d..011902b02 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "nette/mail": "^3.0", "nette/tester": "^2.2", "latte/latte": "^2.5", - "psr/log": "^1.0", + "psr/log": "^1.0|^2.0|^3.0", "phpstan/phpstan": "^0.12" }, "conflict": { diff --git a/src/Bridges/Psr/TracyToPsrLoggerAdapter.php b/src/Bridges/Psr/TracyToPsrLoggerAdapter.php index 32d5747c6..7cd6de5d8 100644 --- a/src/Bridges/Psr/TracyToPsrLoggerAdapter.php +++ b/src/Bridges/Psr/TracyToPsrLoggerAdapter.php @@ -40,7 +40,7 @@ public function __construct(Tracy\ILogger $tracyLogger) } - public function log($level, $message, array $context = []) + public function log($level, $message, array $context = []): void { $level = self::LEVEL_MAP[$level] ?? Tracy\ILogger::ERROR; diff --git a/tests/Tracy.Bridges/PsrToTracyLoggerAdapter.phpt b/tests/Tracy.Bridges/PsrToTracyLoggerAdapter.phpt index 21205190e..7ee938bf5 100644 --- a/tests/Tracy.Bridges/PsrToTracyLoggerAdapter.phpt +++ b/tests/Tracy.Bridges/PsrToTracyLoggerAdapter.phpt @@ -19,7 +19,7 @@ class DummyPsrLogger extends Psr\Log\AbstractLogger public $entries = []; - public function log($level, $message, array $context = []) + public function log($level, $message, array $context = []): void { $this->entries[] = [$level, $message, $context]; }