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

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

smeeckaert/di
=============

08PHP

Since Sep 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/smeeckaert/di)[ Packagist](https://packagist.org/packages/smeeckaert/di)[ RSS](/packages/smeeckaert-di/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

DI
==

[](#di)

DI is an experiment on dependancy injection in PHP.

The aim of the experiment is to allow the simplest DI in PHP classes making it easily implementable in existing classes as well as working with legacy classes.

There are no God Container and it is based on convention.

It works in PHP 7.0 and hopefully in PHP 5.6. It will work well with any IDE understanding PHPDoc.

All codes examples in this doc can be found in the demo folder.

Overview
--------

[](#overview)

The trait `\FW\DI\DI` is all you need to declare in a class to benefit from the DI.

```
// DBConnection.php
