You are here

public static function ProgressBar::setPlaceholderFormatterDefinition in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Helper/ProgressBar.php \Symfony\Component\Console\Helper\ProgressBar::setPlaceholderFormatterDefinition()

Sets a placeholder formatter for a given name.

This method also allow you to override an existing placeholder.

Parameters

string $name The placeholder name (including the delimiter char like %):

callable $callable A PHP callable:

2 calls to ProgressBar::setPlaceholderFormatterDefinition()
ProgressBarTest::testAddingPlaceholderFormatter in vendor/symfony/console/Tests/Helper/ProgressBarTest.php
ProgressBarTest::testAnsiColorsAndEmojis in vendor/symfony/console/Tests/Helper/ProgressBarTest.php
@requires extension mbstring

File

vendor/symfony/console/Helper/ProgressBar.php, line 87

Class

ProgressBar
The ProgressBar provides helpers to display progress output.

Namespace

Symfony\Component\Console\Helper

Code

public static function setPlaceholderFormatterDefinition($name, $callable) {
  if (!self::$formatters) {
    self::$formatters = self::initPlaceholderFormatters();
  }
  self::$formatters[$name] = $callable;
}