From 43c26c119d54918dfae77bae7c09f154da9b4f6f Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 10 Oct 2024 14:56:12 +0200 Subject: [PATCH] fix(Logger): Adjust to new typings in symfony 6 Signed-off-by: Marcel Klehr --- lib/Service/Logger.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/Service/Logger.php b/lib/Service/Logger.php index 1346beb7..a2ffeb3e 100644 --- a/lib/Service/Logger.php +++ b/lib/Service/Logger.php @@ -8,6 +8,7 @@ use Psr\Log\LoggerInterface; use Symfony\Component\Console\Output\OutputInterface; +use \Stringable; class Logger implements LoggerInterface { private LoggerInterface $logger; @@ -30,7 +31,7 @@ public function setCliOutput(OutputInterface $out): Logger { /** * @inheritDoc */ - public function emergency($message, array $context = array()) { + public function emergency(Stringable|string $message, array $context = array()): void { if (isset($this->cliOutput)) { $this->cliOutput->writeln($message); } @@ -40,7 +41,7 @@ public function emergency($message, array $context = array()) { /** * @inheritDoc */ - public function alert($message, array $context = array()) { + public function alert(Stringable|string $message, array $context = array()): void { if (isset($this->cliOutput)) { $this->cliOutput->writeln($message); } @@ -50,7 +51,7 @@ public function alert($message, array $context = array()) { /** * @inheritDoc */ - public function critical($message, array $context = array()) { + public function critical(Stringable|string $message, array $context = array()): void { if (isset($this->cliOutput)) { $this->cliOutput->writeln($message); } @@ -60,7 +61,7 @@ public function critical($message, array $context = array()) { /** * @inheritDoc */ - public function error($message, array $context = array()) { + public function error(Stringable|string $message, array $context = array()): void { if (isset($this->cliOutput)) { $this->cliOutput->writeln($message); } @@ -70,7 +71,7 @@ public function error($message, array $context = array()) { /** * @inheritDoc */ - public function warning($message, array $context = array()) { + public function warning(Stringable|string $message, array $context = array()): void { if (isset($this->cliOutput)) { $this->cliOutput->writeln($message); } @@ -80,7 +81,7 @@ public function warning($message, array $context = array()) { /** * @inheritDoc */ - public function notice($message, array $context = array()) { + public function notice(Stringable|string $message, array $context = array()): void { if (isset($this->cliOutput)) { $this->cliOutput->writeln($message); } @@ -90,7 +91,7 @@ public function notice($message, array $context = array()) { /** * @inheritDoc */ - public function info($message, array $context = array()) { + public function info(Stringable|string $message, array $context = array()): void { if (isset($this->cliOutput) && !$this->cliOutput->isQuiet()) { $this->cliOutput->writeln($message); } @@ -100,7 +101,7 @@ public function info($message, array $context = array()) { /** * @inheritDoc */ - public function debug($message, array $context = array()) { + public function debug(Stringable|string $message, array $context = array()): void { if (isset($this->cliOutput) && !$this->cliOutput->isQuiet()) { $this->cliOutput->writeln($message); } @@ -110,7 +111,7 @@ public function debug($message, array $context = array()) { /** * @inheritDoc */ - public function log($level, $message, array $context = array()) { + public function log($level, Stringable|string $message, array $context = array()): void { if (isset($this->cliOutput)) { $this->cliOutput->writeln($message); }