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

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

innmind/reflection
==================

Library to build objects and extract data out of them

5.3.0(3mo ago)126.2k↓47.7%33MITPHPPHP ~8.4CI passing

Since Jan 17Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/Innmind/Reflection)[ Packagist](https://packagist.org/packages/innmind/reflection)[ Docs](http://github.com/Innmind/Reflection)[ RSS](/packages/innmind-reflection/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (23)Used By (3)

Reflection
==========

[](#reflection)

[![Build Status](https://github.com/innmind/reflection/workflows/CI/badge.svg?branch=master)](https://github.com/innmind/reflection/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/6e56d45f3a02afbc72cd71e4bff921f2bf7728b0d8089776defd5f636bba10f7/68747470733a2f2f636f6465636f762e696f2f67682f696e6e6d696e642f7265666c656374696f6e2f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/innmind/reflection)[![Type Coverage](https://camo.githubusercontent.com/700ddcf730192ff39fc9a917752a1819b43021e8f13d2f0f69c8dd19a396bfc1/68747470733a2f2f73686570686572642e6465762f6769746875622f696e6e6d696e642f7265666c656374696f6e2f636f7665726167652e737667)](https://shepherd.dev/github/innmind/reflection)

Library to build objects and extract data out of them.

Build and inject data into an object
------------------------------------

[](#build-and-inject-data-into-an-object)

```
use Innmind\Reflection\Instanciate;
use Innmind\Immutable\{
    Map,
    Maybe,
};

final class Foo
{
    private int $foo;
    private mixed $bar;

    public function __construct(string $foo)
    {
        $this->foo = $foo;
    }
}

$object = (new Instanciate)(Foo::class, Map::of(
    ['foo', 42],
    ['bar', 'baz'],
)); // Maybe
```

This code will create a new `Foo` object and assign the property `foo` to `42` and `bar` to `'baz'`.

Extracting data out of an object
--------------------------------

[](#extracting-data-out-of-an-object)

```
use Innmind\Reflection\Extract;
use Innmind\Immutable\{
    Set,
    Maybe,
    Map,
};

$properties = (new Extract)($myObject, Set::of('foo', 'bar', 'baz')); // Maybe
```

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance81

Actively maintained with recent releases

Popularity32

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity90

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 94.2% 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 ~204 days

Recently: every ~439 days

Total

19

Last Release

99d ago

Major Versions

1.3.4 → 2.0.02017-02-19

2.0.0 → 3.0.02018-11-01

3.0.0 → 4.0.02019-12-12

4.2.1 → 5.0.02022-04-30

PHP version history (8 changes)1.0.0PHP ~7.0

2.0.0PHP ~7.1

3.0.0PHP ~7.2

4.0.0PHP ~7.4

4.1.0PHP ~7.4|~8.0

5.0.0PHP ~8.1

5.1.0PHP ~8.2

5.3.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (163 commits)")[![hugues-m](https://avatars.githubusercontent.com/u/5310915?v=4)](https://github.com/hugues-m "hugues-m (8 commits)")[![mathieutu](https://avatars.githubusercontent.com/u/11351322?v=4)](https://github.com/mathieutu "mathieutu (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

reflection

### Embed Badge

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

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

###  Alternatives

[phpdocumentor/reflection-common

Common reflection classes used by phpdocumentor to reflect the code structure

9.1k706.8M26](/packages/phpdocumentor-reflection-common)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12521.4M109](/packages/phpdocumentor-reflection)[php-di/phpdoc-reader

PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)

7431.6M55](/packages/php-di-phpdoc-reader)[minime/annotations

The KISS PHP annotations library

229378.6k37](/packages/minime-annotations)[spatie/php-attribute-reader

A clean API for working with PHP attributes

80216.4k11](/packages/spatie-php-attribute-reader)

PHPackages © 2026

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