Handle variadic and not declared arguments in stack traces #1650
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 frommixed[]
toarray<array-key, mixed>
but it didn't help. Do you have an idea what could be causing this?