8000 [Console] [TableHelper] make it work with SymfonyStyle. by aitboudad · Pull Request #18581 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] [TableHelper] make it work with SymfonyStyle. #18581

New issue 8000

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

Merged
merged 1 commit into from
Apr 20, 2016

Conversation

aitboudad
Copy link
Contributor
Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? no
Fixed tickets #18573
License MIT
Doc PR ~

use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
use Symfony\Component\Console\Helper\TableCell;

//Ensure questions do not output anything when input is non-interactive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment needs to be updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@javiereguiluz
Copy link
Member

👍

@@ -204,7 +205,16 @@ public function caution($message)
*/
public function table(array $headers, array $rows)
{
$headers = array_map(function ($value) { return sprintf('<info>%s</>', $value); }, $headers);
array_walk_recursive($headers, function (&$value) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recursive required? Then should we add a test case which would trigger this recursive part?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really recusive, but it can be one/two-dimensional array which is already covered by test

@nicolas-grekas
Copy link
Member

👍

@fabpot
Copy link
Member
fabpot commented Apr 20, 2016

Thank you @aitboudad.

@fabpot fabpot merged commit 43cc93c into symfony:2.7 Apr 20, 2016
fabpot added a commit that referenced this pull request Apr 20, 2016
…itboudad)

This PR was merged into the 2.7 branch.

Discussion
----------

[Console] [TableHelper] make it work with SymfonyStyle.

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | #18573
| License       | MIT
| Doc PR        | ~

Commits
-------

43cc93c [Console] [TableHelper] make it work with SymfonyStyle.
@aitboudad aitboudad deleted the issue_18573 branch April 20, 2016 09:27
@ro0NL
Copy link
Contributor
ro0NL commented Apr 24, 2016

Question.. would a Table::set<Cell|Header|Row>Format() be nice to do the sprintf thingy in a standardized way? Imho this feels a bit like a workaround... something you have to repeat in each style implementation (and sure dont forget it ;-)).

@ro0NL
Copy link
Contributor
ro0NL commented Apr 26, 2016

@aitboudad any thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0