Problem/Motivation

From @larowlan comment on #3594336: Add a command to list modules and themes on a site, it may be a good idea to have a class/interface that uses OutputFormat enum so that it is extensible.

Should this implement an interface and then we type hint on that - it would allow [other thing] to ship its own output format?

Steps to reproduce

Proposed resolution

Create an interface or class that makes use of OutputFormat so that specialized formats can be used by contrib for contrib use cases.

Remaining tasks

User interface changes

N/A

Introduced terminology

TBD

API changes

TBD

Data model changes

N/A

Release notes snippet

Comments

mradcliffe created an issue.

moshe weitzman’s picture

We tentatively decided we would not provide an output format system as Drush did that for years and the Console community did not follow us. IMO its overengineering to provide extensible format names (and not the formatters themselves).

larowlan’s picture

Yeah I was thinking we'd make OutputFormat implement an interface and type hint that

And then add render output method to the interface and move the match from command to the enum

A new format is then a new enum that implements the interface

Enums are nice like that