Weave Code
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

Extension Method Stub Generator Laravel Package

berry/extension-method-stub-generator

Composer plugin that scans dependencies for berry-method-extensions.json and generates PHP stub files for Berry “extension methods”. Improves IDE autocomplete and supports static analysis (e.g., PHPStan) by exposing fluent methods via generated stubs.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Developer Experience (DX) & Tooling: Accelerates onboarding for PHP/Laravel developers by auto-generating IDE-compatible stubs for custom extension methods, reducing manual documentation and setup time.
  • Type Safety & Static Analysis: Enables seamless integration with PHPStan and IDEs (PhpStorm, VSCode) for Berry extension methods, improving code quality and reducing runtime errors.
  • Berry Ecosystem Adoption: Lowers friction for teams adopting Berry PHP packages (e.g., berry/htmx, berry/laravel) by automating stub generation, making it easier to extend core functionality.
  • Build vs. Buy: Avoids reinventing wheel for stub generation; leverages a composer plugin (low maintenance, open-source) instead of custom scripts or manual files.
  • Roadmap for PHP/Laravel Projects:
    • Phase 1: Pilot in internal tools or open-source projects using Berry extensions.
    • Phase 2: Scale to team-wide adoption if it reduces IDE/debugging overhead.
    • Phase 3: Extend to custom extension methods beyond Berry (if the plugin’s architecture allows).

When to Consider This Package

  • Use this if:

    • Your project uses Berry PHP packages (e.g., berry/htmx, berry/laravel) and developers struggle with IDE autocompletion or PHPStan errors for extension methods.
    • You prioritize developer velocity and want to eliminate manual stub file maintenance.
    • Your team already uses Composer and PHPStan/IDE tooling (PhpStorm, VSCode).
    • You’re building a Laravel or PHP project with heavy custom extension logic (e.g., domain-specific methods).
  • Look elsewhere if:

    • You’re not using Berry PHP packages (this is niche to their ecosystem).
    • Your team prefers manual stub files or has existing solutions (e.g., custom scripts, php-stub).
    • You need dynamic stub generation (e.g., based on runtime behavior) rather than static JSON definitions.
    • Your project lacks Composer or PHPStan/IDE integration (e.g., legacy systems).
    • You require high maturity (this package has 0 stars/dependents; evaluate risk tolerance).

How to Pitch It (Stakeholders)

For Executives/Product Leaders:

*"This is a low-risk, high-reward tool to supercharge our PHP/Laravel developers. By automating IDE stub generation for Berry extension methods, we can:

  • Cut debugging time by 20–30% (anecdotal from similar tools like php-stub).
  • Reduce onboarding friction for new hires working with Berry packages.
  • Improve code quality via PHPStan integration, catching issues early.
  • Leverage open-source (MIT license) with minimal maintenance overhead.

Ask: Should we pilot this in [Project X] to measure impact on developer productivity? Budget: ~$0 (open-source)."*


For Engineering/Tech Leads:

*"The Berry Extension Method Stub Generator is a Composer plugin that auto-generates IDE stubs (PhpStorm/VSCode) and PHPStan support for custom Berry extension methods. Here’s why it’s worth trying:

  • Zero setup: Just add the Composer plugin; it scans dependencies for berry-method-extensions.json and generates stubs.
  • Example: For berry/htmx, it auto-detects methods like hxGet() and provides type hints/docs, so IDEs recognize them as first-class methods.
  • Pros:
    • Saves hours of manual stub writing.
    • Works seamlessly with PHPStan (no more @method annotations).
    • Future-proof: Berry’s ecosystem is growing (e.g., Laravel integrations).
  • Cons:
    • Early-stage (0 stars, but MIT licensed and actively used in Berry repos).
    • Limited to Berry packages (not generic PHP extensions).
  • Proposal: Add to our Composer dev dependencies in [Project Y] and test with the Berry/Htmx package. If it works, we can expand to other Berry tools."

Key Metric to Track: "% reduction in IDE/PHPStan-related developer blockers."

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.
babenkoivan/elastic-client
innmind/static-analysis
innmind/coding-standard
datacore/hub-sdk
alengo/sulu-http-cache-bundle
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
imbo/imbo-coding-standard
visualbuilder/filament-lottie
servicioslineaonce/starter-kit
atomcoder/laravel-reorderable
irajul/filament-shadcn-theme
agtp/agtp-php
agtp/mod-php
centraldesktop/protobuf-php