PHPackages                             christopheraseidl/reflect - 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. christopheraseidl/reflect

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

christopheraseidl/reflect
=========================

A simple class for facilitating quicker use of PHP's ReflectionClass.

13.1k[4 PRs](https://github.com/christopheraseidl/reflect/pulls)PHPCI passing

Since Oct 13Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/christopheraseidl/reflect)[ Packagist](https://packagist.org/packages/christopheraseidl/reflect)[ RSS](/packages/christopheraseidl-reflect/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

An easy way to utilize the power of PHP's ReflectionClass.
==========================================================

[](#an-easy-way-to-utilize-the-power-of-phps-reflectionclass)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bda23960572e51c4c952fc8332fe6f18dd6e210551191d07b3f5790b508825f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368726973746f7068657261736569646c2f7265666c6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/christopheraseidl/reflect)[![GitHub Tests Action Status](https://camo.githubusercontent.com/1c4c21d22bb493ea4d0fafbc8a999beeb87efa6433b457d839a2253ca41561b9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6368726973746f7068657261736569646c2f7265666c6563742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/christopheraseidl/reflect/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/19cf9ec1abdb63effcf87da624d4325740833506918f441027d268e6b18ec969/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6368726973746f7068657261736569646c2f7265666c6563742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/christopheraseidl/reflect/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/e093c191bf3fba8281e070e6156e7e0ef17fd078a7326d5c3fbeefd18bfb23f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6368726973746f7068657261736569646c2f7265666c6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/christopheraseidl/reflect)

Reflect is a simple wrapper around PHP's ReflectionClass that provides easy access to private properties and methods, supporting both instanced and static members with inheritance.

PHP Versions
------------

[](#php-versions)

- PHP 8.0+

Installation
------------

[](#installation)

You can install Reflect via composer:

```
composer require christopheraseidl/reflect
```

Usage
-----

[](#usage)

### Accessing instance members

[](#accessing-instance-members)

```
class MyClass {
    private string $private = 'private property';
    private function method(): string
    {
        return 'private method';
    }
}

$reflect = Reflect::on(new MyClass());
echo $reflect->private; // 'private property'
echo $reflect->method(); // 'private method'
```

### Accessing static members

[](#accessing-static-members)

```
class MyStaticClass {
    private static string $static = 'static property';
    private static function staticMethod(): string
    {
        return 'static method';
    }
}

$reflect = Reflect::on(MyStaticClass::class);
echo $reflect->static; // 'static property'
echo $reflect->staticMethod(); // 'static method'
```

### Inheritance support

[](#inheritance-support)

```
class ParentClass {
    private string $parentProp = 'parent property';
}

class Child extends ParentClass {
    private string $childProp = 'child property';
}

$reflect = Reflect::on(new Child());
echo $reflect->parentProp; // 'parent property'
echo $reflect->childProp; // 'child property'
```

### Non-instantiable classes

[](#non-instantiable-classes)

```
abstract class AbstractClass {
    private static string $env = 'development';
}

$reflect = Reflect::on(AbstractClass::class);
echo $reflect->env; // 'development'
```

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Chris Seidl](https://github.com/christopheraseidl)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance59

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/639d641f14096c8c9e5e0e990b06414f5ed5f6ea4d13b6e103aae2405ce870fc?d=identicon)[christopheraseidl](/maintainers/christopheraseidl)

---

Top Contributors

[![christopheraseidl](https://avatars.githubusercontent.com/u/73406146?v=4)](https://github.com/christopheraseidl "christopheraseidl (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

### Embed Badge

![Health badge](/badges/christopheraseidl-reflect/health.svg)

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

PHPackages © 2026

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