PHPackages                             php-lab/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. [Framework](/categories/framework)
4. /
5. php-lab/di

ActiveLibrary[Framework](/categories/framework)

php-lab/di
==========

Dependency injection container.

0137PHP

Since Mar 7Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Dependency injection container
==============================

[](#dependency-injection-container)

[![Build Status](https://camo.githubusercontent.com/46cb947f311ea44f188f2036e9605a3599a2e54fbe79a3a60bdb0c80942bd716/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068702d6c61622f64692f6d61737465722e737667)](https://travis-ci.org/php-lab/di)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/16b282dea89077f1560037640f158809dd61eb30f11c3a140d12a4831e09fd5d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7068702d6c61622f64692e737667)](https://scrutinizer-ci.com/g/php-lab/di/)[![Total Downloads](https://camo.githubusercontent.com/5650434480487f76b24374067fa31d30f7b143c8835c889be4551e86ed457c7b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068702d6c61622f64692e737667)](https://packagist.org/packages/php-lab/di)[![License](https://camo.githubusercontent.com/d2b926eb5d3579e81b324ec99a78d6cbf988abd7f5df5000c88ee6543270cfe3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068702d6c61622f64692e737667)](https://packagist.org/packages/php-lab/di)

PhpLab\\Di requires PHP 7.

Usage
-----

[](#usage)

```
use PhpLab\Di\Container;

$app = new Container();

$app->pageIndexAction = function (Container $di) {
    return new \Page\Action\IndexAction($di->pageIndexResponder);
};
$app->pageIndexResponder = function (Container $di) {
    return new \Page\Responder\IndexResponder($di->pageIndexTemplate);
};
$app->pageIndexTemplate = function (Container $di) {
    return new \Page\Template\IndexTemplate($di['path.template']);
};

$app['path.root'] = __DIR__ . '/../..';
$app['path.template'] = $app['path.root'] . '/template/site';
```

License
-------

[](#license)

PhpLab\\Di is licensed under the MIT license.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

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://avatars.githubusercontent.com/u/4481981?v=4)[Yuriy Davletshin](/maintainers/davletshin)[@davletshin](https://github.com/davletshin)

---

Top Contributors

[![davletshin](https://avatars.githubusercontent.com/u/4481981?v=4)](https://github.com/davletshin "davletshin (5 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)

PHPackages © 2026

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