sanmai / callable-reflection
ReflectionFunctionAbstract for any callable
Fund package maintenance!
1.0.1
2026-07-19 01:15 UTC
Requires
- php: ^8.2
Requires (Dev)
- ergebnis/composer-normalize: ^2.47
- friendsofphp/php-cs-fixer: ^3.84
- infection/infection: ^0.30.3 || ^0.32.0
- phpunit/phpunit: ^11
- sanmai/phpstan-rules: ^0.3.10
This package is auto-updated.
Last update: 2026-07-19 01:18:43 UTC
README
Get ReflectionFunctionAbstract for any callable.
Installation
composer require sanmai/callable-reflection
Usage
use CallableReflection\CallableReflection; $reflection = new CallableReflection(); $params = $reflection->reflect($callable)->getNumberOfParameters();
Works with closures, functions, methods, invokable objects, and first-class callables.
Unlike with ReflectionFunction(Closure::fromCallable($callable)), you can dependency-inject it.