PHPackages                             ioc-interop/impl - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. ioc-interop/impl

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

ioc-interop/impl
================

Reference implementations of Ioc-Interop.

1.x-dev(3w ago)17MITPHPPHP &gt;=8.4CI passing

Since Jul 23Pushed 3w agoCompare

[ Source](https://github.com/ioc-interop/impl)[ Packagist](https://packagist.org/packages/ioc-interop/impl)[ Docs](https://github.com/ioc-interop/impl)[ RSS](/packages/ioc-interop-impl/feed)WikiDiscussions 1.x Synced 1w ago

READMEChangelogDependencies (6)Versions (1)Used By (0)

ioc-interop/impl
================

[](#ioc-interopimpl)

[![PDS Skeleton](https://camo.githubusercontent.com/50d01a5094afcc3a827c3cadaec43d23b2a256cb249f5fdd6e5ffdb53ea7971c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7064732d736b656c65746f6e2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/php-pds/skeleton)[![PDS Composer Script Names](https://camo.githubusercontent.com/0c17df07fd0a51ad878f1de0d4c17ea8e460f2e96ce796c8cd58e6c96ed9c08d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7064732d636f6d706f7365722d2d7363726970742d2d6e616d65732d626c75653f7374796c653d666c61742d737175617265)](https://github.com/php-pds/composer-script-names)

Reference implementations of the [Ioc-Interop](https://github.com/ioc-interop/interface) interfaces for PHP 8.4+.

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

[](#installation)

```
composer require ioc-interop/impl

```

Usage
-----

[](#usage)

Compose a container by populating a [*IocContainerFactory*](https://github.com/ioc-interop/interface#ioccontainerfactory) with shared instances and service factories, then ask it for a new container:

```
use IocInterop\Impl\ContainerFactory;
use IocInterop\Interface\IocContainer;

$containerFactory = new ContainerFactory();

$containerFactory->instances = [
    PDO::class => new PDO('sqlite::memory:'),
];

$containerFactory->factories = [
    Logger::class => fn (IocContainer $ioc) => new Logger(),
    UserService::class => fn (IocContainer $ioc) => new UserService(
        $ioc->getService(PDO::class),
        $ioc->getService(Logger::class),
    ),
];

$ioc = $containerFactory->newContainer();
```

Retrieve services by name. The first call to `getService()` resolves and shares the instance for subsequent calls:

```
$logger = $ioc->getService(Logger::class);
$users = $ioc->getService(UserService::class);
```

Check for service availability:

```
if ($ioc->hasService(Logger::class)) {
    // ...
}
```

Requesting a service that is not registered throws a `ContainerException`:

```
use IocInterop\Interface\IocThrowable;

try {
    $ioc->getService('does-not-exist');
} catch (IocThrowable $e) {
    // ...
}
```

Classes
-------

[](#classes)

InterfaceImplementation*IocContainer*`Container`*IocContainerFactory*`ContainerFactory`*IocThrowable*`ContainerException`All classes are in the `IocInterop\Impl` namespace.

See the [Ioc-Interop](https://github.com/ioc-interop/interface) interface package for the full specification.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance94

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

26d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25754?v=4)[Paul M. Jones](/maintainers/pmjones)[@pmjones](https://github.com/pmjones)

---

Top Contributors

[![pmjones](https://avatars.githubusercontent.com/u/25754?v=4)](https://github.com/pmjones "pmjones (16 commits)")

---

Tags

containerdependency-injectiondiiocservice

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ioc-interop-impl/health.svg)

```
[![Health](https://phpackages.com/badges/ioc-interop-impl/health.svg)](https://phpackages.com/packages/ioc-interop-impl)
```

###  Alternatives

[php-di/php-di

The dependency injection container for humans

2.8k58.2M1.4k](/packages/php-di-php-di)[slince/di

A flexible dependency injection container

20277.1k6](/packages/slince-di)[capsule/di

A PSR-11 compliant autowiring dependency injection container.

2860.8k2](/packages/capsule-di)

PHPackages © 2026

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