dave-liddament/phpstan-rule-test-helper
A lightweight test helper for PHPStan custom rules. It provides utilities to run rules against sample code and assert expected errors, reducing boilerplate when validating your static analysis extensions.
ShouldQueue," "no env() outside config"), this package directly affects the cost side of that equation. Writing a rule is the easy half; keeping it correct as the codebase evolves is the expensive half, and rule tests are what make a rule library sustainable rather than a source of false positives that engineers learn to ignore.@phpstan-ignore'd into oblivion.Adopt it only if all of the following hold:
RuleTestCase plus inline container setup is a few dozen lines you can write once and copy.Look elsewhere — or simply vendor the code — if:
tests/Support directory, and carry zero supply-chain or abandonment risk.RuleTestCase is inherently coupled to PHPStan internals; a low-traffic package is unlikely to keep pace as promptly as your PHPStan upgrade cadence requires.To executives (one paragraph): This is a small, free, MIT-licensed utility for testing the custom static-analysis rules we write ourselves. It doesn't touch the product or the customer experience; it reduces the engineering cost of enforcing our own code conventions automatically. It is not a strategic dependency, and the sensible default is to copy its few dozen lines of logic into our own test suite rather than take it on as a third-party package — we get the same productivity benefit with no maintenance or supply-chain exposure. Recommend: no formal adoption; treat it as reference material if we build out a custom rule library.
To engineering leadership: The real decision isn't this package, it's whether we're going to maintain a set of homegrown PHPStan rules. If yes, rule tests are non-negotiable and this helper removes friction — but it's a one-maintainer, near-zero-adoption wrapper over PHPStan's RuleTestCase. Either accept it as a low-stakes dev dependency with an owner, or vendor it and move on. If no, close the ticket.
To the engineering team: Useful if you're already fighting PHPStan's rule-testing boilerplate. Read the source first — it's small — and decide whether a dependency or a local copy is the better trade. Don't let it become an implicit commitment to building a rule library nobody has agreed to staff.
How can I help you explore Laravel packages today?