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

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

evaneos/dic-it
==============

Yet another dependency injection container

v2.2.1(12y ago)069.7k11MITPHP

Since Nov 1Pushed 4y ago19 watchersCompare

[ Source](https://github.com/Evaneos/dic-it)[ Packagist](https://packagist.org/packages/evaneos/dic-it)[ Docs](http://github.com/Evaneos/dic-it)[ RSS](/packages/evaneos-dic-it/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (9)Versions (8)Used By (1)

dic-it
======

[](#dic-it)

DIC-IT is a simple dependency injection container, with extensible activation &amp; injection strategies.

Setup
-----

[](#setup)

The recommended setup is to create a config folder at the root of your repository. All configuration is based on YAML files.

Sample YAML file :

```
parameters:
    MyParameter: 'Some parameter value'
    MyOtherParameter: 42
    MyParameters:
        nested_level:
            foo : foo
            bar : bar
            baz : foobar
classes:
    MyServiceName:
        class: \Fully\Qualified\ClassName
        arguments: [ @MyDependency, %MyParameter, %MyParameters.nested_level, 'Hard-coded value', $container, $env.ENV, $const.ROOT_PATH ]
    MyDependency:
        class: \Fully\Qualified\DependencyClassName
        props:
            MyProperty: %MyOtherParameter
```

References
----------

[](#references)

You can inject different kind of references inside class definitions. You can get other service instances, parameters, the container itself, env variables, and constant values.

- @ServiceName : fetch an instance of that definition
- %param : fetch a parameter defined in the container
- $container : fetch the container itself
- $env.ENV\_NAME : fetch an environment variable
- $const.CONST\_NAME : fetch a global defined constant value

Using includes
--------------

[](#using-includes)

The configuration can be split into multiple files to ease management of your dependencies :

```
includes:
    - relative/file.yml
    - relative/another-file.yml

classes:
    ...
```

This allows you to separate parameters from service definitions for example.

Default object life-cycle
-------------------------

[](#default-object-life-cycle)

By default, all objects are created as non-singleton (this will definitely change) objects, so every time a reference is resolved by the container, a new instance of the requested object is created.

Managing circular dependencies
------------------------------

[](#managing-circular-dependencies)

By default, circular dependencies are not handled well (stack overflow...) due the default object life-cycle. To enable circular dependencies for a given object, at least one of the two objects must be defined as a singleton. This however will not yield the expected results, so it is *highly* recommended to define both objects involved in the circular dependency as singletons.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 72.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 ~0 days

Total

7

Last Release

4582d ago

Major Versions

1.0.2 → v2.0.02013-11-01

### Community

Maintainers

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

---

Top Contributors

[![oliviermadre](https://avatars.githubusercontent.com/u/1543271?v=4)](https://github.com/oliviermadre "oliviermadre (49 commits)")[![maffpool](https://avatars.githubusercontent.com/u/4547357?v=4)](https://github.com/maffpool "maffpool (6 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (3 commits)")[![jjsaunier](https://avatars.githubusercontent.com/u/1763341?v=4)](https://github.com/jjsaunier "jjsaunier (3 commits)")[![christophehurpeau](https://avatars.githubusercontent.com/u/302891?v=4)](https://github.com/christophehurpeau "christophehurpeau (2 commits)")[![Prophet777](https://avatars.githubusercontent.com/u/76678181?v=4)](https://github.com/Prophet777 "Prophet777 (2 commits)")[![joelwurtz](https://avatars.githubusercontent.com/u/90466?v=4)](https://github.com/joelwurtz "joelwurtz (1 commits)")[![robink](https://avatars.githubusercontent.com/u/116530?v=4)](https://github.com/robink "robink (1 commits)")[![artggd](https://avatars.githubusercontent.com/u/1837559?v=4)](https://github.com/artggd "artggd (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)

PHPackages © 2026

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