TeamSpeak 3 PHP Framework
1.1.12
|
Enhanced exception class for TeamSpeak3_Helper_Signal objects. More...
Public Member Functions | |
getSender () | |
Returns the class from which the exception was thrown. | |
Static Public Member Functions | |
static | registerCustomMessage ($code, $mesg) |
Registers a custom error message to $code. | |
static | unregisterCustomMessage ($code) |
Unregisters a custom error message from $code. | |
Protected Member Functions | |
prepareCustomMessage (TeamSpeak3_Helper_String $mesg) | |
Prepares a custom error message by replacing pre-defined signs with given values. | |
Static Protected Attributes | |
static | $messages = array() |
Enhanced exception class for TeamSpeak3_Helper_Signal objects.
Definition at line 32 of file Exception.php.
TeamSpeak3_Exception::prepareCustomMessage | ( | TeamSpeak3_Helper_String $ | mesg | ) | [protected, inherited] |
Prepares a custom error message by replacing pre-defined signs with given values.
TeamSpeak3_Helper_String | $mesg |
Definition at line 66 of file Exception.php.
References TeamSpeak3_Helper_String\arg().
Referenced by TeamSpeak3_Exception\__construct().
{ $args = array( "code" => $this->getCode(), "mesg" => $this->getMessage(), "line" => $this->getLine(), "file" => $this->getFile(), ); return $mesg->arg($args)->toString(); }
static TeamSpeak3_Exception::registerCustomMessage | ( | $ | code, |
$ | mesg | ||
) | [static, inherited] |
Registers a custom error message to $code.
integer | $code | |
string | $mesg |
TeamSpeak3_Exception |
Definition at line 86 of file Exception.php.
{ if(array_key_exists((int) $code, self::$messages)) { throw new self("custom message for code 0x" . strtoupper(dechex($code)) . " is already registered"); } if(!is_string($mesg)) { throw new self("custom message for code 0x" . strtoupper(dechex($code)) . " must be a string"); } self::$messages[(int) $code] = new TeamSpeak3_Helper_String($mesg); }
static TeamSpeak3_Exception::unregisterCustomMessage | ( | $ | code | ) | [static, inherited] |
Unregisters a custom error message from $code.
integer | $code |
TeamSpeak3_Exception |
Definition at line 108 of file Exception.php.
{ if(!array_key_exists((int) $code, self::$messages)) { throw new self("custom message for code 0x" . strtoupper(dechex($code)) . " is not registered"); } unset(self::$messages[intval($code)]); }
TeamSpeak3_Exception::getSender | ( | ) | [inherited] |
Returns the class from which the exception was thrown.
Definition at line 123 of file Exception.php.
{ $trace = $this->getTrace(); return (isset($trace[0]["class"])) ? $trace[0]["class"] : "{main}"; }