PHPackages                             tractorcow/classproxy - 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. tractorcow/classproxy

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

tractorcow/classproxy
=====================

1.0.1(4mo ago)2524.7k↓48.3%3[1 issues](https://github.com/tractorcow/classproxy/issues)2BSD-3-ClausePHPCI failing

Since Feb 16Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tractorcow/classproxy)[ Packagist](https://packagist.org/packages/tractorcow/classproxy)[ RSS](/packages/tractorcow-classproxy/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (2)

Partial proxy class builder
===========================

[](#partial-proxy-class-builder)

[![Build Status](https://camo.githubusercontent.com/5ce2b0bcff38705e4ccdae72a91b2f1d90212567fc2d4466aeabc84c80c9b10c/68747470733a2f2f7472617669732d63692e6f72672f74726163746f72636f772f636c61737370726f78792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tractorcow/classproxy)[![SilverStripe supported module](https://camo.githubusercontent.com/9b7e93d393a01f6d3091fb30983b870aa863ef076858115faaa1c74b995854ec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73696c7665727374726970652d737570706f727465642d3030373143342e737667)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)

Dynamically scaffold proxy classes that actually extend the class being proxied, allowing them to be used in type-strict applications.

No it's not prophecy because this is designed for partial proxies, not testing.

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

[](#installation)

```
composer require tractorcow/classproxy
```

Examples
--------

[](#examples)

```
// Create a proxy creator
$proxy = ProxyFactory::create(DataBase::class)
    ->addMethod('connect', function ($args, $next) use ($logger) {
        $logger->log("Connecting to server " . $args[0]['server'];
        return $next(...$args);
    });

// Generate instance of our proxy
$instance = $proxy->instance();
assert($instance instanceof Database); // Yep!

// Connects to underlying database, logging the call
$instance->connect([
    'server' => 'localhost',
    'user' => 'root'
]);
```

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance63

Regular maintenance activity

Popularity40

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~727 days

Total

5

Last Release

149d ago

Major Versions

0.1.2 → 1.0.02022-04-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/f6a363b2d85dc3e82e73cc9e3a57fc15132920b166c5938ad63a54029b9f94b9?d=identicon)[tractorcow](/maintainers/tractorcow)

![](https://www.gravatar.com/avatar/04057079b9a8a168a9e8c40cf7bac17f05047255c48b71b63fc610db06f096cb?d=identicon)[robbieaverill](/maintainers/robbieaverill)

---

Top Contributors

[![robbieaverill](https://avatars.githubusercontent.com/u/5170590?v=4)](https://github.com/robbieaverill "robbieaverill (3 commits)")[![tractorcow](https://avatars.githubusercontent.com/u/936064?v=4)](https://github.com/tractorcow "tractorcow (3 commits)")[![emteknetnz](https://avatars.githubusercontent.com/u/4809037?v=4)](https://github.com/emteknetnz "emteknetnz (2 commits)")[![GuySartorelli](https://avatars.githubusercontent.com/u/36352093?v=4)](https://github.com/GuySartorelli "GuySartorelli (1 commits)")[![satrun77](https://avatars.githubusercontent.com/u/166450?v=4)](https://github.com/satrun77 "satrun77 (1 commits)")

---

Tags

classphpproxyreflection

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tractorcow-classproxy/health.svg)

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

###  Alternatives

[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M343](/packages/drupal-core-dev)

PHPackages © 2026

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