Defined function scopes , modified code styling to match present standards of ClipBucket

This commit is contained in:
Saqib Razzaq 2017-01-19 11:52:28 +05:00
parent 235f92482a
commit 152490593c

View file

@ -11,46 +11,46 @@ class errorhandler extends ClipBucket {
public $warning_list = array();
/**
* Function used to add new Error
*/
* Function used to add new Error
*/
/*function add_error($message=NULL,$id=NULL) {
private static function add_error($message=NULL,$id=NULL) {
global $ignore_cb_errors;
//if id is set, error will be generated from error message list
if(!$ignore_cb_errors)
$this->error_list[] = $message;
}*/
}
/**
* Function usd to add new warning
*/
/*function add_warning($message=NULL,$id=NULL)
{
* Function usd to add new warning
*/
private static function add_warning($message=NULL,$id=NULL) {
$this->warning_list[] = $message;
}
*/
/**
* Function used to get error list
*/
* Function used to get error list
*/
function error_list() {
public function error_list() {
return $this->error_list;
}
/**
* Function used to flush errors
*/
function flush_error()
{
$this->error_list = '';
}
/**
* Function used to flush errors
*/
public static function flush_error() {
$this->error_list = '';
}
/**
* Functio nused to add message_list
*/
function add_message($message=NULL,$id=NULL)
{
* Functio nused to add message_list
*/
public static function add_message($message=NULL,$id=NULL) {
global $ignore_cb_errors;
//if id is set, error will be generated from error message list
if(!$ignore_cb_errors)
@ -58,49 +58,48 @@ class errorhandler extends ClipBucket {
}
/**
* Function used to get message list
*/
function message_list()
{
* Function used to get message list
*/
public function message_list() {
return $this->message_list;
}
/**
* Function used to flush message
*/
function flush_msg()
{
* Function used to flush message
*/
public static function flush_msg() {
$this->message_list = '';
}
/**
* Function used to flush warning
*/
function flush_warning()
{
* Function used to flush warning
*/
public static function flush_warning() {
$this->warning_list = '';
}
/**
* Function used to flush , both message and error
*/
function flush()
{
* Function used to flush , both message and error
*/
public static function flush() {
$this->flush_msg();
$this->flush_error();
$this->flush_warning();
}
/**
* Function used to add error or either message using simple
* and small object
* @param : message, @param :type,@param:id
*/
function e($message=NULL,$type='e',$id=NULL)
{
* Function used to add error or either message using simple
* and small object
* @param : message, @param :type,@param:id
*/
function e($message=NULL,$type='e',$id=NULL) {
switch($type)
{
switch($type) {
case 'm':
case 1:
case 'msg':
@ -111,21 +110,18 @@ class errorhandler extends ClipBucket {
case 'e':
case 'err':
case 'error':
default:
$this->add_error($message,$id);
$this->add_error($message,$id);
break;
case 'w':
case 2:
case 'war':
case 'warning':
{
$this->add_warning($message,$id);
}
break;
default:
$this->error_list($message,$id);
$this->error_list($message,$id);
break;
}