Skip to content

Commit 02d1091

Browse files
committed
bug #4209 Fix method for adding placholders in progressBar (danez)
This PR was merged into the 2.5 branch. Discussion ---------- Fix method for adding placholders in progressBar The method is called setPlaceholderFormatterDefinition and not setPlaceholderFormatter see [here][1] Edit: I found another glitch: The name of the placeholder must not be packed in %-characters, like it is the case when using the placeholders in the format. As you can see [here][2] the defaults are also not like this and best indication: it does not work if doing like in the docs :) [1]: https://github.com/symfony/symfony/blob/2.5/src/Symfony/Component/Console/Helper/ProgressBar.php#L82 [2]: https://github.com/symfony/symfony/blob/2.5/src/Symfony/Component/Console/Helper/ProgressBar.php#L486 Commits ------- f3ef9dc The name of the placeholder must not be encapsulated in % fb0e79c Fix method for adding placholders in progressBar
2 parents 4a7f973 + f3ef9dc commit 02d1091

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/console/helpers/progressbar.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ display that are not available in the list of built-in placeholders, you can
289289
create your own. Let's see how you can create a ``remaining_steps`` placeholder
290290
that displays the number of remaining steps::
291291

292-
ProgressBar::setPlaceholderFormatter(
293-
'%remaining_steps%',
292+
ProgressBar::setPlaceholderFormatterDefinition(
293+
'remaining_steps',
294294
function (ProgressBar $bar, OutputInterface $output) {
295295
return $bar->getMaxSteps() - $bar->getStep();
296296
}

0 commit comments

Comments
 (0)