Autowiring
Injecting values by ID
Scalars and configuration come from the container by ID, using an attribute:Resolvers
Two resolvers extend the container with dynamic IDs.Configuration
Anything starting withconfig. comes from the configuration object built at bootstrap:
Options
Anything starting withoption. comes from the options table. Values are stored as JSON, flattened into a dot map, and cast on the way out:
Options are read once per request. If the database isn’t configured, resolution quietly returns nothing, which keeps the installer working.
Resolving imperatively
Where constructor injection isn’t possible, such as inside a plugin’sboot():
Application::make($id, $default) returns the default when the ID can’t be resolved, instead of throwing.
Binding your own services
Bind an interface when callers should depend on the contract:Keyed registries
For extension points with many implementations, Aikeedo uses registries rather than container bindings, so implementations can be listed as well as resolved:
Entries are stored as class names and resolved from the container on first use, so registering is cheap.