-
Notifications
You must be signed in to change notification settings - Fork 6
Description
I'm using PHPStan on my project as a static code analyzer. After the changes of #15, it is impossible for me to perform assertions on the context of log records without PHPStan complaining about accessing undefined keys.
self::assertSame($expectedFoo, $logger->records[0]['context']['foo']);Output:
Offset 'foo' does not exist on array{exception?: Throwable}.
According to PSR-3, the context array can contains virtually anything. The exception key is mentioned in the standard for storing logged exceptions, but the standard also says,
Implementors MUST still verify that the
'exception'key is actually anExceptionbefore using it as such, as it MAY contain anything.
Because of that, I'd like to propose that the type of the context is reverted to mixed[].
MidnightDesign
Metadata
Metadata
Assignees
Labels
No labels