PHPackages                             dcp/di - 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. dcp/di

ActiveLibrary

dcp/di
======

Provides a minimalistic dependency injection container.

3144[2 issues](https://github.com/estelsmith/dcp-di/issues)PHP

Since Dec 7Pushed 10y ago1 watchersCompare

[ Source](https://github.com/estelsmith/dcp-di)[ Packagist](https://packagist.org/packages/dcp/di)[ RSS](/packages/dcp-di/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

*WARNING: UNMAINTAINED!*
========================

[](#warning-unmaintained)

About
=====

[](#about)

Provides a minimalistic dependency injection container.

Example
-------

[](#example)

```
use DCP\Di\Container;
use DCP\Di\Service\Reference;

interface MailerInterface {}

class Mailer implements MailerInterface
{
    protected $transport;

    public function __construct(MailerTransportInterface $transport)
    {
        $this->transport = $transport;
    }
}

interface MailerTransportInterface {}

class MailerTransport implements MailerTransportInterface
{
    protected $host;
    protected $port;

    public function __construct($host, $port)
    {
        $this->host = $host;
        $this->port = $port;
    }
}

$di = new Container();

$di
    ->register(MailerInterface::class, 'mailer')
    ->toClass(Mailer::class)
;

$di
    ->register(MailerTransportInterface::class)
    ->toInstance(new Reference(MailerTransport::class))
;

$di
    ->register(MailerTransport::class)
    ->addArguments([
        'host' => 'localhost',
        'port' => 25
    ])
;

var_dump($di->get('mailer'));
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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://www.gravatar.com/avatar/d749ac0a0f0c2e479074aab7d3027392814ec71b882ab362c90637db2e62e82e?d=identicon)[estel.smith](/maintainers/estel.smith)

---

Top Contributors

[![estelsmith](https://avatars.githubusercontent.com/u/363670?v=4)](https://github.com/estelsmith "estelsmith (28 commits)")

### Embed Badge

![Health badge](/badges/dcp-di/health.svg)

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

PHPackages © 2026

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