本文整理汇总了PHP中Symfony\Component\Console\Helper\TableStyle::setVerticalBorderChar方法的典型用法代码示例。如果您正苦于以下问题:PHP TableStyle::setVerticalBorderChar方法的具体用法?PHP TableStyle::setVerticalBorderChar怎么用?PHP TableStyle::setVerticalBorderChar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Console\Helper\TableStyle
的用法示例。
在下文中一共展示了TableStyle::setVerticalBorderChar方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: declareWinner
private function declareWinner(PokerGame $pokerGame)
{
$style = new TableStyle();
$style->setVerticalBorderChar('<fg=red;bg=black>|</>')->setHorizontalBorderChar('<fg=red;bg=black>-</>');
$winningHand = $pokerGame->getWinner();
$table = new Table($this->output);
$table->setRows([$winningHand]);
$table->render();
}
示例2: displayErrors
/**
* Display validation errors.
*
* @param Validator $validator The json-schema validator.
* @param OutputInterface $output An OutputInterface instance.
*/
public static function displayErrors(Validator $validator, OutputInterface $output)
{
$table = new Table($output);
$style = new TableStyle();
$style->setCellHeaderFormat('<error>%s</error>');
$style->setHorizontalBorderChar(' ');
$style->setVerticalBorderChar(' ');
$style->setCrossingChar(' ');
$table->setHeaders(['Property', 'Error']);
$table->setRows($validator->getErrors());
$table->setStyle($style);
$table->render();
}
示例3: getTable
/**
* Get a Table instance.
*
* Falls back to legacy TableHelper.
*
* @return Table|TableHelper
*/
protected function getTable(OutputInterface $output)
{
if (!class_exists('Symfony\\Component\\Console\\Helper\\Table')) {
return $this->getTableHelper();
}
$style = new TableStyle();
$style->setVerticalBorderChar(' ')->setHorizontalBorderChar('')->setCrossingChar('');
$table = new Table($output);
return $table->setRows(array())->setStyle($style);
}
示例4: table
/**
* @param string[] $rows
* @param string[] $headers
*/
public function table(array $rows, array $headers = null)
{
$rows = array_map(function ($value) {
if (!is_array($value)) {
return $value;
}
$header = array_shift($value);
array_unshift($value, sprintf('<fg=blue>%s</>', $header));
return $value;
}, $rows);
$style = new TableStyle();
$style->setVerticalBorderChar('<fg=blue>|</>');
$style->setHorizontalBorderChar('<fg=blue>-</>');
$style->setCrossingChar('<fg=blue>+</>');
$style->setCellHeaderFormat('%s');
$table = new Table($this);
$table->setStyle($style);
if ($headers) {
$table->setHeaders($headers);
}
$table->setRows($rows);
$table->render();
$this->newLine();
}