Interface for managing container services in the application.
This interface defines a method for configuring and registering dependency injection (DI) containers
using the provided ContainerService
. It enables the registration of services or objects that can
later be injected into other components.
Example usage for registering a service:
public function containers(ContainerService $service): ContainerService
{
return $service->register(new Test('foo bar'));
}
Example usage for injecting a registered service:
#[\Darken\Attributes\Inject]
public Test $test;
Configure and register containers for dependency injection. This method allows the registration of services or objects into the DI container, making them available for injection into other components via attributes or constructor injection.
Example:
return $service->register(new Test($this->env('DARKEN_TEST', 'test')));
$service | Darken\Service\ContainerService |
Return | Darken\Service\ContainerService |