symplify/simple-php-doc-parser
Simple PHP Doc Parser by Symplify is a lightweight library for reading PHP docblocks. It extracts comments, tags, and annotations from classes, methods, and properties through a simple API, making PHPDoc data easy to use in static analysis, code generation, and documentation tools.
phpstan/phpdoc-parser directly. This package is effectively a "buy-lite" choice: a thin, purpose-built service layer that trades flexibility for time-to-first-value. That is a legitimate strategic trade when parsing is incidental to your product rather than the product itself.@param/@return/@var for doc generation, enforcing annotation standards in CI, building annotation-driven registries or routing, and bridging legacy docblock-typed code into modern typed systems.Adopt when:
phpstan/phpdoc-parser semantics match your other tooling.Look elsewhere when:
phpstan/phpdoc-parser directly.Maturity caveat to surface in the decision: low adopters and minimal scoring signal mean you inherit maintenance risk. Budget for a fallback path (direct use of the upstream parser) before committing broadly.
For executives: This is a small, low-cost utility that lets us build developer-productivity and code-automation features faster by reusing a battle-tested parser underneath. It is not a platform bet — the strategic commitment is minimal, and the underlying parser is the same one powering the widely used PHPStan ecosystem. Expected upside is faster delivery of internal tooling; downside is bounded and replaceable.
For engineering: It is a service integration over phpstan/phpdoc-parser that removes setup and traversal boilerplate for common docblock tasks — extracting types, tags, and annotations — with a simple API designed for practical use rather than completeness. It is the right call when docblock parsing is a means to an end; it is the wrong call when parsing is core, where you should target the upstream parser or a full static-analysis engine directly. Because the package is a thin wrapper with little downstream adoption, treat it as a convenience layer: encapsulate it behind an internal interface so we can swap to the upstream parser without touching call sites.
How can I help you explore Laravel packages today?