Event Cart: honor the allow_same_participant_emails setting
[civicrm-core.git] / CRM / Core / TemporaryErrorScope.php
index 6ab382b1d0c136765b60e5d6a7fd8de5632981a0..d8853b8ef8cdff4b6ea0802a32e832b9d2d630d9 100644 (file)
  * safe to temporarily switch to exception
  */
 class CRM_Core_TemporaryErrorScope {
-  static $oldFrames;
+  public static $oldFrames;
 
   /**
    * @return CRM_Core_TemporaryErrorScope
    */
   public static function useException() {
-    return self::create(array('CRM_Core_Error', 'exceptionHandler'), 1);
+    return self::create(['CRM_Core_Error', 'exceptionHandler'], 1);
   }
 
   /**
    * @return CRM_Core_TemporaryErrorScope
    */
   public static function ignoreException() {
-    return self::create(array('CRM_Core_Error', 'nullHandler'));
+    return self::create(['CRM_Core_Error', 'nullHandler']);
   }
 
   /**
@@ -45,11 +45,11 @@ class CRM_Core_TemporaryErrorScope {
    * @return CRM_Core_TemporaryErrorScope
    */
   public static function create($callback, $modeException = NULL) {
-    $newFrame = array(
+    $newFrame = [
       '_PEAR_default_error_mode' => PEAR_ERROR_CALLBACK,
       '_PEAR_default_error_options' => $callback,
       'modeException' => $modeException,
-    );
+    ];
     return new CRM_Core_TemporaryErrorScope($newFrame);
   }
 
@@ -70,19 +70,22 @@ class CRM_Core_TemporaryErrorScope {
    * Read the active error-handler settings
    */
   public static function getActive() {
-    return array(
+    return [
       '_PEAR_default_error_mode' => $GLOBALS['_PEAR_default_error_mode'],
       '_PEAR_default_error_options' => $GLOBALS['_PEAR_default_error_options'],
       'modeException' => CRM_Core_Error::$modeException,
-    );
+    ];
   }
 
   /**
    * Set the active error-handler settings
+   *
+   * @param string $frame
    */
   public static function setActive($frame) {
     $GLOBALS['_PEAR_default_error_mode'] = $frame['_PEAR_default_error_mode'];
     $GLOBALS['_PEAR_default_error_options'] = $frame['_PEAR_default_error_options'];
     CRM_Core_Error::$modeException = $frame['modeException'];
   }
+
 }