From 775584299d912445d832166db4479a88c6a7f081 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 23 Oct 2026 17:36:56 +0200 Subject: [PATCH] Add Psalm capability annotations to LoggerInterface --- src/LoggerInterface.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/LoggerInterface.php b/src/LoggerInterface.php index cb4cf64..f517377 100644 --- a/src/LoggerInterface.php +++ b/src/LoggerInterface.php @@ -23,6 +23,7 @@ interface LoggerInterface * System is unusable. * * @param mixed[] $context + * @psalm-capabilities read-props|write-this-props|write-props|read-globals|write-globals|io|time */ public function emergency(string|\Stringable $message, array $context = []): void; @@ -33,6 +34,7 @@ public function emergency(string|\Stringable $message, array $context = []): voi * trigger the SMS alerts and wake you up. * * @param mixed[] $context + * @psalm-capabilities read-props|write-this-props|write-props|read-globals|write-globals|io|time */ public function alert(string|\Stringable $message, array $context = []): void; @@ -42,6 +44,7 @@ public function alert(string|\Stringable $message, array $context = []): void; * Example: Application component unavailable, unexpected exception. * * @param mixed[] $context + * @psalm-capabilities read-props|write-this-props|write-props|read-globals|write-globals|io|time */ public function critical(string|\Stringable $message, array $context = []): void; @@ -50,6 +53,7 @@ public function critical(string|\Stringable $message, array $context = []): void * be logged and monitored. * * @param mixed[] $context + * @psalm-capabilities read-props|write-this-props|write-props|read-globals|write-globals|io|time */ public function error(string|\Stringable $message, array $context = []): void; @@ -60,6 +64,7 @@ public function error(string|\Stringable $message, array $context = []): void; * that are not necessarily wrong. * * @param mixed[] $context + * @psalm-capabilities read-props|write-this-props|write-props|read-globals|write-globals|io|time */ public function warning(string|\Stringable $message, array $context = []): void; @@ -67,6 +72,7 @@ public function warning(string|\Stringable $message, array $context = []): void; * Normal but significant events. * * @param mixed[] $context + * @psalm-capabilities read-props|write-this-props|write-props|read-globals|write-globals|io|time */ public function notice(string|\Stringable $message, array $context = []): void; @@ -76,6 +82,7 @@ public function notice(string|\Stringable $message, array $context = []): void; * Example: User logs in, SQL logs. * * @param mixed[] $context + * @psalm-capabilities read-props|write-this-props|write-props|read-globals|write-globals|io|time */ public function info(string|\Stringable $message, array $context = []): void; @@ -83,6 +90,7 @@ public function info(string|\Stringable $message, array $context = []): void; * Detailed debug information. * * @param mixed[] $context + * @psalm-capabilities read-props|write-this-props|write-props|read-globals|write-globals|io|time */ public function debug(string|\Stringable $message, array $context = []): void; @@ -93,6 +101,7 @@ public function debug(string|\Stringable $message, array $context = []): void; * @param mixed[] $context * * @throws \Psr\Log\InvalidArgumentException + * @psalm-capabilities read-props|write-this-props|write-props|read-globals|write-globals|io|time */ public function log($level, string|\Stringable $message, array $context = []): void; }