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

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

entelisteam/lbaf-reflection
===========================

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

1.2.1(3w ago)08↓50%1MITPHPPHP ~8.2

Since May 11Pushed 3w agoCompare

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

READMEChangelogDependencies (6)Versions (4)Used By (1)

entelisteam/lbaf-reflection
===========================

[](#entelisteamlbaf-reflection)

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

Install
-------

[](#install)

```
composer require entelisteam/lbaf-reflection
```

Requires PHP 8.2 or newer.

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

[](#whats-inside)

### `EntelisTeam\Lbaf\Reflection\TypeCaster`

[](#entelisteamlbafreflectiontypecaster)

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\Lbaf\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\Lbaf\Reflection\EnumHelper`

[](#entelisteamlbafreflectionenumhelper)

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

```
use EntelisTeam\Lbaf\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\Lbaf\Reflection\ClassNameHelper`

[](#entelisteamlbafreflectionclassnamehelper)

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

```
use EntelisTeam\Lbaf\Reflection\ClassNameHelper;

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

### `EntelisTeam\Lbaf\Reflection\MethodParameters`

[](#entelisteamlbafreflectionmethodparameters)

Cached lookup of method parameters by name.

```
use EntelisTeam\Lbaf\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.

Версионирование
---------------

[](#версионирование)

Все пакеты LBAF следуют [SemVer](https://semver.org):

- **Major (`1.x` → `2.0`)** — слом обратной совместимости публичного API. Каждое такое изменение сопровождается Rector-миграцией (см. [lbaf-rector](https://github.com/entelisteam/lbaf-rector)). Обновляется только вручную: поднять constraint в `composer.json` и выполнить `composer update`.
- **Minor (`1.2` → `1.3`)** — новая функциональность, обратная совместимость сохранена.
- **Patch (`1.2.0` → `1.2.1`)** — исправления без изменения публичного API.

Правило: **если изменение требует Rector-миграции — это major**, иначе minor или patch.

Зависимости на пакеты LBAF указываются через caret (`"entelisteam/lbaf-*": "^1.2"`): minor и patch подтягиваются обычным `composer update`, major автоматически не устанавливается. После обновления Rector-миграции применяются автоматически (хук `post-update-cmd`); если хук не настроен — выполните `composer rector:fix`.

License
-------

[](#license)

MIT.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance95

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

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

Every ~26 days

Total

3

Last Release

24d 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 (4 commits)")

---

Tags

enumutilityhelpersreflectiontype-casting

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

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

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

###  Alternatives

[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.3M193](/packages/danielstjules-stringy)[voku/arrayy

Array manipulation library for PHP, called Arrayy!

4915.7M18](/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.0k539.1k12](/packages/brandonwamboldt-utilphp)[voku/stringy

A string manipulation library with multibyte support

1803.9M28](/packages/voku-stringy)[statamic/stringy

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

245.0M18](/packages/statamic-stringy)[tcb13/substringy

A sub string manipulation library with multibyte support that extends Stringy

1761.0k1](/packages/tcb13-substringy)

PHPackages © 2026

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