@@ -293,14 +293,14 @@ public static function printf(string $format, ...$args): void
293
293
/**
294
294
* Print colored message to STDOUT
295
295
*
296
- * @param string|array $messages
297
- * @param string $style
296
+ * @param string|array $messages
297
+ * @param string|array|null $style
298
298
*/
299
- public static function println ($ messages , string $ style = 'info ' ): void
299
+ public static function println ($ messages , $ style = 'info ' ): void
300
300
{
301
- $ string = is_array ($ messages ) ? implode ("\n" , $ messages ) : (string )$ messages ;
301
+ $ str = is_array ($ messages ) ? implode ("\n" , $ messages ) : (string )$ messages ;
302
302
303
- echo self ::render ($ string , $ style ) . PHP_EOL ;
303
+ echo self ::render ($ str , $ style ) . PHP_EOL ;
304
304
}
305
305
306
306
/**
@@ -321,8 +321,8 @@ public static function addTag(string $text, string $tag = 'info'): string
321
321
/**
322
322
* Render text, apply color code
323
323
*
324
- * @param string $text
325
- * @param string|array $style
324
+ * @param string $text
325
+ * @param string|array|null $style
326
326
* - string: 'green', 'blue'
327
327
* - array: [Color::FG_GREEN, Color::BG_WHITE, Color::UNDERSCORE]
328
328
*
@@ -345,11 +345,11 @@ public static function render(string $text, $style = null): string
345
345
if (is_string ($ style )) {
346
346
$ color = self ::STYLES [$ style ] ?? '' ;
347
347
348
- // custom style: [self::FG_GREEN, self::BG_WHITE, self::UNDERSCORE]
348
+ // custom style: [self::FG_GREEN, self::BG_WHITE, self::UNDERSCORE]
349
349
} elseif (is_array ($ style )) {
350
350
$ color = implode ('; ' , $ style );
351
351
352
- // user color tag: <info>message</info>
352
+ // user color tag: <info>message</info>
353
353
} elseif (strpos ($ text , '</ ' ) > 0 ) {
354
354
return self ::parseTag ($ text );
355
355
}
0 commit comments