1 | <?php |
||
47 | class RemoteInstance extends NC21Signatory implements INC21QueryRow, JsonSerializable { |
||
48 | |||
49 | |||
50 | use TArrayTools; |
||
51 | |||
52 | const TYPE_UNKNOWN = 'Unknown'; // not trusted |
||
53 | const TYPE_PASSIVE = 'Passive'; // Minimum information about Federated Circles are broadcasted if a member belongs to the circle. |
||
54 | const TYPE_EXTERNAL = 'External'; // info about Federated Circles and their members are broadcasted if a member belongs to the circle. |
||
55 | const TYPE_TRUSTED = 'Trusted'; // everything about Federated Circles are broadcasted. |
||
56 | const TYPE_GLOBAL_SCALE = 'GlobalScale'; // every Circle is broadcasted, |
||
57 | |||
58 | const TEST = 'test'; |
||
59 | const INCOMING = 'incoming'; |
||
60 | const EVENT = 'event'; |
||
61 | const CIRCLES = 'circles'; |
||
62 | const CIRCLE = 'circle'; |
||
63 | const MEMBERS = 'members'; |
||
64 | const MEMBER = 'member'; |
||
65 | |||
66 | |||
67 | /** @var int */ |
||
68 | private $dbId = 0; |
||
69 | |||
70 | /** @var string */ |
||
71 | private $type = self::TYPE_UNKNOWN; |
||
72 | |||
73 | /** @var string */ |
||
74 | private $test = ''; |
||
75 | |||
76 | /** @var string */ |
||
77 | private $incoming = ''; |
||
78 | |||
79 | /** @var string */ |
||
80 | private $event = ''; |
||
81 | |||
82 | /** @var string */ |
||
83 | private $circles = ''; |
||
84 | |||
85 | /** @var string */ |
||
86 | private $circle = ''; |
||
87 | |||
88 | /** @var string */ |
||
89 | private $members = ''; |
||
90 | |||
91 | /** @var string */ |
||
92 | private $member = ''; |
||
93 | |||
94 | /** @var string */ |
||
95 | private $uid = ''; |
||
96 | |||
97 | /** @var string */ |
||
98 | private $authSigned = ''; |
||
99 | |||
100 | /** @var bool */ |
||
101 | private $identityAuthed = false; |
||
102 | |||
103 | |||
104 | /** |
||
105 | * @param int $dbId |
||
106 | * |
||
107 | * @return self |
||
108 | */ |
||
109 | public function setDbId(int $dbId): self { |
||
114 | |||
115 | /** |
||
116 | * @return int |
||
117 | */ |
||
118 | public function getDbId(): int { |
||
121 | |||
122 | |||
123 | /** |
||
124 | * @param string $type |
||
125 | * |
||
126 | * @return $this |
||
127 | */ |
||
128 | public function setType(string $type): self { |
||
133 | |||
134 | /** |
||
135 | * @return string |
||
136 | */ |
||
137 | public function getType(): string { |
||
140 | |||
141 | |||
142 | /** |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getIncoming(): string { |
||
148 | |||
149 | /** |
||
150 | * @param string $incoming |
||
151 | * |
||
152 | * @return self |
||
153 | */ |
||
154 | public function setIncoming(string $incoming): self { |
||
159 | |||
160 | |||
161 | /** |
||
162 | * @return string |
||
163 | */ |
||
164 | public function getEvent(): string { |
||
167 | |||
168 | /** |
||
169 | * @param string $event |
||
170 | * |
||
171 | * @return self |
||
172 | */ |
||
173 | public function setEvent(string $event): self { |
||
178 | |||
179 | |||
180 | /** |
||
181 | * @param string $test |
||
182 | * |
||
183 | * @return RemoteInstance |
||
184 | */ |
||
185 | public function setTest(string $test): self { |
||
190 | |||
191 | /** |
||
192 | * @return string |
||
193 | */ |
||
194 | public function getTest(): string { |
||
197 | |||
198 | |||
199 | /** |
||
200 | * @return string |
||
201 | */ |
||
202 | public function getCircles(): string { |
||
205 | |||
206 | /** |
||
207 | * @param string $circles |
||
208 | * |
||
209 | * @return self |
||
210 | */ |
||
211 | public function setCircles(string $circles): self { |
||
216 | |||
217 | |||
218 | /** |
||
219 | * @return string |
||
220 | */ |
||
221 | public function getCircle(): string { |
||
224 | |||
225 | /** |
||
226 | * @param string $circle |
||
227 | * |
||
228 | * @return self |
||
229 | */ |
||
230 | public function setCircle(string $circle): self { |
||
235 | |||
236 | |||
237 | /** |
||
238 | * @return string |
||
239 | */ |
||
240 | public function getMembers(): string { |
||
243 | |||
244 | /** |
||
245 | * @param string $members |
||
246 | * |
||
247 | * @return self |
||
248 | */ |
||
249 | public function setMembers(string $members): self { |
||
254 | |||
255 | |||
256 | /** |
||
257 | * @return string |
||
258 | */ |
||
259 | public function getMember(): string { |
||
262 | |||
263 | /** |
||
264 | * @param string $member |
||
265 | * |
||
266 | * @return self |
||
267 | */ |
||
268 | public function setMember(string $member): self { |
||
273 | |||
274 | |||
275 | /** |
||
276 | * @return $this |
||
277 | */ |
||
278 | public function setUidFromKey(): self { |
||
283 | |||
284 | /** |
||
285 | * @param string $uid |
||
286 | * |
||
287 | * @return RemoteInstance |
||
288 | */ |
||
289 | public function setUid(string $uid): self { |
||
294 | |||
295 | /** |
||
296 | * @param bool $shorten |
||
297 | * |
||
298 | * @return string |
||
299 | */ |
||
300 | public function getUid(bool $shorten = false): string { |
||
307 | |||
308 | |||
309 | /** |
||
310 | * @param string $authSigned |
||
311 | * |
||
312 | * @return RemoteInstance |
||
313 | */ |
||
314 | public function setAuthSigned(string $authSigned): self { |
||
319 | |||
320 | /** |
||
321 | * @return string |
||
322 | */ |
||
323 | public function getAuthSigned(): string { |
||
326 | |||
327 | |||
328 | /** |
||
329 | * @param bool $identityAuthed |
||
330 | * |
||
331 | * @return RemoteInstance |
||
332 | */ |
||
333 | public function setIdentityAuthed(bool $identityAuthed): self { |
||
338 | |||
339 | /** |
||
340 | * @return bool |
||
341 | */ |
||
342 | public function isIdentityAuthed(): bool { |
||
345 | |||
346 | /** |
||
347 | * @throws RemoteUidException |
||
348 | */ |
||
349 | public function mustBeIdentityAuthed(): void { |
||
354 | |||
355 | |||
356 | /** |
||
357 | * @param array $data |
||
358 | * |
||
359 | * @return NC21Signatory |
||
|
|||
360 | */ |
||
361 | public function import(array $data): NC21Signatory { |
||
384 | |||
385 | |||
386 | /** |
||
387 | * @return array |
||
388 | */ |
||
389 | public function jsonSerialize(): array { |
||
407 | |||
408 | |||
409 | /** |
||
410 | * @param array $data |
||
411 | * |
||
412 | * @return self |
||
413 | */ |
||
414 | public function importFromDatabase(array $data): INC21QueryRow { |
||
424 | |||
425 | } |
||
426 | |||
427 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.