PHPackages                             simplydi/simplydi - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. simplydi/simplydi

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

simplydi/simplydi
=================

PHP Dependency Injection in its simplest form

29PHP

Since Aug 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/bharatkumar200/SimplyDI)[ Packagist](https://packagist.org/packages/simplydi/simplydi)[ RSS](/packages/simplydi-simplydi/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (1)Used By (0)

SimplyDI
========

[](#simplydi)

DI in its simplest form (PHP)

Registering
-----------

[](#registering)

**Register the classes in your bootstrap or anywhere you like**:

```
// In your application's bootstrap or configuration file

use SimplyDi\SimplyDi\Container;

Container::register('content', function () {
    return new \App\Libraries\Content\Posts();
});
```

**Using the dependencies in your controllers**:

```
namespace App\Controllers;

use SimplyDi\SimplyDi\Container;

class MyController
{
    private $content;

    public function __construct()
    {
        $this->content = Container::resolve('content');
    }

    public function someMethod()
    {
        // Now you can use $this->content as an instance of \App\Libraries\Content\Posts
        $post = $this->content->getPostBySlug('example-slug');
    }
}
```

Notes
-----

[](#notes)

- This is the simplest form of DI (inspired from CodeIgniter 4 services) wherein you register all your classes in a single container class and then use the same container to load all other classes
- it doesn't offer high level features such as Autowiring and stuff. For such features, use Symfony or League Dependency Injection component.
- this project is suitable only for smaller projects or for learning

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 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://www.gravatar.com/avatar/e62fc23e7e11617b80edb58e4d3df6722b8fd31c36e97cdc70e21a70631d465e?d=identicon)[bharatkumar200](/maintainers/bharatkumar200)

---

Top Contributors

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

### Embed Badge

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

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

PHPackages © 2026

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