]> granicus.if.org Git - php/commitdiff
Be more consistent with CS
authorTomas V.V.Cox <cox@php.net>
Mon, 21 Jun 2004 04:06:18 +0000 (04:06 +0000)
committerTomas V.V.Cox <cox@php.net>
Mon, 21 Jun 2004 04:06:18 +0000 (04:06 +0000)
pear/PEAR/Exception.php

index d5ef4464eb7c6781b277d405fc6d4e42b7d45cda..be6d5732018de10705ca7f14c6b9bc15663c5c77 100644 (file)
@@ -15,6 +15,7 @@
 // +----------------------------------------------------------------------+
 // | Authors: Tomas V.V.Cox <cox@idecnet.com>                             |
 // |          Hans Lellelid <hans@velum.net>                              |
+// |                                                                      |
 // +----------------------------------------------------------------------+
 //
 // $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('<pre>'.htmlentities($str).'</pre>');