8000 [Console] added explanation of messages usage in a progress bar by fabpot · Pull Request #19035 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] added explanation of messages usage in a progress bar #19035

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

Merged
merged 1 commit into from
Jun 13, 2016
Merged
Changes from all commits
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
12 changes: 11 additions & 1 deletion src/Symfony/Component/Console/Helper/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ProgressBar
private $stepWidth;
private $percent = 0.0;
private $formatLineCount;
private $messages;
private $messages = array();
private $overwrite = true;

private static $formatters;
Expand Down Expand Up @@ -139,6 +139,16 @@ public static function getFormatDefinition($name)
return isset(self::$formats[$name]) ? self::$formats[$name] : null;
}

/**
* Associates a text with a named placeholder.
*
* The text is displayed when the progress bar is rendered but only
* when the corresponding placeholder is part of the custom format line
* (by wrapping the name with %).
*
* @param string $message The text to associate with the placeholder
* @param string $name The name of the placeholder
*/
public function setMessage($message, $name = 'message')
{
$this->messages[$name] = $message;
Expand Down
0