From 24ec6e5a5ce2a03b7ee1a0f812b9c1b3bd9b7660 Mon Sep 17 00:00:00 2001 From: "Tomas V.V.Cox" Date: Mon, 21 Jun 2004 04:06:18 +0000 Subject: Be more consistent with CS --- pear/PEAR/Exception.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'pear') diff --git a/pear/PEAR/Exception.php b/pear/PEAR/Exception.php index d5ef4464eb..be6d573201 100644 --- a/pear/PEAR/Exception.php +++ b/pear/PEAR/Exception.php @@ -15,6 +15,7 @@ // +----------------------------------------------------------------------+ // | Authors: Tomas V.V.Cox | // | Hans Lellelid | +// | | // +----------------------------------------------------------------------+ // // $Id$ @@ -95,7 +96,7 @@ class PEAR_Exception extends Exception protected $error_class; protected $error_method; - private $method; + private $_method; private static $_observers = array(); /** @@ -121,16 +122,16 @@ class PEAR_Exception extends Exception $trace = parent::getTrace(); $this->error_class = $trace[0]['class']; $this->error_method = $trace[0]['function']; - $this->method = $this->error_class.'::'.$this->error_method.'()'; + $this->_method = $this->error_class . '::' . $this->error_method . '()'; parent::__construct($message, $code); $this->_signal(); } /** - * @param mixed $callback - A valid php callback, see php_func is_callable() + * @param mixed $callback - A valid php callback, see php func is_callable() * - A PEAR_OBSERVER_* constant - * - An array(const PEAR_OBSERVER_*,mixed $options) + * - An array(const PEAR_OBSERVER_*, mixed $options) * * @param string $label - The name of the observer. Use this if you want * to remove it later with delObserver() @@ -175,9 +176,9 @@ class PEAR_Exception extends Exception private function _getCauseMessage() { - $msg = ' ' . $this->method . " at {$this->file} ({$this->line})\n"; + $msg = ' ' . $this->_method . " at {$this->file} ({$this->line})\n"; if ($this->cause instanceof Exception) { - return $msg.$this->cause->_getCauseMessage(); + return $msg . $this->cause->_getCauseMessage(); } return $msg; } @@ -203,12 +204,12 @@ class PEAR_Exception extends Exception public function __toString() { $str = get_class($this) . " occurred: \n" . - ' Error message: ' . $this->message . "\n" . - ' Error code : ' . $this->code . "\n" . - ' File (Line) : ' . "{$this->file} ({$this->line})\n" . - ' Method : ' . $this->method . "\n"; + " Error message: {$this->message}\n" . + " Error code : {$this->code}\n" . + " File (Line) : {$this->file} ({$this->line})\n" . + " Method : {$this->_method}\n"; if ($this->cause instanceof Exception) { - $str .= " Nested Error : \n".$this->_getCauseMessage(); + $str .= " Nested Error :\n" . $this->_getCauseMessage(); } if (isset($_SERVER['REQUEST_URI'])) { return nl2br('
'.htmlentities($str).'
'); -- cgit v1.2.1