Dirthara Container
A PSR-11 dependency injection container with autowiring for the Dirthara framework.
Installation
Requirements and installation of Dirthara Container.
Getting started
Register instances, bindings, and singletons, and resolve entries from the container.
Autowiring
How the container builds classes that are not registered, and how it fills in each constructor parameter.
Contextual bindings
Give one class a different dependency, or a value for a parameter, without changing it for the rest.
Making and calling
Build new instances with make(), pass constructor parameters, and call methods and closures with call().
Attributes
Declare a type's default implementation, its lifetime, and what a parameter receives with attributes.
Tags
Group entries under a tag, and resolve or inject every entry with that tag.
Decorators
Wrap or replace what the container builds for an entry with extend() and the
Lazy services
Hand out a lazy object that builds a class only when it is first used, with lazy() or the
Resolution callbacks
Run a callback on every object of a type the container builds, with afterResolving().
Introspection
List what is registered, and describe where an entry comes from and how it is built.
Delegate containers
Resolve entries the container does not have from other PSR-11 containers.
Error handling
The exception interface, the exception classes, what get() throws when, diagnostic context, and logging.