PHPackages                             wheakerd/php-mimic - 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. wheakerd/php-mimic

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

wheakerd/php-mimic
==================

A transparent AOP library for PHP.

00PHP

Since Apr 9Pushed 2mo agoCompare

[ Source](https://github.com/wheakerd/mimic)[ Packagist](https://packagist.org/packages/wheakerd/php-mimic)[ RSS](/packages/wheakerd-php-mimic/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP-Mimic
=========

[](#php-mimic)

A transparent AOP library for PHP.

---

What is Mimic?
--------------

[](#what-is-mimic)

PHP-Mimic is a transparent AOP (Aspect-Oriented Programming) framework that intercepts class loading at the stream level. It reshapes code on-the-fly via AST (Abstract Syntax Tree) manipulation, enabling non-intrusive logic injection into any class—including final classes and methods—without modifying original source files or requiring manual proxies.

Core Philosophy
---------------

[](#core-philosophy)

- Transparent: Works with native new, static, and instanceof calls.
- Intrusive but Safe: Capability to intercept final members and private scopes.
- Debug-First: Integrated source-mapping ensures stack traces and error reports point back to original file paths and line numbers.
- Zero Eval: No eval() is used. All code is processed via custom stream wrappers and the Zend OPcache.

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

[](#installation)

```
composer require wheakerd/php-mimic
```

Quick Start
-----------

[](#quick-start)

#### 1. Initialize the Kernel

[](#1-initialize-the-kernel)

Register the aop:// protocol and hijack the autoloader.

```
$mimic = new MimicFactory();

$mimic->register(
    [
        TestCaseService::class => $composerLoader->findFile(TestCaseService::class),
    ],
)->intercept([TestCaseService::class, 'handle'], function (ProceedingJoinPoint $point) {
    var_dump('Print return value：' . $point->proceed());

    return 999;
});

// Direct your autoloader to use the aop:// prefix
```

License
-------

[](#license)

BSD 3-Clause License (New or Revised)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance58

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![wheakerd](https://avatars.githubusercontent.com/u/78034820?v=4)](https://github.com/wheakerd "wheakerd (2 commits)")

### Embed Badge

![Health badge](/badges/wheakerd-php-mimic/health.svg)

```
[![Health](https://phpackages.com/badges/wheakerd-php-mimic/health.svg)](https://phpackages.com/packages/wheakerd-php-mimic)
```

###  Alternatives

[boxybird/inertia-wordpress

The WordPress adapter for Inertia.js

1828.0k](/packages/boxybird-inertia-wordpress)[barrelstrength/sprout-reports

Powerful custom reports.

1138.2k3](/packages/barrelstrength-sprout-reports)

PHPackages © 2026

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