Fwk\Di
Simple and powerfull Dependency Injection Container.

What is "Dependency Injection" and how this design pattern can improve my code ?

The magic of Dependency Injection

No matter the size of your app you'll require Resources (or Services) to be available: the database connection, the Cache manager etc. To be simple, you could load all these objects in a file called

services.php
and include it everytime you need to access some of these resources. However this is not recommended because you would have probably loaded unused resources, making your app not efficient (i.e costly).

Dependency Injection tries to solve this problem by letting the developer describe all its resources (Definitions) in a _Container_. A Definition is the way to tell the Container how to instanciate a resource. This makes Resources available "on demand" easily!