public static function set($error, $key = null)
    {
        if (isset($key)) {
            static::$errors[$key] = $error;
        } else {
            static::$errors = $error;
        }
    }
public static function set($error, $key = null)
    {
        if (isset($key)) {
            static::$errors[$key] = $error;
        } else {
            static::$errors = $error;
        }
    }
public static function set ( $ error , $ key = null ) { if ( isset ( $ key ) ) { static :: $ errors [ $ key ] = $ error ; } else { static :: $ errors = $ error ; } }
Set the error msg.

@param (string)          $error error msg
@param (string) optional $key   key of error msg like username

@since 2.0.3

@return bool
Set the error msg .