Closed bwaidelich closed 3 months ago
@SimonFrings you got me
In my opinion, PHPStan will be an important topic
=> #195
I was about to do this same PR: the documented returned class does not exist.
FYI: I'm in the process of cleaning up my pending PRs. I'll go ahead and close this one in the next couple of days if there is no more feedback
Hey @bwaidelich, thanks for bringing this up 👍
Actually an interesting one. We would normally check these types by running our test suite with an static analysis tool like PHPStan, similar to reactphp/promise#246, reactphp/async#77 and others.
In my opinion, PHPStan will be an important topic once we're looking into a major version bump where we remove support for part of the legacy PHP versions (like we're currently doing with ReactPHP v3, see https://github.com/orgs/reactphp/discussions/481) We're still supporting legacy PHP versions (< PHP 7.1) in this project, so we have to resort to type definitions in docblocks instead of using native PHP types for now and thus need some workarounds for old PHP.
Reviewing your description, I think your changes are an improvement to this project and this is why I'd approve this pull request. I would really like to see some tests for this, but like I said above, I'm not sure if this is something to look into right now or a topic for another day 👍
Interested in what @WyriHaximus and @clue think about this.
+9001, PHPStan is already helping our packages a lot. It is only natural we expand that effort beyond to our non-core packages once v3 is out.
FYI: I'm in the process of cleaning up my pending PRs. I'll go ahead and close this one in the next couple of days if there is no more feedback
@bwaidelich I'll ping @clue, this should be ready to merge at this point
Adds a missing
use
statement for thePromiseInterface
type toMysqlClient
. Without that change, using the API leads to type warnings: