Skip to content

tux-rampage/laminas-di

 
 

Repository files navigation

laminas-di

Build Status Coverage Status

laminas-di provides autowiring to implement Inversion of Control (IoC) containers. IoC containers are widely used to create object instances that have all dependencies resolved and injected. Dependency Injection containers are one form of IoC – but not the only form.

laminas-di is designed to be simple, fast and reusable. It provides the following features:

  • Constructor injection
  • Autowiring:
    • Recursively through all dependencies
    • With configured type preferences
    • with configured injections
    • With injections passed in the create() call
  • Code generators to create factories usable by other IoC containers like Laminas\ServiceManager

It does not provide:

  • Setter, interface, property or any other injection method than constructor injection
  • Support for factories
  • Declaring shared/unshared instances
    • the injector always creates new instances
    • the default container always shares instances
  • Support for variadic arguments in __construct

If you need these features combine it with another IoC container such as laminas-servicemanager.

About

Automated dependency injection for PSR-11 containers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%