reactphp / promise

Promises/A implementation for PHP.
https://reactphp.org/promise/
MIT License
2.38k stars 146 forks source link

[3.x] Add PHPStan to test environment with `max` level #246

Closed clue closed 1 year ago

clue commented 1 year ago

This changeset adds PHPStan on max level to the test environment for all supported PHP versions. Unlike previous attempts, it runs the maximum level supported with all errors addressed without having to resort to a baseline. The changeset size seems reasonable and this does not other affect our public API, so this should be safe to apply.

If this PR is merged, we could backport most of the changes from v3 to v2 and v1. The changes are somewhat similar across all versions, but v2 and v1 still supports legacy PHP, so we would have to resort to type definitions in docblocks instead of native PHP types. Let's continue this discussion outside of this PR.

Builds on top of https://github.com/clue/framework-x/pull/200, https://github.com/clue/framework-x/pull/201, https://github.com/clue/framework-x/pull/221, https://github.com/reactphp/async/pull/76 and https://github.com/reactphp/async/pull/77 See also https://github.com/orgs/reactphp/discussions/469

WyriHaximus commented 1 year ago

@clue Awesome! Will get the 3.x PR with template types ready :+1: