Skip to content

Commit 9932270

Browse files
committed
[Console] fixed some initializations in the ProgressBar class
1 parent 091a779 commit 9932270

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Helper/ProgressBar.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ public static function setPlaceholderFormatterDefinition($name, $callable)
9797
*/
9898
public static function getPlaceholderFormatterDefinition($name)
9999
{
100+
if (!self::$formatters) {
101+
self::$formatters = self::initPlaceholderFormatters();
102+
}
103+
100104
return isset(self::$formatters[$name]) ? self::$formatters[$name] : null;
101105
}
102106

@@ -126,6 +130,10 @@ public static function setFormatDefinition($name, $format)
126130
*/
127131
public static function getFormatDefinition($name)
128132
{
133+
if (!self::$formats) {
134+
self::$formats = self::initFormats();
135+
}
136+
129137
return isset(self::$formats[$name]) ? self::$formats[$name] : null;
130138
}
131139

0 commit comments

Comments
 (0)