-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Tweaked some console command styles #14196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👍 |
Nice job Javier! |
👍 |
Thank you @javiereguiluz. |
This PR was squashed before being merged into the 2.7 branch (closes #14196). Discussion ---------- Tweaked some console command styles | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14174 | License | MIT | Doc PR | - As discussed, after updating the first console commands to the new style guide, we were going to introduce the needed tweaks. This PR is the first one with those tweaks. ### Tables Headers now are displayed in the usual green color used frequently by Symfony commands:  ### Command tiles and section titles I see these titles in a beautiful blue color ... but lots of people use color schemes which make them almost unreadable. Now they use the yellow color frequently used by Symfony commands:  ### Listings Elements in a listing no longer add an extra blank line. See #14174 for the rationale. Commits ------- dcf1801 Tweaked some console command styles
@@ -183,6 +183,8 @@ public function caution($message) | |||
*/ | |||
public function table(array $headers, array $rows) | |||
{ | |||
$headers = array_map(function ($value) { return sprintf('<info>%s</>', $value); }, $headers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of interest: what's the advantage of </>
? I'm seeing it more and more these days and I'm not sure why. Probably, there is a reason for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm the one who introduced that, so, mainly to avoid too much noise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally use it because the code looks more much concise and clear to me. Since this is just markup and not "real code", I want it to mess my code as less as possible. That's why using </info>
looks very repetitive to me. When using custom styles (e.g. <fg=blue>
) duplicating it in the closing tag loks awfully boring to me.
As discussed, after updating the first console commands to the new style guide, we were going to introduce the needed tweaks. This PR is the first one with those tweaks.
Tables
Headers now are displayed in the usual green color used frequently by Symfony commands:
Command tiles and section titles
I see these titles in a beautiful blue color ... but lots of people use color schemes which make them almost unreadable. Now they use the yellow color frequently used by Symfony commands:
Listings
Elements in a listing no longer add an extra blank line. See #14174 for the rationale.