@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | ->orderBy('id'); |
| 350 | 350 | |
| 351 | 351 | $cursor = $qb->execute(); |
| 352 | - while($data = $cursor->fetch()) { |
|
| 352 | + while ($data = $cursor->fetch()) { |
|
| 353 | 353 | $children[] = $this->createShare($data); |
| 354 | 354 | } |
| 355 | 355 | $cursor->closeCursor(); |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | $user = $this->userManager->get($recipient); |
| 395 | 395 | |
| 396 | 396 | if (is_null($group)) { |
| 397 | - throw new ProviderException('Group "' . $share->getSharedWith() . '" does not exist'); |
|
| 397 | + throw new ProviderException('Group "'.$share->getSharedWith().'" does not exist'); |
|
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | if (!$group->inGroup($user)) { |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | ); |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 592 | + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 593 | 593 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
| 594 | 594 | |
| 595 | 595 | $qb->orderBy('id'); |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | |
| 648 | 648 | $cursor = $qb->execute(); |
| 649 | 649 | $shares = []; |
| 650 | - while($data = $cursor->fetch()) { |
|
| 650 | + while ($data = $cursor->fetch()) { |
|
| 651 | 651 | $shares[] = $this->createShare($data); |
| 652 | 652 | } |
| 653 | 653 | $cursor->closeCursor(); |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | ->execute(); |
| 727 | 727 | |
| 728 | 728 | $shares = []; |
| 729 | - while($data = $cursor->fetch()) { |
|
| 729 | + while ($data = $cursor->fetch()) { |
|
| 730 | 730 | $shares[] = $this->createShare($data); |
| 731 | 731 | } |
| 732 | 732 | $cursor->closeCursor(); |
@@ -797,7 +797,7 @@ discard block |
||
| 797 | 797 | |
| 798 | 798 | $cursor = $qb->execute(); |
| 799 | 799 | |
| 800 | - while($data = $cursor->fetch()) { |
|
| 800 | + while ($data = $cursor->fetch()) { |
|
| 801 | 801 | if ($this->isAccessibleResult($data)) { |
| 802 | 802 | $shares[] = $this->createShare($data); |
| 803 | 803 | } |
@@ -812,7 +812,7 @@ discard block |
||
| 812 | 812 | $shares2 = []; |
| 813 | 813 | |
| 814 | 814 | $start = 0; |
| 815 | - while(true) { |
|
| 815 | + while (true) { |
|
| 816 | 816 | $groups = array_slice($allGroups, $start, 100); |
| 817 | 817 | $start += 100; |
| 818 | 818 | |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | )); |
| 858 | 858 | |
| 859 | 859 | $cursor = $qb->execute(); |
| 860 | - while($data = $cursor->fetch()) { |
|
| 860 | + while ($data = $cursor->fetch()) { |
|
| 861 | 861 | if ($offset > 0) { |
| 862 | 862 | $offset--; |
| 863 | 863 | continue; |
@@ -926,16 +926,16 @@ discard block |
||
| 926 | 926 | */ |
| 927 | 927 | private function createShare($data) { |
| 928 | 928 | $share = new Share($this->rootFolder, $this->userManager); |
| 929 | - $share->setId((int)$data['id']) |
|
| 930 | - ->setShareType((int)$data['share_type']) |
|
| 931 | - ->setPermissions((int)$data['permissions']) |
|
| 929 | + $share->setId((int) $data['id']) |
|
| 930 | + ->setShareType((int) $data['share_type']) |
|
| 931 | + ->setPermissions((int) $data['permissions']) |
|
| 932 | 932 | ->setTarget($data['file_target']) |
| 933 | 933 | ->setNote($data['note']) |
| 934 | - ->setMailSend((bool)$data['mail_send']) |
|
| 934 | + ->setMailSend((bool) $data['mail_send']) |
|
| 935 | 935 | ->setLabel($data['label']); |
| 936 | 936 | |
| 937 | 937 | $shareTime = new \DateTime(); |
| 938 | - $shareTime->setTimestamp((int)$data['stime']); |
|
| 938 | + $shareTime->setTimestamp((int) $data['stime']); |
|
| 939 | 939 | $share->setShareTime($shareTime); |
| 940 | 940 | |
| 941 | 941 | if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) { |
@@ -948,14 +948,14 @@ discard block |
||
| 948 | 948 | $share->setSharedWith($data['share_with']); |
| 949 | 949 | } else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK) { |
| 950 | 950 | $share->setPassword($data['password']); |
| 951 | - $share->setSendPasswordByTalk((bool)$data['password_by_talk']); |
|
| 951 | + $share->setSendPasswordByTalk((bool) $data['password_by_talk']); |
|
| 952 | 952 | $share->setToken($data['token']); |
| 953 | 953 | } |
| 954 | 954 | |
| 955 | 955 | $share->setSharedBy($data['uid_initiator']); |
| 956 | 956 | $share->setShareOwner($data['uid_owner']); |
| 957 | 957 | |
| 958 | - $share->setNodeId((int)$data['file_source']); |
|
| 958 | + $share->setNodeId((int) $data['file_source']); |
|
| 959 | 959 | $share->setNodeType($data['item_type']); |
| 960 | 960 | |
| 961 | 961 | if ($data['expiration'] !== null) { |
@@ -972,7 +972,7 @@ discard block |
||
| 972 | 972 | } |
| 973 | 973 | |
| 974 | 974 | $share->setProviderId($this->identifier()); |
| 975 | - $share->setHideDownload((int)$data['hide_download'] === 1); |
|
| 975 | + $share->setHideDownload((int) $data['hide_download'] === 1); |
|
| 976 | 976 | |
| 977 | 977 | return $share; |
| 978 | 978 | } |
@@ -986,7 +986,7 @@ discard block |
||
| 986 | 986 | $result = []; |
| 987 | 987 | |
| 988 | 988 | $start = 0; |
| 989 | - while(true) { |
|
| 989 | + while (true) { |
|
| 990 | 990 | /** @var Share[] $shareSlice */ |
| 991 | 991 | $shareSlice = array_slice($shares, $start, 100); |
| 992 | 992 | $start += 100; |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | $shareMap = []; |
| 1002 | 1002 | |
| 1003 | 1003 | foreach ($shareSlice as $share) { |
| 1004 | - $ids[] = (int)$share->getId(); |
|
| 1004 | + $ids[] = (int) $share->getId(); |
|
| 1005 | 1005 | $shareMap[$share->getId()] = $share; |
| 1006 | 1006 | } |
| 1007 | 1007 | |
@@ -1018,8 +1018,8 @@ discard block |
||
| 1018 | 1018 | |
| 1019 | 1019 | $stmt = $query->execute(); |
| 1020 | 1020 | |
| 1021 | - while($data = $stmt->fetch()) { |
|
| 1022 | - $shareMap[$data['parent']]->setPermissions((int)$data['permissions']); |
|
| 1021 | + while ($data = $stmt->fetch()) { |
|
| 1022 | + $shareMap[$data['parent']]->setPermissions((int) $data['permissions']); |
|
| 1023 | 1023 | $shareMap[$data['parent']]->setTarget($data['file_target']); |
| 1024 | 1024 | $shareMap[$data['parent']]->setParent($data['parent']); |
| 1025 | 1025 | } |
@@ -1117,8 +1117,8 @@ discard block |
||
| 1117 | 1117 | |
| 1118 | 1118 | $cursor = $qb->execute(); |
| 1119 | 1119 | $ids = []; |
| 1120 | - while($row = $cursor->fetch()) { |
|
| 1121 | - $ids[] = (int)$row['id']; |
|
| 1120 | + while ($row = $cursor->fetch()) { |
|
| 1121 | + $ids[] = (int) $row['id']; |
|
| 1122 | 1122 | } |
| 1123 | 1123 | $cursor->closeCursor(); |
| 1124 | 1124 | |
@@ -1160,8 +1160,8 @@ discard block |
||
| 1160 | 1160 | |
| 1161 | 1161 | $cursor = $qb->execute(); |
| 1162 | 1162 | $ids = []; |
| 1163 | - while($row = $cursor->fetch()) { |
|
| 1164 | - $ids[] = (int)$row['id']; |
|
| 1163 | + while ($row = $cursor->fetch()) { |
|
| 1164 | + $ids[] = (int) $row['id']; |
|
| 1165 | 1165 | } |
| 1166 | 1166 | $cursor->closeCursor(); |
| 1167 | 1167 | |
@@ -1215,8 +1215,8 @@ discard block |
||
| 1215 | 1215 | |
| 1216 | 1216 | $users = []; |
| 1217 | 1217 | $link = false; |
| 1218 | - while($row = $cursor->fetch()) { |
|
| 1219 | - $type = (int)$row['share_type']; |
|
| 1218 | + while ($row = $cursor->fetch()) { |
|
| 1219 | + $type = (int) $row['share_type']; |
|
| 1220 | 1220 | if ($type === \OCP\Share::SHARE_TYPE_USER) { |
| 1221 | 1221 | $uid = $row['share_with']; |
| 1222 | 1222 | $users[$uid] = isset($users[$uid]) ? $users[$uid] : []; |
@@ -1366,7 +1366,7 @@ discard block |
||
| 1366 | 1366 | $message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]); |
| 1367 | 1367 | if ($initiatorEmailAddress !== null) { |
| 1368 | 1368 | $message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]); |
| 1369 | - $emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan()); |
|
| 1369 | + $emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan()); |
|
| 1370 | 1370 | } else { |
| 1371 | 1371 | $emailTemplate->addFooter(); |
| 1372 | 1372 | } |
@@ -1397,7 +1397,7 @@ discard block |
||
| 1397 | 1397 | ); |
| 1398 | 1398 | |
| 1399 | 1399 | $cursor = $qb->execute(); |
| 1400 | - while($data = $cursor->fetch()) { |
|
| 1400 | + while ($data = $cursor->fetch()) { |
|
| 1401 | 1401 | try { |
| 1402 | 1402 | $share = $this->createShare($data); |
| 1403 | 1403 | } catch (InvalidShare $e) { |
@@ -211,10 +211,10 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | $passwordPolicy = $this->getPasswordPolicy(); |
| 214 | - $passwordCharset = ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS; |
|
| 214 | + $passwordCharset = ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS; |
|
| 215 | 215 | $passwordLength = 8; |
| 216 | 216 | if (!empty($passwordPolicy)) { |
| 217 | - $passwordLength = (int)$passwordPolicy['minLength'] > 0 ? (int)$passwordPolicy['minLength'] : $passwordLength; |
|
| 217 | + $passwordLength = (int) $passwordPolicy['minLength'] > 0 ? (int) $passwordPolicy['minLength'] : $passwordLength; |
|
| 218 | 218 | $passwordCharset .= $passwordPolicy['enforceSpecialCharacters'] ? ISecureRandom::CHAR_SYMBOLS : ''; |
| 219 | 219 | } |
| 220 | 220 | |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | $text = $this->l->t('%1$s shared »%2$s« with you.', [$initiatorDisplayName, $filename]); |
| 408 | 408 | |
| 409 | 409 | $emailTemplate->addBodyText( |
| 410 | - htmlspecialchars($text . ' ' . $this->l->t('Click the button below to open it.')), |
|
| 410 | + htmlspecialchars($text.' '.$this->l->t('Click the button below to open it.')), |
|
| 411 | 411 | $text |
| 412 | 412 | ); |
| 413 | 413 | $emailTemplate->addBodyButton( |
@@ -431,9 +431,9 @@ discard block |
||
| 431 | 431 | // The "Reply-To" is set to the sharer if an mail address is configured |
| 432 | 432 | // also the default footer contains a "Do not reply" which needs to be adjusted. |
| 433 | 433 | $initiatorEmail = $initiatorUser->getEMailAddress(); |
| 434 | - if($initiatorEmail !== null) { |
|
| 434 | + if ($initiatorEmail !== null) { |
|
| 435 | 435 | $message->setReplyTo([$initiatorEmail => $initiatorDisplayName]); |
| 436 | - $emailTemplate->addFooter($instanceName . ($this->defaults->getSlogan() !== '' ? ' - ' . $this->defaults->getSlogan() : '')); |
|
| 436 | + $emailTemplate->addFooter($instanceName.($this->defaults->getSlogan() !== '' ? ' - '.$this->defaults->getSlogan() : '')); |
|
| 437 | 437 | } else { |
| 438 | 438 | $emailTemplate->addFooter(); |
| 439 | 439 | } |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | $message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]); |
| 496 | 496 | if ($initiatorEmailAddress !== null) { |
| 497 | 497 | $message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]); |
| 498 | - $emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan()); |
|
| 498 | + $emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan()); |
|
| 499 | 499 | } else { |
| 500 | 500 | $emailTemplate->addFooter(); |
| 501 | 501 | } |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | $message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]); |
| 554 | 554 | if ($initiatorEmailAddress !== null) { |
| 555 | 555 | $message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]); |
| 556 | - $emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan()); |
|
| 556 | + $emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan()); |
|
| 557 | 557 | } else { |
| 558 | 558 | $emailTemplate->addFooter(); |
| 559 | 559 | } |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | ->orderBy('id'); |
| 647 | 647 | |
| 648 | 648 | $cursor = $qb->execute(); |
| 649 | - while($data = $cursor->fetch()) { |
|
| 649 | + while ($data = $cursor->fetch()) { |
|
| 650 | 650 | $children[] = $this->createShareObject($data); |
| 651 | 651 | } |
| 652 | 652 | $cursor->closeCursor(); |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | $qb->execute(); |
| 694 | 694 | $id = $qb->getLastInsertId(); |
| 695 | 695 | |
| 696 | - return (int)$id; |
|
| 696 | + return (int) $id; |
|
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | /** |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | // a real password was given |
| 711 | 711 | $validPassword = $plainTextPassword !== null && $plainTextPassword !== ''; |
| 712 | 712 | |
| 713 | - if($validPassword && ($originalShare->getPassword() !== $share->getPassword() || |
|
| 713 | + if ($validPassword && ($originalShare->getPassword() !== $share->getPassword() || |
|
| 714 | 714 | ($originalShare->getSendPasswordByTalk() && !$share->getSendPasswordByTalk()))) { |
| 715 | 715 | $this->sendPassword($share, $plainTextPassword); |
| 716 | 716 | } |
@@ -819,7 +819,7 @@ discard block |
||
| 819 | 819 | |
| 820 | 820 | $cursor = $qb->execute(); |
| 821 | 821 | $shares = []; |
| 822 | - while($data = $cursor->fetch()) { |
|
| 822 | + while ($data = $cursor->fetch()) { |
|
| 823 | 823 | $shares[] = $this->createShareObject($data); |
| 824 | 824 | } |
| 825 | 825 | $cursor->closeCursor(); |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | ->execute(); |
| 872 | 872 | |
| 873 | 873 | $shares = []; |
| 874 | - while($data = $cursor->fetch()) { |
|
| 874 | + while ($data = $cursor->fetch()) { |
|
| 875 | 875 | $shares[] = $this->createShareObject($data); |
| 876 | 876 | } |
| 877 | 877 | $cursor->closeCursor(); |
@@ -910,7 +910,7 @@ discard block |
||
| 910 | 910 | |
| 911 | 911 | $cursor = $qb->execute(); |
| 912 | 912 | |
| 913 | - while($data = $cursor->fetch()) { |
|
| 913 | + while ($data = $cursor->fetch()) { |
|
| 914 | 914 | $shares[] = $this->createShareObject($data); |
| 915 | 915 | } |
| 916 | 916 | $cursor->closeCursor(); |
@@ -973,20 +973,20 @@ discard block |
||
| 973 | 973 | protected function createShareObject($data) { |
| 974 | 974 | |
| 975 | 975 | $share = new Share($this->rootFolder, $this->userManager); |
| 976 | - $share->setId((int)$data['id']) |
|
| 977 | - ->setShareType((int)$data['share_type']) |
|
| 978 | - ->setPermissions((int)$data['permissions']) |
|
| 976 | + $share->setId((int) $data['id']) |
|
| 977 | + ->setShareType((int) $data['share_type']) |
|
| 978 | + ->setPermissions((int) $data['permissions']) |
|
| 979 | 979 | ->setTarget($data['file_target']) |
| 980 | - ->setMailSend((bool)$data['mail_send']) |
|
| 980 | + ->setMailSend((bool) $data['mail_send']) |
|
| 981 | 981 | ->setNote($data['note']) |
| 982 | 982 | ->setToken($data['token']); |
| 983 | 983 | |
| 984 | 984 | $shareTime = new \DateTime(); |
| 985 | - $shareTime->setTimestamp((int)$data['stime']); |
|
| 985 | + $shareTime->setTimestamp((int) $data['stime']); |
|
| 986 | 986 | $share->setShareTime($shareTime); |
| 987 | 987 | $share->setSharedWith($data['share_with']); |
| 988 | 988 | $share->setPassword($data['password']); |
| 989 | - $share->setSendPasswordByTalk((bool)$data['password_by_talk']); |
|
| 989 | + $share->setSendPasswordByTalk((bool) $data['password_by_talk']); |
|
| 990 | 990 | |
| 991 | 991 | if ($data['uid_initiator'] !== null) { |
| 992 | 992 | $share->setShareOwner($data['uid_owner']); |
@@ -994,7 +994,7 @@ discard block |
||
| 994 | 994 | } else { |
| 995 | 995 | //OLD SHARE |
| 996 | 996 | $share->setSharedBy($data['uid_owner']); |
| 997 | - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); |
|
| 997 | + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); |
|
| 998 | 998 | |
| 999 | 999 | $owner = $path->getOwner(); |
| 1000 | 1000 | $share->setShareOwner($owner->getUID()); |
@@ -1007,7 +1007,7 @@ discard block |
||
| 1007 | 1007 | } |
| 1008 | 1008 | } |
| 1009 | 1009 | |
| 1010 | - $share->setNodeId((int)$data['file_source']); |
|
| 1010 | + $share->setNodeId((int) $data['file_source']); |
|
| 1011 | 1011 | $share->setNodeType($data['item_type']); |
| 1012 | 1012 | |
| 1013 | 1013 | $share->setProviderId($this->identifier()); |
@@ -1124,7 +1124,7 @@ discard block |
||
| 1124 | 1124 | ); |
| 1125 | 1125 | } |
| 1126 | 1126 | |
| 1127 | - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 1127 | + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 1128 | 1128 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
| 1129 | 1129 | |
| 1130 | 1130 | $qb->orderBy('id'); |
@@ -1178,7 +1178,7 @@ discard block |
||
| 1178 | 1178 | ); |
| 1179 | 1179 | |
| 1180 | 1180 | $cursor = $qb->execute(); |
| 1181 | - while($data = $cursor->fetch()) { |
|
| 1181 | + while ($data = $cursor->fetch()) { |
|
| 1182 | 1182 | try { |
| 1183 | 1183 | $share = $this->createShareObject($data); |
| 1184 | 1184 | } catch (InvalidShare $e) { |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | if ($remoteShare) { |
| 215 | 215 | try { |
| 216 | 216 | $ownerCloudId = $this->cloudIdManager->getCloudId($remoteShare['owner'], $remoteShare['remote']); |
| 217 | - $shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_' . time(), $shareType); |
|
| 217 | + $shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_'.time(), $shareType); |
|
| 218 | 218 | $share->setId($shareId); |
| 219 | 219 | list($token, $remoteId) = $this->askOwnerToReShare($shareWith, $share, $shareId); |
| 220 | 220 | // remote share was create successfully if we get a valid token as return |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | $failure = true; |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | - if($failure) { |
|
| 299 | + if ($failure) { |
|
| 300 | 300 | $this->removeShareFromTableById($shareId); |
| 301 | 301 | $message_t = $this->l->t('Sharing %1$s failed, could not find %2$s, maybe the server is currently unreachable or uses a self-signed certificate.', |
| 302 | 302 | [$share->getNode()->getName(), $share->getSharedWith()]); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | ->andWhere($query->expr()->eq('mountpoint', $query->createNamedParameter($share->getTarget()))); |
| 349 | 349 | $result = $query->execute()->fetchAll(); |
| 350 | 350 | |
| 351 | - if (isset($result[0]) && (int)$result[0]['remote_id'] > 0) { |
|
| 351 | + if (isset($result[0]) && (int) $result[0]['remote_id'] > 0) { |
|
| 352 | 352 | return $result[0]; |
| 353 | 353 | } |
| 354 | 354 | |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | $qb->execute(); |
| 392 | 392 | $id = $qb->getLastInsertId(); |
| 393 | 393 | |
| 394 | - return (int)$id; |
|
| 394 | + return (int) $id; |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | /** |
@@ -481,14 +481,14 @@ discard block |
||
| 481 | 481 | public function getRemoteId(IShare $share) { |
| 482 | 482 | $query = $this->dbConnection->getQueryBuilder(); |
| 483 | 483 | $query->select('remote_id')->from('federated_reshares') |
| 484 | - ->where($query->expr()->eq('share_id', $query->createNamedParameter((int)$share->getId()))); |
|
| 484 | + ->where($query->expr()->eq('share_id', $query->createNamedParameter((int) $share->getId()))); |
|
| 485 | 485 | $data = $query->execute()->fetch(); |
| 486 | 486 | |
| 487 | 487 | if (!is_array($data) || !isset($data['remote_id'])) { |
| 488 | 488 | throw new ShareNotFound(); |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | - return (int)$data['remote_id']; |
|
| 491 | + return (int) $data['remote_id']; |
|
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | /** |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | ->orderBy('id'); |
| 520 | 520 | |
| 521 | 521 | $cursor = $qb->execute(); |
| 522 | - while($data = $cursor->fetch()) { |
|
| 522 | + while ($data = $cursor->fetch()) { |
|
| 523 | 523 | $children[] = $this->createShareObject($data); |
| 524 | 524 | } |
| 525 | 525 | $cursor->closeCursor(); |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | ); |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 649 | + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 650 | 650 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
| 651 | 651 | |
| 652 | 652 | $qb->orderBy('id'); |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | |
| 710 | 710 | $cursor = $qb->execute(); |
| 711 | 711 | $shares = []; |
| 712 | - while($data = $cursor->fetch()) { |
|
| 712 | + while ($data = $cursor->fetch()) { |
|
| 713 | 713 | $shares[] = $this->createShareObject($data); |
| 714 | 714 | } |
| 715 | 715 | $cursor->closeCursor(); |
@@ -733,7 +733,7 @@ discard block |
||
| 733 | 733 | $cursor->closeCursor(); |
| 734 | 734 | |
| 735 | 735 | if ($data === false) { |
| 736 | - throw new ShareNotFound('Can not find share with ID: ' . $id); |
|
| 736 | + throw new ShareNotFound('Can not find share with ID: '.$id); |
|
| 737 | 737 | } |
| 738 | 738 | |
| 739 | 739 | try { |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | ->execute(); |
| 763 | 763 | |
| 764 | 764 | $shares = []; |
| 765 | - while($data = $cursor->fetch()) { |
|
| 765 | + while ($data = $cursor->fetch()) { |
|
| 766 | 766 | $shares[] = $this->createShareObject($data); |
| 767 | 767 | } |
| 768 | 768 | $cursor->closeCursor(); |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | |
| 802 | 802 | $cursor = $qb->execute(); |
| 803 | 803 | |
| 804 | - while($data = $cursor->fetch()) { |
|
| 804 | + while ($data = $cursor->fetch()) { |
|
| 805 | 805 | $shares[] = $this->createShareObject($data); |
| 806 | 806 | } |
| 807 | 807 | $cursor->closeCursor(); |
@@ -878,15 +878,15 @@ discard block |
||
| 878 | 878 | private function createShareObject($data) { |
| 879 | 879 | |
| 880 | 880 | $share = new Share($this->rootFolder, $this->userManager); |
| 881 | - $share->setId((int)$data['id']) |
|
| 882 | - ->setShareType((int)$data['share_type']) |
|
| 883 | - ->setPermissions((int)$data['permissions']) |
|
| 881 | + $share->setId((int) $data['id']) |
|
| 882 | + ->setShareType((int) $data['share_type']) |
|
| 883 | + ->setPermissions((int) $data['permissions']) |
|
| 884 | 884 | ->setTarget($data['file_target']) |
| 885 | - ->setMailSend((bool)$data['mail_send']) |
|
| 885 | + ->setMailSend((bool) $data['mail_send']) |
|
| 886 | 886 | ->setToken($data['token']); |
| 887 | 887 | |
| 888 | 888 | $shareTime = new \DateTime(); |
| 889 | - $shareTime->setTimestamp((int)$data['stime']); |
|
| 889 | + $shareTime->setTimestamp((int) $data['stime']); |
|
| 890 | 890 | $share->setShareTime($shareTime); |
| 891 | 891 | $share->setSharedWith($data['share_with']); |
| 892 | 892 | |
@@ -896,13 +896,13 @@ discard block |
||
| 896 | 896 | } else { |
| 897 | 897 | //OLD SHARE |
| 898 | 898 | $share->setSharedBy($data['uid_owner']); |
| 899 | - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); |
|
| 899 | + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); |
|
| 900 | 900 | |
| 901 | 901 | $owner = $path->getOwner(); |
| 902 | 902 | $share->setShareOwner($owner->getUID()); |
| 903 | 903 | } |
| 904 | 904 | |
| 905 | - $share->setNodeId((int)$data['file_source']); |
|
| 905 | + $share->setNodeId((int) $data['file_source']); |
|
| 906 | 906 | $share->setNodeType($data['item_type']); |
| 907 | 907 | |
| 908 | 908 | $share->setProviderId($this->identifier()); |
@@ -1114,7 +1114,7 @@ discard block |
||
| 1114 | 1114 | ); |
| 1115 | 1115 | |
| 1116 | 1116 | $cursor = $qb->execute(); |
| 1117 | - while($data = $cursor->fetch()) { |
|
| 1117 | + while ($data = $cursor->fetch()) { |
|
| 1118 | 1118 | try { |
| 1119 | 1119 | $share = $this->createShareObject($data); |
| 1120 | 1120 | } catch (InvalidShare $e) { |