@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function register(IRegistrationContext $context): void { |
61 | 61 | $context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class); |
62 | 62 | |
63 | - $context->registerService(NewUserMailHelper::class, function (ContainerInterface $c) { |
|
63 | + $context->registerService(NewUserMailHelper::class, function(ContainerInterface $c) { |
|
64 | 64 | return new NewUserMailHelper( |
65 | 65 | $c->get(Defaults::class), |
66 | 66 | $c->get(IURLGenerator::class), |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | Util::getDefaultEmailAddress('no-reply') |
74 | 74 | ); |
75 | 75 | }); |
76 | - $context->registerService(ProvisioningApiMiddleware::class, function (ContainerInterface $c) { |
|
76 | + $context->registerService(ProvisioningApiMiddleware::class, function(ContainerInterface $c) { |
|
77 | 77 | $user = $c->get(IUserManager::class)->get($c->get('UserId')); |
78 | 78 | $isAdmin = false; |
79 | 79 | $isSubAdmin = false; |
@@ -103,7 +103,7 @@ |
||
103 | 103 | if (isset($pluginManagerSuppressed)) { |
104 | 104 | $this->pluginManager->setSuppressDeletion($pluginManagerSuppressed); |
105 | 105 | } |
106 | - $output->writeln('<error>' . $e->getMessage() . '</error>'); |
|
106 | + $output->writeln('<error>'.$e->getMessage().'</error>'); |
|
107 | 107 | return 1; |
108 | 108 | } |
109 | 109 | $output->writeln('<error>Error while resetting user</error>'); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
127 | - uasort($users, function ($a, $b) { |
|
127 | + uasort($users, function($a, $b) { |
|
128 | 128 | /** |
129 | 129 | * @var \OC\User\User $a |
130 | 130 | * @var \OC\User\User $b |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | 'message' => $userStatus->getMessage(), |
170 | 170 | 'icon' => $userStatus->getIcon(), |
171 | 171 | 'clearAt' => $userStatus->getClearAt() |
172 | - ? (int)$userStatus->getClearAt()->format('U') |
|
172 | + ? (int) $userStatus->getClearAt()->format('U') |
|
173 | 173 | : null, |
174 | 174 | ]; |
175 | 175 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | 'message' => $userStatus->getMessage(), |
254 | 254 | 'icon' => $userStatus->getIcon(), |
255 | 255 | 'clearAt' => $userStatus->getClearAt() |
256 | - ? (int)$userStatus->getClearAt()->format('U') |
|
256 | + ? (int) $userStatus->getClearAt()->format('U') |
|
257 | 257 | : null, |
258 | 258 | ]; |
259 | 259 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | return new Index( |
79 | 79 | //TODO migrate existing uppercase indexes, then $this->connection->quoteIdentifier($index->getName()), |
80 | 80 | $index->getName(), |
81 | - array_map(function ($columnName) { |
|
81 | + array_map(function($columnName) { |
|
82 | 82 | return $this->connection->quoteIdentifier($columnName); |
83 | 83 | }, $index->getColumns()), |
84 | 84 | $index->isUnique(), |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | */ |
98 | 98 | protected function quoteForeignKeyConstraint($fkc) { |
99 | 99 | return new ForeignKeyConstraint( |
100 | - array_map(function ($columnName) { |
|
100 | + array_map(function($columnName) { |
|
101 | 101 | return $this->connection->quoteIdentifier($columnName); |
102 | 102 | }, $fkc->getLocalColumns()), |
103 | 103 | $this->connection->quoteIdentifier($fkc->getForeignTableName()), |
104 | - array_map(function ($columnName) { |
|
104 | + array_map(function($columnName) { |
|
105 | 105 | return $this->connection->quoteIdentifier($columnName); |
106 | 106 | }, $fkc->getForeignColumns()), |
107 | 107 | $fkc->getName(), |
@@ -119,24 +119,24 @@ discard block |
||
119 | 119 | $schemaDiff = parent::getDiff($targetSchema, $connection); |
120 | 120 | |
121 | 121 | // oracle forces us to quote the identifiers |
122 | - $schemaDiff->newTables = array_map(function (Table $table) { |
|
122 | + $schemaDiff->newTables = array_map(function(Table $table) { |
|
123 | 123 | return new Table( |
124 | 124 | $this->connection->quoteIdentifier($table->getName()), |
125 | - array_map(function (Column $column) { |
|
125 | + array_map(function(Column $column) { |
|
126 | 126 | return $this->quoteColumn($column); |
127 | 127 | }, $table->getColumns()), |
128 | - array_map(function (Index $index) { |
|
128 | + array_map(function(Index $index) { |
|
129 | 129 | return $this->quoteIndex($index); |
130 | 130 | }, $table->getIndexes()), |
131 | 131 | [], |
132 | - array_map(function (ForeignKeyConstraint $fck) { |
|
132 | + array_map(function(ForeignKeyConstraint $fck) { |
|
133 | 133 | return $this->quoteForeignKeyConstraint($fck); |
134 | 134 | }, $table->getForeignKeys()), |
135 | 135 | $table->getOptions() |
136 | 136 | ); |
137 | 137 | }, $schemaDiff->newTables); |
138 | 138 | |
139 | - $schemaDiff->removedTables = array_map(function (Table $table) { |
|
139 | + $schemaDiff->removedTables = array_map(function(Table $table) { |
|
140 | 140 | return new Table( |
141 | 141 | $this->connection->quoteIdentifier($table->getName()), |
142 | 142 | $table->getColumns(), |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | foreach ($schemaDiff->changedTables as $tableDiff) { |
151 | 151 | $tableDiff->name = $this->connection->quoteIdentifier($tableDiff->name); |
152 | 152 | |
153 | - $tableDiff->addedColumns = array_map(function (Column $column) { |
|
153 | + $tableDiff->addedColumns = array_map(function(Column $column) { |
|
154 | 154 | return $this->quoteColumn($column); |
155 | 155 | }, $tableDiff->addedColumns); |
156 | 156 | |
@@ -160,43 +160,43 @@ discard block |
||
160 | 160 | $column->changedProperties = array_diff($column->changedProperties, ['autoincrement', 'unsigned']); |
161 | 161 | } |
162 | 162 | // remove columns that no longer have changed (because autoincrement and unsigned are not supported) |
163 | - $tableDiff->changedColumns = array_filter($tableDiff->changedColumns, function (ColumnDiff $column) { |
|
163 | + $tableDiff->changedColumns = array_filter($tableDiff->changedColumns, function(ColumnDiff $column) { |
|
164 | 164 | return count($column->changedProperties) > 0; |
165 | 165 | }); |
166 | 166 | |
167 | - $tableDiff->removedColumns = array_map(function (Column $column) { |
|
167 | + $tableDiff->removedColumns = array_map(function(Column $column) { |
|
168 | 168 | return $this->quoteColumn($column); |
169 | 169 | }, $tableDiff->removedColumns); |
170 | 170 | |
171 | - $tableDiff->renamedColumns = array_map(function (Column $column) { |
|
171 | + $tableDiff->renamedColumns = array_map(function(Column $column) { |
|
172 | 172 | return $this->quoteColumn($column); |
173 | 173 | }, $tableDiff->renamedColumns); |
174 | 174 | |
175 | - $tableDiff->addedIndexes = array_map(function (Index $index) { |
|
175 | + $tableDiff->addedIndexes = array_map(function(Index $index) { |
|
176 | 176 | return $this->quoteIndex($index); |
177 | 177 | }, $tableDiff->addedIndexes); |
178 | 178 | |
179 | - $tableDiff->changedIndexes = array_map(function (Index $index) { |
|
179 | + $tableDiff->changedIndexes = array_map(function(Index $index) { |
|
180 | 180 | return $this->quoteIndex($index); |
181 | 181 | }, $tableDiff->changedIndexes); |
182 | 182 | |
183 | - $tableDiff->removedIndexes = array_map(function (Index $index) { |
|
183 | + $tableDiff->removedIndexes = array_map(function(Index $index) { |
|
184 | 184 | return $this->quoteIndex($index); |
185 | 185 | }, $tableDiff->removedIndexes); |
186 | 186 | |
187 | - $tableDiff->renamedIndexes = array_map(function (Index $index) { |
|
187 | + $tableDiff->renamedIndexes = array_map(function(Index $index) { |
|
188 | 188 | return $this->quoteIndex($index); |
189 | 189 | }, $tableDiff->renamedIndexes); |
190 | 190 | |
191 | - $tableDiff->addedForeignKeys = array_map(function (ForeignKeyConstraint $fkc) { |
|
191 | + $tableDiff->addedForeignKeys = array_map(function(ForeignKeyConstraint $fkc) { |
|
192 | 192 | return $this->quoteForeignKeyConstraint($fkc); |
193 | 193 | }, $tableDiff->addedForeignKeys); |
194 | 194 | |
195 | - $tableDiff->changedForeignKeys = array_map(function (ForeignKeyConstraint $fkc) { |
|
195 | + $tableDiff->changedForeignKeys = array_map(function(ForeignKeyConstraint $fkc) { |
|
196 | 196 | return $this->quoteForeignKeyConstraint($fkc); |
197 | 197 | }, $tableDiff->changedForeignKeys); |
198 | 198 | |
199 | - $tableDiff->removedForeignKeys = array_map(function (ForeignKeyConstraint $fkc) { |
|
199 | + $tableDiff->removedForeignKeys = array_map(function(ForeignKeyConstraint $fkc) { |
|
200 | 200 | return $this->quoteForeignKeyConstraint($fkc); |
201 | 201 | }, $tableDiff->removedForeignKeys); |
202 | 202 | } |
@@ -210,15 +210,15 @@ discard block |
||
210 | 210 | */ |
211 | 211 | protected function convertStatementToScript($statement) { |
212 | 212 | if (substr($statement, -1) === ';') { |
213 | - return $statement . PHP_EOL . '/' . PHP_EOL; |
|
213 | + return $statement.PHP_EOL.'/'.PHP_EOL; |
|
214 | 214 | } |
215 | - $script = $statement . ';'; |
|
215 | + $script = $statement.';'; |
|
216 | 216 | $script .= PHP_EOL; |
217 | 217 | $script .= PHP_EOL; |
218 | 218 | return $script; |
219 | 219 | } |
220 | 220 | |
221 | 221 | protected function getFilterExpression() { |
222 | - return '/^"' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/'; |
|
222 | + return '/^"'.preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')).'/'; |
|
223 | 223 | } |
224 | 224 | } |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | public function execute(InputInterface $input, OutputInterface $output): int { |
70 | 70 | $remoteStorages = $this->getRemoteStorages(); |
71 | 71 | |
72 | - $output->writeln(count($remoteStorages) . ' remote storage(s) need(s) to be checked'); |
|
72 | + $output->writeln(count($remoteStorages).' remote storage(s) need(s) to be checked'); |
|
73 | 73 | |
74 | 74 | $remoteShareIds = $this->getRemoteShareIds(); |
75 | 75 | |
76 | - $output->writeln(count($remoteShareIds) . ' remote share(s) exist'); |
|
76 | + $output->writeln(count($remoteShareIds).' remote share(s) exist'); |
|
77 | 77 | |
78 | 78 | foreach ($remoteShareIds as $id => $remoteShareId) { |
79 | 79 | if (isset($remoteStorages[$remoteShareId])) { |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | ->where($queryBuilder->expr()->like( |
152 | 152 | 'id', |
153 | 153 | // match all 'shared::' + 32 characters storages |
154 | - $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::') . str_repeat('_', 32)), |
|
154 | + $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::').str_repeat('_', 32)), |
|
155 | 155 | IQueryBuilder::PARAM_STR) |
156 | 156 | ) |
157 | 157 | ->andWhere($queryBuilder->expr()->notLike( |
158 | 158 | 'id', |
159 | 159 | // but not the ones starting with a '/', they are for normal shares |
160 | - $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/') . '%'), |
|
160 | + $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/').'%'), |
|
161 | 161 | IQueryBuilder::PARAM_STR) |
162 | 162 | )->orderBy('numeric_id'); |
163 | 163 | $query = $queryBuilder->execute(); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $cloudId = $this->cloudIdManager->getCloudId($row['owner'], $row['remote']); |
184 | 184 | $remote = $cloudId->getRemote(); |
185 | 185 | |
186 | - $remoteShareIds[$row['id']] = 'shared::' . md5($row['share_token'] . '@' . $remote); |
|
186 | + $remoteShareIds[$row['id']] = 'shared::'.md5($row['share_token'].'@'.$remote); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | return $remoteShareIds; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
91 | 91 | $path = Filesystem::getPath($params['fileSource']); |
92 | 92 | [$owner, $ownerPath] = $this->getOwnerPath($path); |
93 | - $absPath = '/' . $owner . '/files/' . $ownerPath; |
|
93 | + $absPath = '/'.$owner.'/files/'.$ownerPath; |
|
94 | 94 | $this->update($absPath); |
95 | 95 | } |
96 | 96 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
107 | 107 | $path = Filesystem::getPath($params['fileSource']); |
108 | 108 | [$owner, $ownerPath] = $this->getOwnerPath($path); |
109 | - $absPath = '/' . $owner . '/files/' . $ownerPath; |
|
109 | + $absPath = '/'.$owner.'/files/'.$ownerPath; |
|
110 | 110 | $this->update($absPath); |
111 | 111 | } |
112 | 112 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function postRestore($params) { |
122 | 122 | if ($this->encryptionManager->isEnabled()) { |
123 | - $path = Filesystem::normalizePath('/' . $this->uid . '/files/' . $params['filePath']); |
|
123 | + $path = Filesystem::normalizePath('/'.$this->uid.'/files/'.$params['filePath']); |
|
124 | 124 | $this->update($path); |
125 | 125 | } |
126 | 126 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | dirname($source) !== dirname($target) |
140 | 140 | ) { |
141 | 141 | [$owner, $ownerPath] = $this->getOwnerPath($target); |
142 | - $absPath = '/' . $owner . '/files/' . $ownerPath; |
|
142 | + $absPath = '/'.$owner.'/files/'.$ownerPath; |
|
143 | 143 | $this->update($absPath); |
144 | 144 | } |
145 | 145 | } |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | protected function getOwnerPath($path) { |
155 | 155 | $info = Filesystem::getFileInfo($path); |
156 | 156 | $owner = Filesystem::getOwner($path); |
157 | - $view = new View('/' . $owner . '/files'); |
|
157 | + $view = new View('/'.$owner.'/files'); |
|
158 | 158 | $path = $view->getPath($info->getId()); |
159 | 159 | if ($path === null) { |
160 | - throw new InvalidArgumentException('No file found for ' . $info->getId()); |
|
160 | + throw new InvalidArgumentException('No file found for '.$info->getId()); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | return [$owner, $path]; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $encryptionModule->update($file, $this->uid, $usersSharing); |
194 | 194 | } catch (GenericEncryptionException $e) { |
195 | 195 | // If the update of an individual file fails e.g. due to a corrupt key we should continue the operation and just log the failure |
196 | - $this->logger->error('Failed to update encryption module for ' . $this->uid . ' ' . $file, [ 'exception' => $e ]); |
|
196 | + $this->logger->error('Failed to update encryption module for '.$this->uid.' '.$file, ['exception' => $e]); |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $avatarsToDeleteCount = 0; |
96 | 96 | |
97 | 97 | foreach ($this->getAvatarsToDelete() as [$userId, $avatar]) { |
98 | - $output->writeln('Deleting avatar for ' . $userId, OutputInterface::VERBOSITY_VERBOSE); |
|
98 | + $output->writeln('Deleting avatar for '.$userId, OutputInterface::VERBOSITY_VERBOSE); |
|
99 | 99 | |
100 | 100 | $avatarsToDeleteCount++; |
101 | 101 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | } |
114 | 114 | |
115 | - $output->writeln('Deleted ' . $avatarsToDeleteCount . ' avatars'); |
|
115 | + $output->writeln('Deleted '.$avatarsToDeleteCount.' avatars'); |
|
116 | 116 | $output->writeln(''); |
117 | 117 | } |
118 | 118 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $previewsToDeleteCount = 0; |
131 | 131 | |
132 | 132 | foreach ($this->getPreviewsToDelete() as ['name' => $previewFileId, 'path' => $filePath]) { |
133 | - $output->writeln('Deleting previews for ' . $filePath, OutputInterface::VERBOSITY_VERBOSE); |
|
133 | + $output->writeln('Deleting previews for '.$filePath, OutputInterface::VERBOSITY_VERBOSE); |
|
134 | 134 | |
135 | 135 | $previewsToDeleteCount++; |
136 | 136 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | } |
140 | 140 | |
141 | 141 | try { |
142 | - $preview = $this->previewFolder->getFolder((string)$previewFileId); |
|
142 | + $preview = $this->previewFolder->getFolder((string) $previewFileId); |
|
143 | 143 | $preview->delete(); |
144 | 144 | } catch (NotFoundException $e) { |
145 | 145 | // continue |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
151 | - $output->writeln('Deleted ' . $previewsToDeleteCount . ' previews'); |
|
151 | + $output->writeln('Deleted '.$previewsToDeleteCount.' previews'); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | // Copy pasted and adjusted from |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * We take the md5 of the name (fileid) and split the first 7 chars. That way |
172 | 172 | * there are not a gazillion files in the root of the preview appdata. |
173 | 173 | */ |
174 | - $like = $this->connection->escapeLikeParameter($data['path']) . '/_/_/_/_/_/_/_/%'; |
|
174 | + $like = $this->connection->escapeLikeParameter($data['path']).'/_/_/_/_/_/_/_/%'; |
|
175 | 175 | |
176 | 176 | $qb = $this->connection->getQueryBuilder(); |
177 | 177 | $qb->select('a.name', 'b.path') |
@@ -65,9 +65,9 @@ |
||
65 | 65 | } |
66 | 66 | $userFolder = $rootFolder->getUserFolder($user->getUID()); |
67 | 67 | $fileQuery = new SearchQuery( |
68 | - new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', '%' . $query . '%'), |
|
69 | - (int)$limit, |
|
70 | - (int)$offset, |
|
68 | + new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', '%'.$query.'%'), |
|
69 | + (int) $limit, |
|
70 | + (int) $offset, |
|
71 | 71 | [ |
72 | 72 | new SearchOrder(ISearchOrder::DIRECTION_DESCENDING, 'mtime'), |
73 | 73 | ], |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | public function search(IUser $user, ISearchQuery $query): SearchResult { |
104 | 104 | $userFolder = $this->rootFolder->getUserFolder($user->getUID()); |
105 | 105 | $fileQuery = new SearchQuery( |
106 | - new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', '%' . $query->getTerm() . '%'), |
|
106 | + new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', '%'.$query->getTerm().'%'), |
|
107 | 107 | $query->getLimit(), |
108 | - (int)$query->getCursor(), |
|
108 | + (int) $query->getCursor(), |
|
109 | 109 | $query->getSortOrder() === ISearchQuery::SORT_DATE_DESC ? [ |
110 | 110 | new SearchOrder(ISearchOrder::DIRECTION_DESCENDING, 'mtime'), |
111 | 111 | ] : [], |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | return SearchResult::paginated( |
116 | 116 | $this->l10n->t('Files'), |
117 | - array_map(function (Node $result) use ($userFolder) { |
|
117 | + array_map(function(Node $result) use ($userFolder) { |
|
118 | 118 | // Generate thumbnail url |
119 | 119 | $thumbnailUrl = $this->urlGenerator->linkToRouteAbsolute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->getId()]); |
120 | 120 | $path = $userFolder->getRelativePath($result->getPath()); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $this->urlGenerator->getAbsoluteURL($link), |
134 | 134 | $result->getMimetype() === FileInfo::MIMETYPE_FOLDER ? 'icon-folder' : $this->mimeTypeDetector->mimeTypeIcon($result->getMimetype()) |
135 | 135 | ); |
136 | - $searchResultEntry->addAttribute('fileId', (string)$result->getId()); |
|
136 | + $searchResultEntry->addAttribute('fileId', (string) $result->getId()); |
|
137 | 137 | $searchResultEntry->addAttribute('path', $path); |
138 | 138 | return $searchResultEntry; |
139 | 139 | }, $userFolder->search($fileQuery)), |