Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Simple Php Doc Parser Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature prioritization for developer-tooling bets. Docblock parsing underpins features like auto-generated API docs, custom lint rules, automated refactors, and annotation-driven configuration. If your roadmap includes any of these, this package is a low-cost way to ship the parsing layer without owning a parser.
  • Build vs. buy on parsing infrastructure. The alternative is writing a docblock tokenizer in-house or adopting the heavier 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.
  • Scope decisions inside static analysis / codegen tooling. Teams building Rector-style refactorers, migration codemods, or internal code generators must decide how much type information they extract from comments vs. inferred types. This package commits you to the docblock-as-source-of-truth approach — a decision that affects accuracy, edge cases, and how much you lean on comments in your codebase.
  • Tooling investment for platform/DevEx teams. A concrete input to decisions like "do we invest in a homegrown annotation reader, or standardize on the PHPStan ecosystem?" Adopting this nudges you toward PHPStan-compatible semantics, which has downstream implications for tooling coherence.
  • Use cases it directly unlocks: extracting @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.

When to Consider This Package

Adopt when:

  • You need practical, simple docblock extraction — types, tags, annotations — and do not need a full PHP AST or deep semantic analysis.
  • You are already in the PHPStan ecosystem (or willing to be), so the underlying phpstan/phpdoc-parser semantics match your other tooling.
  • You are prototyping internal tooling, a CLI, or a CI check and want to skip boilerplate around parser setup and node traversal.
  • The team is small and the parsing concern is peripheral; a thin wrapper beats maintaining a bespoke parser.

Look elsewhere when:

  • You need production-grade, long-lived infrastructure. The zero dependent count and thin-wrapper nature mean you should treat this as a convenience dependency, not a platform commitment — and be prepared to vendor or replace it. In that case, depend on phpstan/phpdoc-parser directly.
  • Your requirement is full static analysis, type inference, or cross-file resolution — use PHPStan (or Psalm) as the engine instead of a parser wrapper.
  • You only need runtime annotation reading from classes/attributes — reflection and PHP 8 attributes are the better fit; docblock parsing adds fragility.
  • You are evaluating for a regulated/high-assurance product where a single-maintainer dependency with no downstream adoption is a supply-chain or bus-factor risk.

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.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons