Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 64ec5c5

Browse filesBrowse files
committed
feature #21664 [Console] simplify the implementation of SymfonyStyle::comment() (fabpot)
This PR was merged into the 3.3-dev branch. Discussion ---------- [Console] simplify the implementation of SymfonyStyle::comment() | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes-ish | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 2321491 [Console] simplify the implementation of SymfonyStyle::comment()
2 parents 42de145 + 2321491 commit 64ec5c5
Copy full SHA for 64ec5c5

File tree

1 file changed

+4
-7
lines changed
Filter options

1 file changed

+4
-7
lines changed

‎src/Symfony/Component/Console/Style/SymfonyStyle.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Style/SymfonyStyle.php
+4-7Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ public function __construct(InputInterface $input, OutputInterface $output)
6363
* @param string|null $style The style to apply to the whole block
6464
* @param string $prefix The prefix for the block
6565
* @param bool $padding Whether to add vertical padding
66+
* @param bool $escape Whether to escape the message
6667
*/
67-
public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false)
68+
public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = true)
6869
{
6970
$messages = is_array($messages) ? array_values($messages) : array($messages);
7071

7172
$this->autoPrependBlock();
72-
$this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, true));
73+
$this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape));
7374
$this->newLine();
7475
}
7576

@@ -133,11 +134,7 @@ public function text($message)
133134
*/
134135
public function comment($message)
135136
{
136-
$messages = is_array($message) ? array_values($message) : array($message);
137-
138-
$this->autoPrependBlock();
139-
$this->writeln($this->createBlock($messages, null, null, '<fg=default;bg=default> // </>'));
140-
$this->newLine();
137+
$this->block($message, null, null, '<fg=default;bg=default> // </>', false, false);
141138
}
142139

143140
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.