Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[RFC] (Console) Add a second style (besides SymfonyStyle) #58714

Open
@dsentker

Description

@dsentker

Description

The SymfonyStyle has helped us for years to display messages and other information nicely in the console. However, the formatting of various events, e.g. "success", could also be displayed differently.

In my opinion, more text is easier to read if it is not highlighted in color. One solution is to use the color scheme only for the outline of the block. A positive side effect is a sleek and modern output. Here is an Example:

protected function execute(InputInterface $input, OutputInterface $output): int
{
    $outlineStyle = new OutlineStyle($input, $output);
    $outlineStyle->box('Hello World');
    $outlineStyle->box('A title for this box is also possible', 'Title here');
    $outlineStyle->success('This is a multiline demo message to demonstrate how the text behaves across multiple lines with different message boxes.');
    $outlineStyle->error('This is a multiline demo message to demonstrate how the text behaves across multiple lines with different message boxes.');
    $outlineStyle->warning('This is a multiline demo message to demonstrate how the text behaves across multiple lines with different message boxes.');
    $outlineStyle->note('This is a multiline demo message to demonstrate how the text behaves across multiple lines with different message boxes.');
}

I played around a bit and I think the result is pretty neat.

I therefore suggest adding this second style to the Console component as well.

Example

image

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions