PHPackages                             entelisteam/php-reflection-helpers - 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. entelisteam/php-reflection-helpers

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

entelisteam/php-reflection-helpers
==================================

Lightweight PHP reflection utilities: enum helper, type caster, short class name resolver, cached method parameter lookup.

1.0(4w ago)022↓100%1MITPHPPHP ~8.2

Since May 11Pushed 4w agoCompare

[ Source](https://github.com/entelisteam/php-reflection-helpers)[ Packagist](https://packagist.org/packages/entelisteam/php-reflection-helpers)[ RSS](/packages/entelisteam-php-reflection-helpers/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (1)

entelisteam/php-reflection-helpers
==================================

[](#entelisteamphp-reflection-helpers)

Lightweight PHP reflection utilities. No runtime dependencies beyond the PHP standard library.

Install
-------

[](#install)

```
composer require entelisteam/php-reflection-helpers
```

Requires PHP 8.2 or newer.

What's inside
-------------

[](#whats-inside)

### `EntelisTeam\Reflection\TypeCaster`

[](#entelisteamreflectiontypecaster)

Converts a scalar value to a PHP type by name. Accepts both PHP type names (`int`, `bool`, `float`, `string`) and legacy `gettype()` names (`integer`, `boolean`, `double`).

```
use EntelisTeam\Reflection\TypeCaster;

TypeCaster::cast('42', 'int');        // 42
TypeCaster::cast('1', 'bool');        // true
TypeCaster::cast('true', 'bool');     // true (case-insensitive)
TypeCaster::cast(3.14, 'string');     // "3.14"
```

### `EntelisTeam\Reflection\EnumHelper`

[](#entelisteamreflectionenumhelper)

Constructs an enum case from a value. Works for both backed enums (`::from()`) and unit enums (constant lookup).

```
use EntelisTeam\Reflection\EnumHelper;

enum Status: string { case Active = 'active'; case Inactive = 'inactive'; }
EnumHelper::formatEnumValue(Status::class, 'active'); // Status::Active

enum Priority { case Low; case High; }
EnumHelper::formatEnumValue(Priority::class, 'Low');  // Priority::Low
```

For backed enums the value is coerced to the backing type via `TypeCaster::cast()` first, so `'42'` will match an `int`-backed case.

### `EntelisTeam\Reflection\ClassNameHelper`

[](#entelisteamreflectionclassnamehelper)

Returns the short class name (without namespace) with internal caching.

```
use EntelisTeam\Reflection\ClassNameHelper;

ClassNameHelper::getShortClassName(\App\Foo\Bar::class); // "Bar"
```

### `EntelisTeam\Reflection\MethodParameters`

[](#entelisteamreflectionmethodparameters)

Cached lookup of method parameters by name.

```
use EntelisTeam\Reflection\MethodParameters;

$method = new ReflectionMethod(MyController::class, 'handle');

MethodParameters::getReflection($method, 'id');   // ReflectionParameter for $id
MethodParameters::getTypeName($method, 'id');     // "int" (or "mixed" if untyped)
MethodParameters::getList($method);               // ['id' => ReflectionParameter, ...]
```

Throws `\InvalidArgumentException` if the named parameter does not exist.

License
-------

[](#license)

MIT.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance94

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

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

29d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5281445?v=4)[Dim Entelis](/maintainers/dentelis)[@dentelis](https://github.com/dentelis)

---

Top Contributors

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

---

Tags

enumutilityhelpersreflectiontype-casting

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/entelisteam-php-reflection-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/entelisteam-php-reflection-helpers/health.svg)](https://phpackages.com/packages/entelisteam-php-reflection-helpers)
```

###  Alternatives

[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.2M192](/packages/danielstjules-stringy)[voku/arrayy

Array manipulation library for PHP, called Arrayy!

4915.6M18](/packages/voku-arrayy)[brandonwamboldt/utilphp

util.php is a collection of useful functions and snippets that you need or could use every day, designed to avoid conflicts with existing projects

1.0k538.8k12](/packages/brandonwamboldt-utilphp)[voku/stringy

A string manipulation library with multibyte support

1793.9M24](/packages/voku-stringy)[statamic/stringy

A string manipulation library with multibyte support, forked from @statamic

244.8M17](/packages/statamic-stringy)[tcb13/substringy

A sub string manipulation library with multibyte support that extends Stringy

1760.9k1](/packages/tcb13-substringy)

PHPackages © 2026

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