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 3mo ago1 watchersCompare

[ Source](https://github.com/meowphp/di)[ Packagist](https://packagist.org/packages/meow/di)[ RSS](/packages/meow-di/feed)WikiDiscussions main Synced 1w 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

33

—

LowBetter than 75% of packages

Maintenance65

Regular maintenance activity

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

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

395d 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/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[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.

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

A simple API extension for DateTime.

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

PHPackages © 2026

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