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
Proposal of return types for Result
interface
#6287
base: 4.1.x
Are you sure you want to change the base?
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.
@devnix one thing I realized here: you may get resource objects, in case of LOBs? 🤔
That said, this is a good move forward, and the time is good to introduce it now (rather than when the major release is finalized)
(╯°□°)╯︵ ┻━┻ |
2b442be
to
af7fd28
Compare
I'm not sure, I want to make any guarantees on possible data types returned by our drivers or middleware, tbh. Database-related PHP extensions have a history of getting more type-aware release after release. And if someone decided to write a piece of middleware that let's say decodes JSON on the fly, why should we forbid that?
I like the proposed |
I've added another Now I can take a look at each implementation. In the cases where the types are not guaranteed but we assume that they are correct, should we force the type with |
If rearranging code without runtime impact (!) makes the static analysis happy, let's do that. Otherwise annotations are fine. |
c02a487
to
bb192ab
Compare
I think these changes are correct, if there is any other API I can improve in this PR let me know! I observed some |
Not sure what's up with those |
….Commenting.InlineDocCommentDeclaration` rule
Little ping here @derrabus, I think all the requested changes are done, if you want to approve the workflows 😃 |
🫡 |
Summary
Taking advantage that the next major version is very near, I thought this could be a good addition (maybe a little too late but I just realized about this part of the API.
This draft contains modifications only on the interface just to get your feedback about the correctness of the types, and if it could be a nice addition for 4.0. Also, there could be a couple more of places that could be better typed, WDYT?