Repository navigation
How is parity with PHPStan achieved? #379
Replies: 1 comment 1 reply
|
Hey, thanks for opening the discussion and for your excellent questions. You're right to ask about this. To clarify, while we test against both tools, our primary goal isn't to be a 1-to-1 match with PHPStan. Mago initially started as a reimplementation of Psalm, and while it has diverged in many ways, we still aim to detect every single error that Psalm/**PHPStan **can, and even more. You can see the strong similarity in our issue code list here: mago/crates/analyzer/src/code.rs Lines 3 to 246 in 0d0686a For example, the Regarding testing, you're correct that there isn't an automated test suite for this yet. Our current process involves manual testing: nearly all of our analyzer test cases have also been run against Psalm and PHPStan to ensure Mago reports equivalent issues when they are found by other tools. We know there are still some high-level checks that Mago is missing. Off the top of my head, one example is the signature comparison between a method and its parent's method when overriding. I don't have a concrete list of everything that's missing at the moment. I think your point is very valid—creating such a list would be incredibly helpful for us to track what's left and for potential users to understand the current coverage. I'll look into creating an issue or a tracking document for this. Thanks again for the valuable feedback! |
Uh oh!
There was an error while loading. Please reload this page.
Hey.
I've seen it being mentioned on Reddit that parity with PHPStan is "regularly tested". How exactly is that being done? I don't see any automatic tests for that in the codebase, but I might be missing something.
While I understand the difficulty of having such a test case (different style of error reporting, bugs in phpstan etc), having the PHPStan parity is what's necessary in order for bigger projects to consider migrating from PHPStan. The benefits are enormous (just the speed alone is insane, but having an LSP would be a game changer), but if we can't rely on it a 100%, it's not really useful.
It's also currently unknown how much of PHPStan parity is implemented - e.g. are 100% of PHPStan's features and rules supported? Is it less? How much less?
Thank you
All reactions