Download the PHP package entelisteam/php-reflection-helpers without Composer
On this page you can find all versions of the php package entelisteam/php-reflection-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download entelisteam/php-reflection-helpers
More information about entelisteam/php-reflection-helpers
Files in entelisteam/php-reflection-helpers
Package php-reflection-helpers
Short Description Lightweight PHP reflection utilities: enum helper, type caster, short class name resolver, cached method parameter lookup.
License MIT
Informations about the package php-reflection-helpers
entelisteam/php-reflection-helpers
Lightweight PHP reflection utilities. No runtime dependencies beyond the PHP standard library.
Install
Requires PHP 8.2 or newer.
What's inside
EntelisTeam\Reflection\TypeCaster
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).
EntelisTeam\Reflection\EnumHelper
Constructs an enum case from a value. Works for both backed enums (::from()) and unit enums (constant lookup).
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
Returns the short class name (without namespace) with internal caching.
EntelisTeam\Reflection\MethodParameters
Cached lookup of method parameters by name.
Throws \InvalidArgumentException if the named parameter does not exist.
License
MIT.