PHPackages                             progphil1337/php-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. progphil1337/php-di

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

progphil1337/php-di
===================

Simple but effective dependency injection library

v1.0.0(3y ago)0177MITPHPPHP ^8.1

Since Sep 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/progphil1337/php-di)[ Packagist](https://packagist.org/packages/progphil1337/php-di)[ RSS](/packages/progphil1337-php-di/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP-DI
======

[](#php-di)

Simple but effective dependency injection library

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

[](#installation)

Install with composer:

```
$ composer require progphil1337/php-di
```

Compatibility
-------------

[](#compatibility)

`ProgPhil1337\DependencyInjection` requires PHP 8.1 (or better).

Usage
-----

[](#usage)

### Basic example

[](#basic-example)

ExampleForm.php

```
use ProgPhil1337\DependencyInjection\ClassLookup;
use ProgPhil1337\DependencyInjection\Injector;

use MyApp\YamlConfig;
use MyApp\AbstractConfig;
use MyApp\SingletonInterface;

$lookup = new ClassLookup();
$injector = new Injector($lookup);

$lookup
    // class aliases
    ->alias(YamlConfig::class, AbstractConfig::class)

    // register singletons
    ->singleton(SingletonInterface::class)

    // Register classes that cannot be created
    ->register(new YamlConfig())
;

// Example for alias and registering
$yamlConfig = $injector->create(AbstractConfig::class);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1342d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe0febabf0b72bbeb1eaa56bb63cd3b97c9f8eb8ffbb8d61ac8b74f934adc756?d=identicon)[progphil1337](/maintainers/progphil1337)

---

Top Contributors

[![progphil1337](https://avatars.githubusercontent.com/u/8302313?v=4)](https://github.com/progphil1337 "progphil1337 (2 commits)")

### Embed Badge

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

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

###  Alternatives

[ocramius/proxy-manager

A library providing utilities to generate, instantiate and generally operate with Object Proxies

5.0k82.4M230](/packages/ocramius-proxy-manager)

PHPackages © 2026

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