[Console] simplify the implementation of SymfonyStyle::comment()
This commit is contained in:
parent
6ea39990c3
commit
2321491d3f
@ -63,13 +63,14 @@ class SymfonyStyle extends OutputStyle
|
|||||||
* @param string|null $style The style to apply to the whole block
|
* @param string|null $style The style to apply to the whole block
|
||||||
* @param string $prefix The prefix for the block
|
* @param string $prefix The prefix for the block
|
||||||
* @param bool $padding Whether to add vertical padding
|
* @param bool $padding Whether to add vertical padding
|
||||||
|
* @param bool $escape Whether to escape the message
|
||||||
*/
|
*/
|
||||||
public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false)
|
public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = true)
|
||||||
{
|
{
|
||||||
$messages = is_array($messages) ? array_values($messages) : array($messages);
|
$messages = is_array($messages) ? array_values($messages) : array($messages);
|
||||||
|
|
||||||
$this->autoPrependBlock();
|
$this->autoPrependBlock();
|
||||||
$this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, true));
|
$this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape));
|
||||||
$this->newLine();
|
$this->newLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,11 +134,7 @@ class SymfonyStyle extends OutputStyle
|
|||||||
*/
|
*/
|
||||||
public function comment($message)
|
public function comment($message)
|
||||||
{
|
{
|
||||||
$messages = is_array($message) ? array_values($message) : array($message);
|
$this->block($message, null, null, '<fg=default;bg=default> // </>', false, false);
|
||||||
|
|
||||||
$this->autoPrependBlock();
|
|
||||||
$this->writeln($this->createBlock($messages, null, null, '<fg=default;bg=default> // </>'));
|
|
||||||
$this->newLine();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user