Skip to content

Commit

Permalink
Ad-Hoc: Fix PHPStan flagged issues
Browse files Browse the repository at this point in the history
These issues happened because the interface the log methods may not have type added. This addition is backwards compatible as it is contravarient with the `string|\Stringable` type dictated by the latest interface, while respecting the implicit `mixed` the lack of type of the interface in its lowest compatible version has.
  • Loading branch information
agustingomes committed Aug 25, 2024
1 parent e21d422 commit 0b09289
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Tools/Console/ConsoleLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function __construct(
*
* @param mixed[] $context
*/
public function log($level, $message, array $context = []): void
public function log($level, mixed $message, array $context = []): void
{
if (! isset($this->verbosityLevelMap[$level])) {
throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level));
Expand Down
2 changes: 1 addition & 1 deletion tests/Metadata/Storage/DebugLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class DebugLogger extends AbstractLogger
*
* @param mixed[] $context
*/
public function log($level, $message, array $context = []): void
public function log($level, mixed $message, array $context = []): void
{
$this->count++;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TestLogger extends AbstractLogger
*
* @param mixed[] $context
*/
public function log($level, $message, array $context = []): void
public function log($level, mixed $message, array $context = []): void
{
$this->logs[] = $this->interpolate($message, $context);
}
Expand Down

0 comments on commit 0b09289

Please sign in to comment.