Cli Notifications

Notifications are used to keep users aware of the current state of an executed command. They help users to have a clearer understanding pf what is going on. For example, there could be notifications for when a code successfully executes or when an error is encountered. The Cli class provides some useful methods for setting responses. These method have a predefined text prefixes assigned to messages. The text prefixes also use similarly related color codes to quickly call console users to awareness. The following are notification related methods.

Cli::error()
This method makes it easier to display error texts. It adds a prefix of "Error:" on any text supplied and returns the prefixed text.

Syntax
    Cli::error($text, $indent); 
    
      where: 
    
        $text   : The error text to be prefixed
        $indent : Number of left space indents to be added
    
                                            

Cli::warning()
This method makes it easier to display warning texts. It adds a prefix of "Warning:" on any text supplied and returns the prefixed text.

Syntax
    Cli::warning($text, $indent); 
    
      where: 
    
        $text   : The error text to be prefixed
        $indent : Number of left space indents to be added
    
                                            

Cli::caution()
This method makes it easier to display caution texts. It adds a prefix of "CAUTION:" on any text supplied and returns the prefixed text.

Syntax
    Cli::warning($text, $indent); 
    
      where: 
    
        $text   : The error text to be prefixed
        $indent : Number of left space indents to be added
    
                                            

Cli::notice()
This method makes it easier to display notice texts. It adds a prefix of "NOTICE:" on any text supplied and returns the prefixed text.

Syntax
    Cli::warning($text, $indent); 
    
      where: 
    
        $text   : The error text to be prefixed
        $indent : Number of left space indents to be added
    
                                            

Cli::success()
This method makes it easier to display notice texts. It adds a prefix of "Success:" on any text supplied and returns the prefixed text.

Syntax
    Cli::warning($text, $indent); 
    
      where: 
    
        $text   : The error text to be prefixed
        $indent : Number of left space indents to be added