Skip to content

Inject

Parameter-level override: resolve this parameter from the container by an explicit id instead of autowiring by type.

Use to pick among multiple implementations of an interface, or to name a service registered under a role/alias rather than a class.

final class Inject

SourceDI/Attribute/Inject.php
PropertyTypeDescription
$idstring

public function __construct(string $id): mixed

ParameterTypeDescription
$idstring

Returns mixed