phpstan/phpstan-php-parser
PHPStan extension for nikic/php-parser that adds precise type inference for AST nodes and visitors, improving static analysis of code that parses, traverses, or manipulates PHP source.
nikic/php-parser (codemods, migration scripts, custom lint rules, refactoring bots, static-analysis extensions). If that work is on the roadmap, it supports a decision to invest in typed, CI-checked AST tooling instead of untyped one-off scripts.Node, NodeVisitor, and NodeTraverser objects — a class of bugs that unit tests routinely miss.Consider it only when all of the following hold:
phpstan/phpstan and nikic/php-parser, and the team wants static analysis to cover its AST-manipulating code.Look elsewhere when:
For executives: This is a small, free developer-productivity add-on for static analysis of internal PHP tooling. It carries no license cost and no customer-facing impact. Its weakness is stewardship — it is archived and effectively frozen — so treat any use as an internal maintenance commitment, not a vendor dependency. Recommended position: do not add it to the roadmap as an initiative; let engineering decide at the team level, with a named owner if it stays.
For engineering: Treat this as a dev-only dependency with an expiration date. If it is already in the lockfile and CI is green, leave it and pin the version. Do not introduce it into new projects. Before the next PHPStan or PHP major upgrade, run a short spike to replace it with either built-in stubs or ~a day of in-repo type declarations. Do not let it become load-bearing without an owner, and do not count on upstream fixes — there is no active maintainer.
How can I help you explore Laravel packages today?