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

Technical Evaluation

Architecture fit. symplify/simple-php-doc-parser is a thin service wrapper around phpstan/phpdoc-parser, the AST-based docblock parser maintained by PHPStan. It exposes a SimplePhpDocParser with convenience methods that return parsed docblock nodes, sparing callers from wiring up lexers, token iterators, and PhpDocParser configuration themselves. For a Laravel application, the package is framework-agnostic and has no Laravel-specific coupling — it is a plain PHP library that can be resolved from the container. Architecturally, it fits only where you actually need structured PHPDoc introspection: code generation, static analysis tooling, annotation-driven metadata, IDE-helper artifact generation, or tooling that maps docblocks to runtime/discovery metadata. It does not belong in request-path business logic.

Integration feasibility. High mechanically: composer require symplify/simple-php-doc-parser, bind SimplePhpDocParser as a singleton in a service provider, inject where needed. No configuration files, no publishable assets, no service provider shipped by the package. The real friction is version alignment: the wrapper pins a compatible range of phpstan/phpdoc-parser, and you may already have phpstan/phpdoc-parser (directly or transitively via PHPStan, Rector, Larastan, or Psalm bridges) at a version the wrapper does not accept. That is the most likely integration blocker and should be validated with composer why phpstan/phpdoc-parser before committing.

Technical risk.

  • Maintenance posture (high). The Symplify ecosystem has been progressively deprecated as its author consolidated effort into Rector and related tooling. A zero-score/zero-dependent listing is consistent with a low-traffic or archived package. Do not assume ongoing releases, PHP-version bumps, or security review.
  • Thin value layer (medium). The wrapper adds ergonomics, not capability. If it becomes unusable, the fallback — constructing Lexer + PhpDocParser + ConstExprParser + TypeParser directly — is roughly 30–50 lines. Migration cost is low, which cuts both ways: low switching cost for you, but also low defensibility for the package.
  • Upstream coupling (medium). Behavior and node API are dictated by phpstan/phpdoc-parser; a major upstream bump (v1 → v2 changed constructor signatures and node handling) can strand the wrapper.
  • Parsing correctness (low, inherited). The underlying parser is battle-tested in production static analysis; correctness risk sits with your usage, not the library.

Key questions.

  1. Is the repository archived or explicitly deprecated? Check the README banner and last commit date before adoption.
  2. What phpstan/phpdoc-parser constraint does the wrapper declare, and does it intersect with versions already in the lockfile?
  3. Do we need the wrapper's conveniences at all, or should we depend on phpstan/phpdoc-parser directly and own a small internal adapter?
  4. Which concrete feature requires docblock parsing — and is there a non-parsing alternative (attributes, config, reflection) that avoids the dependency entirely?
  5. Who owns the fork-and-patch burden if upstream goes quiet?

Integration Approach

Stack fit. Clean. No Laravel version constraints, no facade or config expectations, PSR-4 autoloading only. Works identically on Laravel 9–12 and on PHP 8.1+ assuming composer resolution succeeds. It is tooling-adjacent rather than application-runtime, so it should sit in require-dev unless a production feature genuinely parses docblocks at runtime.

Migration path. Two viable routes:

  • Direct adoption — install as-is, bind the parser, use it. Fastest path; accept the maintenance risk explicitly and pin the version.
  • Adapter-first (recommended) — define a narrow internal interface (e.g. DocBlockReader with properties(), methods(), tags()), implement it with the wrapper today, and keep the implementation behind the container binding. Swapping to raw phpstan/phpdoc-parser or a future fork then becomes a one-class change.

If adoption is exploratory, installing into require-dev and prototyping inside a single Artisan command is a cheap way to validate the value before formalizing.

Compatibility. Verify against the existing lockfile first: composer require symplify/simple-php-doc-parser --dry-run. Watch for conflicts with Larastan/PHPStan (which ships phpstan/phpdoc-parser), Rector, and any Psalm bridge. Because the wrapper is not on a fast release cadence, expect its upstream constraint to lag; if the project already runs a recent phpstan/phpdoc-parser, resolution may fail outright.

Sequencing.

  1. Confirm the package is not archived; capture last-release date and open-issue count as an adoption record.
  2. Dry-run composer resolution against the current lockfile.
  3. Build one vertical slice — a single Artisan command or codegen step — to prove the API is sufficient.
  4. Introduce the internal interface immediately, before a second consumer appears.
  5. Add a Composer constraint pin (exact minor) and a CI job that flags when the pinned version falls more than one minor behind upstream.

Operational Impact

Maintenance. Low ongoing effort from you, but effectively zero upstream maintenance. Treat the dependency as frozen: no automatic composer update for this package, Dependabot/Renovate configured for notification-only, and a documented decision record noting the deprecation risk. The internal adapter is the real maintenance asset; the package is a disposable implementation detail.

Support. No vendor support, no SLA, community-only via GitHub issues on a low-traffic repository. Internal support means one or two engineers who understand PHPDoc ASTs. Budget for that as a knowledge silo and document the parsing entry points.

Scaling. Negligible runtime footprint — parsing is CPU-bound, in-memory, and microseconds-to-low-milliseconds per docblock. It does not scale with request volume in any meaningful way. It scales with file count: if you parse every class in the codebase on each invocation, cache results (Laravel cache or a build artifact) keyed by file path plus mtime. Never parse inside a request handler without caching.

Failure modes.

  • Composer resolution failure on PHP or phpstan/phpdoc-parser upgrade — blocks the whole dependency graph, not just the feature. Highest-probability failure.
  • Silent parse degradation — malformed or unconventional docblocks yield partial or empty node trees rather than exceptions. Callers must handle "no tags found" explicitly rather than assuming structure.
  • Upstream API drift — if a transitive dependency bumps phpstan/phpdoc-parser past the wrapper's constraint, behavior changes may surface as confusing downstream errors.
  • Abandonment — no PHP-version compatibility updates; eventually the package becomes uninstallable on a future PHP release, forcing the adapter swap on someone else's schedule.
  • Autoload/opcache interaction — minor; only relevant if parsing is added to a boot path.

Ramp-up. Low for anyone familiar with PHPStan-style tooling; ~half a day for a mid-level engineer to learn the node types (PhpDocTagNode, PropertyTagValueNode, MethodTagValueNode) and the AttributeAware gotchas. Non-trivial for engineers unfamiliar with AST traversal — the API returns node objects, not arrays, and requires recursive descent. Allocate a short internal write-up covering the internal interface, supported tag subset, and the "empty result means unsupported syntax, not an error" contract.

Bottom line. Adopt only as a dev-time or tooling dependency, behind an internal interface, version-pinned, with an explicit plan to replace it with direct phpstan/phpdoc-parser usage. The underlying parser is excellent; the wrapper is a convenience with no maintenance guarantee and should not be load-bearing.

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.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route