The Wayback Machine - https://web.archive.org/web/20220510011052/https://github.com/symfony/symfony
Skip to content
6.1
Switch branches/tags
Code

Latest commit

This PR was merged into the 6.1 branch.

Discussion
----------

[Console] Table vertical rendering

| Q             | A
| ------------- | ---
| Branch?       | 6.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #41595
| License       | MIT
| Doc PR        |

This PR adds a way to render Console Tables vertically. This is inspired by the way MySQL and PostgreSQL do with the '\G' command terminator.
For example, if we use this vertical rendering for the command `debug:validator`, the command would show something like:
```bash
App\Entity\Foo
-------------------

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property: bar                                                                                                                                                       |
|     Name: Symfony\Component\Validator\Constraints\Length                                                                                                            |
|   Groups: Default, Foo                                                                                                                                              |
|  Options: [                                                                                                                                                         |
|   "maxMessage" => "This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.",   |
|   "minMessage" => "This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.", |
|   "exactMessage" => "This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.",                                 |
|   "charsetMessage" => "This value does not match the expected {{ charset }} charset.",                                                                              |
|   "max" => 75,                                                                                                                                                      |
|   "min" => 2,                                                                                                                                                       |
|   "charset" => "UTF-8",                                                                                                                                             |
|   "normalizer" => null,                                                                                                                                             |
|   "allowEmptyString" => false,                                                                                                                                      |
|   "payload" => null                                                                                                                                                 |
| ]                                                                                                                                                                   |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ...                                                                                                                                                                 |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+

```
Instead of :
```bash
App\Entity\Foo
-------------------

+----------+------------------------------------------------+------------------------------------------------+----------------------------------------------------------------------------------+
| Property | Name                                           | Groups                                         | Options                                                                          |
+----------+------------------------------------------------+------------------------------------------------+----------------------------------------------------------------------------------+
| bar      | Symfony\Component\Validator\Constraints\Length | Default, Foo                                   | [                                                                                |
|          |                                                |                                                |   "maxMessage" => "This value                                                    |
|          |                                                |                                                | is too long. It should have {{ limit }} character or less.|This value is too lon |
|          |                                                |                                                | g. It should have {{ limit }} characters or less.",                              |
|          |                                                |                                                |   "minMessage" => "This value                                                    |
|          |                                                |                                                | is too short. It should have {{ limit }} character or more.|This value is too sh |
|          |                                                |                                                | ort. It should have {{ limit }} characters or more.",                            |
|          |                                                |                                                |   "exactMessage" => "This valu                                                   |
|          |                                                |                                                | e should have exactly {{ limit }} character.|This value should have exactly {{ l |
|          |                                                |                                                | imit }} characters.",                                                            |
|          |                                                |                                                |   "charsetMessage" => "This va                                                   |
|          |                                                |                                                | lue does not match the expected {{ charset }} charset.",                         |
|          |                                                |                                                |   "max" => 75,                                                                   |
|          |                                                |                                                |   "min" => 2,                                                                    |
|          |                                                |                                                |   "charset" => "UTF-8                                                   |
|          |                                                |                                                | 208m",                                                                           |
|          |                                                |                                                |   "normalizer" => null                                                   |
|          |                                                |                                                | ;208m,                                                                           |
|          |                                                |                                                |   "allowEmptyString" => false                                                   |
|          |                                                |                                                | [0;38;5;208m,                                                                    |
|          |                                                |                                                |   "payload" => null                                                   |
|          |                                                |                                                | 8m                                                                               |
|          |                                                |                                                | ]                                                                                |
...
+----------+------------------------------------------------+------------------------------------------------+----------------------------------------------------------------------------------+

```
Which is hard to read.

Commits
-------

15fa4c5 Console Table vertical rendering
8d5dd1b

Files

Permalink
Failed to load latest commit information.

Symfony is a PHP framework for web and console applications and a set of reusable PHP components. Symfony is used by thousands of web applications and most of the popular PHP projects.

Installation

Sponsor

Symfony 6.1 is backed by basecom.

As a professional software service provider, basecom implements customized solutions in the areas of e-commerce, PIM solutions and web portals. With our experience and certified expertise, we have been one of the most renowned Symfony specialists in Germany for many years.

Help Symfony by sponsoring its development!

Documentation

Community

Contributing

Symfony is an Open Source, community-driven project with thousands of contributors. Join them contributing code or contributing documentation.

Security Issues

If you discover a security vulnerability within Symfony, please follow our disclosure procedure.

About Us

Symfony development is led by the Symfony Core Team and supported by Symfony contributors.