X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FTemporaryErrorScope.php;h=d8853b8ef8cdff4b6ea0802a32e832b9d2d630d9;hb=12171c0e37ea7333476276c980f4977c0ecf8705;hp=6ab382b1d0c136765b60e5d6a7fd8de5632981a0;hpb=29d98e1314e345f1b9044f5359c2d0a67f380d21;p=civicrm-core.git diff --git a/CRM/Core/TemporaryErrorScope.php b/CRM/Core/TemporaryErrorScope.php index 6ab382b1d0..d8853b8ef8 100644 --- a/CRM/Core/TemporaryErrorScope.php +++ b/CRM/Core/TemporaryErrorScope.php @@ -22,20 +22,20 @@ * 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']; } + }