Comment fixes
[civicrm-core.git] / CRM / Core / Error.php
index f9c4ec35d322f044a91a637b95887710a0f745ce..42c614e8f48e0c4c079ec43ffa225108a39f6c61 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
@@ -24,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  * Start of the Error framework. We should check out and inherit from
@@ -46,8 +45,8 @@ require_once 'Log.php';
  * Class CRM_Exception
  */
 class CRM_Exception extends PEAR_Exception {
-  // Redefine the exception so message isn't optional
   /**
+   * Redefine the exception so message isn't optional
    * Supported signatures:
    *  - PEAR_Exception(string $message);
    *  - PEAR_Exception(string $message, int $code);
@@ -58,13 +57,14 @@ class CRM_Exception extends PEAR_Exception {
    *  - PEAR_Exception(string $message, array $causes);
    *  - PEAR_Exception(string $message, array $causes, int $code);
    *
-   * @param string exception message
+   * @param string $message exception message
    * @param int $code
    * @param Exception $previous
    */
   public function __construct($message = NULL, $code = 0, Exception $previous = NULL) {
     parent::__construct($message, $code, $previous);
   }
+
 }
 
 /**
@@ -74,7 +74,6 @@ class CRM_Core_Error extends PEAR_ErrorStack {
 
   /**
    * Status code of various types of errors
-   * @var const
    */
   const FATAL_ERROR = 2;
   const DUPLICATE_CONTACT = 8001;
@@ -85,20 +84,17 @@ class CRM_Core_Error extends PEAR_ErrorStack {
    * We only need one instance of this object. So we use the singleton
    * pattern and cache the instance in this variable
    * @var object
-   * @static
    */
   private static $_singleton = NULL;
 
   /**
    * The logger object for this application
    * @var object
-   * @static
    */
   private static $_log = NULL;
 
   /**
    * If modeException == true, errors are raised as exception instead of returning civicrm_errors
-   * @static
    */
   public static $modeException = NULL;
 
@@ -112,7 +108,6 @@ class CRM_Core_Error extends PEAR_ErrorStack {
    * @param string $stackClass
    *
    * @return object
-   * @static
    */
   public static function &singleton($package = NULL, $msgCallback = FALSE, $contextCallback = FALSE, $throwPEAR_Error = FALSE, $stackClass = 'PEAR_ErrorStack') {
     if (self::$_singleton === NULL) {
@@ -173,7 +168,7 @@ class CRM_Core_Error extends PEAR_ErrorStack {
    * the errors we expect are from the pear modules DB, DB_DataObject
    * which currently use PEAR::raiseError to notify of error messages.
    *
-   * @param object PEAR_Error
+   * @param object $pearError PEAR_Error
    *
    * @return void
    */
@@ -250,10 +245,11 @@ class CRM_Core_Error extends PEAR_ErrorStack {
     self::abend(1);
   }
 
-  // this function is used to trap and print errors
-  // during system initialization time. Hence the error
-  // message is quite ugly
   /**
+   * this function is used to trap and print errors
+   * during system initialization time. Hence the error
+   * message is quite ugly
+   *
    * @param $pearError
    */
   public static function simpleHandler($pearError) {
@@ -308,7 +304,6 @@ class CRM_Core_Error extends PEAR_ErrorStack {
    * @throws Exception
    *
    * @return void
-   * @static
    */
   public static function fatal($message = NULL, $code = NULL, $email = NULL) {
     $vars = array(
@@ -395,7 +390,6 @@ class CRM_Core_Error extends PEAR_ErrorStack {
    * @param Exception $exception
    *
    * @return void
-   * @static
    */
   public static function handleUnhandledException($exception) {
     try {
@@ -468,17 +462,16 @@ class CRM_Core_Error extends PEAR_ErrorStack {
    * Outputs pre-formatted debug information. Flushes the buffers
    * so we can interrupt a potential POST/redirect
    *
-   * @param string name of debug section
-   * @param mixed reference to variables that we need a trace of
-   * @param bool should we log or return the output
-   * @param bool whether to generate a HTML-escaped output
-   * @param bool should we check permissions before displaying output
+   * @param string $name name of debug section
+   * @param $variable mixed reference to variables that we need a trace of
+   * @param bool $log should we log or return the output
+   * @param bool $html whether to generate a HTML-escaped output
+   * @param bool $checkPermission should we check permissions before displaying output
    *                useful when we die during initialization and permissioning
    *                subsystem is not initialized - CRM-13765
    *
    * @return string
    *   the generated output
-   * @static
    */
   public static function debug($name, $variable = NULL, $log = TRUE, $html = TRUE, $checkPermission = TRUE) {
     $error = self::singleton();
@@ -530,12 +523,11 @@ class CRM_Core_Error extends PEAR_ErrorStack {
    *   the generated output
    *
    *
-   * @static
    *
    * @see CRM_Core_Error::debug()
    * @see CRM_Core_Error::debug_log_message()
    */
-  static function debug_var(
+  public static function debug_var(
     $variable_name,
     $variable,
     $print = TRUE,
@@ -580,7 +572,6 @@ class CRM_Core_Error extends PEAR_ErrorStack {
    *   format of the backtrace
    *
    *
-   * @static
    */
   public static function debug_log_message($message, $out = FALSE, $comp = '') {
     $config = CRM_Core_Config::singleton();
@@ -862,7 +853,6 @@ class CRM_Core_Error extends PEAR_ErrorStack {
    * @param null $redirect
    * @param string $title
    * @return void
-   * @static
    */
   public static function statusBounce($status, $redirect = NULL, $title = NULL) {
     $session = CRM_Core_Session::singleton();
@@ -882,7 +872,6 @@ class CRM_Core_Error extends PEAR_ErrorStack {
   /**
    * Reset the error stack
    *
-   * @static
    */
   public static function reset() {
     $error = self::singleton();
@@ -908,7 +897,6 @@ class CRM_Core_Error extends PEAR_ErrorStack {
    *   The PEAR_ERROR object.
    * @return object
    *   $obj
-   * @static
    */
   public static function nullHandler($obj) {
     CRM_Core_Error::debug_log_message("Ignoring exception thrown by nullHandler: {$obj->code}, {$obj->message}");
@@ -916,12 +904,11 @@ class CRM_Core_Error extends PEAR_ErrorStack {
     return $obj;
   }
 
-  /*
+  /**
    * @deprecated
    * This function is no longer used by v3 api.
    * @fixme Some core files call it but it should be re-thought & renamed or removed
-   */
-  /**
+   *
    * @param $msg
    * @param null $data
    *
@@ -967,8 +954,8 @@ class CRM_Core_Error extends PEAR_ErrorStack {
   }
 
   /**
-   * @param $error
-   * @param const $type
+   * @param array $error
+   * @param int $type
    *
    * @return bool
    */
@@ -981,6 +968,7 @@ class CRM_Core_Error extends PEAR_ErrorStack {
     }
     return FALSE;
   }
+
 }
 
 $e = new PEAR_ErrorStack('CRM');