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

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

timandes/reflection
===================

Reflection related library

v0.4.0(6y ago)02.8kApache-2.0PHPPHP ^7.0

Since Feb 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Timandes/reflection)[ Packagist](https://packagist.org/packages/timandes/reflection)[ Docs](https://github.com/Timandes/reflection)[ RSS](/packages/timandes-reflection/feed)WikiDiscussions master Synced 3d ago

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

Timandes's Reflection Library
=============================

[](#timandess-reflection-library)

JDK-like Dynamic Proxy
----------------------

[](#jdk-like-dynamic-proxy)

```
interface Foo
{
    public function foo();
}

interface Bar
{
    public function bar();
}

class DefaultFooBar implements Foo, Bar
{
    public function foo()
    {
        echo 'DefaultFooBar::foo()' . PHP_EOL;
        return 'foo';
    }
    public function bar()
    {
        echo 'DefaultFooBar::bar()' . PHP_EOL;
        return 'bar';
    }
}

use Timandes\Reflection\Proxy;

$fooBar = new DefaultFooBar();
$fooBarProxy = Proxy::newProxyInstance($fooBar, [Foo::class, Bar::class], function($proxy, \ReflectionMethod $method, array $args) use($fooBar) {
    echo "Before invoking" . PHP_EOL;
    return $method->invokeArgs($fooBar, $args);
});
$fooBarProxy->foo();
```

Output:

```
Before invoking
DefaultFooBar::foo()

```

CGLib-like Dynamic Proxy
------------------------

[](#cglib-like-dynamic-proxy)

```
class BaseFoo
{
    public function bar()
    {
        echo 'BaseFoo::bar()' . PHP_EOL;
        return 'bar';
    }
}

use Timandes\Reflection\Enhancer;

$foo = new BaseFoo();
$fooProxy = Enhancer::createInstance(BaseFoo::class, function($object, \ReflectionMethod $method, array $args) use($foo) {
    echo 'Before invoking' . PHP_EOL;
    return $method->invokeArgs($foo, $args);
});
$fooProxy->bar();
```

Output:

```
Before invoking
BaseFoo::bar()

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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 ~55 days

Total

5

Last Release

2469d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/305486?v=4)[Timandes White](/maintainers/Timandes)[@Timandes](https://github.com/Timandes)

---

Top Contributors

[![Timandes](https://avatars.githubusercontent.com/u/305486?v=4)](https://github.com/Timandes "Timandes (14 commits)")

---

Tags

dynamicphpproxyreflectionphpproxyreflectiondynamic

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[minime/annotations

The KISS PHP annotations library

233390.7k38](/packages/minime-annotations)

PHPackages © 2026

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