Version 3.0 is a major step for this PHPStan extension: it goes well beyond flagging blocking calls and starts encoding how ReactPHP code is usually meant to be written.
The release adds a full set of event-loop rules that treat the loop as a global concern you reach through Loop::…, not something you inject, pass around, or keep on objects. PHPStan now nudges you toward static loop APIs, away from Loop::get() indirection and from calling methods on values typed as LoopInterface, and it catches promoted properties and traits that would hold a loop reference in your domain model. Together, those checks reflect the direction the ReactPHP ecosystem has been taking: fewer foot-guns around loop lifetime and clearer separation between application code and the runtime.
On the react/async side, 3.0 brings static analysis for fiber-style await usage. A parser visitor tracks which closures are wrapped in async, and a call-graph collector follows the stack when await might be reached indirectly. You get feedback when await appears outside an async closure, and when a plain closure can still reach await through callees—the cases that are easy to miss in review but painful at runtime.
Everything remains on by default, but you can tune the extension under parameters.wyrihaximus.reactphp.rules, so teams can adopt event-loop or async rules gradually or silence a category without dropping the whole package. Documentation and installation notes were refreshed (including the correct extension.neon include and guidance around PHPStan’s extension installer), and the project runs on current PHP and QA tooling so the new rules sit on a maintained foundation.
3.0.0
- Total issues resolved: 0
- Total pull requests resolved: 49
- Total contributors: 2
Bug 🐞
Configuration ⚙,Dependencies 📦
- 77: Update WyriHaximus/github-workflows action to v1.1.0 thanks to @renovate-runner[bot]
- 69: Update WyriHaximus/github-workflows action to v1.0.4 thanks to @renovate-runner[bot]
- 63: Update WyriHaximus/github-workflows action to v1.0.3 thanks to @renovate-runner[bot]
- 62: Pin WyriHaximus/github-workflows action to f7d123a - autoclosed thanks to @renovate-runner[bot]
- 60: Update QA Utilities thanks to @renovate-runner[bot]
- 43: Update QA Utilities thanks to @renovate-runner[bot]
- 33: Update dependency wyrihaximus/makefiles to ^0.7.10 thanks to @renovate-runner[bot]
Configuration ⚙
- 76: Improve readme thanks to @WyriHaximus
Configuration ⚙,Dependencies 📦,Enhancement ✨
Dependencies 📦
- 78: Update dependency wyrihaximus/makefiles to ^0.15.1 thanks to @renovate-runner[bot]
- 74: Async readme thanks to @WyriHaximus
- 67: Update dependency wyrihaximus/test-utilities to ^14.4.0 thanks to @renovate-runner[bot]
- 61: Update dependency wyrihaximus/test-utilities to v14 thanks to @renovate-runner[bot]
- 59: Update dependency wyrihaximus/test-utilities to ^13.5.1 thanks to @renovate-runner[bot]
- 58: Update dependency wyrihaximus/test-utilities to ^13.5.0 thanks to @renovate-runner[bot]
- 57: Update dependency wyrihaximus/makefiles to ^0.13.3 thanks to @renovate-runner[bot]
- 56: Update QA Utilities thanks to @renovate-runner[bot]
- 53: Update dependency wyrihaximus/makefiles to ^0.11.1 thanks to @renovate-runner[bot]
- 52: Update dependency wyrihaximus/test-utilities to ^13.1.0 thanks to @renovate-runner[bot]
- 51: Update dependency wyrihaximus/test-utilities to v13 thanks to @renovate-runner[bot]
- 50: Update dependency wyrihaximus/makefiles to ^0.10.6 thanks to @renovate-runner[bot]
- 49: Update dependency wyrihaximus/test-utilities to ^12.2.0 thanks to @renovate-runner[bot]
- 48: Update dependency wyrihaximus/makefiles to ^0.10.4 thanks to @renovate-runner[bot]
- 47: Update dependency wyrihaximus/test-utilities to ^12.1.0 thanks to @renovate-runner[bot]
- 46: Update dependency wyrihaximus/makefiles to ^0.10.3 thanks to @renovate-runner[bot]
- 45: Update dependency wyrihaximus/makefiles to ^0.10.2 thanks to @renovate-runner[bot]
- 44: Update dependency wyrihaximus/test-utilities to v12 thanks to @renovate-runner[bot]
- 40: Update dependency wyrihaximus/makefiles to ^0.7.16 - autoclosed thanks to @renovate-runner[bot]
- 39: Update dependency wyrihaximus/makefiles to ^0.7.15 thanks to @renovate-runner[bot]
- 38: Update dependency wyrihaximus/makefiles to ^0.7.14 - autoclosed thanks to @renovate-runner[bot]
- 37: Update dependency wyrihaximus/makefiles to ^0.7.13 - autoclosed thanks to @renovate-runner[bot]
- 36: Update dependency wyrihaximus/makefiles to ^0.7.12 thanks to @renovate-runner[bot]
- 35: Update dependency wyrihaximus/makefiles to ^0.7.11 thanks to @renovate-runner[bot]
- 34: Update dependency wyrihaximus/test-utilities to ^8.8.0 - autoclosed thanks to @renovate-runner[bot]
- 29: Update dependency wyrihaximus/test-utilities to ^8.5.0 thanks to @renovate-runner[bot]
- 28: Update dependency wyrihaximus/makefiles to ^0.7.5 thanks to @renovate-runner[bot]
- 27: PHP 8.4 + QA updates thanks to @WyriHaximus
- 24: Update dependency wyrihaximus/makefiles to ^0.5.0 - autoclosed thanks to @renovate-runner[bot]
- 22: Update dependency wyrihaximus/makefiles to ^0.5.0 - autoclosed thanks to @renovate-runner[bot]
Dependencies 📦,Feature 🏗
- 73: Async await reached without async thanks to @WyriHaximus
- 72: Async await without async thanks to @WyriHaximus
- 65: Only allow calls to
Loopto be proxy calls likeLoop::futureTick()thanks to @WyriHaximus
Enhancement ✨
Feature 🏗
- 75: Make all rules configurable thanks to @WyriHaximus
- 71: Add parser visitor to detect async-wrapped closures. thanks to @WyriHaximus
- 70: Disallow keeping the event loop around in your objects thanks to @WyriHaximus
- 68: Disallow injecting the event loop, only
Loop::calls are allowed thanks to @WyriHaximus - 66: Disallow calling any methods on an object implementing the LoopInterface thanks to @WyriHaximus