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

Generator Laravel Package

php-stubs/generator

Generate PHP stub files from your codebase for better IDE autocomplete, static analysis, and documentation. php-stubs/generator scans sources and produces lightweight stubs suitable for packages and frameworks, helping consumers get accurate type hints without shipping full sources.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Developer-experience roadmap: Decide whether to invest in reducing friction for Laravel/PHP teams working in legacy modules, internal packages, or vendor libraries that lack reliable type information and IDE completion.
  • Static-analysis coverage: Use generated stubs to expand PHPStan/Psalm coverage into code that mixes declarations with side effects, without rewriting production code first.
  • Build vs. buy: Favor adopting this MIT-licensed Composer package over building a custom stub generator, provided a short pilot validates accuracy and CI fit. Treat it as a small tooling dependency, not a strategic platform bet.
  • Refactor sequencing: Generate stubs for older Laravel code or third-party SDKs before a typing/migration effort, so teams can measure static-analysis errors and IDE gaps earlier.
  • Use cases:
    • Internal PHP packages with weak PHPDoc or missing return types.
    • Vendor libraries that degrade IDE autocomplete or PHPStan results.
    • Legacy Laravel modules where full typing is not immediately feasible.
    • CI-generated stub artifacts used only by static analysis and IDE tooling.
  • Adoption caution: With 83 stars and 0 listed dependents, adoption evidence is limited. PM should fund a bounded pilot, pin versions, and define an exit/fork plan rather than standardizing org-wide immediately.

When to Consider This Package

  • Consider adoption if:
    • The team is on PHP 7.4+ and uses Composer, an IDE with stub support, and PHPStan/Psalm or similar static analysis.
    • The main pain is legacy or third-party PHP code that lacks type information, not Laravel framework magic itself.
    • Engineering can own stub generation in CI, decide whether stubs are committed or cached, and regenerate when source code changes.
    • The organization values low-cost, MIT-licensed tooling and can tolerate a small, community-maintained dependency.
  • Look elsewhere or defer if:
    • The codebase is already well typed and static analysis is clean; the value may be too small to justify another tool.
    • The need is Laravel-specific facade, model, or container metadata; Laravel IDE Helper or existing framework stubs may be a better fit.
    • The team expects commercial support, SLAs, or strong production-adoption signals; this package does not provide that.
    • Dynamic behavior such as facades, magic methods, or runtime-generated classes is the core problem; generated stubs cannot infer everything.
    • There is no static-analysis or IDE-tooling culture to consume the stubs.

How to Pitch It (Stakeholders)

For executives: This is a low-cost, MIT-licensed developer-productivity tool, not a customer-facing feature. It can reduce manual stub work and improve IDE/static-analysis coverage for legacy or vendor PHP code, with no runtime performance impact. Because adoption signals are limited, propose a small pilot on one Laravel module and measure PHPStan/Psalm error reduction, IDE completion coverage, and onboarding friction before broader rollout.

For engineering: The package generates stub declarations from existing PHP code via CLI or PHP API, supports output files and symbol-type filtering, and can feed PHPStan, Psalm, and IDE completion. Integrate it into CI for targeted legacy/vendor directories, pin the version, define regeneration ownership, and validate generated stubs with tests. Use Laravel IDE Helper or manual stubs where framework magic is the gap; use this generator where the gap is missing declarations in ordinary PHP code.

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.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log