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

Skip to content

[Console] Wrapping cell text with setColumnMaxWidth could work better for console links #45521

Closed
@ondrejmirtes

Description

@ondrejmirtes

Symfony version(s) affected

5.4.3, 6.x possibly too

Description

Given a cell text that roughly looks like this:

Method PHPStan\Command\ErrorsConsoleStyle::wrap() is unused.\n
✏️ <href=phpstorm://...long link...>src/Command/ErrorsConsoleStyle.php</>

The resulting output is:

 ------ -----------------------------------------------------------------------------
  Line   src/Command/ErrorsConsoleStyle.php
 ------ -----------------------------------------------------------------------------
  83     Method PHPStan\Command\ErrorsConsoleStyle::wrap() is unused.
         ✏️  src/Com
         mand/ErrorsConsoleStyle.php
 ------ -----------------------------------------------------------------------------

But I'd like it to be this:

 ------ -----------------------------------------------------------------------------
  Line   src/Command/ErrorsConsoleStyle.php
 ------ -----------------------------------------------------------------------------
  83     Method PHPStan\Command\ErrorsConsoleStyle::wrap() is unused.
         ✏️  src/Command/ErrorsConsoleStyle.php
 ------ -----------------------------------------------------------------------------

How to reproduce

In context of SymfonyStyle child class:

		$table = $this->createTable();
		$table->setHeaders($headers);
		$table->setRows($rows);
		$table->setColumnMaxWidth(1, 60);

		$table->render();

Possible Solution

No response

Additional Context

No response

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