PHPackages                             php-kitchen/yii2-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. php-kitchen/yii2-di

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

php-kitchen/yii2-di
===================

Advanced Dependency Injection container built on top of default Yii2 container.

v0.2.0(4y ago)51.9k2MITPHPPHP &gt;=7.4

Since Dec 7Pushed 4y ago4 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (13)Used By (2)

Yii2 Container
==============

[](#yii2-container)

Advanced Dependency Injection Container fo Yii 2.

Package information
-------------------

[](#package-information)

Latest Stable VersionTotal downloadsMonthly DownloadsLicensing[![Latest Stable Version](https://camo.githubusercontent.com/fcdd15589ce9fdf80a25a10f8084fdad6462b46925825353e2ac1bcc3c59b09b/68747470733a2f2f706f7365722e707567782e6f72672f7068702d6b69746368656e2f796969322d64692f762f737461626c65)](https://packagist.org/packages/php-kitchen/yii2-di)[![Total Downloads](https://camo.githubusercontent.com/9a263c7f37a523a912cc4f8ab09ea161798378557658f35f7c8b7a614c5846a0/68747470733a2f2f706f7365722e707567782e6f72672f7068702d6b69746368656e2f796969322d64692f646f776e6c6f616473)](https://packagist.org/packages/php-kitchen/yii2-di)[![Monthly Downloads](https://camo.githubusercontent.com/29d86c340983aa116cd7c4e0977b339ee5bad487f26ee60f1d09e1ca864ee5cc/68747470733a2f2f706f7365722e707567782e6f72672f7068702d6b69746368656e2f796969322d64692f642f6d6f6e74686c79)](https://packagist.org/packages/php-kitchen/yii2-di)[![License](https://camo.githubusercontent.com/17e1aeba6aca22be5ac89cfcd75fd5c3b0de4f36952f1415e274917baf7a32a8/68747470733a2f2f706f7365722e707567782e6f72672f7068702d6b69746368656e2f796969322d64692f6c6963656e7365)](https://packagist.org/packages/php-kitchen/yii2-di)Requirements
------------

[](#requirements)

**`PHP >=7.4` is required.**

Getting Started
---------------

[](#getting-started)

Run the following command to add Yii2 Container to your project's `composer.json`. See [Packagist](https://packagist.org/packages/php-kitchen/yii2-di) for specific versions.

```
composer require php-kitchen/yii2-di
```

Or you can copy this library from:

- [Packagist](https://packagist.org/packages/php-kitchen/yii2-di)
- [Github](https://github.com/php-kitchen/yii2-di)

Then add following line of code in you application entry point or bootstrap file:

```
Yii::$container = new \PHPKitchen\DI\Container();
spl_autoload_unregister([\PHPKitchen\DI\autoload\ClassLoader::class, 'loadClass']);
```

For additional information and guides go to the [project documentation](docs/README.md)

Upgrade from 0.0.9
------------------

[](#upgrade-from-009)

In 0.1.0 `yii\base\Object` changed to `yii\base\BaseObject` to support PHP 7.2 but it means that you need yii `2.0.13` and higher.

Contributing
------------

[](#contributing)

If you want to ask any questions, suggest improvements or just to talk with community and developers, [join our server at Discord](https://discord.gg/Ez5VZhC)

Build status
------------

[](#build-status)

CI statusCode quality[![Build Status](https://camo.githubusercontent.com/973567a4fdc02d4138ad634fd552dd5be5699c8c0f1a1ef33c8c14d67e570caa/68747470733a2f2f7472617669732d63692e6f72672f7068702d6b69746368656e2f796969322d64692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/php-kitchen/yii2-di)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/66f271489d8a8d38501e3998c33205ea9bcd4531ebedc100459b2714cabc9e95/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068702d6b69746368656e2f796969322d64692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/php-kitchen/yii2-di/?branch=master)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 94.1% 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

Every ~165 days

Recently: every ~387 days

Total

12

Last Release

1625d ago

PHP version history (4 changes)0.0.0PHP ^5.6|^7.0

0.0.8PHP 7.1

0.0.9PHP ^7.1

v0.2.0PHP &gt;=7.4

### Community

Maintainers

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

---

Top Contributors

[![prowwid](https://avatars.githubusercontent.com/u/3070281?v=4)](https://github.com/prowwid "prowwid (16 commits)")[![dmitrybukavin](https://avatars.githubusercontent.com/u/186560148?v=4)](https://github.com/dmitrybukavin "dmitrybukavin (1 commits)")

---

Tags

containerfactorydependency-injectiondiservice provideryii2yiidecorator

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[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)

PHPackages © 2026

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