Passed
Push — master ( 7149ed...962901 )
by John
13:20 queued 11s
created

DummyUserSession::getImpersonatingUserID()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016, ownCloud, Inc.
4
 *
5
 * @author Joas Schilling <[email protected]>
6
 * @author Robin Appelman <[email protected]>
7
 *
8
 * @license AGPL-3.0
9
 *
10
 * This code is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU Affero General Public License, version 3,
12
 * as published by the Free Software Foundation.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
 * GNU Affero General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU Affero General Public License, version 3,
20
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
21
 *
22
 */
23
24
namespace OCA\Files_External\Migration;
25
26
use OCP\IUser;
27
use OCP\IUserSession;
28
29
class DummyUserSession implements IUserSession {
30
31
	/**
32
	 * @var IUser
33
	 */
34
	private $user;
35
36
	public function login($user, $password) {
37
	}
38
39
	public function logout() {
40
	}
41
42
	public function setUser($user) {
43
		$this->user = $user;
44
	}
45
46
	public function getUser() {
47
		return $this->user;
48
	}
49
50
	public function isLoggedIn() {
51
		return !is_null($this->user);
52
	}
53
54
	/**
55
	 * get getImpersonatingUserID
56
	 *
57
	 * @return string|null
58
	 * @since 17.0.0
59
	 */
60
	public function getImpersonatingUserID() : ?string {
61
		return null;
62
	}
63
64
	/**
65
	 * set setImpersonatingUserID
66
	 *
67
	 * @since 17.0.0
68
	 */
69
	public function setImpersonatingUserID(bool $useCurrentUser = true): void {
70
		//no OP
71
	}
72
73
}
74