Passed
Push — master ( b2341c...323f40 )
by Roeland
11:16
created
lib/public/Files/Search/ISearchBinaryOperator.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -25,27 +25,27 @@
 block discarded – undo
25 25
  * @since 12.0.0
26 26
  */
27 27
 interface ISearchBinaryOperator extends ISearchOperator {
28
-	const OPERATOR_AND = 'and';
29
-	const OPERATOR_OR = 'or';
30
-	const OPERATOR_NOT = 'not';
28
+    const OPERATOR_AND = 'and';
29
+    const OPERATOR_OR = 'or';
30
+    const OPERATOR_NOT = 'not';
31 31
 
32
-	/**
33
-	 * The type of binary operator
34
-	 *
35
-	 * One of the ISearchBinaryOperator::OPERATOR_* constants
36
-	 *
37
-	 * @return string
38
-	 * @since 12.0.0
39
-	 */
40
-	public function getType();
32
+    /**
33
+     * The type of binary operator
34
+     *
35
+     * One of the ISearchBinaryOperator::OPERATOR_* constants
36
+     *
37
+     * @return string
38
+     * @since 12.0.0
39
+     */
40
+    public function getType();
41 41
 
42
-	/**
43
-	 * The arguments for the binary operator
44
-	 *
45
-	 * One argument for the 'not' operator and two for 'and' and 'or'
46
-	 *
47
-	 * @return ISearchOperator[]
48
-	 * @since 12.0.0
49
-	 */
50
-	public function getArguments();
42
+    /**
43
+     * The arguments for the binary operator
44
+     *
45
+     * One argument for the 'not' operator and two for 'and' and 'or'
46
+     *
47
+     * @return ISearchOperator[]
48
+     * @since 12.0.0
49
+     */
50
+    public function getArguments();
51 51
 }
Please login to merge, or discard this patch.
lib/public/Files/Cache/ICache.php 1 patch
Indentation   +208 added lines, -208 removed lines patch added patch discarded remove patch
@@ -37,233 +37,233 @@
 block discarded – undo
37 37
  * @since 9.0.0
38 38
  */
