@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | } else { |
109 | 109 | // Update old classes to new namespace |
110 | 110 | if (strpos($storage, 'OC_Filestorage_') !== false) { |
111 | - $storage = '\OC\Files\Storage\\' . substr($storage, 15); |
|
111 | + $storage = '\OC\Files\Storage\\'.substr($storage, 15); |
|
112 | 112 | } |
113 | 113 | $this->class = $storage; |
114 | 114 | $this->arguments = $arguments; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | return; |
161 | 161 | } |
162 | 162 | } else { |
163 | - \OCP\Util::writeLog('core', 'storage backend ' . $this->class . ' not found', ILogger::ERROR); |
|
163 | + \OCP\Util::writeLog('core', 'storage backend '.$this->class.' not found', ILogger::ERROR); |
|
164 | 164 | $this->invalidStorage = true; |
165 | 165 | return; |
166 | 166 | } |
@@ -210,13 +210,13 @@ discard block |
||
210 | 210 | */ |
211 | 211 | public function getInternalPath($path) { |
212 | 212 | $path = Filesystem::normalizePath($path, true, false, true); |
213 | - if ($this->mountPoint === $path or $this->mountPoint . '/' === $path) { |
|
213 | + if ($this->mountPoint === $path or $this->mountPoint.'/' === $path) { |
|
214 | 214 | $internalPath = ''; |
215 | 215 | } else { |
216 | 216 | $internalPath = substr($path, strlen($this->mountPoint)); |
217 | 217 | } |
218 | 218 | // substr returns false instead of an empty string, we always want a string |
219 | - return (string)$internalPath; |
|
219 | + return (string) $internalPath; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | /** |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | */ |
270 | 270 | public function getStorageRootId() { |
271 | 271 | if (is_null($this->rootId) || $this->rootId === -1) { |
272 | - $this->rootId = (int)$this->getStorage()->getCache()->getId(''); |
|
272 | + $this->rootId = (int) $this->getStorage()->getCache()->getId(''); |
|
273 | 273 | } |
274 | 274 | return $this->rootId; |
275 | 275 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | $userMountPoint = array_shift($userMountPoints); |
310 | 310 | |
311 | 311 | if ($userMountPoint === null) { |
312 | - throw new GenericShareException('Could not get proper user mount for ' . $userMountPointId . '. Failing since else the next calls are called with null'); |
|
312 | + throw new GenericShareException('Could not get proper user mount for '.$userMountPointId.'. Failing since else the next calls are called with null'); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | /* Check if this is an incoming share */ |
@@ -399,9 +399,9 @@ discard block |
||
399 | 399 | |
400 | 400 | if ($fullId === null && $expirationDate === null && $this->shareApiInternalDefaultExpireDate()) { |
401 | 401 | $expirationDate = new \DateTime(); |
402 | - $expirationDate->setTime(0,0,0); |
|
402 | + $expirationDate->setTime(0, 0, 0); |
|
403 | 403 | |
404 | - $days = (int)$this->config->getAppValue('core', 'internal_defaultExpDays', $this->shareApiLinkDefaultExpireDays()); |
|
404 | + $days = (int) $this->config->getAppValue('core', 'internal_defaultExpDays', $this->shareApiLinkDefaultExpireDays()); |
|
405 | 405 | if ($days > $this->shareApiLinkDefaultExpireDays()) { |
406 | 406 | $days = $this->shareApiLinkDefaultExpireDays(); |
407 | 407 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | |
417 | 417 | $date = new \DateTime(); |
418 | 418 | $date->setTime(0, 0, 0); |
419 | - $date->add(new \DateInterval('P' . $this->shareApiInternalDefaultExpireDays() . 'D')); |
|
419 | + $date->add(new \DateInterval('P'.$this->shareApiInternalDefaultExpireDays().'D')); |
|
420 | 420 | if ($date < $expirationDate) { |
421 | 421 | $message = $this->l->t('Can’t set expiration date more than %s days in the future', [$this->shareApiInternalDefaultExpireDays()]); |
422 | 422 | throw new GenericShareException($message, $message, 404); |
@@ -475,9 +475,9 @@ discard block |
||
475 | 475 | |
476 | 476 | if ($fullId === null && $expirationDate === null && $this->shareApiLinkDefaultExpireDate()) { |
477 | 477 | $expirationDate = new \DateTime(); |
478 | - $expirationDate->setTime(0,0,0); |
|
478 | + $expirationDate->setTime(0, 0, 0); |
|
479 | 479 | |
480 | - $days = (int)$this->config->getAppValue('core', 'link_defaultExpDays', $this->shareApiLinkDefaultExpireDays()); |
|
480 | + $days = (int) $this->config->getAppValue('core', 'link_defaultExpDays', $this->shareApiLinkDefaultExpireDays()); |
|
481 | 481 | if ($days > $this->shareApiLinkDefaultExpireDays()) { |
482 | 482 | $days = $this->shareApiLinkDefaultExpireDays(); |
483 | 483 | } |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | |
493 | 493 | $date = new \DateTime(); |
494 | 494 | $date->setTime(0, 0, 0); |
495 | - $date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D')); |
|
495 | + $date->add(new \DateInterval('P'.$this->shareApiLinkDefaultExpireDays().'D')); |
|
496 | 496 | if ($date < $expirationDate) { |
497 | 497 | $message = $this->l->t('Can’t set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]); |
498 | 498 | throw new GenericShareException($message, $message, 404); |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | } |
778 | 778 | |
779 | 779 | // Generate the target |
780 | - $target = $this->config->getSystemValue('share_folder', '/') .'/'. $share->getNode()->getName(); |
|
780 | + $target = $this->config->getSystemValue('share_folder', '/').'/'.$share->getNode()->getName(); |
|
781 | 781 | $target = \OC\Files\Filesystem::normalizePath($target); |
782 | 782 | $share->setTarget($target); |
783 | 783 | |
@@ -822,12 +822,12 @@ discard block |
||
822 | 822 | $emailAddress, |
823 | 823 | $share->getExpirationDate() |
824 | 824 | ); |
825 | - $this->logger->debug('Sent share notification to ' . $emailAddress . ' for share with ID ' . $share->getId(), ['app' => 'share']); |
|
825 | + $this->logger->debug('Sent share notification to '.$emailAddress.' for share with ID '.$share->getId(), ['app' => 'share']); |
|
826 | 826 | } else { |
827 | - $this->logger->debug('Share notification not sent to ' . $share->getSharedWith() . ' because email address is not set.', ['app' => 'share']); |
|
827 | + $this->logger->debug('Share notification not sent to '.$share->getSharedWith().' because email address is not set.', ['app' => 'share']); |
|
828 | 828 | } |
829 | 829 | } else { |
830 | - $this->logger->debug('Share notification not sent to ' . $share->getSharedWith() . ' because user could not be found.', ['app' => 'share']); |
|
830 | + $this->logger->debug('Share notification not sent to '.$share->getSharedWith().' because user could not be found.', ['app' => 'share']); |
|
831 | 831 | } |
832 | 832 | } else { |
833 | 833 | $this->logger->debug('Share notification not sent because mailsend is false.', ['app' => 'share']); |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | $text = $l->t('%1$s shared »%2$s« with you.', [$initiatorDisplayName, $filename]); |
875 | 875 | |
876 | 876 | $emailTemplate->addBodyText( |
877 | - htmlspecialchars($text . ' ' . $l->t('Click the button below to open it.')), |
|
877 | + htmlspecialchars($text.' '.$l->t('Click the button below to open it.')), |
|
878 | 878 | $text |
879 | 879 | ); |
880 | 880 | $emailTemplate->addBodyButton( |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | $initiatorEmail = $initiatorUser->getEMailAddress(); |
901 | 901 | if ($initiatorEmail !== null) { |
902 | 902 | $message->setReplyTo([$initiatorEmail => $initiatorDisplayName]); |
903 | - $emailTemplate->addFooter($instanceName . ($this->defaults->getSlogan($l->getLanguageCode()) !== '' ? ' - ' . $this->defaults->getSlogan($l->getLanguageCode()) : '')); |
|
903 | + $emailTemplate->addFooter($instanceName.($this->defaults->getSlogan($l->getLanguageCode()) !== '' ? ' - '.$this->defaults->getSlogan($l->getLanguageCode()) : '')); |
|
904 | 904 | } else { |
905 | 905 | $emailTemplate->addFooter('', $l->getLanguageCode()); |
906 | 906 | } |
@@ -909,7 +909,7 @@ discard block |
||
909 | 909 | try { |
910 | 910 | $failedRecipients = $this->mailer->send($message); |
911 | 911 | if (!empty($failedRecipients)) { |
912 | - $this->logger->error('Share notification mail could not be sent to: ' . implode(', ', $failedRecipients)); |
|
912 | + $this->logger->error('Share notification mail could not be sent to: '.implode(', ', $failedRecipients)); |
|
913 | 913 | return; |
914 | 914 | } |
915 | 915 | } catch (\Exception $e) { |
@@ -1178,7 +1178,7 @@ discard block |
||
1178 | 1178 | * @param string $recipientId |
1179 | 1179 | */ |
1180 | 1180 | public function deleteFromSelf(IShare $share, $recipientId) { |
1181 | - list($providerId, ) = $this->splitFullId($share->getFullId()); |
|
1181 | + list($providerId,) = $this->splitFullId($share->getFullId()); |
|
1182 | 1182 | $provider = $this->factory->getProvider($providerId); |
1183 | 1183 | |
1184 | 1184 | $provider->deleteFromSelf($share, $recipientId); |
@@ -1187,7 +1187,7 @@ discard block |
||
1187 | 1187 | } |
1188 | 1188 | |
1189 | 1189 | public function restoreShare(IShare $share, string $recipientId): IShare { |
1190 | - list($providerId, ) = $this->splitFullId($share->getFullId()); |
|
1190 | + list($providerId,) = $this->splitFullId($share->getFullId()); |
|
1191 | 1191 | $provider = $this->factory->getProvider($providerId); |
1192 | 1192 | |
1193 | 1193 | return $provider->restore($share, $recipientId); |
@@ -1208,7 +1208,7 @@ discard block |
||
1208 | 1208 | if ($share->getShareType() === IShare::TYPE_GROUP) { |
1209 | 1209 | $sharedWith = $this->groupManager->get($share->getSharedWith()); |
1210 | 1210 | if (is_null($sharedWith)) { |
1211 | - throw new \InvalidArgumentException('Group "' . $share->getSharedWith() . '" does not exist'); |
|
1211 | + throw new \InvalidArgumentException('Group "'.$share->getSharedWith().'" does not exist'); |
|
1212 | 1212 | } |
1213 | 1213 | $recipient = $this->userManager->get($recipientId); |
1214 | 1214 | if (!$sharedWith->inGroup($recipient)) { |
@@ -1216,7 +1216,7 @@ discard block |
||
1216 | 1216 | } |
1217 | 1217 | } |
1218 | 1218 | |
1219 | - list($providerId, ) = $this->splitFullId($share->getFullId()); |
|
1219 | + list($providerId,) = $this->splitFullId($share->getFullId()); |
|
1220 | 1220 | $provider = $this->factory->getProvider($providerId); |
1221 | 1221 | |
1222 | 1222 | return $provider->move($share, $recipientId); |
@@ -1225,7 +1225,7 @@ discard block |
||
1225 | 1225 | public function getSharesInFolder($userId, Folder $node, $reshares = false) { |
1226 | 1226 | $providers = $this->factory->getAllProviders(); |
1227 | 1227 | |
1228 | - return array_reduce($providers, function ($shares, IShareProvider $provider) use ($userId, $node, $reshares) { |
|
1228 | + return array_reduce($providers, function($shares, IShareProvider $provider) use ($userId, $node, $reshares) { |
|
1229 | 1229 | $newShares = $provider->getSharesInFolder($userId, $node, $reshares); |
1230 | 1230 | foreach ($newShares as $fid => $data) { |
1231 | 1231 | if (!isset($shares[$fid])) { |
@@ -1342,12 +1342,12 @@ discard block |
||
1342 | 1342 | $shares = $this->getSharedWith($userId, $shareType, $node, $limit, $offset); |
1343 | 1343 | |
1344 | 1344 | // Only get deleted shares |
1345 | - $shares = array_filter($shares, function (IShare $share) { |
|
1345 | + $shares = array_filter($shares, function(IShare $share) { |
|
1346 | 1346 | return $share->getPermissions() === 0; |
1347 | 1347 | }); |
1348 | 1348 | |
1349 | 1349 | // Only get shares where the owner still exists |
1350 | - $shares = array_filter($shares, function (IShare $share) { |
|
1350 | + $shares = array_filter($shares, function(IShare $share) { |
|
1351 | 1351 | return $this->userManager->userExists($share->getShareOwner()); |
1352 | 1352 | }); |
1353 | 1353 | |
@@ -1386,7 +1386,7 @@ discard block |
||
1386 | 1386 | * |
1387 | 1387 | * @return Share[] |
1388 | 1388 | */ |
1389 | - public function getSharesByPath(\OCP\Files\Node $path, $page=0, $perPage=50) { |
|
1389 | + public function getSharesByPath(\OCP\Files\Node $path, $page = 0, $perPage = 50) { |
|
1390 | 1390 | return []; |
1391 | 1391 | } |
1392 | 1392 | |
@@ -1644,7 +1644,7 @@ discard block |
||
1644 | 1644 | } |
1645 | 1645 | $al['users'][$owner] = [ |
1646 | 1646 | 'node_id' => $path->getId(), |
1647 | - 'node_path' => '/' . $ownerPath, |
|
1647 | + 'node_path' => '/'.$ownerPath, |
|
1648 | 1648 | ]; |
1649 | 1649 | } else { |
1650 | 1650 | $al['users'][] = $owner; |
@@ -1745,7 +1745,7 @@ discard block |
||
1745 | 1745 | * @return int |
1746 | 1746 | */ |
1747 | 1747 | public function shareApiLinkDefaultExpireDays() { |
1748 | - return (int)$this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
1748 | + return (int) $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
1749 | 1749 | } |
1750 | 1750 | |
1751 | 1751 | /** |
@@ -1773,7 +1773,7 @@ discard block |
||
1773 | 1773 | * @return int |
1774 | 1774 | */ |
1775 | 1775 | public function shareApiInternalDefaultExpireDays(): int { |
1776 | - return (int)$this->config->getAppValue('core', 'shareapi_internal_expire_after_n_days', '7'); |
|
1776 | + return (int) $this->config->getAppValue('core', 'shareapi_internal_expire_after_n_days', '7'); |
|
1777 | 1777 | } |
1778 | 1778 | |
1779 | 1779 | /** |