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

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.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
adachsoft/php-code-style