39 39
 interface ICache {
40
-	const NOT_FOUND = 0;
41
-	const PARTIAL = 1; //only partial data available, file not cached in the database
42
-	const SHALLOW = 2; //folder in cache, but not all child files are completely scanned
43
-	const COMPLETE = 3;
40
+    const NOT_FOUND = 0;
41
+    const PARTIAL = 1; //only partial data available, file not cached in the database
42
+    const SHALLOW = 2; //folder in cache, but not all child files are completely scanned
43
+    const COMPLETE = 3;
44 44
 
45
-	/**
46
-	 * Get the numeric storage id for this cache's storage
47
-	 *
48
-	 * @return int
49
-	 * @since 9.0.0
50
-	 */
51
-	public function getNumericStorageId();
45
+    /**
46
+     * Get the numeric storage id for this cache's storage
47
+     *
48
+     * @return int
49
+     * @since 9.0.0
50
+     */
51
+    public function getNumericStorageId();
52 52
 
53
-	/**
54
-	 * get the stored metadata of a file or folder
55
-	 *
56
-	 * @param string | int $file either the path of a file or folder or the file id for a file or folder
57
-	 * @return ICacheEntry|false the cache entry or false if the file is not found in the cache
58
-	 * @since 9.0.0
59
-	 */
60
-	public function get($file);
53
+    /**
54
+     * get the stored metadata of a file or folder
55
+     *
56
+     * @param string | int $file either the path of a file or folder or the file id for a file or folder
57
+     * @return ICacheEntry|false the cache entry or false if the file is not found in the cache
58
+     * @since 9.0.0
59
+     */
60
+    public function get($file);
61 61
 
62
-	/**
63
-	 * get the metadata of all files stored in $folder
64
-	 *
65
-	 * Only returns files one level deep, no recursion
66
-	 *
67
-	 * @param string $folder
68
-	 * @return ICacheEntry[]
69
-	 * @since 9.0.0
70
-	 */
71
-	public function getFolderContents($folder);
62
+    /**
63
+     * get the metadata of all files stored in $folder
64
+     *
65
+     * Only returns files one level deep, no recursion
66
+     *
67
+     * @param string $folder
68
+     * @return ICacheEntry[]
69
+     * @since 9.0.0
70
+     */
71
+    public function getFolderContents($folder);
72 72
 
73
-	/**
74
-	 * get the metadata of all files stored in $folder
75
-	 *
76
-	 * Only returns files one level deep, no recursion
77
-	 *
78
-	 * @param int $fileId the file id of the folder
79
-	 * @return ICacheEntry[]
80
-	 * @since 9.0.0
81
-	 */
82
-	public function getFolderContentsById($fileId);
73
+    /**
74
+     * get the metadata of all files stored in $folder
75
+     *
76
+     * Only returns files one level deep, no recursion
77
+     *
78
+     * @param int $fileId the file id of the folder
79
+     * @return ICacheEntry[]
80
+     * @since 9.0.0
81
+     */
82
+    public function getFolderContentsById($fileId);
83 83
 
84
-	/**
85
-	 * store meta data for a file or folder
86
-	 * This will automatically call either insert or update depending on if the file exists
87
-	 *
88
-	 * @param string $file
89
-	 * @param array $data
90
-	 *
91
-	 * @return int file id
92
-	 * @throws \RuntimeException
93
-	 * @since 9.0.0
94
-	 */
95
-	public function put($file, array $data);
84
+    /**
85
+     * store meta data for a file or folder
86
+     * This will automatically call either insert or update depending on if the file exists
87
+     *
88
+     * @param string $file
89
+     * @param array $data
90
+     *
91
+     * @return int file id
92
+     * @throws \RuntimeException
93
+     * @since 9.0.0
94
+     */
95
+    public function put($file, array $data);
96 96
 
97
-	/**
98
-	 * insert meta data for a new file or folder
99
-	 *
100
-	 * @param string $file
101
-	 * @param array $data
102
-	 *
103
-	 * @return int file id
104
-	 * @throws \RuntimeException
105
-	 * @since 9.0.0
106
-	 */
107
-	public function insert($file, array $data);
97
+    /**
98
+     * insert meta data for a new file or folder
99
+     *
100
+     * @param string $file
101
+     * @param array $data
102
+     *
103
+     * @return int file id
104
+     * @throws \RuntimeException
105
+     * @since 9.0.0
106
+     */
107
+    public function insert($file, array $data);
108 108
 
109
-	/**
110
-	 * update the metadata of an existing file or folder in the cache
111
-	 *
112
-	 * @param int $id the fileid of the existing file or folder
113
-	 * @param array $data [$key => $value] the metadata to update, only the fields provided in the array will be updated, non-provided values will remain unchanged
114
-	 * @since 9.0.0
115
-	 */
116
-	public function update($id, array $data);
109
+    /**
110
+     * update the metadata of an existing file or folder in the cache
111
+     *
112
+     * @param int $id the fileid of the existing file or folder
113
+     * @param array $data [$key => $value] the metadata to update, only the fields provided in the array will be updated, non-provided values will remain unchanged
114
+     * @since 9.0.0
115
+     */
116
+    public function update($id, array $data);
117 117
 
118
-	/**
119
-	 * get the file id for a file
120
-	 *
121
-	 * A file id is a numeric id for a file or folder that's unique within an owncloud instance which stays the same for the lifetime of a file
122
-	 *
123
-	 * File ids are easiest way for apps to store references to a file since unlike paths they are not affected by renames or sharing
124
-	 *
125
-	 * @param string $file
126
-	 * @return int
127
-	 * @since 9.0.0
128
-	 */
129
-	public function getId($file);
118
+    /**
119
+     * get the file id for a file
120
+     *
121
+     * A file id is a numeric id for a file or folder that's unique within an owncloud instance which stays the same for the lifetime of a file
122
+     *
123
+     * File ids are easiest way for apps to store references to a file since unlike paths they are not affected by renames or sharing
124
+     *
125
+     * @param string $file
126
+     * @return int
127
+     * @since 9.0.0
128
+     */
129
+    public function getId($file);
130 130
 
131
-	/**
132
-	 * get the id of the parent folder of a file
133
-	 *
134
-	 * @param string $file
135
-	 * @return int
136
-	 * @since 9.0.0
137
-	 */
138
-	public function getParentId($file);
131
+    /**
132
+     * get the id of the parent folder of a file
133
+     *
134
+     * @param string $file
135
+     * @return int
136
+     * @since 9.0.0
137
+     */
138
+    public function getParentId($file);
139 139
 
140
-	/**
141
-	 * check if a file is available in the cache
142
-	 *
143
-	 * @param string $file
144
-	 * @return bool
145
-	 * @since 9.0.0
146
-	 */
147
-	public function inCache($file);
140
+    /**
141
+     * check if a file is available in the cache
142
+     *
143
+     * @param string $file
144
+     * @return bool
145
+     * @since 9.0.0
146
+     */
147
+    public function inCache($file);
148 148
 
149
-	/**
150
-	 * remove a file or folder from the cache
151
-	 *
152
-	 * when removing a folder from the cache all files and folders inside the folder will be removed as well
153
-	 *
154
-	 * @param string $file
155
-	 * @since 9.0.0
156
-	 */
157
-	public function remove($file);
149
+    /**
150
+     * remove a file or folder from the cache
151
+     *
152
+     * when removing a folder from the cache all files and folders inside the folder will be removed as well
153
+     *
154
+     * @param string $file
155
+     * @since 9.0.0
156
+     */
157
+    public function remove($file);
158 158
 
159
-	/**
160
-	 * Move a file or folder in the cache
161
-	 *
162
-	 * @param string $source
163
-	 * @param string $target
164
-	 * @since 9.0.0
165
-	 */
166
-	public function move($source, $target);
159
+    /**
160
+     * Move a file or folder in the cache
161
+     *
162
+     * @param string $source
163
+     * @param string $target
164
+     * @since 9.0.0
165
+     */
166
+    public function move($source, $target);
167 167
 
168
-	/**
169
-	 * Move a file or folder in the cache
170
-	 *
171
-	 * Note that this should make sure the entries are removed from the source cache
172
-	 *
173
-	 * @param \OCP\Files\Cache\ICache $sourceCache
174
-	 * @param string $sourcePath
175
-	 * @param string $targetPath
176
-	 * @throws \OC\DatabaseException
177
-	 * @since 9.0.0
178
-	 */
179
-	public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath);
168
+    /**
169
+     * Move a file or folder in the cache
170
+     *
171
+     * Note that this should make sure the entries are removed from the source cache
172
+     *
173
+     * @param \OCP\Files\Cache\ICache $sourceCache
174
+     * @param string $sourcePath
175
+     * @param string $targetPath
176
+     * @throws \OC\DatabaseException
177
+     * @since 9.0.0
178
+     */
179
+    public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath);
180 180
 
181
-	/**
182
-	 * Get the scan status of a file
183
-	 *
184
-	 * - ICache::NOT_FOUND: File is not in the cache
185
-	 * - ICache::PARTIAL: File is not stored in the cache but some incomplete data is known
186
-	 * - ICache::SHALLOW: The folder and it's direct children are in the cache but not all sub folders are fully scanned
187
-	 * - ICache::COMPLETE: The file or folder, with all it's children) are fully scanned
188
-	 *
189
-	 * @param string $file
190
-	 *
191
-	 * @return int ICache::NOT_FOUND, ICache::PARTIAL, ICache::SHALLOW or ICache::COMPLETE
192
-	 * @since 9.0.0
193
-	 */
194
-	public function getStatus($file);
181
+    /**
182
+     * Get the scan status of a file
183
+     *
184
+     * - ICache::NOT_FOUND: File is not in the cache
185
+     * - ICache::PARTIAL: File is not stored in the cache but some incomplete data is known
186
+     * - ICache::SHALLOW: The folder and it's direct children are in the cache but not all sub folders are fully scanned
187
+     * - ICache::COMPLETE: The file or folder, with all it's children) are fully scanned
188
+     *
189
+     * @param string $file
190
+     *
191
+     * @return int ICache::NOT_FOUND, ICache::PARTIAL, ICache::SHALLOW or ICache::COMPLETE
192
+     * @since 9.0.0
193
+     */
194
+    public function getStatus($file);
195 195
 
196
-	/**
197
-	 * search for files matching $pattern, files are matched if their filename matches the search pattern
198
-	 *
199
-	 * @param string $pattern the search pattern using SQL search syntax (e.g. '%searchstring%')
200
-	 * @return ICacheEntry[] an array of cache entries where the name matches the search pattern
201
-	 * @since 9.0.0
202
-	 * @deprecated 9.0.0 due to lack of pagination, not all backends might implement this
203
-	 */
204
-	public function search($pattern);
196
+    /**
197
+     * search for files matching $pattern, files are matched if their filename matches the search pattern
198
+     *
199
+     * @param string $pattern the search pattern using SQL search syntax (e.g. '%searchstring%')
200
+     * @return ICacheEntry[] an array of cache entries where the name matches the search pattern
201
+     * @since 9.0.0
202
+     * @deprecated 9.0.0 due to lack of pagination, not all backends might implement this
203
+     */
204
+    public function search($pattern);
205 205
 
206
-	/**
207
-	 * search for files by mimetype
208
-	 *
209
-	 * @param string $mimetype either a full mimetype to search ('text/plain') or only the first part of a mimetype ('image')
210
-	 *        where it will search for all mimetypes in the group ('image/*')
211
-	 * @return ICacheEntry[] an array of cache entries where the mimetype matches the search
212
-	 * @since 9.0.0
213
-	 * @deprecated 9.0.0 due to lack of pagination, not all backends might implement this
214
-	 */
215
-	public function searchByMime($mimetype);
206
+    /**
207
+     * search for files by mimetype
208
+     *
209
+     * @param string $mimetype either a full mimetype to search ('text/plain') or only the first part of a mimetype ('image')
210
+     *        where it will search for all mimetypes in the group ('image/*')
211
+     * @return ICacheEntry[] an array of cache entries where the mimetype matches the search
212
+     * @since 9.0.0
213
+     * @deprecated 9.0.0 due to lack of pagination, not all backends might implement this
214
+     */
215
+    public function searchByMime($mimetype);
216 216
 
217
-	/**
218
-	 * Search for files with a flexible query
219
-	 *
220
-	 * @param ISearchQuery $query
221
-	 * @return ICacheEntry[]
222
-	 * @throw \InvalidArgumentException if the cache is unable to perform the query
223
-	 * @since 12.0.0
224
-	 */
225
-	public function searchQuery(ISearchQuery $query);
217
+    /**
218
+     * Search for files with a flexible query
219
+     *
220
+     * @param ISearchQuery $query
221
+     * @return ICacheEntry[]
222
+     * @throw \InvalidArgumentException if the cache is unable to perform the query
223
+     * @since 12.0.0
224
+     */
225
+    public function searchQuery(ISearchQuery $query);
226 226
 
227
-	/**
228
-	 * Search for files by tag of a given users.
229
-	 *
230
-	 * Note that every user can tag files differently.
231
-	 *
232
-	 * @param string|int $tag name or tag id
233
-	 * @param string $userId owner of the tags
234
-	 * @return ICacheEntry[] file data
235
-	 * @since 9.0.0
236
-	 * @deprecated 9.0.0 due to lack of pagination, not all backends might implement this
237
-	 */
238
-	public function searchByTag($tag, $userId);
227
+    /**
228
+     * Search for files by tag of a given users.
229
+     *
230
+     * Note that every user can tag files differently.
231
+     *
232
+     * @param string|int $tag name or tag id
233
+     * @param string $userId owner of the tags
234
+     * @return ICacheEntry[] file data
235
+     * @since 9.0.0
236
+     * @deprecated 9.0.0 due to lack of pagination, not all backends might implement this
237
+     */
238
+    public function searchByTag($tag, $userId);
239 239
 
240
-	/**
241
-	 * find a folder in the cache which has not been fully scanned
242
-	 *
243
-	 * If multiple incomplete folders are in the cache, the one with the highest id will be returned,
244
-	 * use the one with the highest id gives the best result with the background scanner, since that is most
245
-	 * likely the folder where we stopped scanning previously
246
-	 *
247
-	 * @return string|bool the path of the folder or false when no folder matched
248
-	 * @since 9.0.0
249
-	 */
250
-	public function getIncomplete();
240
+    /**
241
+     * find a folder in the cache which has not been fully scanned
242
+     *
243
+     * If multiple incomplete folders are in the cache, the one with the highest id will be returned,
244
+     * use the one with the highest id gives the best result with the background scanner, since that is most
245
+     * likely the folder where we stopped scanning previously
246
+     *
247
+     * @return string|bool the path of the folder or false when no folder matched
248
+     * @since 9.0.0
249
+     */
250
+    public function getIncomplete();
251 251
 
252
-	/**
253
-	 * get the path of a file on this storage by it's file id
254
-	 *
255
-	 * @param int $id the file id of the file or folder to search
256
-	 * @return string|null the path of the file (relative to the storage) or null if a file with the given id does not exists within this cache
257
-	 * @since 9.0.0
258
-	 */
259
-	public function getPathById($id);
252
+    /**
253
+     * get the path of a file on this storage by it's file id
254
+     *
255
+     * @param int $id the file id of the file or folder to search
256
+     * @return string|null the path of the file (relative to the storage) or null if a file with the given id does not exists within this cache
257
+     * @since 9.0.0
258
+     */
259
+    public function getPathById($id);
260 260
 
261
-	/**
262
-	 * normalize the given path for usage in the cache
263
-	 *
264
-	 * @param string $path
265
-	 * @return string
266
-	 * @since 9.0.0
267
-	 */
268
-	public function normalize($path);
261
+    /**
262
+     * normalize the given path for usage in the cache
263
+     *
264
+     * @param string $path
265
+     * @return string
266
+     * @since 9.0.0
267
+     */
268
+    public function normalize($path);
269 269
 }
Please login to merge, or discard this patch.
lib/private/Files/Search/SearchComparison.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -24,44 +24,44 @@
 block discarded – undo
24 24
 use OCP\Files\Search\ISearchComparison;
25 25
 
26 26
 class SearchComparison implements ISearchComparison {
27
-	/** @var string */
28
-	private $type;
29
-	/** @var string */
30
-	private $field;
31
-	/** @var string|integer|\DateTime */
32
-	private $value;
27
+    /** @var string */
28
+    private $type;
29
+    /** @var string */
30
+    private $field;
31
+    /** @var string|integer|\DateTime */
32
+    private $value;
33 33
 
34
-	/**
35
-	 * SearchComparison constructor.
36
-	 *
37
-	 * @param string $type
38
-	 * @param string $field
39
-	 * @param \DateTime|int|string $value
40
-	 */
41
-	public function __construct($type, $field, $value) {
42
-		$this->type = $type;
43
-		$this->field = $field;
44
-		$this->value = $value;
45
-	}
34
+    /**
35
+     * SearchComparison constructor.
36
+     *
37
+     * @param string $type
38
+     * @param string $field
39
+     * @param \DateTime|int|string $value
40
+     */
41
+    public function __construct($type, $field, $value) {
42
+        $this->type = $type;
43
+        $this->field = $field;
44
+        $this->value = $value;
45
+    }
46 46
 
47
-	/**
48
-	 * @return string
49
-	 */
50
-	public function getType() {
51
-		return $this->type;
52
-	}
47
+    /**
48
+     * @return string
49
+     */
50
+    public function getType() {
51
+        return $this->type;
52
+    }
53 53
 
54
-	/**
55
-	 * @return string
56
-	 */
57
-	public function getField() {
58
-		return $this->field;
59
-	}
54
+    /**
55
+     * @return string
56
+     */
57
+    public function getField() {
58
+        return $this->field;
59
+    }
60 60
 
61
-	/**
62
-	 * @return \DateTime|int|string
63
-	 */
64
-	public function getValue() {
65
-		return $this->value;
66
-	}
61
+    /**
62
+     * @return \DateTime|int|string
63
+     */
64
+    public function getValue() {
65
+        return $this->value;
66
+    }
67 67
 }
Please login to merge, or discard this patch.
lib/private/Files/Search/SearchOrder.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -25,33 +25,33 @@
 block discarded – undo
25 25
 use OCP\Files\Search\ISearchOrder;
26 26
 
27 27
 class SearchOrder implements ISearchOrder {
28
-	/** @var  string */
29
-	private $direction;
30
-	/** @var  string */
31
-	private $field;
28
+    /** @var  string */
29
+    private $direction;
30
+    /** @var  string */
31
+    private $field;
32 32
 
33
-	/**
34
-	 * SearchOrder constructor.
35
-	 *
36
-	 * @param string $direction
37
-	 * @param string $field
38
-	 */
39
-	public function __construct($direction, $field) {
40
-		$this->direction = $direction;
41
-		$this->field = $field;
42
-	}
33
+    /**
34
+     * SearchOrder constructor.
35
+     *
36
+     * @param string $direction
37
+     * @param string $field
38
+     */
39
+    public function __construct($direction, $field) {
40
+        $this->direction = $direction;
41
+        $this->field = $field;
42
+    }
43 43
 
44
-	/**
45
-	 * @return string
46
-	 */
47
-	public function getDirection() {
48
-		return $this->direction;
49
-	}
44
+    /**
45
+     * @return string
46
+     */
47
+    public function getDirection() {
48
+        return $this->direction;
49
+    }
50 50
 
51
-	/**
52
-	 * @return string
53
-	 */
54
-	public function getField() {
55
-		return $this->field;
56
-	}
51
+    /**
52
+     * @return string
53
+     */
54
+    public function getField() {
55
+        return $this->field;
56
+    }
57 57
 }
Please login to merge, or discard this patch.
lib/private/Files/Search/SearchBinaryOperator.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -25,33 +25,33 @@
 block discarded – undo
25 25
 use OCP\Files\Search\ISearchOperator;
26 26
 
27 27
 class SearchBinaryOperator implements ISearchBinaryOperator {
28
-	/** @var string */
29
-	private $type;
30
-	/** @var ISearchOperator[] */
31
-	private $arguments;
28
+    /** @var string */
29
+    private $type;
30
+    /** @var ISearchOperator[] */
31
+    private $arguments;
32 32
 
33
-	/**
34
-	 * SearchBinaryOperator constructor.
35
-	 *
36
-	 * @param string $type
37
-	 * @param ISearchOperator[] $arguments
38
-	 */
39
-	public function __construct($type, array $arguments) {
40
-		$this->type = $type;
41
-		$this->arguments = $arguments;
42
-	}
33
+    /**
34
+     * SearchBinaryOperator constructor.
35
+     *
36
+     * @param string $type
37
+     * @param ISearchOperator[] $arguments
38
+     */
39
+    public function __construct($type, array $arguments) {
40
+        $this->type = $type;
41
+        $this->arguments = $arguments;
42
+    }
43 43
 
44
-	/**
45
-	 * @return string
46
-	 */
47
-	public function getType() {
48
-		return $this->type;
49
-	}
44
+    /**
45
+     * @return string
46
+     */
47
+    public function getType() {
48
+        return $this->type;
49
+    }
50 50
 
51
-	/**
52
-	 * @return ISearchOperator[]
53
-	 */
54
-	public function getArguments() {
55
-		return $this->arguments;
56
-	}
51
+    /**
52
+     * @return ISearchOperator[]
53
+     */
54
+    public function getArguments() {
55
+        return $this->arguments;
56
+    }
57 57
 }
Please login to merge, or discard this patch.
lib/private/Lockdown/Filesystem/NullCache.php 1 patch
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -27,101 +27,101 @@
 block discarded – undo
27 27
 use OCP\Files\Search\ISearchQuery;
28 28
 
29 29
 class NullCache implements ICache {
30
-	public function getNumericStorageId() {
31
-		return -1;
32
-	}
33
-
34
-	public function get($file) {
35
-		return $file !== '' ? null :
36
-			new CacheEntry([
37
-				'fileid' => -1,
38
-				'parent' => -1,
39
-				'name' => '',
40
-				'path' => '',
41
-				'size' => '0',
42
-				'mtime' => time(),
43
-				'storage_mtime' => time(),
44
-				'etag' => '',
45
-				'mimetype' => FileInfo::MIMETYPE_FOLDER,
46
-				'mimepart' => 'httpd',
47
-				'permissions' => Constants::PERMISSION_READ
48
-			]);
49
-	}
50
-
51
-	public function getFolderContents($folder) {
52
-		return [];
53
-	}
54
-
55
-	public function getFolderContentsById($fileId) {
56
-		return [];
57
-	}
58
-
59
-	public function put($file, array $data) {
60
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
61
-	}
62
-
63
-	public function insert($file, array $data) {
64
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
65
-	}
66
-
67
-	public function update($id, array $data) {
68
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
69
-	}
70
-
71
-	public function getId($file) {
72
-		return -1;
73
-	}
74
-
75
-	public function getParentId($file) {
76
-		return -1;
77
-	}
78
-
79
-	public function inCache($file) {
80
-		return $file === '';
81
-	}
82
-
83
-	public function remove($file) {
84
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
85
-	}
86
-
87
-	public function move($source, $target) {
88
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
89
-	}
90
-
91
-	public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {
92
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
93
-	}
94
-
95
-	public function getStatus($file) {
96
-		return ICache::COMPLETE;
97
-	}
98
-
99
-	public function search($pattern) {
100
-		return [];
101
-	}
102
-
103
-	public function searchByMime($mimetype) {
104
-		return [];
105
-	}
106
-
107
-	public function searchQuery(ISearchQuery $query) {
108
-		return [];
109
-	}
110
-
111
-	public function searchByTag($tag, $userId) {
112
-		return [];
113
-	}
114
-
115
-	public function getIncomplete() {
116
-		return [];
117
-	}
118
-
119
-	public function getPathById($id) {
120
-		return '';
121
-	}
122
-
123
-	public function normalize($path) {
124
-		return $path;
125
-	}
30
+    public function getNumericStorageId() {
31
+        return -1;
32
+    }
33
+
34
+    public function get($file) {
35
+        return $file !== '' ? null :
36
+            new CacheEntry([
37
+                'fileid' => -1,
38
+                'parent' => -1,
39
+                'name' => '',
40
+                'path' => '',
41
+                'size' => '0',
42
+                'mtime' => time(),
43
+                'storage_mtime' => time(),
44
+                'etag' => '',
45
+                'mimetype' => FileInfo::MIMETYPE_FOLDER,
46
+                'mimepart' => 'httpd',
47
+                'permissions' => Constants::PERMISSION_READ
48
+            ]);
49
+    }
50
+
51
+    public function getFolderContents($folder) {
52
+        return [];
53
+    }
54
+
55
+    public function getFolderContentsById($fileId) {
56
+        return [];
57
+    }
58
+
59
+    public function put($file, array $data) {
60
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
61
+    }
62
+
63
+    public function insert($file, array $data) {
64
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
65
+    }
66
+
67
+    public function update($id, array $data) {
68
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
69
+    }
70
+
71
+    public function getId($file) {
72
+        return -1;
73
+    }
74
+
75
+    public function getParentId($file) {
76
+        return -1;
77
+    }
78
+
79
+    public function inCache($file) {
80
+        return $file === '';
81
+    }
82
+
83
+    public function remove($file) {
84
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
85
+    }
86
+
87
+    public function move($source, $target) {
88
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
89
+    }
90
+
91
+    public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {
92
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
93
+    }
94
+
95
+    public function getStatus($file) {
96
+        return ICache::COMPLETE;
97
+    }
98
+
99
+    public function search($pattern) {
100
+        return [];
101
+    }
102
+
103
+    public function searchByMime($mimetype) {
104
+        return [];
105
+    }
106
+
107
+    public function searchQuery(ISearchQuery $query) {
108
+        return [];
109
+    }
110
+
111
+    public function searchByTag($tag, $userId) {
112
+        return [];
113
+    }
114
+
115
+    public function getIncomplete() {
116
+        return [];
117
+    }
118
+
119
+    public function getPathById($id) {
120
+        return '';
121
+    }
122
+
123
+    public function normalize($path) {
124
+        return $path;
125
+    }
126 126
 
127 127
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php 1 patch
Indentation   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -45,114 +45,114 @@
 block discarded – undo
45 45
  * @package OCA\DAV\Connector\Sabre
46 46
  */
47 47
 class FakeLockerPlugin extends ServerPlugin {
48
-	/** @var \Sabre\DAV\Server */
49
-	private $server;
48
+    /** @var \Sabre\DAV\Server */
49
+    private $server;
50 50
 
51
-	/** {@inheritDoc} */
52
-	public function initialize(\Sabre\DAV\Server $server) {
53
-		$this->server = $server;
54
-		$this->server->on('method:LOCK', [$this, 'fakeLockProvider'], 1);
55
-		$this->server->on('method:UNLOCK', [$this, 'fakeUnlockProvider'], 1);
56
-		$server->on('propFind', [$this, 'propFind']);
57
-		$server->on('validateTokens', [$this, 'validateTokens']);
58
-	}
51
+    /** {@inheritDoc} */
52
+    public function initialize(\Sabre\DAV\Server $server) {
53
+        $this->server = $server;
54
+        $this->server->on('method:LOCK', [$this, 'fakeLockProvider'], 1);
55
+        $this->server->on('method:UNLOCK', [$this, 'fakeUnlockProvider'], 1);
56
+        $server->on('propFind', [$this, 'propFind']);
57
+        $server->on('validateTokens', [$this, 'validateTokens']);
58
+    }
59 59
 
60
-	/**
61
-	 * Indicate that we support LOCK and UNLOCK
62
-	 *
63
-	 * @param string $path
64
-	 * @return string[]
65
-	 */
66
-	public function getHTTPMethods($path) {
67
-		return [
68
-			'LOCK',
69
-			'UNLOCK',
70
-		];
71
-	}
60
+    /**
61
+     * Indicate that we support LOCK and UNLOCK
62
+     *
63
+     * @param string $path
64
+     * @return string[]
65
+     */
66
+    public function getHTTPMethods($path) {
67
+        return [
68
+            'LOCK',
69
+            'UNLOCK',
70
+        ];
71
+    }
72 72
 
73
-	/**
74
-	 * Indicate that we support locking
75
-	 *
76
-	 * @return integer[]
77
-	 */
78
-	function getFeatures() {
79
-		return [2];
80
-	}
73
+    /**
74
+     * Indicate that we support locking
75
+     *
76
+     * @return integer[]
77
+     */
78
+    function getFeatures() {
79
+        return [2];
80
+    }
81 81
 
82
-	/**
83
-	 * Return some dummy response for PROPFIND requests with regard to locking
84
-	 *
85
-	 * @param PropFind $propFind
86
-	 * @param INode $node
87
-	 * @return void
88
-	 */
89
-	function propFind(PropFind $propFind, INode $node) {
90
-		$propFind->handle('{DAV:}supportedlock', function() {
91
-			return new SupportedLock(true);
92
-		});
93
-		$propFind->handle('{DAV:}lockdiscovery', function() use ($propFind) {
94
-			return new LockDiscovery([]);
95
-		});
96
-	}
82
+    /**
83
+     * Return some dummy response for PROPFIND requests with regard to locking
84
+     *
85
+     * @param PropFind $propFind
86
+     * @param INode $node
87
+     * @return void
88
+     */
89
+    function propFind(PropFind $propFind, INode $node) {
90
+        $propFind->handle('{DAV:}supportedlock', function() {
91
+            return new SupportedLock(true);
92
+        });
93
+        $propFind->handle('{DAV:}lockdiscovery', function() use ($propFind) {
94
+            return new LockDiscovery([]);
95
+        });
96
+    }
97 97
 
98
-	/**
99
-	 * Mark a locking token always as valid
100
-	 *
101
-	 * @param RequestInterface $request
102
-	 * @param array $conditions
103
-	 */
104
-	public function validateTokens(RequestInterface $request, &$conditions) {
105
-		foreach($conditions as &$fileCondition) {
106
-			if(isset($fileCondition['tokens'])) {
107
-				foreach($fileCondition['tokens'] as &$token) {
108
-					if(isset($token['token'])) {
109
-						if(substr($token['token'], 0, 16) === 'opaquelocktoken:') {
110
-							$token['validToken'] = true;
111
-						}
112
-					}
113
-				}
114
-			}
115
-		}
116
-	}
98
+    /**
99
+     * Mark a locking token always as valid
100
+     *
101
+     * @param RequestInterface $request
102
+     * @param array $conditions
103
+     */
104
+    public function validateTokens(RequestInterface $request, &$conditions) {
105
+        foreach($conditions as &$fileCondition) {
106
+            if(isset($fileCondition['tokens'])) {
107
+                foreach($fileCondition['tokens'] as &$token) {
108
+                    if(isset($token['token'])) {
109
+                        if(substr($token['token'], 0, 16) === 'opaquelocktoken:') {
110
+                            $token['validToken'] = true;
111
+                        }
112
+                    }
113
+                }
114
+            }
115
+        }
116
+    }
117 117
 
118
-	/**
119
-	 * Fakes a successful LOCK
120
-	 *
121
-	 * @param RequestInterface $request
122
-	 * @param ResponseInterface $response
123
-	 * @return bool
124
-	 */
125
-	public function fakeLockProvider(RequestInterface $request,
126
-									 ResponseInterface $response) {
118
+    /**
119
+     * Fakes a successful LOCK
120
+     *
121
+     * @param RequestInterface $request
122
+     * @param ResponseInterface $response
123
+     * @return bool
124
+     */
125
+    public function fakeLockProvider(RequestInterface $request,
126
+                                        ResponseInterface $response) {
127 127
 
128
-		$lockInfo = new LockInfo();
129
-		$lockInfo->token = md5($request->getPath());
130
-		$lockInfo->uri = $request->getPath();
131
-		$lockInfo->depth = \Sabre\DAV\Server::DEPTH_INFINITY;
132
-		$lockInfo->timeout = 1800;
128
+        $lockInfo = new LockInfo();
129
+        $lockInfo->token = md5($request->getPath());
130
+        $lockInfo->uri = $request->getPath();
131
+        $lockInfo->depth = \Sabre\DAV\Server::DEPTH_INFINITY;
132
+        $lockInfo->timeout = 1800;
133 133
 
134
-		$body = $this->server->xml->write('{DAV:}prop', [
135
-				'{DAV:}lockdiscovery' =>
136
-						new LockDiscovery([$lockInfo])
137
-		]);
134
+        $body = $this->server->xml->write('{DAV:}prop', [
135
+                '{DAV:}lockdiscovery' =>
136
+                        new LockDiscovery([$lockInfo])
137
+        ]);
138 138
 
139
-		$response->setStatus(200);
140
-		$response->setBody($body);
139
+        $response->setStatus(200);
140
+        $response->setBody($body);
141 141
 
142
-		return false;
143
-	}
142
+        return false;
143
+    }
144 144
 
145
-	/**
146
-	 * Fakes a successful LOCK
147
-	 *
148
-	 * @param RequestInterface $request
149
-	 * @param ResponseInterface $response
150
-	 * @return bool
151
-	 */
152
-	public function fakeUnlockProvider(RequestInterface $request,
153
-									 ResponseInterface $response) {
154
-		$response->setStatus(204);
155
-		$response->setHeader('Content-Length', '0');
156
-		return false;
157
-	}
145
+    /**
146
+     * Fakes a successful LOCK
147
+     *
148
+     * @param RequestInterface $request
149
+     * @param ResponseInterface $response
150
+     * @return bool
151
+     */
152
+    public function fakeUnlockProvider(RequestInterface $request,
153
+                                        ResponseInterface $response) {
154
+        $response->setStatus(204);
155
+        $response->setHeader('Content-Length', '0');
156
+        return false;
157
+    }
158 158
 }
Please login to merge, or discard this patch.
lib/public/Files/Search/ISearchQuery.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -27,41 +27,41 @@
 block discarded – undo
27 27
  * @since 12.0.0
28 28
  */
29 29
 interface ISearchQuery {
30
-	/**
31
-	 * @return ISearchOperator
32
-	 * @since 12.0.0
33
-	 */
34
-	public function getSearchOperation();
30
+    /**
31
+     * @return ISearchOperator
32
+     * @since 12.0.0
33
+     */
34
+    public function getSearchOperation();
35 35
 
36
-	/**
37
-	 * Get the maximum number of results to return
38
-	 *
39
-	 * @return integer
40
-	 * @since 12.0.0
41
-	 */
42
-	public function getLimit();
36
+    /**
37
+     * Get the maximum number of results to return
38
+     *
39
+     * @return integer
40
+     * @since 12.0.0
41
+     */
42
+    public function getLimit();
43 43
 
44
-	/**
45
-	 * Get the offset for returned results
46
-	 *
47
-	 * @return integer
48
-	 * @since 12.0.0
49
-	 */
50
-	public function getOffset();
44
+    /**
45
+     * Get the offset for returned results
46
+     *
47
+     * @return integer
48
+     * @since 12.0.0
49
+     */
50
+    public function getOffset();
51 51
 
52
-	/**
53
-	 * The fields and directions to order by
54
-	 *
55
-	 * @return ISearchOrder[]
56
-	 * @since 12.0.0
57
-	 */
58
-	public function getOrder();
52
+    /**
53
+     * The fields and directions to order by
54
+     *
55
+     * @return ISearchOrder[]
56
+     * @since 12.0.0
57
+     */
58
+    public function getOrder();
59 59
 
60
-	/**
61
-	 * The user that issued the search
62
-	 *
63
-	 * @return IUser
64
-	 * @since 12.0.0
65
-	 */
66
-	public function getUser();
60
+    /**
61
+     * The user that issued the search
62
+     *
63
+     * @return IUser
64
+     * @since 12.0.0
65
+     */
66
+    public function getUser();
67 67
 }
Please login to merge, or discard this patch.
lib/private/Files/Search/SearchQuery.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -27,66 +27,66 @@
 block discarded – undo
27 27
 use OCP\IUser;
28 28
 
29 29
 class SearchQuery implements ISearchQuery {
30
-	/** @var  ISearchOperator */
31
-	private $searchOperation;
32
-	/** @var  integer */
33
-	private $limit;
34
-	/** @var  integer */
35
-	private $offset;
36
-	/** @var  ISearchOrder[] */
37
-	private $order;
38
-	/** @var IUser */
39
-	private $user;
30
+    /** @var  ISearchOperator */
31
+    private $searchOperation;
32
+    /** @var  integer */
33
+    private $limit;
34
+    /** @var  integer */
35
+    private $offset;
36
+    /** @var  ISearchOrder[] */
37
+    private $order;
38
+    /** @var IUser */
39
+    private $user;
40 40
 
41
-	/**
42
-	 * SearchQuery constructor.
43
-	 *
44
-	 * @param ISearchOperator $searchOperation
45
-	 * @param int $limit
46
-	 * @param int $offset
47
-	 * @param array $order
48
-	 * @param IUser $user
49
-	 */
50
-	public function __construct(ISearchOperator $searchOperation, $limit, $offset, array $order, IUser $user) {
51
-		$this->searchOperation = $searchOperation;
52
-		$this->limit = $limit;
53
-		$this->offset = $offset;
54
-		$this->order = $order;
55
-		$this->user = $user;
56
-	}
41
+    /**
42
+     * SearchQuery constructor.
43
+     *
44
+     * @param ISearchOperator $searchOperation
45
+     * @param int $limit
46
+     * @param int $offset
47
+     * @param array $order
48
+     * @param IUser $user
49
+     */
50
+    public function __construct(ISearchOperator $searchOperation, $limit, $offset, array $order, IUser $user) {
51
+        $this->searchOperation = $searchOperation;
52
+        $this->limit = $limit;
53
+        $this->offset = $offset;
54
+        $this->order = $order;
55
+        $this->user = $user;
56
+    }
57 57
 
58
-	/**
59
-	 * @return ISearchOperator
60
-	 */
61
-	public function getSearchOperation() {
62
-		return $this->searchOperation;
63
-	}
58
+    /**
59
+     * @return ISearchOperator
60
+     */
61
+    public function getSearchOperation() {
62
+        return $this->searchOperation;
63
+    }
64 64
 
65
-	/**
66
-	 * @return int
67
-	 */
68
-	public function getLimit() {
69
-		return $this->limit;
70
-	}
65
+    /**
66
+     * @return int
67
+     */
68
+    public function getLimit() {
69
+        return $this->limit;
70
+    }
71 71
 
72
-	/**
73
-	 * @return int
74
-	 */
75
-	public function getOffset() {
76
-		return $this->offset;
77
-	}
72
+    /**
73
+     * @return int
74
+     */
75
+    public function getOffset() {
76
+        return $this->offset;
77
+    }
78 78
 
79
-	/**
80
-	 * @return ISearchOrder[]
81
-	 */
82
-	public function getOrder() {
83
-		return $this->order;
84
-	}
79
+    /**
80
+     * @return ISearchOrder[]
81
+     */
82
+    public function getOrder() {
83
+        return $this->order;
84
+    }
85 85
 
86
-	/**
87
-	 * @return IUser
88
-	 */
89
-	public function getUser() {
90
-		return $this->user;
91
-	}
86
+    /**
87
+     * @return IUser
88
+     */
89
+    public function getUser() {
90
+        return $this->user;
91
+    }
92 92
 }
Please login to merge, or discard this patch.