Passed
Push — master ( 24e25a...d3efd4 )
by Joas
29:31 queued 13:57
created
lib/public/Preview/IVersionedPreviewFile.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
  * @since 17.0.0
32 32
  */
33 33
 interface IVersionedPreviewFile {
34
-	/**
35
-	 * @return string
36
-	 * @since 17.0.0
37
-	 */
38
-	public function getPreviewVersion(): string;
34
+    /**
35
+     * @return string
36
+     * @since 17.0.0
37
+     */
38
+    public function getPreviewVersion(): string;
39 39
 }
Please login to merge, or discard this patch.
lib/private/Authentication/Token/IWipeableToken.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
 
27 27
 interface IWipeableToken extends IToken {
28 28
 
29
-	/**
30
-	 * Mark the token for remote wipe
31
-	 */
32
-	public function wipe(): void;
29
+    /**
30
+     * Mark the token for remote wipe
31
+     */
32
+    public function wipe(): void;
33 33
 
34 34
 }
Please login to merge, or discard this patch.
lib/private/Authentication/Token/RemoteWipe.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		$tokens = $this->tokenProvider->getTokenByUser($user->getUID());
86 86
 
87 87
 		/** @var IWipeableToken[] $wipeable */
88
-		$wipeable = array_filter($tokens, function (IToken $token) {
88
+		$wipeable = array_filter($tokens, function(IToken $token) {
89 89
 			return $token instanceof IWipeableToken;
90 90
 		});
91 91
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
 		$dbToken = $e->getToken();
123 123
 
124
-		$this->logger->info("user " . $dbToken->getUID() . " started a remote wipe");
124
+		$this->logger->info("user ".$dbToken->getUID()." started a remote wipe");
125 125
 
126 126
 		$this->eventDispatcher->dispatch(RemoteWipeStarted::class, new RemoteWipeStarted($dbToken));
127 127
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 		$this->tokenProvider->invalidateToken($token);
151 151
 
152
-		$this->logger->info("user " . $dbToken->getUID() . " finished a remote wipe");
152
+		$this->logger->info("user ".$dbToken->getUID()." finished a remote wipe");
153 153
 		$this->eventDispatcher->dispatch(RemoteWipeFinished::class, new RemoteWipeFinished($dbToken));
154 154
 
155 155
 		return true;
Please login to merge, or discard this patch.
Indentation   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -39,117 +39,117 @@
 block discarded – undo
39 39
 
40 40
 class RemoteWipe {
41 41
 
42
-	/** @var IProvider */
43
-	private $tokenProvider;
44
-
45
-	/** @var IEventDispatcher */
46
-	private $eventDispatcher;
47
-
48
-	/** @var LoggerInterface */
49
-	private $logger;
50
-
51
-	public function __construct(IProvider $tokenProvider,
52
-								IEventDispatcher $eventDispatcher,
53
-								LoggerInterface $logger) {
54
-		$this->tokenProvider = $tokenProvider;
55
-		$this->eventDispatcher = $eventDispatcher;
56
-		$this->logger = $logger;
57
-	}
58
-
59
-	/**
60
-	 * @param IToken $token
61
-	 * @return bool
62
-	 *
63
-	 * @throws InvalidTokenException
64
-	 * @throws WipeTokenException
65
-	 */
66
-	public function markTokenForWipe(IToken $token): bool {
67
-		if (!$token instanceof IWipeableToken) {
68
-			return false;
69
-		}
70
-
71
-		$token->wipe();
72
-		$this->tokenProvider->updateToken($token);
73
-
74
-		return true;
75
-	}
76
-
77
-	/**
78
-	 * @param IUser $user
79
-	 *
80
-	 * @return bool true if any tokens have been marked for remote wipe
81
-	 */
82
-	public function markAllTokensForWipe(IUser $user): bool {
83
-		$tokens = $this->tokenProvider->getTokenByUser($user->getUID());
84
-
85
-		/** @var IWipeableToken[] $wipeable */
86
-		$wipeable = array_filter($tokens, function (IToken $token) {
87
-			return $token instanceof IWipeableToken;
88
-		});
89
-
90
-		if (empty($wipeable)) {
91
-			return false;
92
-		}
93
-
94
-		foreach ($wipeable as $token) {
95
-			$token->wipe();
96
-			$this->tokenProvider->updateToken($token);
97
-		}
98
-
99
-		return true;
100
-	}
101
-
102
-	/**
103
-	 * @param string $token
104
-	 *
105
-	 * @return bool whether wiping was started
106
-	 * @throws InvalidTokenException
107
-	 *
108
-	 */
109
-	public function start(string $token): bool {
110
-		try {
111
-			$this->tokenProvider->getToken($token);
112
-
113
-			// We expect a WipedTokenException here. If we reach this point this
114
-			// is an ordinary token
115
-			return false;
116
-		} catch (WipeTokenException $e) {
117
-			// Expected -> continue below
118
-		}
119
-
120
-		$dbToken = $e->getToken();
121
-
122
-		$this->logger->info("user " . $dbToken->getUID() . " started a remote wipe");
123
-
124
-		$this->eventDispatcher->dispatch(RemoteWipeStarted::class, new RemoteWipeStarted($dbToken));
125
-
126
-		return true;
127
-	}
128
-
129
-	/**
130
-	 * @param string $token
131
-	 *
132
-	 * @return bool whether wiping could be finished
133
-	 * @throws InvalidTokenException
134
-	 */
135
-	public function finish(string $token): bool {
136
-		try {
137
-			$this->tokenProvider->getToken($token);
138
-
139
-			// We expect a WipedTokenException here. If we reach this point this
140
-			// is an ordinary token
141
-			return false;
142
-		} catch (WipeTokenException $e) {
143
-			// Expected -> continue below
144
-		}
145
-
146
-		$dbToken = $e->getToken();
147
-
148
-		$this->tokenProvider->invalidateToken($token);
149
-
150
-		$this->logger->info("user " . $dbToken->getUID() . " finished a remote wipe");
151
-		$this->eventDispatcher->dispatch(RemoteWipeFinished::class, new RemoteWipeFinished($dbToken));
152
-
153
-		return true;
154
-	}
42
+    /** @var IProvider */
43
+    private $tokenProvider;
44
+
45
+    /** @var IEventDispatcher */
46
+    private $eventDispatcher;
47
+
48
+    /** @var LoggerInterface */
49
+    private $logger;
50
+
51
+    public function __construct(IProvider $tokenProvider,
52
+                                IEventDispatcher $eventDispatcher,
53
+                                LoggerInterface $logger) {
54
+        $this->tokenProvider = $tokenProvider;
55
+        $this->eventDispatcher = $eventDispatcher;
56
+        $this->logger = $logger;
57
+    }
58
+
59
+    /**
60
+     * @param IToken $token
61
+     * @return bool
62
+     *
63
+     * @throws InvalidTokenException
64
+     * @throws WipeTokenException
65
+     */
66
+    public function markTokenForWipe(IToken $token): bool {
67
+        if (!$token instanceof IWipeableToken) {
68
+            return false;
69
+        }
70
+
71
+        $token->wipe();
72
+        $this->tokenProvider->updateToken($token);
73
+
74
+        return true;
75
+    }
76
+
77
+    /**
78
+     * @param IUser $user
79
+     *
80
+     * @return bool true if any tokens have been marked for remote wipe
81
+     */
82
+    public function markAllTokensForWipe(IUser $user): bool {
83
+        $tokens = $this->tokenProvider->getTokenByUser($user->getUID());
84
+
85
+        /** @var IWipeableToken[] $wipeable */
86
+        $wipeable = array_filter($tokens, function (IToken $token) {
87
+            return $token instanceof IWipeableToken;
88
+        });
89
+
90
+        if (empty($wipeable)) {
91
+            return false;
92
+        }
93
+
94
+        foreach ($wipeable as $token) {
95
+            $token->wipe();
96
+            $this->tokenProvider->updateToken($token);
97
+        }
98
+
99
+        return true;
100
+    }
101
+
102
+    /**
103
+     * @param string $token
104
+     *
105
+     * @return bool whether wiping was started
106
+     * @throws InvalidTokenException
107
+     *
108
+     */
109
+    public function start(string $token): bool {
110
+        try {
111
+            $this->tokenProvider->getToken($token);
112
+
113
+            // We expect a WipedTokenException here. If we reach this point this
114
+            // is an ordinary token
115
+            return false;
116
+        } catch (WipeTokenException $e) {
117
+            // Expected -> continue below
118
+        }
119
+
120
+        $dbToken = $e->getToken();
121
+
122
+        $this->logger->info("user " . $dbToken->getUID() . " started a remote wipe");
123
+
124
+        $this->eventDispatcher->dispatch(RemoteWipeStarted::class, new RemoteWipeStarted($dbToken));
125
+
126
+        return true;
127
+    }
128
+
129
+    /**
130
+     * @param string $token
131
+     *
132
+     * @return bool whether wiping could be finished
133
+     * @throws InvalidTokenException
134
+     */
135
+    public function finish(string $token): bool {
136
+        try {
137
+            $this->tokenProvider->getToken($token);
138
+
139
+            // We expect a WipedTokenException here. If we reach this point this
140
+            // is an ordinary token
141
+            return false;
142
+        } catch (WipeTokenException $e) {
143
+            // Expected -> continue below
144
+        }
145
+
146
+        $dbToken = $e->getToken();
147
+
148
+        $this->tokenProvider->invalidateToken($token);
149
+
150
+        $this->logger->info("user " . $dbToken->getUID() . " finished a remote wipe");
151
+        $this->eventDispatcher->dispatch(RemoteWipeFinished::class, new RemoteWipeFinished($dbToken));
152
+
153
+        return true;
154
+    }
155 155
 }
Please login to merge, or discard this patch.
lib/public/FullTextSearch/Model/ISearchRequest.php 1 patch
Indentation   +311 added lines, -311 removed lines patch added patch discarded remove patch
@@ -52,317 +52,317 @@
 block discarded – undo
52 52
 interface ISearchRequest {
53 53
 
54 54
 
55
-	/**
56
-	 * Get the maximum number of results to be returns by the Search Platform.
57
-	 *
58
-	 * @since 15.0.0
59
-	 *
60
-	 * @return int
61
-	 */
62
-	public function getSize(): int;
63
-
64
-
65
-	/**
66
-	 * Get the current page.
67
-	 * Used by pagination.
68
-	 *
69
-	 * @since 15.0.0
70
-	 *
71
-	 * @return int
72
-	 */
73
-	public function getPage(): int;
74
-
75
-
76
-	/**
77
-	 * Get the author of the request.
78
-	 *
79
-	 * @since 15.0.0
80
-	 *
81
-	 * @return string
82
-	 */
83
-	public function getAuthor(): string;
84
-
85
-	/**
86
-	 * Get the searched string.
87
-	 *
88
-	 * @since 15.0.0
89
-	 *
90
-	 * @return string
91
-	 */
92
-	public function getSearch(): string;
93
-
94
-	/**
95
-	 * Set the searched string.
96
-	 *
97
-	 * @param string $search
98
-	 *
99
-	 * @since 17.0.0
100
-	 *
101
-	 * @return ISearchRequest
102
-	 */
103
-	public function setSearch(string $search): ISearchRequest;
104
-
105
-	/**
106
-	 * Extends the searched string.
107
-	 *
108
-	 * @since 17.0.0
109
-	 *
110
-	 * @param string $search
111
-	 *
112
-	 * @return ISearchRequest
113
-	 */
114
-	public function addSearch(string $search): ISearchRequest;
115
-
116
-
117
-	/**
118
-	 * Get the value of an option (as string).
119
-	 *
120
-	 * @since 15.0.0
121
-	 *
122
-	 * @param string $option
123
-	 * @param string $default
124
-	 *
125
-	 * @return string
126
-	 */
127
-	public function getOption(string $option, string $default = ''): string;
128
-
129
-	/**
130
-	 * Get the value of an option (as array).
131
-	 *
132
-	 * @since 15.0.0
133
-	 *
134
-	 * @param string $option
135
-	 * @param array $default
136
-	 *
137
-	 * @return array
138
-	 */
139
-	public function getOptionArray(string $option, array $default = []): array;
140
-
141
-
142
-	/**
143
-	 * Limit the search to a part of the document.
144
-	 *
145
-	 * @since 15.0.0
146
-	 *
147
-	 * @param string $part
148
-	 *
149
-	 * @return ISearchRequest
150
-	 */
151
-	public function addPart(string $part): ISearchRequest;
152
-
153
-	/**
154
-	 * Limit the search to an array of parts of the document.
155
-	 *
156
-	 * @since 15.0.0
157
-	 *
158
-	 * @param array $parts
159
-	 *
160
-	 * @return ISearchRequest
161
-	 */
162
-	public function setParts(array $parts): ISearchRequest;
163
-
164
-	/**
165
-	 * Get the parts the search is limited to.
166
-	 *
167
-	 * @since 15.0.0
168
-	 *
169
-	 * @return array
170
-	 */
171
-	public function getParts(): array;
172
-
173
-
174
-	/**
175
-	 * Limit the search to a specific meta tag.
176
-	 *
177
-	 * @since 15.0.0
178
-	 *
179
-	 * @param string $tag
180
-	 *
181
-	 * @return ISearchRequest
182
-	 */
183
-	public function addMetaTag(string $tag): ISearchRequest;
184
-
185
-	/**
186
-	 * Get the meta tags the search is limited to.
187
-	 *
188
-	 * @since 15.0.0
189
-	 *
190
-	 * @return array
191
-	 */
192
-	public function getMetaTags(): array;
193
-
194
-	/**
195
-	 * Limit the search to an array of meta tags.
196
-	 *
197
-	 * @since 15.0.0
198
-	 *
199
-	 * @param array $tags
200
-	 *
201
-	 * @return ISearchRequest
202
-	 */
203
-	public function setMetaTags(array $tags): IsearchRequest;
204
-
205
-
206
-	/**
207
-	 * Limit the search to a specific sub tag.
208
-	 *
209
-	 * @since 15.0.0
210
-	 *
211
-	 * @param string $source
212
-	 * @param string $tag
213
-	 *
214
-	 * @return ISearchRequest
215
-	 */
216
-	public function addSubTag(string $source, string $tag): ISearchRequest;
217
-
218
-	/**
219
-	 * Get the sub tags the search is limited to.
220
-	 *
221
-	 * @since 15.0.0
222
-	 *
223
-	 * @param bool $formatted
224
-	 *
225
-	 * @return array
226
-	 */
227
-	public function getSubTags(bool $formatted): array;
228
-
229
-	/**
230
-	 * Limit the search to an array of sub tags.
231
-	 *
232
-	 * @since 15.0.0
233
-	 *
234
-	 * @param array $tags
235
-	 *
236
-	 * @return ISearchRequest
237
-	 */
238
-	public function setSubTags(array $tags): ISearchRequest;
239
-
240
-
241
-	/**
242
-	 * Limit the search to a specific field of the mapping, using a full string.
243
-	 *
244
-	 * @since 15.0.0
245
-	 *
246
-	 * @param string $field
247
-	 *
248
-	 * @return ISearchRequest
249
-	 */
250
-	public function addLimitField(string $field): ISearchRequest;
251
-
252
-	/**
253
-	 * Get the fields the search is limited to.
254
-	 *
255
-	 * @since 15.0.0
256
-	 *
257
-	 * @return array
258
-	 */
259
-	public function getLimitFields(): array;
260
-
261
-
262
-	/**
263
-	 * Limit the search to a specific field of the mapping, using a wildcard on
264
-	 * the search string.
265
-	 *
266
-	 * @since 15.0.0
267
-	 *
268
-	 * @param string $field
269
-	 *
270
-	 * @return ISearchRequest
271
-	 */
272
-	public function addWildcardField(string $field): ISearchRequest;
273
-
274
-	/**
275
-	 * Get the limit to field of the mapping.
276
-	 *
277
-	 * @since 15.0.0
278
-	 *
279
-	 * @return array
280
-	 */
281
-	public function getWildcardFields(): array;
282
-
283
-
284
-	/**
285
-	 * Filter the results, based on a group of field, using regex
286
-	 *
287
-	 * @since 15.0.0
288
-	 *
289
-	 * @param array $filters
290
-	 *
291
-	 * @return ISearchRequest
292
-	 */
293
-	public function addRegexFilters(array $filters): ISearchRequest;
294
-
295
-	/**
296
-	 * Get the regex filters the search is limit to.
297
-	 *
298
-	 * @since 15.0.0
299
-	 *
300
-	 * @return array
301
-	 */
302
-	public function getRegexFilters(): array;
303
-
304
-
305
-	/**
306
-	 * Filter the results, based on a group of field, using wildcard
307
-	 *
308
-	 * @since 15.0.0
309
-	 *
310
-	 * @param array $filter
311
-	 *
312
-	 * @return ISearchRequest
313
-	 */
314
-	public function addWildcardFilter(array $filter): ISearchRequest;
315
-
316
-	/**
317
-	 * Get the wildcard filters the search is limit to.
318
-	 *
319
-	 * @since 15.0.0
320
-	 *
321
-	 * @return array
322
-	 */
323
-	public function getWildcardFilters(): array;
324
-
325
-
326
-	/**
327
-	 * Add an extra field to the search.
328
-	 *
329
-	 * @since 15.0.0
330
-	 *
331
-	 * @param string $field
332
-	 *
333
-	 * @return ISearchRequest
334
-	 */
335
-	public function addField(string $field): ISearchRequest;
336
-
337
-	/**
338
-	 * Get the list of extra field to search into.
339
-	 *
340
-	 * @since 15.0.0
341
-	 *
342
-	 * @return array
343
-	 */
344
-	public function getFields(): array;
345
-
346
-
347
-
348
-	/**
349
-	 * Add a MUST search on an extra field
350
-	 *
351
-	 * @param ISearchRequestSimpleQuery $query
352
-	 *
353
-	 * @return ISearchRequest
354
-	 * @since 17.0.0
355
-	 */
356
-	public function addSimpleQuery(ISearchRequestSimpleQuery $query): ISearchRequest;
357
-
358
-
359
-	/**
360
-	 * Get the list of queries on extra field.
361
-	 *
362
-	 * @return ISearchRequestSimpleQuery[]
363
-	 * @since 17.0.0
364
-	 */
365
-	public function getSimpleQueries(): array;
55
+    /**
56
+     * Get the maximum number of results to be returns by the Search Platform.
57
+     *
58
+     * @since 15.0.0
59
+     *
60
+     * @return int
61
+     */
62
+    public function getSize(): int;
63
+
64
+
65
+    /**
66
+     * Get the current page.
67
+     * Used by pagination.
68
+     *
69
+     * @since 15.0.0
70
+     *
71
+     * @return int
72
+     */
73
+    public function getPage(): int;
74
+
75
+
76
+    /**
77
+     * Get the author of the request.
78
+     *
79
+     * @since 15.0.0
80
+     *
81
+     * @return string
82
+     */
83
+    public function getAuthor(): string;
84
+
85
+    /**
86
+     * Get the searched string.
87
+     *
88
+     * @since 15.0.0
89
+     *
90
+     * @return string
91
+     */
92
+    public function getSearch(): string;
93
+
94
+    /**
95
+     * Set the searched string.
96
+     *
97
+     * @param string $search
98
+     *
99
+     * @since 17.0.0
100
+     *
101
+     * @return ISearchRequest
102
+     */
103
+    public function setSearch(string $search): ISearchRequest;
104
+
105
+    /**
106
+     * Extends the searched string.
107
+     *
108
+     * @since 17.0.0
109
+     *
110
+     * @param string $search
111
+     *
112
+     * @return ISearchRequest
113
+     */
114
+    public function addSearch(string $search): ISearchRequest;
115
+
116
+
117
+    /**
118
+     * Get the value of an option (as string).
119
+     *
120
+     * @since 15.0.0
121
+     *
122
+     * @param string $option
123
+     * @param string $default
124
+     *
125
+     * @return string
126
+     */
127
+    public function getOption(string $option, string $default = ''): string;
128
+
129
+    /**
130
+     * Get the value of an option (as array).
131
+     *
132
+     * @since 15.0.0
133
+     *
134
+     * @param string $option
135
+     * @param array $default
136
+     *
137
+     * @return array
138
+     */
139
+    public function getOptionArray(string $option, array $default = []): array;
140
+
141
+
142
+    /**
143
+     * Limit the search to a part of the document.
144
+     *
145
+     * @since 15.0.0
146
+     *
147
+     * @param string $part
148
+     *
149
+     * @return ISearchRequest
150
+     */
151
+    public function addPart(string $part): ISearchRequest;
152
+
153
+    /**
154
+     * Limit the search to an array of parts of the document.
155
+     *
156
+     * @since 15.0.0
157
+     *
158
+     * @param array $parts
159
+     *
160
+     * @return ISearchRequest
161
+     */
162
+    public function setParts(array $parts): ISearchRequest;
163
+
164
+    /**
165
+     * Get the parts the search is limited to.
166
+     *
167
+     * @since 15.0.0
168
+     *
169
+     * @return array
170
+     */
171
+    public function getParts(): array;
172
+
173
+
174
+    /**
175
+     * Limit the search to a specific meta tag.
176
+     *
177
+     * @since 15.0.0
178
+     *
179
+     * @param string $tag
180
+     *
181
+     * @return ISearchRequest
182
+     */
183
+    public function addMetaTag(string $tag): ISearchRequest;
184
+
185
+    /**
186
+     * Get the meta tags the search is limited to.
187
+     *
188
+     * @since 15.0.0
189
+     *
190
+     * @return array
191
+     */
192
+    public function getMetaTags(): array;
193
+
194
+    /**
195
+     * Limit the search to an array of meta tags.
196
+     *
197
+     * @since 15.0.0
198
+     *
199
+     * @param array $tags
200
+     *
201
+     * @return ISearchRequest
202
+     */
203
+    public function setMetaTags(array $tags): IsearchRequest;
204
+
205
+
206
+    /**
207
+     * Limit the search to a specific sub tag.
208
+     *
209
+     * @since 15.0.0
210
+     *
211
+     * @param string $source
212
+     * @param string $tag
213
+     *
214
+     * @return ISearchRequest
215
+     */
216
+    public function addSubTag(string $source, string $tag): ISearchRequest;
217
+
218
+    /**
219
+     * Get the sub tags the search is limited to.
220
+     *
221
+     * @since 15.0.0
222
+     *
223
+     * @param bool $formatted
224
+     *
225
+     * @return array
226
+     */
227
+    public function getSubTags(bool $formatted): array;
228
+
229
+    /**
230
+     * Limit the search to an array of sub tags.
231
+     *
232
+     * @since 15.0.0
233
+     *
234
+     * @param array $tags
235
+     *
236
+     * @return ISearchRequest
237
+     */
238
+    public function setSubTags(array $tags): ISearchRequest;
239
+
240
+
241
+    /**
242
+     * Limit the search to a specific field of the mapping, using a full string.
243
+     *
244
+     * @since 15.0.0
245
+     *
246
+     * @param string $field
247
+     *
248
+     * @return ISearchRequest
249
+     */
250
+    public function addLimitField(string $field): ISearchRequest;
251
+
252
+    /**
253
+     * Get the fields the search is limited to.
254
+     *
255
+     * @since 15.0.0
256
+     *
257
+     * @return array
258
+     */
259
+    public function getLimitFields(): array;
260
+
261
+
262
+    /**
263
+     * Limit the search to a specific field of the mapping, using a wildcard on
264
+     * the search string.
265
+     *
266
+     * @since 15.0.0
267
+     *
268
+     * @param string $field
269
+     *
270
+     * @return ISearchRequest
271
+     */
272
+    public function addWildcardField(string $field): ISearchRequest;
273
+
274
+    /**
275
+     * Get the limit to field of the mapping.
276
+     *
277
+     * @since 15.0.0
278
+     *
279
+     * @return array
280
+     */
281
+    public function getWildcardFields(): array;
282
+
283
+
284
+    /**
285
+     * Filter the results, based on a group of field, using regex
286
+     *
287
+     * @since 15.0.0
288
+     *
289
+     * @param array $filters
290
+     *
291
+     * @return ISearchRequest
292
+     */
293
+    public function addRegexFilters(array $filters): ISearchRequest;
294
+
295
+    /**
296
+     * Get the regex filters the search is limit to.
297
+     *
298
+     * @since 15.0.0
299
+     *
300
+     * @return array
301
+     */
302
+    public function getRegexFilters(): array;
303
+
304
+
305
+    /**
306
+     * Filter the results, based on a group of field, using wildcard
307
+     *
308
+     * @since 15.0.0
309
+     *
310
+     * @param array $filter
311
+     *
312
+     * @return ISearchRequest
313
+     */
314
+    public function addWildcardFilter(array $filter): ISearchRequest;
315
+
316
+    /**
317
+     * Get the wildcard filters the search is limit to.
318
+     *
319
+     * @since 15.0.0
320
+     *
321
+     * @return array
322
+     */
323
+    public function getWildcardFilters(): array;
324
+
325
+
326
+    /**
327
+     * Add an extra field to the search.
328
+     *
329
+     * @since 15.0.0
330
+     *
331
+     * @param string $field
332
+     *
333
+     * @return ISearchRequest
334
+     */
335
+    public function addField(string $field): ISearchRequest;
336
+
337
+    /**
338
+     * Get the list of extra field to search into.
339
+     *
340
+     * @since 15.0.0
341
+     *
342
+     * @return array
343
+     */
344
+    public function getFields(): array;
345
+
346
+
347
+
348
+    /**
349
+     * Add a MUST search on an extra field
350
+     *
351
+     * @param ISearchRequestSimpleQuery $query
352
+     *
353
+     * @return ISearchRequest
354
+     * @since 17.0.0
355
+     */
356
+    public function addSimpleQuery(ISearchRequestSimpleQuery $query): ISearchRequest;
357
+
358
+
359
+    /**
360
+     * Get the list of queries on extra field.
361
+     *
362
+     * @return ISearchRequestSimpleQuery[]
363
+     * @since 17.0.0
364
+     */
365
+    public function getSimpleQueries(): array;
366 366
 
367 367
 }
368 368
 
Please login to merge, or discard this patch.
lib/private/Authentication/Notifications/Notifier.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -32,65 +32,65 @@
 block discarded – undo
32 32
 
33 33
 class Notifier implements INotifier {
34 34
 
35
-	/** @var IL10nFactory */
36
-	private $factory;
35
+    /** @var IL10nFactory */
36
+    private $factory;
37 37
 
38
-	public function __construct(IL10nFactory $l10nFactory) {
39
-		$this->factory = $l10nFactory;
40
-	}
38
+    public function __construct(IL10nFactory $l10nFactory) {
39
+        $this->factory = $l10nFactory;
40
+    }
41 41
 
42
-	/**
43
-	 * @inheritDoc
44
-	 */
45
-	public function prepare(INotification $notification, string $languageCode): INotification {
46
-		if ($notification->getApp() !== 'auth') {
47
-			// Not my app => throw
48
-			throw new InvalidArgumentException();
49
-		}
42
+    /**
43
+     * @inheritDoc
44
+     */
45
+    public function prepare(INotification $notification, string $languageCode): INotification {
46
+        if ($notification->getApp() !== 'auth') {
47
+            // Not my app => throw
48
+            throw new InvalidArgumentException();
49
+        }
50 50
 
51
-		// Read the language from the notification
52
-		$l = $this->factory->get('lib', $languageCode);
51
+        // Read the language from the notification
52
+        $l = $this->factory->get('lib', $languageCode);
53 53
 
54
-		switch ($notification->getSubject()) {
55
-			case 'remote_wipe_start':
56
-				$notification->setParsedSubject(
57
-					$l->t('Remote wipe started')
58
-				)->setParsedMessage(
59
-					$l->t('A remote wipe was started on device %s', $notification->getSubjectParameters())
60
-				);
54
+        switch ($notification->getSubject()) {
55
+            case 'remote_wipe_start':
56
+                $notification->setParsedSubject(
57
+                    $l->t('Remote wipe started')
58
+                )->setParsedMessage(
59
+                    $l->t('A remote wipe was started on device %s', $notification->getSubjectParameters())
60
+                );
61 61
 
62
-				return $notification;
63
-			case 'remote_wipe_finish':
64
-				$notification->setParsedSubject(
65
-					$l->t('Remote wipe finished')
66
-				)->setParsedMessage(
67
-					$l->t('The remote wipe on %s has finished', $notification->getSubjectParameters())
68
-				);
62
+                return $notification;
63
+            case 'remote_wipe_finish':
64
+                $notification->setParsedSubject(
65
+                    $l->t('Remote wipe finished')
66
+                )->setParsedMessage(
67
+                    $l->t('The remote wipe on %s has finished', $notification->getSubjectParameters())
68
+                );
69 69
 
70
-				return $notification;
71
-			default:
72
-				// Unknown subject => Unknown notification => throw
73
-				throw new InvalidArgumentException();
74
-		}
75
-	}
70
+                return $notification;
71
+            default:
72
+                // Unknown subject => Unknown notification => throw
73
+                throw new InvalidArgumentException();
74
+        }
75
+    }
76 76
 
77
-	/**
78
-	 * Identifier of the notifier, only use [a-z0-9_]
79
-	 *
80
-	 * @return string
81
-	 * @since 17.0.0
82
-	 */
83
-	public function getID(): string {
84
-		return 'auth';
85
-	}
77
+    /**
78
+     * Identifier of the notifier, only use [a-z0-9_]
79
+     *
80
+     * @return string
81
+     * @since 17.0.0
82
+     */
83
+    public function getID(): string {
84
+        return 'auth';
85
+    }
86 86
 
87
-	/**
88
-	 * Human readable name describing the notifier
89
-	 *
90
-	 * @return string
91
-	 * @since 17.0.0
92
-	 */
93
-	public function getName(): string {
94
-		return $this->factory->get('lib')->t('Authentication');
95
-	}
87
+    /**
88
+     * Human readable name describing the notifier
89
+     *
90
+     * @return string
91
+     * @since 17.0.0
92
+     */
93
+    public function getName(): string {
94
+        return $this->factory->get('lib')->t('Authentication');
95
+    }
96 96
 }
Please login to merge, or discard this patch.
lib/private/Notification/Action.php 1 patch
Indentation   +142 added lines, -142 removed lines patch added patch discarded remove patch
@@ -28,146 +28,146 @@
 block discarded – undo
28 28
 
29 29
 class Action implements IAction {
30 30
 
31
-	/** @var string */
32
-	protected $label;
33
-
34
-	/** @var string */
35
-	protected $labelParsed;
36
-
37
-	/** @var string */
38
-	protected $link;
39
-
40
-	/** @var string */
41
-	protected $requestType;
42
-
43
-	/** @var string */
44
-	protected $icon;
45
-
46
-	/** @var bool */
47
-	protected $primary;
48
-
49
-	public function __construct() {
50
-		$this->label = '';
51
-		$this->labelParsed = '';
52
-		$this->link = '';
53
-		$this->requestType = '';
54
-		$this->primary = false;
55
-	}
56
-
57
-	/**
58
-	 * @param string $label
59
-	 * @return $this
60
-	 * @throws \InvalidArgumentException if the label is invalid
61
-	 * @since 8.2.0
62
-	 */
63
-	public function setLabel(string $label): IAction {
64
-		if ($label === '' || isset($label[32])) {
65
-			throw new \InvalidArgumentException('The given label is invalid');
66
-		}
67
-		$this->label = $label;
68
-		return $this;
69
-	}
70
-
71
-	/**
72
-	 * @return string
73
-	 * @since 8.2.0
74
-	 */
75
-	public function getLabel(): string {
76
-		return $this->label;
77
-	}
78
-
79
-	/**
80
-	 * @param string $label
81
-	 * @return $this
82
-	 * @throws \InvalidArgumentException if the label is invalid
83
-	 * @since 8.2.0
84
-	 */
85
-	public function setParsedLabel(string $label): IAction {
86
-		if ($label === '') {
87
-			throw new \InvalidArgumentException('The given parsed label is invalid');
88
-		}
89
-		$this->labelParsed = $label;
90
-		return $this;
91
-	}
92
-
93
-	/**
94
-	 * @return string
95
-	 * @since 8.2.0
96
-	 */
97
-	public function getParsedLabel(): string {
98
-		return $this->labelParsed;
99
-	}
100
-
101
-	/**
102
-	 * @param $primary bool
103
-	 * @return $this
104
-	 * @since 9.0.0
105
-	 */
106
-	public function setPrimary(bool $primary): IAction {
107
-		$this->primary = $primary;
108
-		return $this;
109
-	}
110
-
111
-	/**
112
-	 * @return bool
113
-	 * @since 9.0.0
114
-	 */
115
-	public function isPrimary(): bool {
116
-		return $this->primary;
117
-	}
118
-
119
-	/**
120
-	 * @param string $link
121
-	 * @param string $requestType
122
-	 * @return $this
123
-	 * @throws \InvalidArgumentException if the link is invalid
124
-	 * @since 8.2.0
125
-	 */
126
-	public function setLink(string $link, string $requestType): IAction {
127
-		if ($link === '' || isset($link[256])) {
128
-			throw new \InvalidArgumentException('The given link is invalid');
129
-		}
130
-		if (!in_array($requestType, [
131
-			self::TYPE_GET,
132
-			self::TYPE_POST,
133
-			self::TYPE_PUT,
134
-			self::TYPE_DELETE,
135
-			self::TYPE_WEB,
136
-		], true)) {
137
-			throw new \InvalidArgumentException('The given request type is invalid');
138
-		}
139
-		$this->link = $link;
140
-		$this->requestType = $requestType;
141
-		return $this;
142
-	}
143
-
144
-	/**
145
-	 * @return string
146
-	 * @since 8.2.0
147
-	 */
148
-	public function getLink(): string {
149
-		return $this->link;
150
-	}
151
-
152
-	/**
153
-	 * @return string
154
-	 * @since 8.2.0
155
-	 */
156
-	public function getRequestType(): string {
157
-		return $this->requestType;
158
-	}
159
-
160
-	/**
161
-	 * @return bool
162
-	 */
163
-	public function isValid(): bool {
164
-		return $this->label !== '' && $this->link !== '';
165
-	}
166
-
167
-	/**
168
-	 * @return bool
169
-	 */
170
-	public function isValidParsed(): bool {
171
-		return $this->labelParsed !== '' && $this->link !== '';
172
-	}
31
+    /** @var string */
32
+    protected $label;
33
+
34
+    /** @var string */
35
+    protected $labelParsed;
36
+
37
+    /** @var string */
38
+    protected $link;
39
+
40
+    /** @var string */
41
+    protected $requestType;
42
+
43
+    /** @var string */
44
+    protected $icon;
45
+
46
+    /** @var bool */
47
+    protected $primary;
48
+
49
+    public function __construct() {
50
+        $this->label = '';
51
+        $this->labelParsed = '';
52
+        $this->link = '';
53
+        $this->requestType = '';
54
+        $this->primary = false;
55
+    }
56
+
57
+    /**
58
+     * @param string $label
59
+     * @return $this
60
+     * @throws \InvalidArgumentException if the label is invalid
61
+     * @since 8.2.0
62
+     */
63
+    public function setLabel(string $label): IAction {
64
+        if ($label === '' || isset($label[32])) {
65
+            throw new \InvalidArgumentException('The given label is invalid');
66
+        }
67
+        $this->label = $label;
68
+        return $this;
69
+    }
70
+
71
+    /**
72
+     * @return string
73
+     * @since 8.2.0
74
+     */
75
+    public function getLabel(): string {
76
+        return $this->label;
77
+    }
78
+
79
+    /**
80
+     * @param string $label
81
+     * @return $this
82
+     * @throws \InvalidArgumentException if the label is invalid
83
+     * @since 8.2.0
84
+     */
85
+    public function setParsedLabel(string $label): IAction {
86
+        if ($label === '') {
87
+            throw new \InvalidArgumentException('The given parsed label is invalid');
88
+        }
89
+        $this->labelParsed = $label;
90
+        return $this;
91
+    }
92
+
93
+    /**
94
+     * @return string
95
+     * @since 8.2.0
96
+     */
97
+    public function getParsedLabel(): string {
98
+        return $this->labelParsed;
99
+    }
100
+
101
+    /**
102
+     * @param $primary bool
103
+     * @return $this
104
+     * @since 9.0.0
105
+     */
106
+    public function setPrimary(bool $primary): IAction {
107
+        $this->primary = $primary;
108
+        return $this;
109
+    }
110
+
111
+    /**
112
+     * @return bool
113
+     * @since 9.0.0
114
+     */
115
+    public function isPrimary(): bool {
116
+        return $this->primary;
117
+    }
118
+
119
+    /**
120
+     * @param string $link
121
+     * @param string $requestType
122
+     * @return $this
123
+     * @throws \InvalidArgumentException if the link is invalid
124
+     * @since 8.2.0
125
+     */
126
+    public function setLink(string $link, string $requestType): IAction {
127
+        if ($link === '' || isset($link[256])) {
128
+            throw new \InvalidArgumentException('The given link is invalid');
129
+        }
130
+        if (!in_array($requestType, [
131
+            self::TYPE_GET,
132
+            self::TYPE_POST,
133
+            self::TYPE_PUT,
134
+            self::TYPE_DELETE,
135
+            self::TYPE_WEB,
136
+        ], true)) {
137
+            throw new \InvalidArgumentException('The given request type is invalid');
138
+        }
139
+        $this->link = $link;
140
+        $this->requestType = $requestType;
141
+        return $this;
142
+    }
143
+
144
+    /**
145
+     * @return string
146
+     * @since 8.2.0
147
+     */
148
+    public function getLink(): string {
149
+        return $this->link;
150
+    }
151
+
152
+    /**
153
+     * @return string
154
+     * @since 8.2.0
155
+     */
156
+    public function getRequestType(): string {
157
+        return $this->requestType;
158
+    }
159
+
160
+    /**
161
+     * @return bool
162
+     */
163
+    public function isValid(): bool {
164
+        return $this->label !== '' && $this->link !== '';
165
+    }
166
+
167
+    /**
168
+     * @return bool
169
+     */
170
+    public function isValidParsed(): bool {
171
+        return $this->labelParsed !== '' && $this->link !== '';
172
+    }
173 173
 }
Please login to merge, or discard this patch.
lib/public/Notification/IApp.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -30,23 +30,23 @@
 block discarded – undo
30 30
  * @since 9.0.0
31 31
  */
32 32
 interface IApp {
33
-	/**
34
-	 * @param INotification $notification
35
-	 * @throws \InvalidArgumentException When the notification is not valid
36
-	 * @since 9.0.0
37
-	 */
38
-	public function notify(INotification $notification): void;
33
+    /**
34
+     * @param INotification $notification
35
+     * @throws \InvalidArgumentException When the notification is not valid
36
+     * @since 9.0.0
37
+     */
38
+    public function notify(INotification $notification): void;
39 39
 
40
-	/**
41
-	 * @param INotification $notification
42
-	 * @since 9.0.0
43
-	 */
44
-	public function markProcessed(INotification $notification): void;
40
+    /**
41
+     * @param INotification $notification
42
+     * @since 9.0.0
43
+     */
44
+    public function markProcessed(INotification $notification): void;
45 45
 
46
-	/**
47
-	 * @param INotification $notification
48
-	 * @return int
49
-	 * @since 9.0.0
50
-	 */
51
-	public function getCount(INotification $notification): int;
46
+    /**
47
+     * @param INotification $notification
48
+     * @return int
49
+     * @since 9.0.0
50
+     */
51
+    public function getCount(INotification $notification): int;
52 52
 }
Please login to merge, or discard this patch.
lib/public/Notification/AlreadyProcessedException.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@
 block discarded – undo
28 28
  */
29 29
 class AlreadyProcessedException extends \RuntimeException {
30 30
 
31
-	/**
32
-	 * @since 17.0.0
33
-	 */
34
-	public function __construct() {
35
-		parent::__construct('Notification is processed already');
36
-	}
31
+    /**
32
+     * @since 17.0.0
33
+     */
34
+    public function __construct() {
35
+        parent::__construct('Notification is processed already');
36
+    }
37 37
 
38 38
 }
Please login to merge, or discard this patch.
lib/public/Notification/INotifier.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -31,29 +31,29 @@
 block discarded – undo
31 31
  */
32 32
 interface INotifier {
33 33
 
34
-	/**
35
-	 * Identifier of the notifier, only use [a-z0-9_]
36
-	 *
37
-	 * @return string
38
-	 * @since 17.0.0
39
-	 */
40
-	public function getID(): string;
34
+    /**
35
+     * Identifier of the notifier, only use [a-z0-9_]
36
+     *
37
+     * @return string
38
+     * @since 17.0.0
39
+     */
40
+    public function getID(): string;
41 41
 
42
-	/**
43
-	 * Human readable name describing the notifier
44
-	 *
45
-	 * @return string
46
-	 * @since 17.0.0
47
-	 */
48
-	public function getName(): string;
42
+    /**
43
+     * Human readable name describing the notifier
44
+     *
45
+     * @return string
46
+     * @since 17.0.0
47
+     */
48
+    public function getName(): string;
49 49
 
50
-	/**
51
-	 * @param INotification $notification
52
-	 * @param string $languageCode The code of the language that should be used to prepare the notification
53
-	 * @return INotification
54
-	 * @throws \InvalidArgumentException When the notification was not prepared by a notifier
55
-	 * @throws AlreadyProcessedException When the notification is not needed anymore and should be deleted
56
-	 * @since 9.0.0
57
-	 */
58
-	public function prepare(INotification $notification, string $languageCode): INotification;
50
+    /**
51
+     * @param INotification $notification
52
+     * @param string $languageCode The code of the language that should be used to prepare the notification
53
+     * @return INotification
54
+     * @throws \InvalidArgumentException When the notification was not prepared by a notifier
55
+     * @throws AlreadyProcessedException When the notification is not needed anymore and should be deleted
56
+     * @since 9.0.0
57
+     */
58
+    public function prepare(INotification $notification, string $languageCode): INotification;
59 59
 }
Please login to merge, or discard this patch.