Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# 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://readthedocs.org/projects/intermix/badge/?version=latest)](https://intermix.readthedocs.io)
[![Documentation](https://img.shields.io/badge/Documentation-InterMix-blue?logo=readthedocs&logoColor=white)](https://docs.infocyph.com/projects/intermix/)
![Packagist Downloads](https://img.shields.io/packagist/dt/infocyph/intermix?color=green&link=https%3A%2F%2Fpackagist.org%2Fpackages%2Finfocyph%2Fintermix)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
![Packagist Version](https://img.shields.io/packagist/v/infocyph/intermix)
![Packagist PHP Version](https://img.shields.io/packagist/dependency-v/infocyph/intermix/php)
![GitHub Code Size](https://img.shields.io/github/languages/code-size/infocyph/intermix)

`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.
`InterMix` is a modern, lightweight PHP toolkit for developers who value class-oriented design, clean architecture, and fast execution. It combines dependency injection, caching, serialization, memoization, macro-style extensibility, and helper utilities with minimal config and maximum control.

---

Expand All @@ -21,7 +21,9 @@
- environment-specific overrides
- debug tracing & cache support
- **Caching** — Dual PSR-6 & PSR-16 compatible cache engine
- **Serializer** — Closure-aware value serialization and resource handlers
- **Fence** — Enforce singleton-style class safety
- **Remix** — Fluent traits, proxies, and global helper functions
- **MacroMix** — Dynamically extend objects or classes with macros
- **Memoizer** — `once()` and `memoize()` helpers for deterministic caching
- **Global Utilities** — Like `pipe()`, `retry()`, `measure()` and more
Expand Down Expand Up @@ -78,7 +80,7 @@ foreach ($c->findByTag('service') as $svc) {
```

See full container guide at:
📖 [https://intermix.readthedocs.io/en/latest/di/overview.html](https://intermix.readthedocs.io/en/latest/di/overview.html)
📖 [https://docs.infocyph.com/projects/intermix/di/overview.html](https://docs.infocyph.com/projects/intermix/di/overview.html)

---

Expand Down Expand Up @@ -106,15 +108,15 @@ $value = once(fn() => rand(1000, 9999)); // Only runs once per file+line

## 📚 Documentation

Full documentation available on **ReadTheDocs**:
Full documentation available at:

🔗 [https://intermix.readthedocs.io](https://intermix.readthedocs.io)
🔗 [https://docs.infocyph.com/projects/intermix/](https://docs.infocyph.com/projects/intermix/)

Includes:

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

Expand Down
10 changes: 5 additions & 5 deletions docs/di/attribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Two families exist:

* **Built-in** tags shipped with InterMix (``Infuse`` / ``Autowire`` / ``Inject``)
* **Custom** attributes you register at runtime through
:php:meth:`Infocyph\InterMix\DI\Attribute\AttributeRegistry::register`
:php:meth:`Infocyph\\InterMix\\DI\\Attribute\\AttributeRegistry::register`

-------------------------------------------------
Built-in Tags (Infuse / Autowire / Inject)
Expand Down Expand Up @@ -58,7 +58,7 @@ Custom Attribute Support
-------------------------------------------------

Create any attribute & a resolver that implements
:php:class:`Infocyph\InterMix\DI\Attribute\AttributeResolverInterface`.
:php:class:`Infocyph\\InterMix\\DI\\Attribute\\AttributeResolverInterface`.

.. code-block:: php

Expand Down Expand Up @@ -125,8 +125,8 @@ Whole-method defaults:
public function execute(int $retries, int $delay) {}
}

*Arguments provided* via :php:meth:`Infocyph\InterMix\DI\Container::call`,
:php:meth:`Infocyph\InterMix\DI\Managers\RegistrationManager::registerMethod`
*Arguments provided* via :php:meth:`Infocyph\\InterMix\\DI\\Container::call`,
:php:meth:`Infocyph\\InterMix\\DI\\Managers\\RegistrationManager::registerMethod`
or explicit arrays always **override** attributes.

-------------------------------------------------
Expand All @@ -144,7 +144,7 @@ Enable with ``propertyAttributes: true``:
}

Properties are injected *after* construction.
Values set via :php:meth:`Infocyph\InterMix\DI\Managers\RegistrationManager::registerProperty`
Values set via :php:meth:`Infocyph\\InterMix\\DI\\Managers\\RegistrationManager::registerProperty`
win over attributes.

-------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/di/definitions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Definition Manager API

``$c->definitions()`` returns an **instance-fluent** manager that stores **recipes**
(**definitions**) by *ID*.
Everything that can be resolved by :php:meth:`Infocyph\InterMix\DI\Container::get`
Everything that can be resolved by :php:meth:`Infocyph\\InterMix\\DI\\Container::get`
ultimately lives in this registry.

---------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/di/environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ Priority & Resolution Order
-----------------------------

If multiple environments are defined, InterMix **only uses** the one explicitly
set via :php:meth:`Infocyph\InterMix\DI\Managers\OptionsManager::setEnvironment`.
set via :php:meth:`Infocyph\\InterMix\\DI\\Managers\\OptionsManager::setEnvironment`.

Resolution priority:

1. **Environment-bound class** (if active)
2. **Globally bound class** via
:php:meth:`Infocyph\InterMix\DI\Managers\DefinitionManager::bind`
:php:meth:`Infocyph\\InterMix\\DI\\Managers\\DefinitionManager::bind`
3. **Autowire fallback** (if ``injection=true``)

-------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/di/lifetimes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Service Lifetimes
===================

InterMix supports three configurable **lifetimes** via
:php:class:`Infocyph\InterMix\DI\Support\LifetimeEnum`.
:php:class:`Infocyph\\InterMix\\DI\\Support\\LifetimeEnum`.

This allows fine-grained control over how instances are reused or regenerated.

Expand Down
2 changes: 1 addition & 1 deletion docs/di/preload.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Advanced Customization 🛠️
--------------------------

You may extend or modify the preload generation behavior by subclassing
:php:class:`Infocyph\InterMix\DI\Support\PreloadGenerator`.
:php:class:`Infocyph\\InterMix\\DI\\Support\\PreloadGenerator`.


Next stop » :doc:`debug_tracing`
4 changes: 2 additions & 2 deletions docs/di/tagging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Add a Tag 🏷️
-----------------

Simply pass **``tags:[…]``** to
:php:meth:`Infocyph\InterMix\DI\Managers\DefinitionManager::bind`.
:php:meth:`Infocyph\\InterMix\\DI\\Managers\\DefinitionManager::bind`.

.. code-block:: php

Expand All @@ -36,7 +36,7 @@ Retrieve All by Tag 📬
$factory()->handle($event);
}

* :php:meth:`Infocyph\InterMix\DI\Container::findByTag` returns an **array**:
* :php:meth:`Infocyph\\InterMix\\DI\\Container::findByTag` returns an **array**:
``[id => callable|object, …]``
* Services are resolved **lazily** – if the definition was a class string the
container still honours lazy loading & lifetimes.
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
infocyph/InterMix Manual
=========================

For `infpcyph/InterMix <https://github.com/infpcyph/InterMix>`_ |version|. Updated on |today|.
For `infocyph/InterMix <https://github.com/infocyph/InterMix>`_ |version|. Updated on |today|.

Licensed under `MIT <https://github.com/infpcyph/InterMix/blob/main/LICENSE>`_.
Licensed under `MIT <https://github.com/infocyph/InterMix/blob/main/LICENSE>`_.

Contents
--------
Expand Down
2 changes: 1 addition & 1 deletion docs/remix/helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ once()
**Goal**: Execute a zero-argument callback exactly once **per call site** (determined by ``file:line``). On the first invocation at that source location, ``once()`` runs the callback and caches its result. All subsequent calls from that same location return the stored value, never re-evaluating the callback.

- ``$callback`` – A zero-argument callable to evaluate.
- ``$container`` *(optional)* – an :php:class:`Infocyph\InterMix\DI\Container`
- ``$container`` *(optional)* – an :php:class:`Infocyph\\InterMix\\DI\\Container`
instance. If supplied, ``once()`` stores/retrieves via container resolution
instead of the internal static cache.

Expand Down
2 changes: 1 addition & 1 deletion docs/serializer/value_serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Under the hood it relies on:
2. A **plugin system** (“resource handlers”) that can *wrap* any PHP
**resource** into plain data and *restore* it on the way back.
3. A tiny **memo-cache** inside
:php:meth:`Infocyph\InterMix\Serializer\ValueSerializer::isSerializedClosure`
:php:meth:`Infocyph\\InterMix\\Serializer\\ValueSerializer::isSerializedClosure`
to detect
Opis payloads with **O(1)** string checks.

Expand Down
Loading