-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix return type JsonFormatter::normalizeException()
#1924
Conversation
See the build failure. It is done like that to allow the child class (LineFormatter) to override this. It's very difficult to have strict types for NormalizerFormatter as it is extended for various different use cases. |
normalizeException
JsonFormatter::normalizeException()
@@ -216,7 +216,7 @@ protected function normalize(mixed $data, int $depth = 0): mixed | |||
* Normalizes given exception with or without its own stack trace based on | |||
* `includeStacktraces` property. | |||
* | |||
* @return array<string, string|int|array<string|int|array<string>>>|string | |||
* @return array<array-key, string|int|array<string|int|array<string>>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keys might be non-string when max depth exceeds, and maybe in case of JsonSerializable
@Seldaek got ya. updated. |
Sorry not sure what you updated? :) Still failing |
yeah ok. i dont feel like doing the phpstan bookkeeping. sorry. we've casted |
Yeah that's fine by me.. I don't know which is best here tbh, we gotta ignore some errors somewhere, but maybe for lib consumers it would be better if we did it like you had and ignore the JsonFormatter extension error. But I guess your |
psalm describes it as
so yes just a union in practice |
OK I think this works e940004 |
I dont see how
normalizeException
can return a string.