@@ -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 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | use Throwable; |
| 43 | 43 | |
| 44 | 44 | |
| 45 | -require_once __DIR__ . '/../../vendor/autoload.php'; |
|
| 45 | +require_once __DIR__.'/../../vendor/autoload.php'; |
|
| 46 | 46 | |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -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 | |
@@ -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 | } |
@@ -1047,17 +1047,17 @@ |
||
| 1047 | 1047 | $content = ''; |
| 1048 | 1048 | |
| 1049 | 1049 | foreach ($xml->diagram as $child) { |
| 1050 | - $deflated_content = (string)$child; |
|
| 1051 | - $base64decoded = base64_decode($deflated_content); |
|
| 1052 | - $urlencoded_content = gzinflate($base64decoded); |
|
| 1053 | - $urldecoded_content = urldecode($urlencoded_content); |
|
| 1050 | + $deflated_content = (string)$child; |
|
| 1051 | + $base64decoded = base64_decode($deflated_content); |
|
| 1052 | + $urlencoded_content = gzinflate($base64decoded); |
|
| 1053 | + $urldecoded_content = urldecode($urlencoded_content); |
|
| 1054 | 1054 | |
| 1055 | - // Remove image tag |
|
| 1056 | - $diagram_str = preg_replace('/style=\"shape=image[^"]*\"/', '', $urldecoded_content); |
|
| 1055 | + // Remove image tag |
|
| 1056 | + $diagram_str = preg_replace('/style=\"shape=image[^"]*\"/', '', $urldecoded_content); |
|
| 1057 | 1057 | |
| 1058 | - // Construct XML |
|
| 1059 | - $diagram_xml = simplexml_load_string($diagram_str); |
|
| 1060 | - $content = $content . ' ' . $this->readDrawioXmlValue($diagram_xml); |
|
| 1058 | + // Construct XML |
|
| 1059 | + $diagram_xml = simplexml_load_string($diagram_str); |
|
| 1060 | + $content = $content . ' ' . $this->readDrawioXmlValue($diagram_xml); |
|
| 1061 | 1061 | } |
| 1062 | 1062 | |
| 1063 | 1063 | } catch (\Throwable $t) { |
@@ -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 | ); |
@@ -621,8 +621,8 @@ discard block |
||
| 621 | 621 | $document->getIndex() |
| 622 | 622 | ->setStatus(IIndex::INDEX_IGNORE); |
| 623 | 623 | $this->miscService->log( |
| 624 | - 'Exception while generateDocument: ' . $e->getMessage() . ' (' . get_class($e) . ') at ' |
|
| 625 | - . $e->getFile() . ' line ' . $e->getLine() |
|
| 624 | + 'Exception while generateDocument: '.$e->getMessage().' ('.get_class($e).') at ' |
|
| 625 | + . $e->getFile().' line '.$e->getLine() |
|
| 626 | 626 | ); |
| 627 | 627 | } |
| 628 | 628 | } |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | |
| 829 | 829 | $part = []; |
| 830 | 830 | foreach ($comments as $comment) { |
| 831 | - $part[] = '<' . $comment->getActorId() . '> ' . $comment->getMessage(); |
|
| 831 | + $part[] = '<'.$comment->getActorId().'> '.$comment->getMessage(); |
|
| 832 | 832 | } |
| 833 | 833 | |
| 834 | 834 | $document->addPart('comments', implode(" \n ", $part)); |
@@ -865,7 +865,7 @@ discard block |
||
| 865 | 865 | |
| 866 | 866 | } catch (Throwable $e) { |
| 867 | 867 | $this->miscService->log( |
| 868 | - 'Issue while getting information on documentId:' . $document->getId(), 0 |
|
| 868 | + 'Issue while getting information on documentId:'.$document->getId(), 0 |
|
| 869 | 869 | ); |
| 870 | 870 | } |
| 871 | 871 | } |
@@ -918,7 +918,7 @@ discard block |
||
| 918 | 918 | } |
| 919 | 919 | |
| 920 | 920 | // 20220219 Parse .drawio file |
| 921 | - if ($extension === 'drawio') { |
|
| 921 | + if ($extension === 'drawio') { |
|
| 922 | 922 | $parsed = self::MIMETYPE_TEXT; |
| 923 | 923 | throw new KnownFileMimeTypeException(); |
| 924 | 924 | } |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | // 20220219 Inflate drawio file |
| 1040 | - if ( $file->getExtension() === 'drawio') { |
|
| 1040 | + if ($file->getExtension() === 'drawio') { |
|
| 1041 | 1041 | $content = $file->getContent(); |
| 1042 | 1042 | |
| 1043 | 1043 | try { |
@@ -1057,7 +1057,7 @@ discard block |
||
| 1057 | 1057 | |
| 1058 | 1058 | // Construct XML |
| 1059 | 1059 | $diagram_xml = simplexml_load_string($diagram_str); |
| 1060 | - $content = $content . ' ' . $this->readDrawioXmlValue($diagram_xml); |
|
| 1060 | + $content = $content.' '.$this->readDrawioXmlValue($diagram_xml); |
|
| 1061 | 1061 | } |
| 1062 | 1062 | |
| 1063 | 1063 | } catch (\Throwable $t) { |
@@ -1089,16 +1089,16 @@ discard block |
||
| 1089 | 1089 | */ |
| 1090 | 1090 | private function readDrawioXmlValue(\SimpleXMLElement $element) { |
| 1091 | 1091 | $str = ''; |
| 1092 | - if( $element['value'] != null && trim(strval($element['value'])) !== '') { |
|
| 1093 | - $str = $str . " " . trim(strval($element['value'])); |
|
| 1092 | + if ($element['value'] != null && trim(strval($element['value'])) !== '') { |
|
| 1093 | + $str = $str." ".trim(strval($element['value'])); |
|
| 1094 | 1094 | } |
| 1095 | - if( $element != null && trim(strval($element)) !== '') { |
|
| 1096 | - $str = $str . " " . trim(strval($element)); |
|
| 1095 | + if ($element != null && trim(strval($element)) !== '') { |
|
| 1096 | + $str = $str." ".trim(strval($element)); |
|
| 1097 | 1097 | } |
| 1098 | 1098 | |
| 1099 | 1099 | try { |
| 1100 | 1100 | foreach ($element->children() as $child) { |
| 1101 | - $str = $str . " " . $this->readDrawioXmlValue($child); |
|
| 1101 | + $str = $str." ".$this->readDrawioXmlValue($child); |
|
| 1102 | 1102 | } |
| 1103 | 1103 | } finally { |
| 1104 | 1104 | } |
@@ -1383,7 +1383,7 @@ discard block |
||
| 1383 | 1383 | $path = ''; |
| 1384 | 1384 | } |
| 1385 | 1385 | |
| 1386 | - $result = (($entrySlash) ? '/' : '') . $path; |
|
| 1386 | + $result = (($entrySlash) ? '/' : '').$path; |
|
| 1387 | 1387 | $this->debug( |
| 1388 | 1388 | 'getPathFromRoot', [ |
| 1389 | 1389 | 'path' => $path, |
@@ -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 | } |