@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $root = '/apps/'.$this->appName; |
104 | 104 | } |
105 | 105 | |
106 | - $url = $root . $ocsRoute['url']; |
|
106 | + $url = $root.$ocsRoute['url']; |
|
107 | 107 | $verb = isset($ocsRoute['verb']) ? strtoupper($ocsRoute['verb']) : 'GET'; |
108 | 108 | |
109 | 109 | $split = explode('#', $name, 2); |
@@ -119,19 +119,19 @@ discard block |
||
119 | 119 | // register the route |
120 | 120 | $handler = new RouteActionHandler($this->container, $controllerName, $actionName); |
121 | 121 | |
122 | - $router = $this->router->create('ocs.'.$this->appName.'.'.$controller.'.'.$action . $postfix, $url) |
|
122 | + $router = $this->router->create('ocs.'.$this->appName.'.'.$controller.'.'.$action.$postfix, $url) |
|
123 | 123 | ->method($verb) |
124 | 124 | ->action($handler); |
125 | 125 | |
126 | 126 | // optionally register requirements for route. This is used to |
127 | 127 | // tell the route parser how url parameters should be matched |
128 | - if(array_key_exists('requirements', $ocsRoute)) { |
|
128 | + if (array_key_exists('requirements', $ocsRoute)) { |
|
129 | 129 | $router->requirements($ocsRoute['requirements']); |
130 | 130 | } |
131 | 131 | |
132 | 132 | // optionally register defaults for route. This is used to |
133 | 133 | // tell the route parser how url parameters should be default valued |
134 | - if(array_key_exists('defaults', $ocsRoute)) { |
|
134 | + if (array_key_exists('defaults', $ocsRoute)) { |
|
135 | 135 | $router->defaults($ocsRoute['defaults']); |
136 | 136 | } |
137 | 137 | } |
@@ -168,19 +168,19 @@ discard block |
||
168 | 168 | |
169 | 169 | // register the route |
170 | 170 | $handler = new RouteActionHandler($this->container, $controllerName, $actionName); |
171 | - $router = $this->router->create($this->appName.'.'.$controller.'.'.$action . $postfix, $url) |
|
171 | + $router = $this->router->create($this->appName.'.'.$controller.'.'.$action.$postfix, $url) |
|
172 | 172 | ->method($verb) |
173 | 173 | ->action($handler); |
174 | 174 | |
175 | 175 | // optionally register requirements for route. This is used to |
176 | 176 | // tell the route parser how url parameters should be matched |
177 | - if(array_key_exists('requirements', $simpleRoute)) { |
|
177 | + if (array_key_exists('requirements', $simpleRoute)) { |
|
178 | 178 | $router->requirements($simpleRoute['requirements']); |
179 | 179 | } |
180 | 180 | |
181 | 181 | // optionally register defaults for route. This is used to |
182 | 182 | // tell the route parser how url parameters should be default valued |
183 | - if(array_key_exists('defaults', $simpleRoute)) { |
|
183 | + if (array_key_exists('defaults', $simpleRoute)) { |
|
184 | 184 | $router->defaults($simpleRoute['defaults']); |
185 | 185 | } |
186 | 186 | } |
@@ -212,16 +212,16 @@ discard block |
||
212 | 212 | foreach ($resources as $resource => $config) { |
213 | 213 | |
214 | 214 | // the url parameter used as id to the resource |
215 | - foreach($actions as $action) { |
|
215 | + foreach ($actions as $action) { |
|
216 | 216 | $url = $config['url']; |
217 | 217 | $method = $action['name']; |
218 | 218 | $verb = isset($action['verb']) ? strtoupper($action['verb']) : 'GET'; |
219 | 219 | $collectionAction = isset($action['on-collection']) ? $action['on-collection'] : false; |
220 | 220 | if (!$collectionAction) { |
221 | - $url = $url . '/{id}'; |
|
221 | + $url = $url.'/{id}'; |
|
222 | 222 | } |
223 | 223 | if (isset($action['url-postfix'])) { |
224 | - $url = $url . '/' . $action['url-postfix']; |
|
224 | + $url = $url.'/'.$action['url-postfix']; |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | $controller = $resource; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $controllerName = $this->buildControllerName($controller); |
230 | 230 | $actionName = $this->buildActionName($method); |
231 | 231 | |
232 | - $routeName = $this->appName . '.' . strtolower($resource) . '.' . strtolower($method); |
|
232 | + $routeName = $this->appName.'.'.strtolower($resource).'.'.strtolower($method); |
|
233 | 233 | |
234 | 234 | $this->router->create($routeName, $url)->method($verb)->action( |
235 | 235 | new RouteActionHandler($this->container, $controllerName, $actionName) |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | private function buildControllerName($controller) |
247 | 247 | { |
248 | 248 | if (!isset($this->controllerNameCache[$controller])) { |
249 | - $this->controllerNameCache[$controller] = $this->underScoreToCamelCase(ucfirst($controller)) . 'Controller'; |
|
249 | + $this->controllerNameCache[$controller] = $this->underScoreToCamelCase(ucfirst($controller)).'Controller'; |
|
250 | 250 | } |
251 | 251 | return $this->controllerNameCache[$controller]; |
252 | 252 | } |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | $pattern = "/_[a-z]?/"; |
270 | 270 | return preg_replace_callback( |
271 | 271 | $pattern, |
272 | - function ($matches) { |
|
272 | + function($matches) { |
|
273 | 273 | return strtoupper(ltrim($matches[0], "_")); |
274 | 274 | }, |
275 | 275 | $str); |
@@ -11,9 +11,9 @@ |
||
11 | 11 | <em><?php p($l->t('Send a personalized link to a file or folder by mail.')); ?></em> |
12 | 12 | |
13 | 13 | <p> |
14 | - <input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if($_['sendPasswordMail']) p('checked'); ?> /> |
|
14 | + <input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if ($_['sendPasswordMail']) p('checked'); ?> /> |
|
15 | 15 | <label for="sendPasswordMail"><?php p($l->t('Send password by mail')); ?></label><br/> |
16 | - <input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if($_['enforcePasswordProtection']) p('checked'); ?> /> |
|
16 | + <input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if ($_['enforcePasswordProtection']) p('checked'); ?> /> |
|
17 | 17 | <label for="enforcePasswordProtection"><?php p($l->t('Enforce password protection')); ?></label> |
18 | 18 | </p> |
19 | 19 |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | |
322 | 322 | if ($fullId === null && $expirationDate === null && $this->shareApiLinkDefaultExpireDate()) { |
323 | 323 | $expirationDate = new \DateTime(); |
324 | - $expirationDate->setTime(0,0,0); |
|
324 | + $expirationDate->setTime(0, 0, 0); |
|
325 | 325 | $expirationDate->add(new \DateInterval('P'.$this->shareApiLinkDefaultExpireDays().'D')); |
326 | 326 | } |
327 | 327 | |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | |
334 | 334 | $date = new \DateTime(); |
335 | 335 | $date->setTime(0, 0, 0); |
336 | - $date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D')); |
|
336 | + $date->add(new \DateInterval('P'.$this->shareApiLinkDefaultExpireDays().'D')); |
|
337 | 337 | if ($date < $expirationDate) { |
338 | 338 | $message = $this->l->t('Cannot set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]); |
339 | 339 | throw new GenericShareException($message, $message, 404); |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | */ |
387 | 387 | $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_USER); |
388 | 388 | $existingShares = $provider->getSharesByPath($share->getNode()); |
389 | - foreach($existingShares as $existingShare) { |
|
389 | + foreach ($existingShares as $existingShare) { |
|
390 | 390 | // Ignore if it is the same share |
391 | 391 | try { |
392 | 392 | if ($existingShare->getFullId() === $share->getFullId()) { |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | */ |
444 | 444 | $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_GROUP); |
445 | 445 | $existingShares = $provider->getSharesByPath($share->getNode()); |
446 | - foreach($existingShares as $existingShare) { |
|
446 | + foreach ($existingShares as $existingShare) { |
|
447 | 447 | try { |
448 | 448 | if ($existingShare->getFullId() === $share->getFullId()) { |
449 | 449 | continue; |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | // Make sure that we do not share a path that contains a shared mountpoint |
513 | 513 | if ($path instanceof \OCP\Files\Folder) { |
514 | 514 | $mounts = $this->mountManager->findIn($path->getPath()); |
515 | - foreach($mounts as $mount) { |
|
515 | + foreach ($mounts as $mount) { |
|
516 | 516 | if ($mount->getStorage()->instanceOfStorage('\OCA\Files_Sharing\ISharedStorage')) { |
517 | 517 | throw new \InvalidArgumentException('Path contains files shared with you'); |
518 | 518 | } |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | $storage = $share->getNode()->getStorage(); |
561 | 561 | if ($storage->instanceOfStorage('OCA\Files_Sharing\External\Storage')) { |
562 | 562 | $parent = $share->getNode()->getParent(); |
563 | - while($parent->getStorage()->instanceOfStorage('OCA\Files_Sharing\External\Storage')) { |
|
563 | + while ($parent->getStorage()->instanceOfStorage('OCA\Files_Sharing\External\Storage')) { |
|
564 | 564 | $parent = $parent->getParent(); |
565 | 565 | } |
566 | 566 | $share->setShareOwner($parent->getOwner()->getUID()); |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | } |
618 | 618 | |
619 | 619 | // Generate the target |
620 | - $target = $this->config->getSystemValue('share_folder', '/') .'/'. $share->getNode()->getName(); |
|
620 | + $target = $this->config->getSystemValue('share_folder', '/').'/'.$share->getNode()->getName(); |
|
621 | 621 | $target = \OC\Files\Filesystem::normalizePath($target); |
622 | 622 | $share->setTarget($target); |
623 | 623 | |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | * @param string $recipientId |
865 | 865 | */ |
866 | 866 | public function deleteFromSelf(\OCP\Share\IShare $share, $recipientId) { |
867 | - list($providerId, ) = $this->splitFullId($share->getFullId()); |
|
867 | + list($providerId,) = $this->splitFullId($share->getFullId()); |
|
868 | 868 | $provider = $this->factory->getProvider($providerId); |
869 | 869 | |
870 | 870 | $provider->deleteFromSelf($share, $recipientId); |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | if ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) { |
886 | 886 | $sharedWith = $this->groupManager->get($share->getSharedWith()); |
887 | 887 | if (is_null($sharedWith)) { |
888 | - throw new \InvalidArgumentException('Group "' . $share->getSharedWith() . '" does not exist'); |
|
888 | + throw new \InvalidArgumentException('Group "'.$share->getSharedWith().'" does not exist'); |
|
889 | 889 | } |
890 | 890 | $recipient = $this->userManager->get($recipientId); |
891 | 891 | if (!$sharedWith->inGroup($recipient)) { |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | } |
894 | 894 | } |
895 | 895 | |
896 | - list($providerId, ) = $this->splitFullId($share->getFullId()); |
|
896 | + list($providerId,) = $this->splitFullId($share->getFullId()); |
|
897 | 897 | $provider = $this->factory->getProvider($providerId); |
898 | 898 | |
899 | 899 | $provider->move($share, $recipientId); |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | |
941 | 941 | $shares2 = []; |
942 | 942 | |
943 | - while(true) { |
|
943 | + while (true) { |
|
944 | 944 | $added = 0; |
945 | 945 | foreach ($shares as $share) { |
946 | 946 | |
@@ -1040,7 +1040,7 @@ discard block |
||
1040 | 1040 | * |
1041 | 1041 | * @return Share[] |
1042 | 1042 | */ |
1043 | - public function getSharesByPath(\OCP\Files\Node $path, $page=0, $perPage=50) { |
|
1043 | + public function getSharesByPath(\OCP\Files\Node $path, $page = 0, $perPage = 50) { |
|
1044 | 1044 | return []; |
1045 | 1045 | } |
1046 | 1046 | |
@@ -1055,7 +1055,7 @@ discard block |
||
1055 | 1055 | public function getShareByToken($token) { |
1056 | 1056 | $share = null; |
1057 | 1057 | try { |
1058 | - if($this->shareApiAllowLinks()) { |
|
1058 | + if ($this->shareApiAllowLinks()) { |
|
1059 | 1059 | $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_LINK); |
1060 | 1060 | $share = $provider->getShareByToken($token); |
1061 | 1061 | } |
@@ -1253,7 +1253,7 @@ discard block |
||
1253 | 1253 | } |
1254 | 1254 | $al['users'][$owner] = [ |
1255 | 1255 | 'node_id' => $path->getId(), |
1256 | - 'node_path' => '/' . $ownerPath, |
|
1256 | + 'node_path' => '/'.$ownerPath, |
|
1257 | 1257 | ]; |
1258 | 1258 | } else { |
1259 | 1259 | $al['users'][] = $owner; |
@@ -1347,7 +1347,7 @@ discard block |
||
1347 | 1347 | * @return int |
1348 | 1348 | */ |
1349 | 1349 | public function shareApiLinkDefaultExpireDays() { |
1350 | - return (int)$this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
1350 | + return (int) $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
1351 | 1351 | } |
1352 | 1352 | |
1353 | 1353 | /** |
@@ -25,7 +25,6 @@ |
||
25 | 25 | |
26 | 26 | use OC\CapabilitiesManager; |
27 | 27 | use OCA\FederatedFileSharing\AddressHandler; |
28 | -use OCA\FederatedFileSharing\DiscoveryManager; |
|
29 | 28 | use OCA\FederatedFileSharing\FederatedShareProvider; |
30 | 29 | use OCA\FederatedFileSharing\Notifications; |
31 | 30 | use OCA\FederatedFileSharing\TokenHandler; |
@@ -209,10 +209,10 @@ discard block |
||
209 | 209 | } |
210 | 210 | |
211 | 211 | $passwordPolicy = $this->getPasswordPolicy(); |
212 | - $passwordCharset = ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS; |
|
212 | + $passwordCharset = ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS; |
|
213 | 213 | $passwordLength = 8; |
214 | 214 | if (!empty($passwordPolicy)) { |
215 | - $passwordLength = (int)$passwordPolicy['minLength'] > 0 ? (int)$passwordPolicy['minLength'] : $passwordLength; |
|
215 | + $passwordLength = (int) $passwordPolicy['minLength'] > 0 ? (int) $passwordPolicy['minLength'] : $passwordLength; |
|
216 | 216 | $passwordCharset .= $passwordPolicy['enforceSpecialCharacters'] ? ISecureRandom::CHAR_SYMBOLS : ''; |
217 | 217 | } |
218 | 218 | |
@@ -350,11 +350,11 @@ discard block |
||
350 | 350 | $share->getSharedWith() |
351 | 351 | ); |
352 | 352 | } catch (HintException $hintException) { |
353 | - $this->logger->error('Failed to send share by mail: ' . $hintException->getMessage()); |
|
353 | + $this->logger->error('Failed to send share by mail: '.$hintException->getMessage()); |
|
354 | 354 | $this->removeShareFromTable($shareId); |
355 | 355 | throw $hintException; |
356 | 356 | } catch (\Exception $e) { |
357 | - $this->logger->error('Failed to send share by mail: ' . $e->getMessage()); |
|
357 | + $this->logger->error('Failed to send share by mail: '.$e->getMessage()); |
|
358 | 358 | $this->removeShareFromTable($shareId); |
359 | 359 | throw new HintException('Failed to send share by mail', |
360 | 360 | $this->l->t('Failed to send share by E-mail')); |
@@ -382,9 +382,9 @@ discard block |
||
382 | 382 | $ownerDisplayName = ($ownerUser instanceof IUser) ? $ownerUser->getDisplayName() : $owner; |
383 | 383 | $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; |
384 | 384 | if ($owner === $initiator) { |
385 | - $subject = (string)$this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename)); |
|
385 | + $subject = (string) $this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename)); |
|
386 | 386 | } else { |
387 | - $subject = (string)$this->l->t('%s shared »%s« with you on behalf of %s', array($ownerDisplayName, $filename, $initiatorDisplayName)); |
|
387 | + $subject = (string) $this->l->t('%s shared »%s« with you on behalf of %s', array($ownerDisplayName, $filename, $initiatorDisplayName)); |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | $message = $this->mailer->createMessage(); |
@@ -396,10 +396,10 @@ discard block |
||
396 | 396 | if ($owner === $initiator) { |
397 | 397 | $text = $this->l->t('%s shared »%s« with you.', [$ownerDisplayName, $filename]); |
398 | 398 | } else { |
399 | - $text= $this->l->t('%s shared »%s« with you on behalf of %s.', [$ownerDisplayName, $filename, $initiator]); |
|
399 | + $text = $this->l->t('%s shared »%s« with you on behalf of %s.', [$ownerDisplayName, $filename, $initiator]); |
|
400 | 400 | } |
401 | 401 | $emailTemplate->addBodyText( |
402 | - $text . ' ' . $this->l->t('Click the button below to open it.'), |
|
402 | + $text.' '.$this->l->t('Click the button below to open it.'), |
|
403 | 403 | $text |
404 | 404 | ); |
405 | 405 | $emailTemplate->addBodyButton( |
@@ -423,9 +423,9 @@ discard block |
||
423 | 423 | // The "Reply-To" is set to the sharer if an mail address is configured |
424 | 424 | // also the default footer contains a "Do not reply" which needs to be adjusted. |
425 | 425 | $ownerEmail = $ownerUser->getEMailAddress(); |
426 | - if($ownerEmail !== null) { |
|
426 | + if ($ownerEmail !== null) { |
|
427 | 427 | $message->setReplyTo([$ownerEmail => $ownerDisplayName]); |
428 | - $emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan()); |
|
428 | + $emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan()); |
|
429 | 429 | } else { |
430 | 430 | $emailTemplate->addFooter(); |
431 | 431 | } |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; |
458 | 458 | $initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; |
459 | 459 | |
460 | - $subject = (string)$this->l->t('Password to access »%s« shared to you by %s', [$filename, $initiatorDisplayName]); |
|
460 | + $subject = (string) $this->l->t('Password to access »%s« shared to you by %s', [$filename, $initiatorDisplayName]); |
|
461 | 461 | $plainBodyPart = $this->l->t("%s shared »%s« with you.\nYou should have already received a separate mail with a link to access it.\n", [$initiatorDisplayName, $filename]); |
462 | 462 | $htmlBodyPart = $this->l->t('%s shared »%s« with you. You should have already received a separate mail with a link to access it.', [$initiatorDisplayName, $filename]); |
463 | 463 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | ); |
508 | 508 | } |
509 | 509 | |
510 | - $subject = (string)$this->l->t('Password to access »%s« shared with %s', [$filename, $shareWith]); |
|
510 | + $subject = (string) $this->l->t('Password to access »%s« shared with %s', [$filename, $shareWith]); |
|
511 | 511 | $bodyPart = $this->l->t("You just shared »%s« with %s. The share was already send to the recipient. Due to the security policies defined by the administrator of %s each share needs to be protected by password and it is not allowed to send the password directly to the recipient. Therefore you need to forward the password manually to the recipient.", [$filename, $shareWith, $this->defaults->getName()]); |
512 | 512 | |
513 | 513 | $message = $this->mailer->createMessage(); |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | */ |
542 | 542 | protected function generateToken($size = 15) { |
543 | 543 | $token = $this->secureRandom->generate( |
544 | - $size, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS); |
|
544 | + $size, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS); |
|
545 | 545 | return $token; |
546 | 546 | } |
547 | 547 | |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | ->orderBy('id'); |
563 | 563 | |
564 | 564 | $cursor = $qb->execute(); |
565 | - while($data = $cursor->fetch()) { |
|
565 | + while ($data = $cursor->fetch()) { |
|
566 | 566 | $children[] = $this->createShareObject($data); |
567 | 567 | } |
568 | 568 | $cursor->closeCursor(); |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | $qb->execute(); |
607 | 607 | $id = $qb->getLastInsertId(); |
608 | 608 | |
609 | - return (int)$id; |
|
609 | + return (int) $id; |
|
610 | 610 | } |
611 | 611 | |
612 | 612 | /** |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | // a real password was given |
624 | 624 | $validPassword = $plainTextPassword !== null && $plainTextPassword !== ''; |
625 | 625 | |
626 | - if($validPassword && $originalShare->getPassword() !== $share->getPassword()) { |
|
626 | + if ($validPassword && $originalShare->getPassword() !== $share->getPassword()) { |
|
627 | 627 | $this->sendPassword($share, $plainTextPassword); |
628 | 628 | } |
629 | 629 | /* |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | |
718 | 718 | $cursor = $qb->execute(); |
719 | 719 | $shares = []; |
720 | - while($data = $cursor->fetch()) { |
|
720 | + while ($data = $cursor->fetch()) { |
|
721 | 721 | $shares[] = $this->createShareObject($data); |
722 | 722 | } |
723 | 723 | $cursor->closeCursor(); |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | ->execute(); |
770 | 770 | |
771 | 771 | $shares = []; |
772 | - while($data = $cursor->fetch()) { |
|
772 | + while ($data = $cursor->fetch()) { |
|
773 | 773 | $shares[] = $this->createShareObject($data); |
774 | 774 | } |
775 | 775 | $cursor->closeCursor(); |
@@ -808,7 +808,7 @@ discard block |
||
808 | 808 | |
809 | 809 | $cursor = $qb->execute(); |
810 | 810 | |
811 | - while($data = $cursor->fetch()) { |
|
811 | + while ($data = $cursor->fetch()) { |
|
812 | 812 | $shares[] = $this->createShareObject($data); |
813 | 813 | } |
814 | 814 | $cursor->closeCursor(); |
@@ -871,15 +871,15 @@ discard block |
||
871 | 871 | protected function createShareObject($data) { |
872 | 872 | |
873 | 873 | $share = new Share($this->rootFolder, $this->userManager); |
874 | - $share->setId((int)$data['id']) |
|
875 | - ->setShareType((int)$data['share_type']) |
|
876 | - ->setPermissions((int)$data['permissions']) |
|
874 | + $share->setId((int) $data['id']) |
|
875 | + ->setShareType((int) $data['share_type']) |
|
876 | + ->setPermissions((int) $data['permissions']) |
|
877 | 877 | ->setTarget($data['file_target']) |
878 | - ->setMailSend((bool)$data['mail_send']) |
|
878 | + ->setMailSend((bool) $data['mail_send']) |
|
879 | 879 | ->setToken($data['token']); |
880 | 880 | |
881 | 881 | $shareTime = new \DateTime(); |
882 | - $shareTime->setTimestamp((int)$data['stime']); |
|
882 | + $shareTime->setTimestamp((int) $data['stime']); |
|
883 | 883 | $share->setShareTime($shareTime); |
884 | 884 | $share->setSharedWith($data['share_with']); |
885 | 885 | $share->setPassword($data['password']); |
@@ -890,7 +890,7 @@ discard block |
||
890 | 890 | } else { |
891 | 891 | //OLD SHARE |
892 | 892 | $share->setSharedBy($data['uid_owner']); |
893 | - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); |
|
893 | + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); |
|
894 | 894 | |
895 | 895 | $owner = $path->getOwner(); |
896 | 896 | $share->setShareOwner($owner->getUID()); |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | } |
904 | 904 | } |
905 | 905 | |
906 | - $share->setNodeId((int)$data['file_source']); |
|
906 | + $share->setNodeId((int) $data['file_source']); |
|
907 | 907 | $share->setNodeType($data['item_type']); |
908 | 908 | |
909 | 909 | $share->setProviderId($this->identifier()); |
@@ -1022,7 +1022,7 @@ discard block |
||
1022 | 1022 | ); |
1023 | 1023 | } |
1024 | 1024 | |
1025 | - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
1025 | + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
1026 | 1026 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
1027 | 1027 | |
1028 | 1028 | $qb->orderBy('id'); |