Inject
in package
FinalYes
#[Inject] attribute.
Marks a property or method as an injection point
Tags
Attributes
- #[Attribute]
- \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER
Table of Contents
Properties
- $name : string|null
- Entry name.
- $parameters : array<string|int, mixed>
- Parameters, indexed by the parameter number (index) or name.
Methods
- __construct() : mixed
- getName() : string|null
- getParameters() : array<string|int, mixed>
Properties
$name
Entry name.
private
string|null
$name
= null
$parameters
Parameters, indexed by the parameter number (index) or name.
private
array<string|int, mixed>
$parameters
= []
Used if the attribute is set on a method
Methods
__construct()
public
__construct([string|array<string|int, mixed>|null $name = null ]) : mixed
Parameters
- $name : string|array<string|int, mixed>|null = null
Tags
getName()
public
getName() : string|null
Return values
string|null —Name of the entry to inject
getParameters()
public
getParameters() : array<string|int, mixed>
Return values
array<string|int, mixed> —Parameters, indexed by the parameter number (index) or name