gacela-project /
container
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace Gacela\Container\Attribute; |
||
| 6 | |||
| 7 | use Attribute; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Marks a constructor parameter for dependency injection. |
||
| 11 | * Optionally specifies which concrete implementation to inject. |
||
| 12 | */ |
||
| 13 | #[Attribute(Attribute::TARGET_PARAMETER)] |
||
| 14 | final class Inject |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @param class-string|null $implementation The specific implementation to inject |
||
|
0 ignored issues
–
show
Documentation
Bug
introduced
by
Loading history...
|
|||
| 18 | */ |
||
| 19 | 3 | public function __construct( |
|
| 20 | public ?string $implementation = null, |
||
| 21 | ) { |
||
| 22 | 3 | } |
|
| 23 | } |
||
| 24 |