$var) { if ($count > 1) { self::write(($index + 1) . ') ', 'magenta', 'black', ['bold']); } self::writeLn(is_scalar($var) ? var_export($var, true) : print_r($var, true)); } } protected static function write($text, $color = 'white', $background = 'black', array $options = []) { echo (new OutputFormatterStyle($color, $background, $options))->apply($text); } protected static function writeLn($text, $color = 'white', $background = 'black', array $options = []) { self::write($text, $color, $background, $options); echo PHP_EOL; } }