Completed
Push — master ( 3797b8...5aaa8a )
by Roeland
12:24
created

AccountProperty::setScope()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @copyright Copyright (c) 2018 Julius Härtl <[email protected]>
7
 *
8
 * @author Julius Härtl <[email protected]>
9
 *
10
 * @license GNU AGPL version 3 or any later version
11
 *
12
 * This program is free software: you can redistribute it and/or modify
13
 * it under the terms of the GNU Affero General Public License as
14
 * published by the Free Software Foundation, either version 3 of the
15
 * License, or (at your option) any later version.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 * GNU Affero General Public License for more details.
21
 *
22
 * You should have received a copy of the GNU Affero General Public License
23
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24
 *
25
 */
26
27
namespace OC\Accounts;
28
29
use OCP\Accounts\IAccountProperty;
30
31
class AccountProperty implements IAccountProperty {
32
33
	/** @var string */
34
	private $name;
35
	/** @var string */
36
	private $value;
37
	/** @var string */
38
	private $scope;
39
	/** @var string */
40
	private $verified;
41
42
	public function __construct(string $name, string $value, string $scope, string $verified) {
43
		$this->name = $name;
44
		$this->value = $value;
45
		$this->scope = $scope;
46
		$this->verified = $verified;
47
	}
48
49
	public function jsonSerialize() {
50
		return [
51
			'name' => $this->getName(),
52
			'value' => $this->getValue(),
53
			'scope' => $this->getScope(),
54
			'verified' => $this->getVerified()
55
		];
56
	}
57
58
	/**
59
	 * Set the value of a property
60
	 *
61
	 * @since 15.0.0
62
	 *
63
	 * @param string $value
64
	 * @return IAccountProperty
65
	 */
66
	public function setValue(string $value): IAccountProperty {
67
		$this->value = $value;
68
		return $this;
69
	}
70
71
	/**
72
	 * Set the scope of a property
73
	 *
74
	 * @since 15.0.0
75
	 *
76
	 * @param string $scope
77
	 * @return IAccountProperty
78
	 */
79
	public function setScope(string $scope): IAccountProperty {
80
		$this->scope = $scope;
81
		return $this;
82
	}
83
84
	/**
85
	 * Set the verification status of a property
86
	 *
87
	 * @since 15.0.0
88
	 *
89
	 * @param string $verified
90
	 * @return IAccountProperty
91
	 */
92
	public function setVerified(string $verified): IAccountProperty {
93
		$this->verified = $verified;
94
		return $this;
95
	}
96
97
	/**
98
	 * Get the name of a property
99
	 *
100
	 * @since 15.0.0
101
	 *
102
	 * @return string
103
	 */
104
	public function getName(): string {
105
		return $this->name;
106
	}
107
108
	/**
109
	 * Get the value of a property
110
	 *
111
	 * @since 15.0.0
112
	 *
113
	 * @return string
114
	 */
115
	public function getValue(): string {
116
		return $this->value;
117
	}
118
119
	/**
120
	 * Get the scope of a property
121
	 *
122
	 * @since 15.0.0
123
	 *
124
	 * @return string
125
	 */
126
	public function getScope(): string {
127
		return $this->scope;
128
	}
129
130
	/**
131
	 * Get the verification status of a property
132
	 *
133
	 * @since 15.0.0
134
	 *
135
	 * @return string
136
	 */
137
	public function getVerified(): string {
138
		return $this->verified;
139
	}
140
}
141