Skip to content

Commit eb36b26

Browse files
committed
[Server] Make CollectingLogger test fixture compatible with psr/log v1
The anonymous logger in StreamableHttpTransportTest used the v2/v3 method signature `log($level, \Stringable|string $message, ...)`. Project composer.json allows psr/log ^1.0 || ^2.0 || ^3.0, so on `--prefer-lowest` CI installs v1 which keeps the untyped parameter and fatals on LSP incompatibility. Drop the type hint to keep the fixture working across all three major versions.
1 parent 3a40738 commit eb36b26

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/Unit/Server/Transport/StreamableHttpTransportTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ private function collectingLogger(): object
285285
/** @var list<array{level: string, message: string}> */
286286
public array $records = [];
287287

288-
public function log($level, \Stringable|string $message, array $context = []): void
288+
// Signature kept untyped on $message to stay compatible with psr/log v1 LoggerInterface.
289+
public function log($level, $message, array $context = []): void
289290
{
290291
$this->records[] = ['level' => (string) $level, 'message' => (string) $message];
291292
}

0 commit comments

Comments
 (0)