Skip to content

[RFC] Add static method + interface to get command names at compile time #23796

Closed
@nicolas-grekas

Description

@nicolas-grekas
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version 3.4

With PSR-4-based service definitions, we can declare command as services. But this doesn't provide laziness for them, because we don't know their name at compile time.

To enhance that, what about adding a new static method + related interface to commands, ?
Eg.

public static function getDefaultName()
{
    return 'foo:bar';
}

That would also enable auto-configuration of commands. The method would be called to fill in the "name" attribute of the "console.command" tag when none is set.

ping @chalasr

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions