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
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# You can set these variables from the command line and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
Expand Down
2 changes: 1 addition & 1 deletion docs/adapters/apcu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ APCu stores only strings. We wrap/unserialize via:
1. ``ValueSerializer::serialize($item)`` → store as string blob
2. On fetch, ``ValueSerializer::unserialize($blob)`` → reconstruct the ``ApcuCacheItem`` object

In other words, each APCu entry is a serialized ``ApcuCacheItem`` containing key, value, hit, and expiration.
In other words, each APCu entry is a serialized ``ApcuCacheItem`` containing key, value, hit and expiration.
2 changes: 1 addition & 1 deletion docs/adapters/file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Concurrency & Locks
* When you call ``save()``, the adapter uses ``file_put_contents(..., LOCK_EX)``
to avoid partial writes.
* Reading does **not** use locks (there is a small race-condition if a write is in progress).
* Bulk ``getItems()`` scans the directory once, checks each file’s content, and unserializes hits.
* Bulk ``getItems()`` scans the directory once, checks each file’s content and unserializes hits.

Hot-Reload / Namespace Change
-----------------------------
Expand Down
10 changes: 5 additions & 5 deletions docs/backstory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
Why I Built InterMix
======================

I did not build InterMix as a large framework from the beginning. I built it because I kept running into a smaller, more practical problem: I wanted dependency injection in PHP to feel lightweight, flexible, and actually pleasant to use.
I did not build InterMix as a large framework from the beginning. I built it because I kept running into a smaller, more practical problem: I wanted dependency injection in PHP to feel lightweight, flexible and actually pleasant to use.

Back in October 2020, I started with a small project called DI-Container. At that time, the goal was straightforward. I wanted a compact utility that could resolve constructors and callables cleanly, without unnecessary heaviness. It began as an experiment, but as I kept working on it, I found myself solving more than just container-related problems. Each improvement opened the door to another need, better invocation flow, more flexible resolution, cleaner abstractions, and utilities that naturally belonged around the core idea.
Back in October 2020, I started with a small project called DI-Container. At that time, the goal was straightforward. I wanted a compact utility that could resolve constructors and callables cleanly, without unnecessary heaviness. It began as an experiment, but as I kept working on it, I found myself solving more than just container-related problems. Each improvement opened the door to another need, better invocation flow, more flexible resolution, cleaner abstractions and utilities that naturally belonged around the core idea.

That was the point where I realized I was no longer building just a DI container.

In May 2021, that earlier work evolved into InterMix. I wanted a better foundation, something that could grow without losing the original simplicity that made the first project useful. The new direction was not about making the project bigger for the sake of being bigger. It was about giving it the structure and freedom to become a toolkit I could genuinely rely on across real applications.

I built InterMix incrementally. There was no single moment where everything was fully designed in advance. The project grew through repeated iteration: building, using, refining, rethinking, and improving. Over time, dependency injection remained the center, but the ecosystem around it expanded naturally into caching, macro-style extensibility, memoization, helper utilities, and safety-focused tools. Those additions were not random. They came from practical needs that kept appearing during development.
I built InterMix incrementally. There was no single moment where everything was fully designed in advance. The project grew through repeated iteration: building, using, refining, rethinking and improving. Over time, dependency injection remained the center, but the ecosystem around it expanded naturally into caching, macro-style extensibility, memoization, helper utilities, and safety-focused tools. Those additions were not random. They came from practical needs that kept appearing during development.

That is really the reason InterMix exists.

I wanted a toolkit that stayed lightweight but could still be powerful. I wanted something modular, reusable, and grounded in real usage rather than unnecessary complexity. I wanted tools that worked well together, but could also stand on their own. Most of all, I wanted to build something that could mature over time without losing its original purpose.
I wanted a toolkit that stayed lightweight but could still be powerful. I wanted something modular, reusable and grounded in real usage rather than unnecessary complexity. I wanted tools that worked well together, but could also stand on their own. Most of all, I wanted to build something that could mature over time without losing its original purpose.

InterMix is the result of that journey. What started as a small experiment in 2020 gradually became a broader and more stable PHP toolkit. I did not build it to chase size or trends. I built it to solve real problems in a way that felt clean, practical, and sustainable, and I have continued refining it with that same mindset ever since.
InterMix is the result of that journey. What started as a small experiment in 2020 gradually became a broader and more stable PHP toolkit. I did not build it to chase size or trends. I built it to solve real problems in a way that felt clean, practical and sustainable, and I have continued refining it with that same mindset ever since.
4 changes: 2 additions & 2 deletions docs/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ It provides:
- **PSR-6 extras**:
- ``set(string $key, mixed $value, int|DateInterval|null $ttl = null): bool``
- ``get(string $key, mixed $default = null): mixed``
- If ``$default`` is a callable, it will be invoked on a cache miss with the ``CacheItemInterface`` as argument, the returned value will be saved (with any TTL set inside the callback), and then returned.
- If ``$default`` is a callable, it will be invoked on a cache miss with the ``CacheItemInterface`` as argument, the returned value will be saved (with any TTL set inside the callback) and then returned.
- **Magic properties** (``$cache->foo``, ``$cache->foo = 'bar'``)
- **ArrayAccess** (``$cache['id']``)
- **Countable** (``count($cache)``)
* **Bulk fetch** (``getItems([...])``) that defers to adapter for single-round-trip performance
* **Iteration** (``foreach ($cache->getItemsIterator() as $k => $v)``)
* Automatic **serialization** of closures, resources, and arbitrary PHP values
* Automatic **serialization** of closures, resources and arbitrary PHP values

-------------------------------
Quick Start
Expand Down
2 changes: 1 addition & 1 deletion docs/di/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Eager warm-up (a.k.a. *compile* the container):
``cacheAllDefinitions()`` iterates every current definition **once**,
resolves it and stores the result in:

1. **The configured file cache namespace**, and
1. **The configured file cache namespace** and
2. The container’s in-process “resolved” map (so it is also fast in memory).

You can now deploy the warmed cache files between runs.
Expand Down
2 changes: 1 addition & 1 deletion docs/di/cheat_sheet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Managers At A Glance
* - ``invocation()``
- ``call()``, ``make()``, ``get()``, ``getReturn()``, ``has()``

All managers use ``ManagerProxy``: ``$mgr('id')``, ``$mgr->id``, ``$mgr['id']``, proxied container methods, and ``->end()`` to return to the container.
All managers use ``ManagerProxy``: ``$mgr('id')``, ``$mgr->id``, ``$mgr['id']``, proxied container methods and ``->end()`` to return to the container.

------------------------------------------
Task Matrix (Fluent vs Shortcut)
Expand Down
4 changes: 2 additions & 2 deletions docs/di/debug_tracing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Trace levels are available via the ``TraceLevelEnum`` enum:
* - ``Verbose``
- Includes param names, fallback notices, env switches, etc

Additional levels are available for custom filtering: ``Error``, ``Warn``, and ``Info``.
Additional levels are available for custom filtering: ``Error``, ``Warn`` and ``Info``.

-----------------------------
Check If a Trace Exists 🧠
Expand All @@ -81,7 +81,7 @@ Check If a Trace Exists 🧠
$steps = $c->tracer()->toArray();
}

Traces are only available **after resolution**, and only if tracing was enabled
Traces are only available **after resolution** and only if tracing was enabled
**before** the resolution occurred.

-------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/di/lazy_loading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Why not all?
---------------

User closures are not wrapped in ``DeferredInitializer``. They run when the
service is resolved, and their reuse depends on lifetime (singleton/scoped cache
service is resolved and their reuse depends on lifetime (singleton/scoped cache
the resolved value; transient does not).

--------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/di/understanding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ InterMix in the picture
#. **Register** recipes (definitions, class bindings, factory closures).
#. **Resolve**: ``$c->get(StoreService::class)``.
#. InterMix analyses the constructor, asks itself *“What fulfills GeolocationService right now?”*,
constructs the dependency (recursively if needed) **once**, and hands back a ready-to-use
constructs the dependency (recursively if needed) **once** and hands back a ready-to-use
``StoreService``.

Environment-based overrides
Expand Down
2 changes: 1 addition & 1 deletion docs/fence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Key Concepts

Implements all logic for requirement checks, keyed vs. singleton behavior,
and instance‐count limits. You do **not** use ``Fence`` directly; one of the three
wrapper traits sets two class‐constants, and the core logic runs on every
wrapper traits sets two class‐constants and the core logic runs on every
``::instance()`` call.

**Singleton (Single)**
Expand Down
4 changes: 2 additions & 2 deletions docs/memoize/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Functions
- Computes a signature for ``$fn`` (using ``ReflectionResource::getSignature()``).
- Looks up the cache bucket for that particular object instance (stored in a ``WeakMap``).
- If a cached value exists for that signature under ``$obj``, returns it (hit).
- Otherwise, invokes ``$fn(...$params)``, stores the result in this object’s bucket, and returns it (miss).
- Otherwise, invokes ``$fn(...$params)``, stores the result in this object’s bucket and returns it (miss).

**Return value**

Expand All @@ -100,7 +100,7 @@ Functions
// Second call with same object, same callable: cache hit
$profile2 = remember($user, fn() => loadProfileFromDb($user));

// $profile1 and $profile2 are identical, and loadProfileFromDb() ran only once.
// $profile1 and $profile2 are identical and loadProfileFromDb() ran only once.

// If you call remember() on a different object, closure runs again for that object.

Expand Down
2 changes: 1 addition & 1 deletion docs/memoize/trait.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Trait API

- Check if ``$this->__memo[$key]`` already exists.
- If yes, return it (cache hit).
- If no, invoke ``$producer()``, store the result under ``$key``, and return it (cache miss).
- If no, invoke ``$producer()``, store the result under ``$key`` and return it (cache miss).

- ``$key`` is typically something like ``__METHOD__`` (a unique string).
- ``$producer`` is a zero‐argument closure that returns whatever you want cached.
Expand Down
2 changes: 1 addition & 1 deletion docs/remix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Remix – Fluent PHP Helpers
===========================

``Infocyph\InterMix\Remix`` is a small collection of *opt-in* traits, proxies, and
``Infocyph\InterMix\Remix`` is a small collection of *opt-in* traits, proxies and
global helper functions that add fluency to any PHP codebase. Each component is purely “opt-in.”
You pick and choose only what you need.

Expand Down
2 changes: 1 addition & 1 deletion docs/remix/helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ measure()

.. php:function:: measure(callable $fn, ?float &$ms = null): mixed

**Goal**: Run a block of code, capture how many milliseconds it took, and
**Goal**: Run a block of code, capture how many milliseconds it took and
return the block’s result.

- ``$fn``: any zero-argument callback to measure.
Expand Down
2 changes: 1 addition & 1 deletion docs/remix/tap-proxy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Tap Proxy (``TapProxy``)
this actually creates a ``TapProxy($someObject)``. Then each chained method
(``foo()``, ``bar()``, ``baz()``) is invoked on the real target, **but the proxy
always returns the original target** (not the proxy itself). That means your
chain never breaks, and you never have to assign the result manually.
chain never breaks and you never have to assign the result manually.

Global Helper Function ``tap()``
================================
Expand Down
2 changes: 1 addition & 1 deletion docs/serializer/resource_handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Class API
.. php:function:: void ResourceHandlers::registerDefaults()

Iterates over all public static methods on ``self::class`` whose names start
with ``"register"``, except ``registerDefaults`` itself, and invokes each one.
with ``"register"``, except ``registerDefaults`` itself and invokes each one.
In other words, every ``registerXxx()`` method in your subclass runs.

Does nothing if no ``registerXxx()`` methods exist.
Expand Down
Loading