sentry-php
sentry-php copied to clipboard
Handle variadic and not declared arguments in stack traces
This pull request fixes #1645.
Short summary: SDK wasn't sending some function arguments to Sentry, namely default, variadic, not declared arguments and arguments with value null
. This pull request reworks function responsible for handling parameters in order to send all of the above.
I tested my changes with all inputs variations I could think of, it seems to be working. However, I don't quite understand how to add tests for it. Testing this method requires using stack trace with real function or real class and method. Where do I create them? Current FrameBuilder
tests don't do anything similar, so I'm not sure what would be the right way to do it.
Also, PHPStan gives me Unreachable statement - code above always terminates.
error on lines 254 and 267. Those statements are definitely reachable, and I confirmed it with manual testing. I tried changing method parameter from mixed[]
to array<array-key, mixed>
but it didn't help. Do you have an idea what could be causing this?