Commit 06a83d11 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Error.php: phpdoc

parent cb533c57
......@@ -38,6 +38,14 @@ namespace qfq;
class SyntaxReportException extends \Exception {
private $fr_error;
/**
* @param string $message
* @param int $code
* @param \Exception $file
* @param $line
* @param array $customMessage
* @param array $fr_error
*/
public function __construct($message, $code, $file, $line, $customMessage = array(), $fr_error = array()) {
parent::__construct($message);
$this->code = $code;
......@@ -48,6 +56,9 @@ class SyntaxReportException extends \Exception {
}
/**
* @return string
*/
public function errorMessage() {
// global $BE_USER; TA: Du sollst kein global verwenden!!
// If '$this->customMessage' is a string, convert it to an array.
......@@ -86,6 +97,13 @@ class SyntaxReportException extends \Exception {
class SqlReportException extends \Exception {
private $fr_error;
/**
* @param string $message
* @param int $sql
* @param \Exception $file
* @param $line
* @param array $fr_error
*/
public function __construct($message, $sql, $file, $line, $fr_error = array()) {
parent::__construct($message);
$this->file = $file;
......@@ -94,6 +112,9 @@ class SqlReportException extends \Exception {
$this->fr_error = $fr_error;
}
/**
* @return string
*/
public function errorMessage() {
// global $BE_USER; TA: Du sollst kein global verwenden!!
......@@ -127,12 +148,20 @@ class CodeReportException extends \Exception {
protected $file;
protected $line;
/**
* @param string $message
* @param string $file
* @param string $line
*/
public function __construct($message, $file = "undefined", $line = "undefined") {
parent::__construct($message);
$this->file = $file;
$this->line = $line;
}
/**
* @return string
*/
public function errorMessage() {
// global $BE_USER; TA: Du sollst kein global verwenden!!
......@@ -161,12 +190,20 @@ class UserReportException extends \Exception {
protected $file;
protected $line;
/**
* @param string $message
* @param string $file
* @param string $line
*/
public function __construct($message, $file = "undefined", $line = "undefined") {
parent::__construct($message);
$this->file = $file;
$this->line = $line;
}
/**
* @return string
*/
public function errorMessage() {
if ($GLOBALS['BE_USER']->user["uid"] > 0 || $_SESSION[FORMREPORT]['be_user_uid'] > 0) {
$errorMsg = nl2br("<hr />Error: <strong>" . $this->getMessage() . "</strong><br />File: <strong>" . $this->file . "</strong><br />Line: <strong>" . $this->line . "</strong><hr />");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment