friends-of-reactphp / mysql

Async MySQL database client for ReactPHP.
MIT License
331 stars 66 forks source link

Add PHPStan to test environment with `max` level #195

Closed bwaidelich closed 4 months ago

bwaidelich commented 4 months ago

Obviously this won't run with PHP 5.6 like this (wow, you really want to support these ancient versions?!)

But even with PHP 8 PHPStan finds a lot of violations currently: https://github.com/friends-of-reactphp/mysql/actions/runs/8379359488/job/22946077184

bwaidelich commented 4 months ago

I gave this one a quick try, but I won't be able to solve the type issues in my free time. There are too many..

Feel free to pick up this PR, but I'll close it for now

SimonFrings commented 4 months ago

@bwaidelich Thanks for looking into this :+1:

Obviously this won't run with PHP 5.6 like this (wow, you really want to support these ancient versions?!)

Yeah, I agree with you that supporting these old PHP versions doesn't make much sense nowadays, especially when looking at the installations on Packagist for PHP < 7. We want to move away from these old versions, that's also why we're currently working on ReactPHP v3 and upgrading to a minimal support of PHP 7.1+.

I want the same for ReactPHP MySQL, but this project is currently in a v0.6.0 and there's no stable v1.0.0 yet. Not completely sure what we'll do here when ReactPHP v3 goes live, maybe we'll release a v1.0.0 with v3 compatibility first or instantly go to a v3.0.0 to create a consistency with the other ReactPHP components. Probably worth to discuss this in another ticket, so I think I'll open one in the upcoming days.

I gave this one a quick try, but I won't be able to solve the type issues in my free time. There are too many..

Understandable and I appreciate the time you already put into this! Getting PHPStan to also run with all the legacy versions makes this whole topic way more complicated. This is also one reason why we didn't backport the PHPStan addition in Promise to v2 and v1 and in Async to v2.

I'm 100% sure that we'll pick up the whole PHPStan topic when working on a v3 in here, so I'll start looking into our plans for this component with the other ReactPHP maintainers first and revisit this afterwards :rocket: