8000 [RFC][Console] Added console style guide helpers by kbond · Pull Request #12035 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[RFC][Console] Added console style guide helpers #12035

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

Closed
wants to merge 24 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added style guide table style
  • Loading branch information
kbond committed Oct 2, 2014
commit d34e0da3a09a11ad2d899c48f1ca4856fdda760d
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
namespace Symfony\Component\Console\Style\Standard;

use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableStyle;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ChoiceQuestion;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Question\Question;
Expand All @@ -22,6 +24,24 @@
*/
class StandardOutputStyle extends AbstractOutputStyle
{
/**
* {@inheritdoc}
*/
public function __construct(OutputInterface $output)
{
$styleGuideTableStyle = new TableStyle();
$styleGuideTableStyle
->setHorizontalBorderChar('-')
->setVerticalBorderChar(' ')
->setCrossingChar(' ')
->setCellHeaderFormat('%s')
;

Table::setStyleDefinition('symfony-style-guide', $styleGuideTableStyle);
Copy link
Member Author

Choose a reason for hiding this comment

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

Should I add this in Table::initStyles?


parent::__construct($output);
}

/**
* Formats a message as a block of text.
*
Expand Down Expand Up @@ -136,6 +156,7 @@ public function table(array $headers, array $rows)
$table = new Table($this);
$table->setHeaders($headers);
$table->setRows($rows);
$table->setStyle('symfony-style-guide');

$table->render();
$this->ln();
Expand Down
0