Skip to content

Make $_ENV usable in attributesΒ #15920

@Valentinfe

Description

@Valentinfe

Description

In my opinion, attributes usage is expanding and adding variables handling or at least $_ENV handling could prove very useful.

#[AsCronTask(expression: '0 */1 * * *', schedule: 'status_updater')]
public class Task{}

As you can see in this exemple, I would love to put this expression in an env var but I think it's not doable right now.

#[AsCronTask(expression: $_ENV['TASK_FREQUENCE'], schedule: 'status_updater')]
public class Task{}

Can you maybe give an explanation on why this is not doable. And if it is doable could it be added ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions