PHPackages                             abmmhasan/intermix - 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. [Caching](/categories/caching)
4. /
5. abmmhasan/intermix

Abandoned → [infocyph/intermix](/?search=infocyph%2Fintermix)Library[Caching](/categories/caching)

abmmhasan/intermix
==================

A Collection of useful PHP class functions.

6.0(1mo ago)1374MITPHPPHP &gt;=8.3CI passing

Since Mar 29Pushed 4mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (20)Versions (58)Used By (0)

InterMix
========

[](#intermix)

[![Security & Standards](https://github.com/infocyph/InterMix/actions/workflows/build.yml/badge.svg)](https://github.com/infocyph/InterMix/actions/workflows/build.yml)[![Documentation Status](https://camo.githubusercontent.com/a6970b2002e5c084996ce5b275e7c24f22a7f62b6dc521b28335fe50ee9fbc7f/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f696e7465726d69782f62616467652f3f76657273696f6e3d6c6174657374)](https://intermix.readthedocs.io)[![Packagist Downloads](https://camo.githubusercontent.com/ebaa2d8e573fd8330bbf0ed0a874bcf837fcec701ccb062dd466c4ce303897e2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e666f637970682f696e7465726d69783f636f6c6f723d677265656e266c696e6b3d68747470732533412532462532467061636b61676973742e6f72672532467061636b61676573253246696e666f63797068253246696e7465726d6978)](https://camo.githubusercontent.com/ebaa2d8e573fd8330bbf0ed0a874bcf837fcec701ccb062dd466c4ce303897e2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e666f637970682f696e7465726d69783f636f6c6f723d677265656e266c696e6b3d68747470732533412532462532467061636b61676973742e6f72672532467061636b61676573253246696e666f63797068253246696e7465726d6978)[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://opensource.org/licenses/MIT)[![Packagist Version](https://camo.githubusercontent.com/4cb31fcfa9759039e1ca4dfe0224179e6fe1548d4bd6c825270a7036bd0ea6f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e666f637970682f696e7465726d6978)](https://camo.githubusercontent.com/4cb31fcfa9759039e1ca4dfe0224179e6fe1548d4bd6c825270a7036bd0ea6f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e666f637970682f696e7465726d6978)[![Packagist PHP Version](https://camo.githubusercontent.com/c21cfea283c43b5dac1a893f3f41685971fb32a53f532a98b7da3996cd5d9c43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f696e666f637970682f696e7465726d69782f706870)](https://camo.githubusercontent.com/c21cfea283c43b5dac1a893f3f41685971fb32a53f532a98b7da3996cd5d9c43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f696e666f637970682f696e7465726d69782f706870)[![GitHub Code Size](https://camo.githubusercontent.com/670bf7791035e493f33fd44b0c8131abfc314d1f1605fcb3b529ef1bda2093e0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f696e666f637970682f696e7465726d6978)](https://camo.githubusercontent.com/670bf7791035e493f33fd44b0c8131abfc314d1f1605fcb3b529ef1bda2093e0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f696e666f637970682f696e7465726d6978)

`InterMix` is a modern, lightweight PHP toolkit for developers who love class-oriented design, clean architecture, and fast execution. From dependency injection to dynamic macros, every utility is designed to **just work** — with minimal config and maximum control.

---

🚀 Key Features
--------------

[](#-key-features)

- **Dependency Injection (DI)** — PSR-11 compliant container with:
    - attribute-based injection
    - scoped lifetimes
    - lazy loading
    - environment-specific overrides
    - debug tracing &amp; cache support
- **Caching** — Dual PSR-6 &amp; PSR-16 compatible cache engine
- **Fence** — Enforce singleton-style class safety
- **MacroMix** — Dynamically extend objects or classes with macros
- **Memoizer** — `once()` and `memoize()` helpers for deterministic caching
- **Global Utilities** — Like `pipe()`, `retry()`, `measure()`, `flatten()`, and more

---

📦 Installation
--------------

[](#-installation)

```
composer require infocyph/intermix
```

Supported PHP versions:

InterMix VersionPHP Version2.x.x and above8.2 or newer1.x.x8.0–8.1 compatible---

⚡ Quick Examples
----------------

[](#-quick-examples)

### 🧱 Dependency Injection

[](#-dependency-injection)

```
use function Infocyph\InterMix\container;

$c = container();
$c->definitions()->bind('now', fn () => new DateTimeImmutable());

echo $c->get('now')->format('c');
```

Enable autowiring with attributes:

```
$c->options()->setOptions(
    injection: true,
    methodAttributes: true,
    propertyAttributes: true
);
```

Tag-based resolution:

```
$c->definitions()->bind('a', A::class, tags: ['service']);
$c->definitions()->bind('b', B::class, tags: ['service']);

foreach ($c->findByTag('service') as $svc) {
    $svc()->handle();
}
```

See full container guide at: 📖

---

### 🧬 Dynamic Macros

[](#-dynamic-macros)

```
MacroTest::mix(new class {
    public function hello($name) {
        return "Hey, $name!";
    }
});

echo (new MacroTest)->hello('Ali'); // Hey, Ali!
```

---

### 🧠 `once()` Memoization

[](#-once-memoization)

```
use function Infocyph\InterMix\Remix\once;

$value = once(fn() => rand(1000, 9999)); // Only runs once per file+line
```

---

📚 Documentation
---------------

[](#-documentation)

Full documentation available on **ReadTheDocs**:

🔗

Includes:

- ✅ Getting Started &amp; Quickstart
- 📦 DI Container Guide (bindings, scopes, attributes, lifetimes)
- 🧩 Modules: Memoizer, Fence, MacroMix
- 🧪 Testing &amp; Caching Tips
- 📘 PDF/ePub formats

---

✅ Testing
---------

[](#-testing)

```
composer install
composer test
```

---

🤝 Contributing
--------------

[](#-contributing)

Got ideas or improvements? Join us!

📂 [Open issues](https://github.com/infocyph/InterMix/issues)📬 Submit a PR — we welcome quality contributions

---

🛡 License
---------

[](#-license)

MIT Licensed — use it freely, modify it openly.

🔗 [opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance81

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 99.5% 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 ~26 days

Recently: every ~48 days

Total

56

Last Release

43d ago

Major Versions

1.08.7 → 2.02024-01-18

2.00.2 → 3.02024-04-15

3.01.5 → 4.02025-01-27

4.02 → 5.02025-06-02

5.35.1 → 6.02026-04-03

PHP version history (3 changes)1.0.0PHP &gt;=8.0

2.0PHP &gt;=8.2

5.35PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/33b750b84ab22f2038ef9b90ee48f2fcdaab6b5698e9f956a89a152466200b63?d=identicon)[abmmhasan](/maintainers/abmmhasan)

---

Top Contributors

[![abmmhasan](https://avatars.githubusercontent.com/u/7711128?v=4)](https://github.com/abmmhasan "abmmhasan (408 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

cachingcontainerdependency-injectiondependency-injection-containerdidi-containermacromacrosmixinoverloadphpphp8psr-11psr-16psr-6utilitycontainerdependencyinjectionreflectiondicachemacromixinmemoizeintermix

###  Code Quality

TestsPest

Static AnalysisPsalm, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/abmmhasan-intermix/health.svg)

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

###  Alternatives

[infocyph/intermix

A Collection of useful PHP class functions.

136.4k1](/packages/infocyph-intermix)[league/container

A fast and intuitive dependency injection container.

86387.8M343](/packages/league-container)[laminas/laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output

1076.9M130](/packages/laminas-laminas-cache)[yiisoft/di

Yii DI container

2351.2M100](/packages/yiisoft-di)[capsule/di

A PSR-11 compliant autowiring dependency injection container.

2857.5k2](/packages/capsule-di)[miladrahimi/phpcontainer

Dependency injection (IoC) container for PHP projects

1322.7k2](/packages/miladrahimi-phpcontainer)

PHPackages © 2026

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