@@ -36,7 +36,7 @@ |
||
36 | 36 | $l = \OC::$server->getL10N('federation'); |
37 | 37 | $this->parameterList = $missingParameters; |
38 | 38 | $parameterList = implode(',', $missingParameters); |
39 | - $message = 'Parameters missing in order to complete the request. Missing Parameters: ' . $parameterList; |
|
39 | + $message = 'Parameters missing in order to complete the request. Missing Parameters: '.$parameterList; |
|
40 | 40 | $hint = $l->t('Parameters missing in order to complete the request. Missing Parameters: "%s"', [$parameterList]); |
41 | 41 | parent::__construct($message, $hint); |
42 | 42 | } |
@@ -166,16 +166,16 @@ discard block |
||
166 | 166 | } |
167 | 167 | |
168 | 168 | // FIXME this should be a method in the user management instead |
169 | - $this->logger->debug('shareWith before, ' . $shareWith, ['app' => 'files_sharing']); |
|
169 | + $this->logger->debug('shareWith before, '.$shareWith, ['app' => 'files_sharing']); |
|
170 | 170 | Util::emitHook( |
171 | 171 | '\OCA\Files_Sharing\API\Server2Server', |
172 | 172 | 'preLoginNameUsedAsUserName', |
173 | 173 | array('uid' => &$shareWith) |
174 | 174 | ); |
175 | - $this->logger->debug('shareWith after, ' . $shareWith, ['app' => 'files_sharing']); |
|
175 | + $this->logger->debug('shareWith after, '.$shareWith, ['app' => 'files_sharing']); |
|
176 | 176 | |
177 | 177 | if (!$this->userManager->userExists($shareWith)) { |
178 | - throw new ProviderCouldNotAddShareException('User does not exists', '',Http::STATUS_BAD_REQUEST); |
|
178 | + throw new ProviderCouldNotAddShareException('User does not exists', '', Http::STATUS_BAD_REQUEST); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | \OC_Util::setupFS($shareWith); |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | ->setType('remote_share') |
202 | 202 | ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_RECEIVED, [$ownerFederatedId, trim($name, '/')]) |
203 | 203 | ->setAffectedUser($shareWith) |
204 | - ->setObject('remote_share', (int)$shareId, $name); |
|
204 | + ->setObject('remote_share', (int) $shareId, $name); |
|
205 | 205 | \OC::$server->getActivityManager()->publish($event); |
206 | 206 | |
207 | 207 | $notification = $this->notificationManager->createNotification(); |
@@ -213,12 +213,12 @@ discard block |
||
213 | 213 | |
214 | 214 | $declineAction = $notification->createAction(); |
215 | 215 | $declineAction->setLabel('decline') |
216 | - ->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId)), 'DELETE'); |
|
216 | + ->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/'.$shareId)), 'DELETE'); |
|
217 | 217 | $notification->addAction($declineAction); |
218 | 218 | |
219 | 219 | $acceptAction = $notification->createAction(); |
220 | 220 | $acceptAction->setLabel('accept') |
221 | - ->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId)), 'POST'); |
|
221 | + ->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/'.$shareId)), 'POST'); |
|
222 | 222 | $notification->addAction($acceptAction); |
223 | 223 | |
224 | 224 | $this->notificationManager->notify($notification); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | 'level' => Util::ERROR, |
231 | 231 | 'app' => 'files_sharing' |
232 | 232 | ]); |
233 | - throw new ProviderCouldNotAddShareException('internal server error, was not able to add share from ' . $remote, '', HTTP::STATUS_INTERNAL_SERVER_ERROR); |
|
233 | + throw new ProviderCouldNotAddShareException('internal server error, was not able to add share from '.$remote, '', HTTP::STATUS_INTERNAL_SERVER_ERROR); |
|
234 | 234 | } |
235 | 235 | } |
236 | 236 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | */ |
307 | 307 | protected function executeAcceptShare(IShare $share) { |
308 | 308 | try { |
309 | - $fileId = (int)$share->getNode()->getId(); |
|
309 | + $fileId = (int) $share->getNode()->getId(); |
|
310 | 310 | list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId); |
311 | 311 | } catch (\Exception $e) { |
312 | 312 | throw new ShareNotFoundException(); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $owner = isset($_POST['owner']) ? $_POST['owner'] : null; |
150 | 150 | $sharedBy = isset($_POST['sharedBy']) ? $_POST['sharedBy'] : null; |
151 | 151 | $shareWith = isset($_POST['shareWith']) ? $_POST['shareWith'] : null; |
152 | - $remoteId = isset($_POST['remoteId']) ? (int)$_POST['remoteId'] : null; |
|
152 | + $remoteId = isset($_POST['remoteId']) ? (int) $_POST['remoteId'] : null; |
|
153 | 153 | $sharedByFederatedId = isset($_POST['sharedByFederatedId']) ? $_POST['sharedByFederatedId'] : null; |
154 | 154 | $ownerFederatedId = isset($_POST['ownerFederatedId']) ? $_POST['ownerFederatedId'] : null; |
155 | 155 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | } catch (ProviderCouldNotAddShareException $e) { |
185 | 185 | throw new OCSException($e->getMessage(), $e->getCode()); |
186 | 186 | } catch (\Exception $e) { |
187 | - throw new OCSException('internal server error, was not able to add share from ' . $remote, 500); |
|
187 | + throw new OCSException('internal server error, was not able to add share from '.$remote, 500); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | return new Http\DataResponse(); |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | |
207 | 207 | $token = $this->request->getParam('token', null); |
208 | 208 | $shareWith = $this->request->getParam('shareWith', null); |
209 | - $permission = (int)$this->request->getParam('permission', null); |
|
210 | - $remoteId = (int)$this->request->getParam('remoteId', null); |
|
209 | + $permission = (int) $this->request->getParam('permission', null); |
|
210 | + $remoteId = (int) $this->request->getParam('remoteId', null); |
|
211 | 211 | |
212 | 212 | if ($id === null || |
213 | 213 | $token === null || |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $share->setSharedWith($shareWith); |
243 | 243 | try { |
244 | 244 | $result = $this->federatedShareProvider->create($share); |
245 | - $this->federatedShareProvider->storeRemoteId((int)$result->getId(), $remoteId); |
|
245 | + $this->federatedShareProvider->storeRemoteId((int) $result->getId(), $remoteId); |
|
246 | 246 | return new Http\DataResponse([ |
247 | 247 | 'token' => $result->getToken(), |
248 | 248 | 'remoteId' => $result->getId() |
@@ -288,9 +288,9 @@ discard block |
||
288 | 288 | } catch (ProviderDoesNotExistsException $e) { |
289 | 289 | throw new OCSException('Server does not support federated cloud sharing', 503); |
290 | 290 | } catch (ShareNotFoundException $e) { |
291 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
291 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
292 | 292 | } catch (\Exception $e) { |
293 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
293 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | return new Http\DataResponse(); |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | $notification = $notificationManager->createNotification(); |
438 | 438 | $notification->setApp('files_sharing') |
439 | 439 | ->setUser($share['user']) |
440 | - ->setObject('remote_share', (int)$share['id']); |
|
440 | + ->setObject('remote_share', (int) $share['id']); |
|
441 | 441 | $notificationManager->markProcessed($notification); |
442 | 442 | |
443 | 443 | $event = \OC::$server->getActivityManager()->generateEvent(); |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | ->setType('remote_share') |
446 | 446 | ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_UNSHARED, [$owner->getId(), $path]) |
447 | 447 | ->setAffectedUser($user) |
448 | - ->setObject('remote_share', (int)$share['id'], $path); |
|
448 | + ->setObject('remote_share', (int) $share['id'], $path); |
|
449 | 449 | \OC::$server->getActivityManager()->publish($event); |
450 | 450 | } |
451 | 451 | |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | $validPermission = ctype_digit($permissions); |
570 | 570 | $validToken = $this->verifyShare($share, $token); |
571 | 571 | if ($validPermission && $validToken) { |
572 | - $this->updatePermissionsInDatabase($share, (int)$permissions); |
|
572 | + $this->updatePermissionsInDatabase($share, (int) $permissions); |
|
573 | 573 | } else { |
574 | 574 | throw new OCSBadRequestException(); |
575 | 575 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | if (!$this->userManager->userExists($shareWith)) { |
151 | 151 | return new JSONResponse( |
152 | - ['message' => 'User "' . $shareWith . '" does not exists at ' . $this->urlGenerator->getBaseUrl()], |
|
152 | + ['message' => 'User "'.$shareWith.'" does not exists at '.$this->urlGenerator->getBaseUrl()], |
|
153 | 153 | Http::STATUS_BAD_REQUEST |
154 | 154 | ); |
155 | 155 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | ); |
182 | 182 | } catch (\Exception $e) { |
183 | 183 | return new JSONResponse( |
184 | - ['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()], |
|
184 | + ['message' => 'Internal error at '.$this->urlGenerator->getBaseUrl()], |
|
185 | 185 | Http::STATUS_BAD_REQUEST |
186 | 186 | ); |
187 | 187 | } |
@@ -250,13 +250,13 @@ discard block |
||
250 | 250 | } |
251 | 251 | catch (\Exception $e) { |
252 | 252 | return new JSONResponse( |
253 | - ['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()], |
|
253 | + ['message' => 'Internal error at '.$this->urlGenerator->getBaseUrl()], |
|
254 | 254 | Http::STATUS_BAD_REQUEST |
255 | 255 | ); |
256 | 256 | } |
257 | 257 | |
258 | 258 | |
259 | - return new JSONResponse([],Http::STATUS_CREATED); |
|
259 | + return new JSONResponse([], Http::STATUS_CREATED); |
|
260 | 260 | |
261 | 261 | } |
262 | 262 | |
@@ -269,13 +269,13 @@ discard block |
||
269 | 269 | private function mapUid($uid) { |
270 | 270 | \OC::$server->getURLGenerator()->linkToDocs('key'); |
271 | 271 | // FIXME this should be a method in the user management instead |
272 | - $this->logger->debug('shareWith before, ' . $uid, ['app' => $this->appName]); |
|
272 | + $this->logger->debug('shareWith before, '.$uid, ['app' => $this->appName]); |
|
273 | 273 | \OCP\Util::emitHook( |
274 | 274 | '\OCA\Files_Sharing\API\Server2Server', |
275 | 275 | 'preLoginNameUsedAsUserName', |
276 | 276 | array('uid' => &$uid) |
277 | 277 | ); |
278 | - $this->logger->debug('shareWith after, ' . $uid, ['app' => $this->appName]); |
|
278 | + $this->logger->debug('shareWith after, '.$uid, ['app' => $this->appName]); |
|
279 | 279 | |
280 | 280 | return $uid; |
281 | 281 | } |