src/Dev/CLI.php
public static function text($text, $fgColour = null, $bgColour = null, $bold = false)
    {
        if (!self::supports_colour()) {
            return $text;
        }

        if ($fgColour || $bgColour || $bold) {
            $prefix = self::start_colour($fgColour, $bgColour, $bold);
            $suffix = self::end_colour();
        } else {
            $prefix = $suffix = "";
        }

        return $prefix . $text . $suffix;
    }
public static function text($text, $fgColour = null, $bgColour = null, $bold = false)
    {
        if (!self::supports_colour()) {
            return $text;
        }

        if ($fgColour || $bgColour || $bold) {
            $prefix = self::start_colour($fgColour, $bgColour, $bold);
            $suffix = self::end_colour();
        } else {
            $prefix = $suffix = "";
        }

        return $prefix . $text . $suffix;
    }
public static function text ( $ text , $ fgColour = null , $ bgColour = null , $ bold = false ) { if ( ! self :: supports_colour ( ) ) { return $ text ; } if ( $ fgColour || $ bgColour || $ bold ) { $ prefix = self :: start_colour ( $ fgColour , $ bgColour , $ bold ) ; $ suffix = self :: end_colour ( ) ; } else { $ prefix = $ suffix = "" ; } return $ prefix . $ text . $ suffix ; }
Return text encoded for CLI output, optionally coloured

@param string $text
@param string $fgColour The foreground colour - black, red, green, yellow, blue, magenta, cyan, white.
Null is default.
@param string $bgColour The foreground colour - black, red, green, yellow, blue, magenta, cyan, white.
Null is default.
@param bool $bold A boolean variable - bold or not.
@return string
Return text encoded for CLI output optionally coloured