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 8a6bab6
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 {

Check failure on line 13 in lib/Service/Logger.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

MethodSignatureMismatch

lib/Service/Logger.php:13:7: MethodSignatureMismatch: Method OCA\Recognize\Service\Logger::emergency with return type '' is different to return type 'void' of inherited method Psr\Log\LoggerInterface::emergency (see https://psalm.dev/042)

Check failure on line 13 in lib/Service/Logger.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

MethodSignatureMismatch

lib/Service/Logger.php:13:7: MethodSignatureMismatch: Method OCA\Recognize\Service\Logger::alert with return type '' is different to return type 'void' of inherited method Psr\Log\LoggerInterface::alert (see https://psalm.dev/042)

Check failure on line 13 in lib/Service/Logger.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

MethodSignatureMismatch

lib/Service/Logger.php:13:7: MethodSignatureMismatch: Method OCA\Recognize\Service\Logger::critical with return type '' is different to return type 'void' of inherited method Psr\Log\LoggerInterface::critical (see https://psalm.dev/042)

Check failure on line 13 in lib/Service/Logger.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

MethodSignatureMismatch

lib/Service/Logger.php:13:7: MethodSignatureMismatch: Method OCA\Recognize\Service\Logger::error with return type '' is different to return type 'void' of inherited method Psr\Log\LoggerInterface::error (see https://psalm.dev/042)

Check failure on line 13 in lib/Service/Logger.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

MethodSignatureMismatch

lib/Service/Logger.php:13:7: MethodSignatureMismatch: Method OCA\Recognize\Service\Logger::warning with return type '' is different to return type 'void' of inherited method Psr\Log\LoggerInterface::warning (see https://psalm.dev/042)

Check failure on line 13 in lib/Service/Logger.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

MethodSignatureMismatch

lib/Service/Logger.php:13:7: MethodSignatureMismatch: Method OCA\Recognize\Service\Logger::notice with return type '' is different to return type 'void' of inherited method Psr\Log\LoggerInterface::notice (see https://psalm.dev/042)

Check failure on line 13 in lib/Service/Logger.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

MethodSignatureMismatch

lib/Service/Logger.php:13:7: MethodSignatureMismatch: Method OCA\Recognize\Service\Logger::info with return type '' is different to return type 'void' of inherited method Psr\Log\LoggerInterface::info (see https://psalm.dev/042)

Check failure on line 13 in lib/Service/Logger.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

MethodSignatureMismatch

lib/Service/Logger.php:13:7: MethodSignatureMismatch: Method OCA\Recognize\Service\Logger::debug with return type '' is different to return type 'void' of inherited method Psr\Log\LoggerInterface::debug (see https://psalm.dev/042)

Check failure on line 13 in lib/Service/Logger.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

MethodSignatureMismatch

lib/Service/Logger.php:13:7: MethodSignatureMismatch: Method OCA\Recognize\Service\Logger::log with return type '' is different to return type 'void' of inherited method Psr\Log\LoggerInterface::log (see https://psalm.dev/042)
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()) {
if (isset($this->cliOutput)) {
$this->cliOutput->writeln($message);

Check failure on line 36 in lib/Service/Logger.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

PossiblyInvalidArgument

lib/Service/Logger.php:36:30: PossiblyInvalidArgument: Argument 1 of Symfony\Component\Console\Output\OutputInterface::writeln expects iterable<mixed, mixed>|string, but possibly different type Stringable|string provided (see https://psalm.dev/092)
}
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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(Stringable|string $level, $message, array $context = array()) {
if (isset($this->cliOutput)) {
$this->cliOutput->writeln($message);
}
Expand Down

0 comments on commit 8a6bab6

Please sign in to comment.