Download the PHP package oihana/php-reflect without Composer
On this page you can find all versions of the php package oihana/php-reflect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download oihana/php-reflect
More information about oihana/php-reflect
Files in oihana/php-reflect
Download oihana/php-reflect
More information about oihana/php-reflect
Files in oihana/php-reflect
Vendor oihana
Package php-reflect
Short Description The Oihana PHP Reflection library
License MPL-2.0
Homepage https://github.com/BcommeBois/oihana-php-reflect
Package php-reflect
Short Description The Oihana PHP Reflection library
License MPL-2.0
Homepage https://github.com/BcommeBois/oihana-php-reflect
Please rate this library. Is it a good library?
Informations about the package php-reflect
Oihana PHP - Reflect
Lightweight reflection and hydration helpers for modern PHP, part of the Oihana PHP ecosystem.
It provides:
- Friendly wrappers around PHP's Reflection API
- Array-to-object hydration with attribute-based mapping
- Utilities to expose public properties as arrays
- Simple constant “enums” helpers
- A compact
Version
value object
📚 Documentation
Full documentation: https://bcommebois.github.io/oihana-php-reflect
📦 Installation
Requires PHP 8.4+
✨ Features
Reflection helpers
- List constants, methods, properties with visibility filters
- Inspect method parameters: type, default, nullable, optional, variadic
- Describe any callable’s parameters (
describeCallableParameters
) - Cached
ReflectionClass
instances
Hydration
- Instantiate and hydrate objects from associative arrays (recursively)
- Supports union types and nullability
- Attribute-based mapping:
#[HydrateKey('source_key')]
to rename incoming keys#[HydrateWith(Foo::class, Bar::class)]
for arrays of objects, including polymorphism via@type
/type
or property-guessing#[HydrateAs(Foo::class)]
to override ambiguous types (object
,array
,mixed
, unions)
- PHPDoc
@var Type[]
and@var array<Type>
support for array element types
Traits
ReflectionTrait
convenience layer andjsonSerializeFromPublicProperties()
(with optional reduction)ConstantsTrait
utilities over class constants:getAll
,includes
,enums
,getConstant
,validate
Value objects
Version
packs major/minor/build/revision into a 32-bit int with configurable string output
🚀 Quick start
Reflection basics
Describe any callable
Hydration: flat and nested
Hydration with attributes
Arrays of objects via PHPDoc
Polymorphic arrays with HydrateWith
Trait: ReflectionTrait
Trait: ConstantsTrait
Value object: Version
✅ Running Unit Tests
Run a specific test file:
🛠️ Generate the API Docs
We use phpDocumentor to generate the HTML docs into ./docs
.
🧾 License
Licensed under the Mozilla Public License 2.0 (MPL-2.0). See LICENSE
.
👤 Author
- Author: Marc ALCARAZ (aka eKameleon)
- Email: [email protected]
- Website:
http://www.ooop.fr
All versions of php-reflect with dependencies
PHP Build Version
Package Version
The package oihana/php-reflect contains the following files
Loading the files please wait ....