Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"psr/http-message": "^1.0",
"psr/http-server-handler": "^1.0",
"psr/http-server-middleware": "^1.0",
"psr/log": "^1.1"
"psr/log": "^1.1 || ^3.0"
Comment thread
tsoslow marked this conversation as resolved.
Outdated
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/StderrLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct(string $minLevel = LogLevel::WARNING, $stream = 'php
}
}

public function log($level, $message, array $context = [])
public function log($level, $message, array $context = []): void
{
if (!isset(self::LOG_LEVEL_MAP[$level])) {
throw new InvalidArgumentException("Invalid log level: {$level}");
Comment thread
tsoslow marked this conversation as resolved.
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/IntegTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected function createHttpServer(ServerRequestInterface $request): HttpServer

protected function failOnLoggedErrors(): void
{
$this->logger->method('error')->willReturnCallback(function (string $message, array $context) {
$this->logger->method('error')->willReturnCallback(function ($message, array $context) {
Comment thread
tsoslow marked this conversation as resolved.
Outdated
$message = "Logged an error: {$message}\nContext:\n";
foreach ($context as $key => $value) {
$message .= "- {$key}: {$value}\n";
Expand Down
Loading