Skip to content

Commit

Permalink
fix(Logger): Adjust to new typings in symfony 6
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Oct 10, 2024
1 parent 3184d3c commit 43c26c1
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/Service/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Output\OutputInterface;
use \Stringable;

class Logger implements LoggerInterface {
private LoggerInterface $logger;
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 43c26c1

Please sign in to comment.