Completed
Push — master ( 065daa...3c5e45 )
by Robin
04:15
created

BasicAuth::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 1
1
<?php
2
/**
3
 * @copyright Copyright (c) 2018 Robin Appelman <[email protected]>
4
 *
5
 * @license GNU AGPL version 3 or any later version
6
 *
7
 * This program is free software: you can redistribute it and/or modify
8
 * it under the terms of the GNU Affero General Public License as
9
 * published by the Free Software Foundation, either version 3 of the
10
 * License, or (at your option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU Affero General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Affero General Public License
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 *
20
 */
21
22
namespace Icewind\SMB;
23
24
class BasicAuth implements IAuth {
25
	/** @var string */
26
	private $username;
27
	/** @var string */
28
	private $workgroup;
29
	/** @var string */
30
	private $password;
31
32
	/**
33
	 * BasicAuth constructor.
34
	 *
35
	 * @param string $username
36
	 * @param string $workgroup
37
	 * @param string $password
38
	 */
39 1036
	public function __construct($username, $workgroup, $password) {
40 1036
		$this->username = $username;
41 1036
		$this->workgroup = $workgroup;
42 1036
		$this->password = $password;
43 1036
	}
44
45 1036
	public function getUsername() {
46 1036
		return $this->username;
47
	}
48
49 256
	public function getWorkgroup() {
50 256
		return $this->workgroup;
51
	}
52
53 1036
	public function getPassword() {
54 1036
		return $this->password;
55
	}
56
57 780
	public function getExtraCommandLineArguments() {
58 780
		return ($this->workgroup) ? '-W ' . escapeshellarg($this->workgroup) : '';
59
	}
60
61 256
	public function setExtraSmbClientOptions($smbClientState) {
62
		// noop
63 256
	}
64
}
65