Пример #1
0
 /**
  * Constructor
  *
  * @param integer $status
  *            Current status of the class.
  * @param string $message
  *            Formatted exception string:
  *
  * <ul>
  * <li><b>%header%</b>: <code>class::function(arguments):</code> </li>
  * <li><b>%status%</b>: Status code of current object.</li>
  * <li><b>%args%</b>: All arguments as a string.</li>
  * <li><b>%class%</b>: Class of of function.</li>
  * <li><b>%func%</b>: Function with invalid argument.</li>
  * </ul>
  *
  * @param integer $code
  *            Exception code.
  * @param \Exception $previous
  *            Previous Exception.
  * @return void
  */
 public function __construct($status, $message = null, $code = 0, Exception $previous = null)
 {
     if (is_null($message)) {
         $message = '%header% Current class is currupted. Status: %status%.';
     }
     $Replacements = $this->GetFields();
     $message = str_replace(array_keys($Replacements), array_values($Replacements), $message);
     $message = str_replace('%status%', @strval($status), $message);
     $message .= $Replacements['%caused%'];
     parent::__construct($message, $code, $previous);
 }
Пример #2
0
 /**
  * Contstructor
  *
  * @param integer $argno
  *            The argument that is invalid.
  * @param string $message
  *            Formatted exception string.
  *
  * <ul>
  * <li><b>%header%</b>: <code>class::function(arguments):</code>.</li>
  * <li><b>%argno%</b>: Invalid argument position.</li>
  * <li><b>%args%</b>: All arguments as a string.</li>
  * <li><b>%class%</b>: Class of of function.</li>
  * <li><b>%func%</b>: Function with invalid argument.</li>
  * </ul>
  *
  * @param integer $code
  *            Exception code.
  * @param \Exception $previous
  *            Previous Exception.
  */
 public function __construct($argno, $message = null, $code = 0, Exception $previous = null)
 {
     if (is_null($message)) {
         $message = '%header% Argument %argno% is invalid.';
     }
     $Replacements = $this->GetFields();
     $Replacements['%argno%'] = @strval($argno + 1);
     $message = str_replace(array_keys($Replacements), array_values($Replacements), $message);
     $message .= $Replacements['%caused%'];
     parent::__construct($message, $code, $previous);
 }