Skip to content

Prove error if "op" is boolean true #62

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

Closed
wants to merge 1 commit into from

Conversation

outdooracorn
Copy link
Contributor

The Postpone exception throwing commit reverts a fix from #60.

If the "op" field is boolean true, it is interpreted as an "add" operation instead of throwing an exception. This is due to true always matching the first switch case (Add::OP)

My bad for not covering it in a test!

This draft PR is to demonstrate the issue. How would you like to fix it?

@vearutop
Copy link
Member

vearutop commented Nov 8, 2022

Oh, my bad, then I think it would be best to reapply your fix (move is_string check back to where it was, before the switch).

@vearutop
Copy link
Member

vearutop commented Nov 8, 2022

(With more focus on Go these days, I'm losing my grip on PHP quirks 😅)

@outdooracorn
Copy link
Contributor Author

No worries, happens to the best of us 😉

Closing this draft in preference of #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants