Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ProgressIndicator.php

function ProgressIndicator::initPlaceholderFormatters

Return value

array<string, \Closure>

2 calls to ProgressIndicator::initPlaceholderFormatters()
ProgressIndicator::getPlaceholderFormatterDefinition in vendor/symfony/console/Helper/ProgressIndicator.php
Gets the placeholder formatter for a given name (including the delimiter char like %).
ProgressIndicator::setPlaceholderFormatterDefinition in vendor/symfony/console/Helper/ProgressIndicator.php
Sets a placeholder formatter for a given name.

File

vendor/symfony/console/Helper/ProgressIndicator.php, line 233

Class

ProgressIndicator
@author Kevin Bond <kevinbond@gmail.com>

Namespace

Symfony\Component\Console\Helper

Code

private static function initPlaceholderFormatters() : array {
    return [
        'indicator' => fn(self $indicator) => $indicator->finished ? $indicator->finishedIndicatorValue : $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)],
        'message' => fn(self $indicator) => $indicator->message,
        'elapsed' => fn(self $indicator) => Helper::formatTime(time() - $indicator->startTime, 2),
        'memory' => fn() => Helper::formatMemory(memory_get_usage(true)),
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal