FEATURE: Create value objects from injected setting #3080
Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Description
Consider the following injected property:
#[Flow\InjectConfiguration(path: 'defaultClusterIdentifier')]
protected string $defaultClusterIdentifier;
Because the setting is a string, we need to use string
as the type of the property. Ideally though, we could use a value object and Flow instantiates it automatically using its fromString()
method:
#[Flow\InjectConfiguration(path: 'defaultClusterIdentifier')]
protected ClusterIdentifier $defaultClusterIdentifier;
Likewise this should be supported for fromArray()
and other methods, if they exist in the declared class.
Possible Solution
No response
Metadata
Assignees
Type
Projects
Status
No status