* will be necessary to get reuse from the other parts of this class.
*/
class CRM_Queue_ErrorPolicy {
- public $active;
+
+ /**
+ * @var bool
+ */
+ protected $active;
+
+ /**
+ * @var int
+ */
+ protected $level;
+
+ /**
+ * @var array
+ */
+ protected $backup;
/**
* @param null|int $level
/**
* Enable the error policy.
*/
- public function activate() {
+ protected function activate() {
$this->active = TRUE;
$this->backup = [];
foreach ([
ini_set($key, 0);
}
set_error_handler([$this, 'onError'], $this->level);
- // FIXME make this temporary/reversible
}
/**
* Disable the error policy.
*/
- public function deactivate() {
- $this->errorScope = NULL;
+ protected function deactivate() {
restore_error_handler();
foreach ([
'display_errors',
* @param array $error
* The PHP error (with "type", "message", etc).
*/
- public function reportError($error) {
+ protected function reportError($error) {
$response = [
'is_error' => 1,
'is_continue' => 0,
* @param Exception $e
* The unhandled exception.
*/
- public function reportException(Exception $e) {
+ protected function reportException(Exception $e) {
CRM_Core_Error::debug_var('CRM_Queue_ErrorPolicy_reportException', CRM_Core_Error::formatTextException($e));
$response = [