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

ActiveLibrary[Framework](/categories/framework)

meow/di
=======

Dependency injection container

v0.1.1(1y ago)113[1 PRs](https://github.com/meowphp/di/pulls)1MITPHPPHP 8.\*CI failing

Since Nov 5Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/meowphp/di)[ Packagist](https://packagist.org/packages/meow/di)[ RSS](/packages/meow-di/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (3)Versions (7)Used By (1)

di
==

[](#di)

**namespace:** `meow\di`

Dependency injection container for PHP

[![ko-fi](https://camo.githubusercontent.com/201ef269611db7eb6b5d08e9f756ab8980df3014b64492770bdf13a6ed924641/68747470733a2f2f6b6f2d66692e636f6d2f696d672f676974687562627574746f6e5f736d2e737667)](https://ko-fi.com/D1D5DMOTA)

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

[](#installation)

To install this plugin use following command

```
composer require meow/di
```

Usage
-----

[](#usage)

Example how to use this container

### Creating new container

[](#creating-new-container)

To create new container you can use code as follows

```
$container = new ApplicationContainer();
```

### Registering services

[](#registering-services)

Services are defined as array `[interface => class]` and have to be defined before you can resolve your classes.

```
protected array $services = [
    BaseServiceInterface::class => BaseService::class
];

// add services to container
foreach ($this->services as $k => $v) {
    $container->set($k, $v);
}
```

### Resolving classes

[](#resolving-classes)

With DI container you don't need to create new instances in constructor (as in example controller - check tests).

```
class MainController
{
    protected User $user;

    protected BaseServiceInterface $service;

    public function __construct(BaseServiceInterface $service, User $user)
    {
        $this->user = $user;
        $this->service = $service;
    }
}
```

now you can resolve controller with container

```
/** @var MainController $controller */
$controller = $container->resolve(MainController::class);
```

**License: MIT**

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance60

Regular maintenance activity

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

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

Every ~1252 days

Total

2

Last Release

441d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[laravel/dusk

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

1.9k39.6M300](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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