X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FTemporaryErrorScope.php;h=d8853b8ef8cdff4b6ea0802a32e832b9d2d630d9;hb=3c3fae78d896a78ab2fda0d687e24ff273648d05;hp=ec170a7b71357be83db0e36ed91d9f8f258bfced;hpb=65742a3ed0f9444378e73bdab10469176f07ce49;p=civicrm-core.git diff --git a/CRM/Core/TemporaryErrorScope.php b/CRM/Core/TemporaryErrorScope.php index ec170a7b71..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,15 +70,17 @@ 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'];