39 protected static $messages = array();
50 parent::__construct($mesg, $code);
52 if(array_key_exists((
int) $code, self::$messages))
69 "code" => $this->getCode(),
70 "mesg" => $this->getMessage(),
71 "line" => $this->getLine(),
72 "file" => $this->getFile(),
75 return $mesg->
arg($args)->toString();
88 if(array_key_exists((
int) $code, self::$messages))
90 throw new self(
"custom message for code 0x" . strtoupper(dechex($code)) .
" is already registered");
95 throw new self(
"custom message for code 0x" . strtoupper(dechex($code)) .
" must be a string");
110 if(!array_key_exists((
int) $code, self::$messages))
112 throw new self(
"custom message for code 0x" . strtoupper(dechex($code)) .
" is not registered");
115 unset(self::$messages[intval($code)]);
125 $trace = $this->getTrace();
127 return (isset($trace[0][
"class"])) ? $trace[0][
"class"] :
"{main}";