Skip to content
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

PHPLIB-951: Assert operation before argument validation #999

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Nov 1, 2022

https://jira.mongodb.org/browse/PHPLIB-951

This prevents a potential PHP warning for accessing a nonexistent array key if the operation doesn't exist, which was responsible for some Astrolabe test failures.

Since assertArgumentsBySchema() is called before the switch statement in Operation execute methods, we don't yet know that the operation exists. With this change, we should never hit default cases in those switch statements; however, they can remain in place for now.

Patch build for drivers-atlas-testing using this PR branch.

This prevents a potential PHP warning for accessing a nonexistent array key if the operation doesn't exist, which was responsible for some Astrolabe test failures.

Since assertArgumentsBySchema() is called before the switch statement in Operation execute methods, we don't yet know that the operation exists. With this change, we should never hit default cases in those switch statements; however, they can remain in place for now.
@jmikola jmikola merged commit a7b1567 into mongodb:master Nov 1, 2022
@jmikola jmikola deleted the phplib-951 branch November 1, 2022 13:55
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.

None yet

1 participant