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

Callback Validator Laravel Package

daverandom/callback-validator

Validate PHP callable signatures against a prototype with variance support. Build a CallbackType from an existing callable or define it manually, then test other callables for parameter/return compatibility (contra/covariance, nullability) and inspect mismatches via __toString().

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enables strict callback contract enforcement in plugin architectures and API integrations
  • Reduces runtime errors by validating user-provided callbacks against expected signatures
  • Provides a "buy" solution for specialized validation needs instead of custom implementation
  • Critical for roadmap items requiring type-safe event systems or hook-based extensions

When to Consider This Package

  • Adopt when building PHP 7+ libraries/frameworks requiring runtime callback signature validation
  • Ideal for systems where third-party callbacks must adhere to precise type contracts (e.g., event listeners, hooks)
  • Avoid if using static analysis tools alone (e.g., PHPStan), or when callback requirements are trivial/non-type-sensitive
  • Not suitable for projects without callback-based interfaces or those needing non-type-based validation logic

How to Pitch It (Stakeholders)

For executives: "Prevents costly production bugs by ensuring third-party callbacks conform to expected signatures, reducing support costs and improving system reliability. For engineering: integrates seamlessly via Composer with minimal performance overhead when cached, handles complex variance rules out-of-the-box, and eliminates manual signature validation logic—freeing teams to focus on core features."

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport