PHPackages                             sanmai/callable-reflection - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sanmai/callable-reflection

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sanmai/callable-reflection
==========================

ReflectionFunctionAbstract for any callable

1.0(9mo ago)10[3 PRs](https://github.com/sanmai/callable-reflection/pulls)Apache-2.0PHPPHP ^8.2CI passing

Since Jul 26Pushed 4mo agoCompare

[ Source](https://github.com/sanmai/callable-reflection)[ Packagist](https://packagist.org/packages/sanmai/callable-reflection)[ GitHub Sponsors](https://github.com/sanmai)[ RSS](/packages/sanmai-callable-reflection/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (6)Used By (0)

CallableReflection
==================

[](#callablereflection)

Get `ReflectionFunctionAbstract` for any callable.

Installation
------------

[](#installation)

```
composer require sanmai/callable-reflection
```

Usage
-----

[](#usage)

```
use CallableReflection\CallableReflection;

$reflection = new CallableReflection();
$params = $reflection->reflect($callable)->getNumberOfParameters();
```

Works with closures, functions, methods, invokable objects, and first-class callables.

If it doesn't work with your callable, [file an issue](https://github.com/sanmai/callable-reflection/issues).

How is this better than `ReflectionFunction(Closure::fromCallable($callable))`?
-------------------------------------------------------------------------------

[](#how-is-this-better-than-reflectionfunctionclosurefromcallablecallable)

*Crickets*

Well... you can dependency inject it I guess?

I was experimenting with Claude Code, and I was interested in whether it could build something like this entirely from my request. I didn't think very hard whenever it made sense, and it went from a few-sentence request to... Done. It turns out it can.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance66

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

296d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/edcb8dde95c71b1c97c3c91e57d3548795fa2014c657744fb878e2be3b5949fc?d=identicon)[sanmai](/maintainers/sanmai)

---

Top Contributors

[![sanmai](https://avatars.githubusercontent.com/u/139488?v=4)](https://github.com/sanmai "sanmai (4 commits)")

---

Tags

callablemetaprogrammingrelfectionrelfection-api

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/sanmai-callable-reflection/health.svg)

```
[![Health](https://phpackages.com/badges/sanmai-callable-reflection/health.svg)](https://phpackages.com/packages/sanmai-callable-reflection)
```

###  Alternatives

[kmlaravel/laravel-geographical-calculator

laravel package help you to implement geographical calculation, with With several algorithms that help you deal with coordinates

42677.2k2](/packages/kmlaravel-laravel-geographical-calculator)[joaopaulolndev/filament-general-settings

Filament package to manage general settings

18129.7k](/packages/joaopaulolndev-filament-general-settings)[foowie/dependentselectbox

Selectbox whose options are depended on another selectbox. Library for Nette Framework

1027.8k](/packages/foowie-dependentselectbox)[christianessl/landmap-generation

Generate pixelated, random world maps in PHP.

173.6k](/packages/christianessl-landmap-generation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
