Uh oh!
There was an error while loading. Please reload this page.
Add ext/mysqli stubs - #4913
Conversation
carusogabriel
commented
Nov 15, 2019
@tvlooy Thanks for your contribution man. Could you please rebase with |
Uh oh!
There was an error while loading. Please reload this page.
27d252d to
45e91ebCompareUh oh!
There was an error while loading. Please reload this page.
88073d9 to
f04f03aCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
kocsismate
left a comment
There was a problem hiding this comment.
@tvlooy I could only review very few functions/methods.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
these are not nullable parameters (there is no ! in the ZPP). That said, the $name parameter's default value should be UNKNOWN AFAIK.
There was a problem hiding this comment.
how can I know that it should be UNKNOWN?
There was a problem hiding this comment.
There is some information written about it by Nikita: https://externals.io/message/106522 (the whole thread is interesting, but you should search for "UNKNOWN"). :)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
kocsismate
commented
Dec 20, 2019
@tvlooy Do you plan to continue working on these stubs in the foreseeable future? If so, I'll try to help you by reviewing the code, otherwise I can also continue it. |
I changed the docblocks like you asked. I rebased and sqashed commits. Tests still pass. I might have underestimated this a bit. I have trouble figuring out the return types and need help with it. Maybe it is better if I hand it over to you. |
@tvlooy You feel right, the return types are usually (much) more difficult to find out than parameter types. What you have to look for in most cases is There are lots of functions in mysqli, so I can understand that you feel it's too much. I'd suggest you to make smaller changes next time (by splitting the work) so it's easier for you when you try to learn how all these things work, and it's easier for the reviewers as well. 😎 My plan is to first work on the SPL (probably after the holidays) so that you have some extra time to decide if you want to proceed with the work. |
tvlooy
commented
Dec 23, 2019
Okay. Then I will do a full review this week. |
There was a problem hiding this comment.
@kocsismate I'm curious how the return_value actually works. ps: I'm reviewing but not done yet. Learning a lot. Thank you for your patience 😊
cmb69
commented
Jan 3, 2020
kocsismate
commented
Jan 3, 2020
@tvlooy Take your time, I have plenty other stuffs to do :) You could have a look at this too https://github.com/php/php-src/blob/master/docs/parameter-parsing-api.md (if you haven't seen it yet), it also helped me a lot. |
nikic
commented
Feb 13, 2020
For now, bool. We currently don't support
In principle yes, but there's backwards compatibility considerations, so if we do this, it should be as a separate change. |
kocsismate
commented
Feb 13, 2020
By default, the return value is |
tvlooy
commented
Feb 13, 2020
I will change the signature for character_set_name() and also for get_client_info(), get_server_info() which seems to have the same case |
nikic
commented
Feb 15, 2020
What's the state of this PR, is it ready for review? |
@nikic@kocsismate the PR is updated and ready for review. |
kocsismate
left a comment
There was a problem hiding this comment.
Really nice job! I could only find a few issues so far (I reached to mysqli_warning).
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
it's invalid PHPDoc (+ there is no parameter added in the param list), but as no exception is thrown in case a wrong object is provided, you should fallback to the object type declaration
There was a problem hiding this comment.
Fixed docblock but didn't change method signature (things break if I do). What should be in the signature?
Uh oh!
There was an error while loading. Please reload this page.
nikic
commented
Feb 18, 2020
FYI I killed the mysqli reflection tests in 541f8b7. They are useless and just cause extra work. |
There was a problem hiding this comment.
what kind of errors are thrown when you add the parameters in the definition? 🤔
There was a problem hiding this comment.
changed and it works with object for mysqli_result::__construct and mysqli_warning::__construct()
There was a problem hiding this comment.
I get a "Fatal error: Arginfo / zpp mismatch during call of mysqli_stmt::__construct() in Unknown on line 0" when I change the signature to (object $mysqli_link, string $statement)
Uh oh!
There was an error while loading. Please reload this page.
tvlooy
commented
Feb 19, 2020
rebased. Thanks for zapping the files |
kocsismate
left a comment
There was a problem hiding this comment.
That's all the issues I could find. Mostly just a category issue with nullable return types. Huge work, @tvlooy!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
tvlooy
commented
Feb 22, 2020
I should have spotted those return types. Thanks for the review! |
@tvlooy There is one failing test left related to |
tvlooy
commented
Feb 22, 2020
Fixed! And rebased |
The PR looks good to me but I think Nikita should have a look at it too before merging. :) |
nikic
commented
Feb 25, 2020
I didn't comprehensively review this again, just added the missing Thanks for your work on this! |
No description provided.