ServiceUnavailableException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 11
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
1
<?php
2
/*
3
 * SPDX-License-Identifier: AGPL-3.0-only
4
 * SPDX-FileCopyrightText: Copyright 2007-2016 Zarafa Deutschland GmbH
5
 * SPDX-FileCopyrightText: Copyright 2020-2022 grommunio GmbH
6
 *
7
 * Exception sending a "503 Service Unavailable" to the mobile.
8
 */
9
10
class ServiceUnavailableException extends HTTPReturnCodeException {
11
	protected $defaultLogLevel = LOGLEVEL_INFO;
12
	protected $httpReturnCode = HTTP_CODE_503;
13
	protected $httpReturnMessage = "Service Unavailable";
14
	protected $httpHeaders = [];
15
	protected $showLegal = false;
16
17
	public function __construct($message = "", $code = 0, $previous = null, $logLevel = false) {
18
		parent::__construct($message, $code, $previous, $logLevel);
19
		if (RETRY_AFTER_DELAY !== false) {
0 ignored issues
show
introduced by
The condition RETRY_AFTER_DELAY !== false is always true.
Loading history...
20
			$this->httpHeaders[] = 'Retry-After: ' . RETRY_AFTER_DELAY;
21
		}
22
	}
23
}
24