SyncObjectBrokenException::GetSyncObject()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 1
nc 2
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
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
 * Indicates that an object was identified as broken.
8
 * The SyncObject may be available for further analysis.
9
 */
10
11
class SyncObjectBrokenException extends GSyncException {
12
	protected $defaultLogLevel = LOGLEVEL_WARN;
13
	private $syncObject;
14
15
	/**
16
	 * Returns the SyncObject which caused this Exception (if set).
17
	 *
18
	 * @return SyncObject
19
	 */
20
	public function GetSyncObject() {
21
		return isset($this->syncObject) ? $this->syncObject : false;
0 ignored issues
show
Bug Best Practice introduced by
The expression return IssetNode ? $this->syncObject : false could also return false which is incompatible with the documented return type SyncObject. Did you maybe forget to handle an error condition?

If the returned type also contains false, it is an indicator that maybe an error condition leading to the specific return statement remains unhandled.

Loading history...
22
	}
23
24
	/**
25
	 * Sets the SyncObject which caused the exception so it can be later retrieved.
26
	 *
27
	 * @param SyncObject $syncobject
28
	 *
29
	 * @return bool
30
	 */
31
	public function SetSyncObject($syncobject) {
32
		$this->syncObject = $syncobject;
33
34
		return true;
35
	}
36
}
37