initPlaceholderFormatters example

/** * Sets a placeholder formatter for a given name, globally for all instances of ProgressBar. * * This method also allow you to override an existing placeholder. * * @param string $name The placeholder name (including the delimiter char like %) * @param callable(ProgressBar):string $callable A PHP callable */
    public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void
    {
        self::$formatters ??= self::initPlaceholderFormatters();

        self::$formatters[$name] = $callable;
    }

    /** * Gets the placeholder formatter for a given name. * * @param string $name The placeholder name (including the delimiter char like %) */
    public static function getPlaceholderFormatterDefinition(string $name): ?callable
    {
        


    /** * Sets a placeholder formatter for a given name. * * This method also allow you to override an existing placeholder. * * @return void */
    public static function setPlaceholderFormatterDefinition(string $name, callable $callable)
    {
        self::$formatters ??= self::initPlaceholderFormatters();

        self::$formatters[$name] = $callable;
    }

    /** * Gets the placeholder formatter for a given name (including the delimiter char like %). */
    public static function getPlaceholderFormatterDefinition(string $name): ?callable
    {
        self::$formatters ??= self::initPlaceholderFormatters();

        
/** * Sets a placeholder formatter for a given name, globally for all instances of ProgressBar. * * This method also allow you to override an existing placeholder. * * @param string $name The placeholder name (including the delimiter char like %) * @param callable(ProgressBar):string $callable A PHP callable */
    public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void
    {
        self::$formatters ??= self::initPlaceholderFormatters();

        self::$formatters[$name] = $callable;
    }

    /** * Gets the placeholder formatter for a given name. * * @param string $name The placeholder name (including the delimiter char like %) */
    public static function getPlaceholderFormatterDefinition(string $name): ?callable
    {
        


    /** * Sets a placeholder formatter for a given name. * * This method also allow you to override an existing placeholder. * * @return void */
    public static function setPlaceholderFormatterDefinition(string $name, callable $callable)
    {
        self::$formatters ??= self::initPlaceholderFormatters();

        self::$formatters[$name] = $callable;
    }

    /** * Gets the placeholder formatter for a given name (including the delimiter char like %). */
    public static function getPlaceholderFormatterDefinition(string $name): ?callable
    {
        self::$formatters ??= self::initPlaceholderFormatters();

        
Home | Imprint | This part of the site doesn't use cookies.