Skip to content

[Console] decorable commands? #34907

@Wojciechem

Description

@Wojciechem

Description
I see some cases where it would make sense to decorate the command itself, not underlying application-layer services - for example to have BenchmarkingCommand, VerboseLoggingCommand, CronCommand etc, which would be precisely "generic" decorators for existing command(s).

This is kinda possible with console as it is now, but AFAIK, console commands must be based on Console\Command class. Which is easy and convenient, but forces several ugly things like overwriting constructor for DI etc.
I can "hack together" my decorators, but I'm not sure if I'm not missing something important.

How about introducing an interface for commands? Is this possible? Is this for some reason discouraged?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConsoleRFCRFC = Request For Comments (proposals about features that you want to be discussed)Stalled

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions