@@ -236,7 +236,7 @@ |
||
236 | 236 | */ |
237 | 237 | public function setDocumentIndexOption(FilesDocument $document, string $option) { |
238 | 238 | $document->getIndex() |
239 | - ->addOption('_' . $option, (string)$this->getAppValue($option)); |
|
239 | + ->addOption('_'.$option, (string)$this->getAppValue($option)); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $this->searchQueryInOptions($request); |
113 | 113 | $this->searchQueryFiltersExtension($request); |
114 | 114 | $this->searchQueryFiltersSource($request); |
115 | - if($this->userId === null) { |
|
115 | + if ($this->userId === null) { |
|
116 | 116 | $this->userId = $this->miscService->secureUsername($request->getAuthor()); |
117 | 117 | } |
118 | 118 | $request->addPart('comments'); |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | */ |
126 | 126 | private function searchQueryShareNames(ISearchRequest $request) { |
127 | 127 | $username = $this->miscService->secureUsername($request->getAuthor()); |
128 | - $request->addField('share_names.' . $username); |
|
128 | + $request->addField('share_names.'.$username); |
|
129 | 129 | |
130 | 130 | $request->addWildcardField('title'); |
131 | - $request->addWildcardField('share_names.' . $username); |
|
131 | + $request->addWildcardField('share_names.'.$username); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | $currentDir = $this->withoutBeginSlash($this->withEndSlash($currentDir)); |
147 | 147 | $request->addRegexFilters( |
148 | 148 | [ |
149 | - ['share_names.' . $username => $currentDir . '.*'], |
|
150 | - ['title' => $currentDir . '.*'] |
|
149 | + ['share_names.'.$username => $currentDir.'.*'], |
|
150 | + ['title' => $currentDir.'.*'] |
|
151 | 151 | ] |
152 | 152 | ); |
153 | 153 | } |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | $username = $this->miscService->secureUsername($request->getAuthor()); |
166 | 166 | $request->addRegexFilters( |
167 | 167 | [ |
168 | - ['share_names.' . $username => '.*\.' . $extension], |
|
169 | - ['title' => '.*\.' . $extension] |
|
168 | + ['share_names.'.$username => '.*\.'.$extension], |
|
169 | + ['title' => '.*\.'.$extension] |
|
170 | 170 | ] |
171 | 171 | ); |
172 | 172 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | |
201 | 201 | if (in_array('filename', $in)) { |
202 | 202 | $username = $this->miscService->secureUsername($request->getAuthor()); |
203 | - $request->addLimitField('share_names.' . $username); |
|
203 | + $request->addLimitField('share_names.'.$username); |
|
204 | 204 | $request->addLimitField('title'); |
205 | 205 | } |
206 | 206 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $filesDocuments[] = $filesDocument; |
254 | 254 | } catch (Exception $e) { |
255 | 255 | $this->miscService->log( |
256 | - 'Exception while improving searchresult: ' . $e->getMessage() . ' - trace: ' |
|
256 | + 'Exception while improving searchresult: '.$e->getMessage().' - trace: ' |
|
257 | 257 | . json_encode($e->getTrace()) |
258 | 258 | ); |
259 | 259 | } |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | private function getWebdavId(int $fileId): string { |
373 | 373 | $instanceId = $this->configService->getSystemValue('instanceid'); |
374 | 374 | |
375 | - return sprintf("%08s", $fileId) . $instanceId; |
|
375 | + return sprintf("%08s", $fileId).$instanceId; |
|
376 | 376 | } |
377 | 377 | |
378 | 378 |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | ->get($indexOptions->getOption('path', '/')); |
235 | 235 | } catch (Throwable $e) { |
236 | 236 | $this->e($e, ['userId' => $userId, 'options' => $indexOptions]); |
237 | - \OC::$server->getLogger()->log(2, 'Issue while retrieving rootFolder for ' . $userId); |
|
237 | + \OC::$server->getLogger()->log(2, 'Issue while retrieving rootFolder for '.$userId); |
|
238 | 238 | |
239 | 239 | return []; |
240 | 240 | } |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | $tagIds = $this->systemTagObjectMapper->getTagIdsForObjects([$file->getId()], 'files'); |
486 | 486 | if (array_key_exists($file->getId(), $tagIds)) { |
487 | 487 | $tags = array_values( |
488 | - array_map(function (ISystemTag $tag): string { |
|
488 | + array_map(function(ISystemTag $tag): string { |
|
489 | 489 | return $tag->getName(); |
490 | 490 | }, $this->systemTagManager->getTagsByIds($tagIds[$file->getId()])) |
491 | 491 | ); |
@@ -620,8 +620,8 @@ discard block |
||
620 | 620 | $document->getIndex() |
621 | 621 | ->setStatus(IIndex::INDEX_IGNORE); |
622 | 622 | $this->miscService->log( |
623 | - 'Exception while generateDocument: ' . $e->getMessage() . ' (' . get_class($e) . ') at ' |
|
624 | - . $e->getFile() . ' line ' . $e->getLine() |
|
623 | + 'Exception while generateDocument: '.$e->getMessage().' ('.get_class($e).') at ' |
|
624 | + . $e->getFile().' line '.$e->getLine() |
|
625 | 625 | ); |
626 | 626 | } |
627 | 627 | } |
@@ -827,7 +827,7 @@ discard block |
||
827 | 827 | |
828 | 828 | $part = []; |
829 | 829 | foreach ($comments as $comment) { |
830 | - $part[] = '<' . $comment->getActorId() . '> ' . $comment->getMessage(); |
|
830 | + $part[] = '<'.$comment->getActorId().'> '.$comment->getMessage(); |
|
831 | 831 | } |
832 | 832 | |
833 | 833 | $document->addPart('comments', implode(" \n ", $part)); |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | |
865 | 865 | } catch (Throwable $e) { |
866 | 866 | $this->miscService->log( |
867 | - 'Issue while getting information on documentId:' . $document->getId(), 0 |
|
867 | + 'Issue while getting information on documentId:'.$document->getId(), 0 |
|
868 | 868 | ); |
869 | 869 | } |
870 | 870 | } |
@@ -1307,7 +1307,7 @@ discard block |
||
1307 | 1307 | $path = ''; |
1308 | 1308 | } |
1309 | 1309 | |
1310 | - $result = (($entrySlash) ? '/' : '') . $path; |
|
1310 | + $result = (($entrySlash) ? '/' : '').$path; |
|
1311 | 1311 | $this->debug( |
1312 | 1312 | 'getPathFromRoot', [ |
1313 | 1313 | 'path' => $path, |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @param FilesDocument $document |
88 | 88 | * @param Node $file |
89 | 89 | */ |
90 | - public function fileIndexing(FilesDocument &$document, Node $file) { |
|
90 | + public function fileIndexing(FilesDocument & $document, Node $file) { |
|
91 | 91 | $this->dispatch('Files_FullTextSearch.onFileIndexing', ['file' => $file, 'document' => &$document]); |
92 | 92 | } |
93 | 93 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | /** |
96 | 96 | * @param ISearchRequest $request |
97 | 97 | */ |
98 | - public function searchRequest(ISearchRequest &$request) { |
|
98 | + public function searchRequest(ISearchRequest & $request) { |
|
99 | 99 | $this->dispatch('Files_FullTextSearch.onSearchRequest', ['request' => &$request]); |
100 | 100 | } |
101 | 101 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * @param ISearchResult $result |
105 | 105 | */ |
106 | - public function searchResult(ISearchResult &$result) { |
|
106 | + public function searchResult(ISearchResult & $result) { |
|
107 | 107 | $this->dispatch('Files_FullTextSearch.onSearchResult', ['result' => &$result]); |
108 | 108 | } |
109 | 109 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | /** |
112 | 112 | * @param IIndexDocument $document |
113 | 113 | */ |
114 | - public function indexComparing(IIndexDocument &$document) { |
|
114 | + public function indexComparing(IIndexDocument & $document) { |
|
115 | 115 | $this->dispatch('Files_FullTextSearch.onIndexComparing', ['document' => &$document]); |
116 | 116 | } |
117 | 117 |
@@ -191,7 +191,7 @@ |
||
191 | 191 | * |
192 | 192 | * @throws FileIsNotIndexableException |
193 | 193 | */ |
194 | - public function updateDocumentAccess(FilesDocument &$document, Node $file) { |
|
194 | + public function updateDocumentAccess(FilesDocument & $document, Node $file) { |
|
195 | 195 | if ($document->getSource() !== ConfigService::FILES_EXTERNAL) { |
196 | 196 | return; |
197 | 197 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * @param FilesDocument $document |
164 | 164 | * @param Node $file |
165 | 165 | */ |
166 | - public function updateDocumentAccess(FilesDocument &$document, Node $file) { |
|
166 | + public function updateDocumentAccess(FilesDocument & $document, Node $file) { |
|
167 | 167 | |
168 | 168 | if ($document->getSource() !== ConfigService::FILES_GROUP_FOLDERS) { |
169 | 169 | return; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | foreach ($mounts as $path => $mount) { |
230 | 230 | $mountPoint = new MountPoint(); |
231 | 231 | $mountPoint->setId($this->getInt('id', $mount, -1)) |
232 | - ->setPath('/' . $userId . '/files/' . $mount['mount_point']) |
|
232 | + ->setPath('/'.$userId.'/files/'.$mount['mount_point']) |
|
233 | 233 | ->setGroups(array_keys($mount['groups'])); |
234 | 234 | $mountPoints[] = $mountPoint; |
235 | 235 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | return $line; |
97 | 97 | } |
98 | 98 | |
99 | - return substr($line, 0, $length - 5) . ' (..)'; |
|
99 | + return substr($line, 0, $length - 5).' (..)'; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | protected function feedStringWithParams(string $line, array $params): string { |
135 | 135 | $ak = array_keys($params); |
136 | 136 | foreach ($ak as $k) { |
137 | - $line = str_replace('{' . $k . '}', (string)$params[$k], $line); |
|
137 | + $line = str_replace('{'.$k.'}', (string)$params[$k], $line); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | return $line; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $s = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']; |
189 | 189 | $e = floor(log($bytes, 1024)); |
190 | 190 | |
191 | - return round($bytes / pow(1024, $e), 2) . ' ' . $s[$e]; |
|
191 | + return round($bytes / pow(1024, $e), 2).' '.$s[$e]; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | |
@@ -211,8 +211,8 @@ discard block |
||
211 | 211 | $second = time(); |
212 | 212 | } |
213 | 213 | |
214 | - $f = new DateTime('@' . $first); |
|
215 | - $s = new DateTime('@' . $second); |
|
214 | + $f = new DateTime('@'.$first); |
|
215 | + $s = new DateTime('@'.$second); |
|
216 | 216 | $duration = $second - $first; |
217 | 217 | if ($short) { |
218 | 218 | $minutes = $this->get('minutes', $words, 'M'); |
@@ -220,16 +220,16 @@ discard block |
||
220 | 220 | $days = $this->get('days', $words, 'D'); |
221 | 221 | |
222 | 222 | if ($duration < 60) { |
223 | - return $f->diff($s)->format('<1' . $minutes); |
|
223 | + return $f->diff($s)->format('<1'.$minutes); |
|
224 | 224 | } |
225 | 225 | if ($duration < 3600) { |
226 | - return $f->diff($s)->format('%i' . $minutes); |
|
226 | + return $f->diff($s)->format('%i'.$minutes); |
|
227 | 227 | } |
228 | 228 | if ($duration < 86400) { |
229 | - return $f->diff($s)->format('%h' . $hours . ', %i' . $minutes); |
|
229 | + return $f->diff($s)->format('%h'.$hours.', %i'.$minutes); |
|
230 | 230 | } |
231 | 231 | |
232 | - return $f->diff($s)->format('%a' . $days . ', %h' . $hours . ', %i' . $minutes); |
|
232 | + return $f->diff($s)->format('%a'.$days.', %h'.$hours.', %i'.$minutes); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | $seconds = $this->get('seconds', $words, 'seconds'); |
@@ -237,22 +237,22 @@ discard block |
||
237 | 237 | $hours = $this->get('hours', $words, 'hours'); |
238 | 238 | $days = $this->get('days', $words, 'days'); |
239 | 239 | if ($duration < 60) { |
240 | - return $f->diff($s)->format('%s ' . $seconds); |
|
240 | + return $f->diff($s)->format('%s '.$seconds); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | if ($duration < 3600) { |
244 | - return $f->diff($s)->format('%i ' . $minutes . ' and %s ' . $seconds); |
|
244 | + return $f->diff($s)->format('%i '.$minutes.' and %s '.$seconds); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | if ($duration < 86400) { |
248 | - return $f->diff($s)->format('%h ' . $hours . ', %i ' . $minutes . ' and %s ' . $seconds); |
|
248 | + return $f->diff($s)->format('%h '.$hours.', %i '.$minutes.' and %s '.$seconds); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | return $f->diff($s)->format( |
252 | - '%a ' . $days . |
|
253 | - ', %h ' . $hours . |
|
254 | - ', %i ' . $minutes . |
|
255 | - ' and %s ' . $seconds |
|
252 | + '%a '.$days. |
|
253 | + ', %h '.$hours. |
|
254 | + ', %i '.$minutes. |
|
255 | + ' and %s '.$seconds |
|
256 | 256 | ); |
257 | 257 | } |
258 | 258 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @param array $serializable |
129 | 129 | */ |
130 | 130 | public function emergency(string $message, bool $trace = false, array $serializable = []): void { |
131 | - $this->log(self::$EMERGENCY, '[emergency] ' . $message, $trace, $serializable); |
|
131 | + $this->log(self::$EMERGENCY, '[emergency] '.$message, $trace, $serializable); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @param array $serializable |
138 | 138 | */ |
139 | 139 | public function alert(string $message, bool $trace = false, array $serializable = []): void { |
140 | - $this->log(self::$ALERT, '[alert] ' . $message, $trace, $serializable); |
|
140 | + $this->log(self::$ALERT, '[alert] '.$message, $trace, $serializable); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @param array $serializable |
147 | 147 | */ |
148 | 148 | public function warning(string $message, bool $trace = false, array $serializable = []): void { |
149 | - $this->log(self::$WARNING, '[warning] ' . $message, $trace, $serializable); |
|
149 | + $this->log(self::$WARNING, '[warning] '.$message, $trace, $serializable); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * @param array $serializable |
156 | 156 | */ |
157 | 157 | public function notice(string $message, bool $trace = false, array $serializable = []): void { |
158 | - $this->log(self::$NOTICE, '[notice] ' . $message, $trace, $serializable); |
|
158 | + $this->log(self::$NOTICE, '[notice] '.$message, $trace, $serializable); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * @param array $serializable |
164 | 164 | */ |
165 | 165 | public function debug(string $message, array $serializable = []): void { |
166 | - $message = '[debug] ' . $message; |
|
166 | + $message = '[debug] '.$message; |
|
167 | 167 | $debugLevel = (int)$this->appConfig('debug_level'); |
168 | 168 | $this->log($debugLevel, $message, ($this->appConfig('debug_trace') === '1'), $serializable); |
169 | 169 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | if ($trace) { |
181 | 181 | $opts['exception'] = new HintException($message, json_encode($serializable)); |
182 | 182 | } elseif (!empty($serializable)) { |
183 | - $message .= ' -- ' . json_encode($serializable); |
|
183 | + $message .= ' -- '.json_encode($serializable); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | $this->logger() |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | foreach ($keys as $key) { |
405 | 405 | if (!array_key_exists($key, $arr)) { |
406 | 406 | throw new MalformedArrayException( |
407 | - 'source: ' . json_encode($arr) . ' - missing key: ' . $key |
|
407 | + 'source: '.json_encode($arr).' - missing key: '.$key |
|
408 | 408 | ); |
409 | 409 | } |
410 | 410 | } |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | protected function cleanArray(array &$arr) { |
418 | 418 | $arr = array_filter( |
419 | 419 | $arr, |
420 | - function ($v) { |
|
420 | + function($v) { |
|
421 | 421 | if (is_string($v)) { |
422 | 422 | return ($v !== ''); |
423 | 423 | } |