Closed iambrosi closed 2 years ago
Hi @iambrosi - thanks for the PR! We're looking to add a static analysis tool like psalm/phpstan to bugsnag-symfony
at some point in the future. We'll review this PR as part of that work when priorities allow 👍
@imjoehaines My apologies, I totally missed your comment. I used to have a use case where we needed to apply custom sanitization of the input data, like for example, cleanup parts of strings instead of full strings.
I made a refactor recently to this code, so instead of overriding getInput
, I registered a callback into the Bugsnag's client that cleanups the report metadata.
Goal
These fixes allow to prevent errors reported by static analysis tools like psalm or phpstan under certain conditions.
I have a use case where I need to extend the class SymfonyRequest, and override the method
getInput
, but psalm complains about the return type being incompatible withSymfony\Component\HttpFoundation\ParameterBag
from the parent method, even though this method returns an array.