phpstan/phpdoc-parser
PHPDoc Parser for PHPStan that parses, represents, and modifies PHPDoc blocks as an AST. Supports rich type syntax (unions, generics, shapes, callables, conditional types), constant expressions, and Doctrine annotations, with full API reference for nodes.
@param extraction) without AST manipulation needs, or if you require non-PHPDoc annotation systems (e.g., JSDoc for JavaScript projects).Executives: "This is the industry-standard PHPDoc parser used by PHPStan—the most widely adopted static analysis tool in PHP. It eliminates months of engineering effort to build a custom parser from scratch, while ensuring compatibility with modern PHP features like generics and Doctrine annotations. By leveraging this proven solution, we can rapidly deliver high-value code quality and documentation features that improve developer productivity and reduce technical debt, all with minimal maintenance overhead."
Engineering: "It provides a robust AST-based parser with format-preserving printing, handling complex PHPDoc scenarios (e.g., generics, intersection types, Doctrine annotations) out of the box. The API is well-documented, actively maintained, and battle-tested in production by PHPStan. Integrating it gives us a reliable foundation for building code analysis tools without reinventing low-level parsing logic—freeing
How can I help you explore Laravel packages today?