-
Notifications
You must be signed in to change notification settings - Fork 209
PHPC-1431, PHPC-1435: Fix Session::startTransaction() param and arginfo #1015
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The signature claims a default value of null
, so this makes sense. You could add a test to explicitly pass null
to the method, but it's also fine without one.
I checked if we had any other phpt tests for passing Side note: the |
Note to self: reference PHPC-1435 in second commit before merging. |
After double-checking, I should've seen that. I checked the |
e875ea7
to
0a86456
Compare
@jmikola I've taken the liberty of amending your commit message and fixing the failing test. Since the behaviour will be different on PHP 5 and PHP 7, I've split the test. |
98bab6c
to
c139797
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appear to be unable to approve my own pull request, but LGTM just the same.
===DONE=== | ||
<?php exit(0); ?> | ||
--EXPECTF-- | ||
OK: Got TypeError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it very interesting that the arg info is what actually changed behavior here. This suggests that PHP might raise the TypeError before the method is even called (perhaps similar to how type hints would be checked in userland code).
PHP 7.x apparently used to emit a warning just like PHP 5 in the original version of session-startTransaction_error-003.phpt
, and I expect that probably originated in the zend_parse_parameters()
call. Perhaps @sgolemon can confirm if this is an accurate assessment.
if ($e === null) { | ||
echo "FAILED: Expected $exceptionname thrown, but no exception thrown!\n"; | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I get a "what what" for object calisthenics 🙌
https://jira.mongodb.org/browse/PHPC-1431
https://jira.mongodb.org/browse/PHPC-1435