@@ -293,14 +293,14 @@ public static function printf(string $format, ...$args): void
293293 /**
294294 * Print colored message to STDOUT
295295 *
296- * @param string|array $messages
297- * @param string $style
296+ * @param string|array $messages
297+ * @param string|array|null $style
298298 */
299- public static function println ($ messages , string $ style = 'info ' ): void
299+ public static function println ($ messages , $ style = 'info ' ): void
300300 {
301- $ string = is_array ($ messages ) ? implode ("\n" , $ messages ) : (string )$ messages ;
301+ $ str = is_array ($ messages ) ? implode ("\n" , $ messages ) : (string )$ messages ;
302302
303- echo self ::render ($ string , $ style ) . PHP_EOL ;
303+ echo self ::render ($ str , $ style ) . PHP_EOL ;
304304 }
305305
306306 /**
@@ -321,8 +321,8 @@ public static function addTag(string $text, string $tag = 'info'): string
321321 /**
322322 * Render text, apply color code
323323 *
324- * @param string $text
325- * @param string|array $style
324+ * @param string $text
325+ * @param string|array|null $style
326326 * - string: 'green', 'blue'
327327 * - array: [Color::FG_GREEN, Color::BG_WHITE, Color::UNDERSCORE]
328328 *
@@ -345,11 +345,11 @@ public static function render(string $text, $style = null): string
345345 if (is_string ($ style )) {
346346 $ color = self ::STYLES [$ style ] ?? '' ;
347347
348- // custom style: [self::FG_GREEN, self::BG_WHITE, self::UNDERSCORE]
348+ // custom style: [self::FG_GREEN, self::BG_WHITE, self::UNDERSCORE]
349349 } elseif (is_array ($ style )) {
350350 $ color = implode ('; ' , $ style );
351351
352- // user color tag: <info>message</info>
352+ // user color tag: <info>message</info>
353353 } elseif (strpos ($ text , '</ ' ) > 0 ) {
354354 return self ::parseTag ($ text );
355355 }
0 commit comments