PHPackages                             jascha030/dic - 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. jascha030/dic

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

jascha030/dic
=============

Simple PHP DIC Container

1.4.0(6y ago)07MITPHPPHP &gt;=7.0

Since Dec 23Pushed 6y ago1 watchersCompare

[ Source](https://github.com/jascha030/DI-Container)[ Packagist](https://packagist.org/packages/jascha030/dic)[ RSS](/packages/jascha030-dic/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Php DI Container
================

[](#php-di-container)

[![Latest Stable Version](https://camo.githubusercontent.com/f386bf64e534172c9e0be3bf026ded9844de48d4d8e7124fcb2f9c1263423df0/68747470733a2f2f706f7365722e707567782e6f72672f6a61736368613033302f6469632f762f737461626c65)](https://packagist.org/packages/jascha030/dic)[![Total Downloads](https://camo.githubusercontent.com/bba304fd1e5f37c735c7f7ee06a5ced135cfc4d4ae98d78288709ff3c024b9ed/68747470733a2f2f706f7365722e707567782e6f72672f6a61736368613033302f6469632f646f776e6c6f616473)](https://packagist.org/packages/jascha030/dic)[![Latest Unstable Version](https://camo.githubusercontent.com/e2d6411bfa6df7bb6524f3d64e552e5c64053c378a0be576f88fcc952f56de4d/68747470733a2f2f706f7365722e707567782e6f72672f6a61736368613033302f6469632f762f756e737461626c65)](https://packagist.org/packages/jascha030/dic)[![License](https://camo.githubusercontent.com/e9a8fa2701eea9ffe6893c75e97bf31d86bf7aadfbdd2c49935759b5d5e3a5d1/68747470733a2f2f706f7365722e707567782e6f72672f6a61736368613033302f6469632f6c6963656e7365)](https://packagist.org/packages/jascha030/dic)[![composer.lock](https://camo.githubusercontent.com/5a008ac30f3270120319676484302850f8cae08599ae3cddc8caa3c76c21c64c/68747470733a2f2f706f7365722e707567782e6f72672f6a61736368613033302f6469632f636f6d706f7365726c6f636b)](https://packagist.org/packages/jascha030/dic)

About
-----

[](#about)

*Simple PSR-11 compliant dependency injection container.*

---

Around the the web there are many examples to be found for simple PHP DI Containers and Resolvers. From all the inspiration I have written a version to my own personal liking. Feel free to use it in your project or take it as inspiration for your own version.

For now only the object definition has been implemented but more will follow.

Getting started
---------------

[](#getting-started)

```
    $ composer require jascha030/dic
```

Usage
-----

[](#usage)

Short example:

Class UserService with dependency User.

```
class UserService
{
    public $user;

    public function __construct(User $user)
    {
        $this->user = $user;
    }

    public function printUserName()
    {
        echo "My name is " . $this->user->name;
    }
}
```

```
$container = new PsrServiceContainer(); // Instantiate container

$userService = $container->get(UserService::class); // Get service or class instance.

$userService->printUserName(); // Outputs: My name is Jeff
```

Full example in [src/example.php](https://github.com/jascha030/DI-Container/blob/master/src/example.php)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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 ~1 days

Total

3

Last Release

2335d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6109ecdd6607e0eec043d8adf1951cf700c0b030ab2fe3fff4525d961b6a50b7?d=identicon)[Jascha030](/maintainers/Jascha030)

---

Top Contributors

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

---

Tags

composer-packagedependency-injectiondependency-injection-containerdependency-injectordi-containerphp

### Embed Badge

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

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

###  Alternatives

[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k431.1M7.5k](/packages/symfony-dependency-injection)[illuminate/contracts

The Illuminate Contracts package.

704122.9M10.1k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31278.1M2.0k](/packages/illuminate-container)[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)

PHPackages © 2026

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