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

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

lepre/di
========

A simple Dependency Injection Container, PSR-11 compliant.

1.0.0-alpha1(7y ago)1233MITPHPPHP ^7.1CI failing

Since Mar 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/leprephp/di)[ Packagist](https://packagist.org/packages/lepre/di)[ Docs](https://github.com/leprephp/di)[ RSS](/packages/lepre-di/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

**🚧 This project is in early development stage and it could change significantly in the future.**

Lepre DI
========

[](#lepre-di)

[![Test library](https://github.com/metaline/wp-api-client/actions/workflows/test-library.yml/badge.svg)](https://github.com/leprephp/di/actions)[![Coverage Status](https://camo.githubusercontent.com/3a925e99b1eaf3584ea899c38335a8285bf04780d67ae35f46846bf6dd083551/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c657072657068702f64692f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/leprephp/di?branch=master)

A simple Dependency Injection Container, [PSR-11](http://www.php-fig.org/psr/psr-11/) compliant.

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

[](#installation)

Install the latest version with [Composer](https://getcomposer.org/):

```
$ composer require lepre/di:dev-master

```

### Requirements

[](#requirements)

This project works with PHP 7.4 or above.

Basic Usage
-----------

[](#basic-usage)

```
use Lepre\DI\Container;

$container = new Container();

// register a service:
$container->set('my service', function () {
    return new MyService();
});

// register a service with dependencies:
$container->set('other service', function (Container $container) {
    return new OtherService(
        $container->get('my service')
    );
});
```

License
-------

[](#license)

This project is licensed under the MIT License. See the LICENSE file for details.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

2612d ago

### Community

Maintainers

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

---

Top Contributors

[![omoikane](https://avatars.githubusercontent.com/u/145311?v=4)](https://github.com/omoikane "omoikane (44 commits)")

---

Tags

dependency-injectionphpphp7psr-11containerPSR-11di containerdependency-injectiondidicdependency injection container

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[php-di/php-di

The dependency injection container for humans

2.8k48.9M994](/packages/php-di-php-di)[aura/di

A serializable dependency injection container with constructor and setter injection, interface and trait awareness, configuration inheritance, and much more.

356968.3k58](/packages/aura-di)[laminas/laminas-servicemanager

Factory-Driven Dependency Injection Container

15955.1M694](/packages/laminas-laminas-servicemanager)[mrclay/props-dic

Props is a simple DI container that allows retrieving values via custom property and method names

3611.7M3](/packages/mrclay-props-dic)[slince/di

A flexible dependency injection container

20260.4k6](/packages/slince-di)[woohoolabs/zen

Woohoo Labs. Zen DI Container and preload file generator

986.2k](/packages/woohoolabs-zen)

PHPackages © 2026

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