@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | |
403 | 403 | $this->htmlBody .= vsprintf($this->heading, [htmlspecialchars($title)]); |
404 | 404 | if ($plainTitle !== false) { |
405 | - $this->plainBody .= $plainTitle . PHP_EOL . PHP_EOL; |
|
405 | + $this->plainBody .= $plainTitle.PHP_EOL.PHP_EOL; |
|
406 | 406 | } |
407 | 407 | } |
408 | 408 | |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | |
440 | 440 | $this->htmlBody .= vsprintf($this->bodyText, [$text]); |
441 | 441 | if ($plainText !== false) { |
442 | - $this->plainBody .= $plainText . PHP_EOL . PHP_EOL; |
|
442 | + $this->plainBody .= $plainText.PHP_EOL.PHP_EOL; |
|
443 | 443 | } |
444 | 444 | } |
445 | 445 | |
@@ -469,18 +469,18 @@ discard block |
||
469 | 469 | |
470 | 470 | $htmlText = $text; |
471 | 471 | if ($metaInfo) { |
472 | - $htmlText = '<em style="color:#777;">' . $metaInfo . '</em><br>' . $htmlText; |
|
472 | + $htmlText = '<em style="color:#777;">'.$metaInfo.'</em><br>'.$htmlText; |
|
473 | 473 | } |
474 | 474 | if ($icon !== '') { |
475 | - $icon = '<img src="' . htmlspecialchars($icon) . '" alt="•">'; |
|
475 | + $icon = '<img src="'.htmlspecialchars($icon).'" alt="•">'; |
|
476 | 476 | } else { |
477 | 477 | $icon = '•'; |
478 | 478 | } |
479 | 479 | $this->htmlBody .= vsprintf($this->listItem, [$icon, $htmlText]); |
480 | 480 | if ($plainText !== false) { |
481 | - $this->plainBody .= ' * ' . $plainText; |
|
481 | + $this->plainBody .= ' * '.$plainText; |
|
482 | 482 | if ($plainMetaInfo !== false) { |
483 | - $this->plainBody .= ' (' . $plainMetaInfo . ')'; |
|
483 | + $this->plainBody .= ' ('.$plainMetaInfo.')'; |
|
484 | 484 | } |
485 | 485 | $this->plainBody .= PHP_EOL; |
486 | 486 | } |
@@ -541,8 +541,8 @@ discard block |
||
541 | 541 | $textColor = $this->themingDefaults->getTextColorPrimary(); |
542 | 542 | |
543 | 543 | $this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $urlLeft, $color, $textColor, $textColor, $textLeft, $urlRight, $textRight]); |
544 | - $this->plainBody .= $plainTextLeft . ': ' . $urlLeft . PHP_EOL; |
|
545 | - $this->plainBody .= $plainTextRight . ': ' . $urlRight . PHP_EOL . PHP_EOL; |
|
544 | + $this->plainBody .= $plainTextLeft.': '.$urlLeft.PHP_EOL; |
|
545 | + $this->plainBody .= $plainTextRight.': '.$urlRight.PHP_EOL.PHP_EOL; |
|
546 | 546 | } |
547 | 547 | |
548 | 548 | /** |
@@ -573,10 +573,10 @@ discard block |
||
573 | 573 | $this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, $textColor, $textColor, $text]); |
574 | 574 | |
575 | 575 | if ($plainText !== false) { |
576 | - $this->plainBody .= $plainText . ': '; |
|
576 | + $this->plainBody .= $plainText.': '; |
|
577 | 577 | } |
578 | 578 | |
579 | - $this->plainBody .= $url . PHP_EOL; |
|
579 | + $this->plainBody .= $url.PHP_EOL; |
|
580 | 580 | } |
581 | 581 | |
582 | 582 | /** |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | public function addFooter(string $text = '', ?string $lang = null) { |
602 | 602 | if ($text === '') { |
603 | 603 | $l10n = $this->l10nFactory->get('lib', $lang); |
604 | - $text = $this->themingDefaults->getName() . ' - ' . $this->themingDefaults->getSlogan($lang) . '<br>' . $l10n->t('This is an automatically sent email, please do not reply.'); |
|
604 | + $text = $this->themingDefaults->getName().' - '.$this->themingDefaults->getSlogan($lang).'<br>'.$l10n->t('This is an automatically sent email, please do not reply.'); |
|
605 | 605 | } |
606 | 606 | |
607 | 607 | if ($this->footerAdded) { |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | |
614 | 614 | $this->htmlBody .= vsprintf($this->footer, [$text]); |
615 | 615 | $this->htmlBody .= $this->tail; |
616 | - $this->plainBody .= PHP_EOL . '-- ' . PHP_EOL; |
|
616 | + $this->plainBody .= PHP_EOL.'-- '.PHP_EOL; |
|
617 | 617 | $this->plainBody .= str_replace('<br>', PHP_EOL, $text); |
618 | 618 | } |
619 | 619 |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | |
396 | 396 | if ($fullId === null && $expirationDate === null && $this->shareApiInternalDefaultExpireDate()) { |
397 | 397 | $expirationDate = new \DateTime(); |
398 | - $expirationDate->setTime(0,0,0); |
|
398 | + $expirationDate->setTime(0, 0, 0); |
|
399 | 399 | $expirationDate->add(new \DateInterval('P'.$this->shareApiInternalDefaultExpireDays().'D')); |
400 | 400 | } |
401 | 401 | |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | |
408 | 408 | $date = new \DateTime(); |
409 | 409 | $date->setTime(0, 0, 0); |
410 | - $date->add(new \DateInterval('P' . $this->shareApiInternalDefaultExpireDays() . 'D')); |
|
410 | + $date->add(new \DateInterval('P'.$this->shareApiInternalDefaultExpireDays().'D')); |
|
411 | 411 | if ($date < $expirationDate) { |
412 | 412 | $message = $this->l->t('Can’t set expiration date more than %s days in the future', [$this->shareApiInternalDefaultExpireDays()]); |
413 | 413 | throw new GenericShareException($message, $message, 404); |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | |
467 | 467 | if ($fullId === null && $expirationDate === null && $this->shareApiLinkDefaultExpireDate()) { |
468 | 468 | $expirationDate = new \DateTime(); |
469 | - $expirationDate->setTime(0,0,0); |
|
469 | + $expirationDate->setTime(0, 0, 0); |
|
470 | 470 | $expirationDate->add(new \DateInterval('P'.$this->shareApiLinkDefaultExpireDays().'D')); |
471 | 471 | } |
472 | 472 | |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | |
479 | 479 | $date = new \DateTime(); |
480 | 480 | $date->setTime(0, 0, 0); |
481 | - $date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D')); |
|
481 | + $date->add(new \DateInterval('P'.$this->shareApiLinkDefaultExpireDays().'D')); |
|
482 | 482 | if ($date < $expirationDate) { |
483 | 483 | $message = $this->l->t('Can’t set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]); |
484 | 484 | throw new GenericShareException($message, $message, 404); |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | } |
769 | 769 | |
770 | 770 | // Generate the target |
771 | - $target = $this->config->getSystemValue('share_folder', '/') .'/'. $share->getNode()->getName(); |
|
771 | + $target = $this->config->getSystemValue('share_folder', '/').'/'.$share->getNode()->getName(); |
|
772 | 772 | $target = \OC\Files\Filesystem::normalizePath($target); |
773 | 773 | $share->setTarget($target); |
774 | 774 | |
@@ -813,12 +813,12 @@ discard block |
||
813 | 813 | $emailAddress, |
814 | 814 | $share->getExpirationDate() |
815 | 815 | ); |
816 | - $this->logger->debug('Sent share notification to ' . $emailAddress . ' for share with ID ' . $share->getId(), ['app' => 'share']); |
|
816 | + $this->logger->debug('Sent share notification to '.$emailAddress.' for share with ID '.$share->getId(), ['app' => 'share']); |
|
817 | 817 | } else { |
818 | - $this->logger->debug('Share notification not sent to ' . $share->getSharedWith() . ' because email address is not set.', ['app' => 'share']); |
|
818 | + $this->logger->debug('Share notification not sent to '.$share->getSharedWith().' because email address is not set.', ['app' => 'share']); |
|
819 | 819 | } |
820 | 820 | } else { |
821 | - $this->logger->debug('Share notification not sent to ' . $share->getSharedWith() . ' because user could not be found.', ['app' => 'share']); |
|
821 | + $this->logger->debug('Share notification not sent to '.$share->getSharedWith().' because user could not be found.', ['app' => 'share']); |
|
822 | 822 | } |
823 | 823 | } else { |
824 | 824 | $this->logger->debug('Share notification not sent because mailsend is false.', ['app' => 'share']); |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | $text = $l->t('%1$s shared »%2$s« with you.', [$initiatorDisplayName, $filename]); |
866 | 866 | |
867 | 867 | $emailTemplate->addBodyText( |
868 | - htmlspecialchars($text . ' ' . $l->t('Click the button below to open it.')), |
|
868 | + htmlspecialchars($text.' '.$l->t('Click the button below to open it.')), |
|
869 | 869 | $text |
870 | 870 | ); |
871 | 871 | $emailTemplate->addBodyButton( |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | $initiatorEmail = $initiatorUser->getEMailAddress(); |
892 | 892 | if ($initiatorEmail !== null) { |
893 | 893 | $message->setReplyTo([$initiatorEmail => $initiatorDisplayName]); |
894 | - $emailTemplate->addFooter($instanceName . ($this->defaults->getSlogan($l->getLanguageCode()) !== '' ? ' - ' . $this->defaults->getSlogan($l->getLanguageCode()) : '')); |
|
894 | + $emailTemplate->addFooter($instanceName.($this->defaults->getSlogan($l->getLanguageCode()) !== '' ? ' - '.$this->defaults->getSlogan($l->getLanguageCode()) : '')); |
|
895 | 895 | } else { |
896 | 896 | $emailTemplate->addFooter('', $l->getLanguageCode()); |
897 | 897 | } |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | try { |
901 | 901 | $failedRecipients = $this->mailer->send($message); |
902 | 902 | if (!empty($failedRecipients)) { |
903 | - $this->logger->error('Share notification mail could not be sent to: ' . implode(', ', $failedRecipients)); |
|
903 | + $this->logger->error('Share notification mail could not be sent to: '.implode(', ', $failedRecipients)); |
|
904 | 904 | return; |
905 | 905 | } |
906 | 906 | } catch (\Exception $e) { |
@@ -1153,7 +1153,7 @@ discard block |
||
1153 | 1153 | * @param string $recipientId |
1154 | 1154 | */ |
1155 | 1155 | public function deleteFromSelf(\OCP\Share\IShare $share, $recipientId) { |
1156 | - list($providerId, ) = $this->splitFullId($share->getFullId()); |
|
1156 | + list($providerId,) = $this->splitFullId($share->getFullId()); |
|
1157 | 1157 | $provider = $this->factory->getProvider($providerId); |
1158 | 1158 | |
1159 | 1159 | $provider->deleteFromSelf($share, $recipientId); |
@@ -1162,7 +1162,7 @@ discard block |
||
1162 | 1162 | } |
1163 | 1163 | |
1164 | 1164 | public function restoreShare(IShare $share, string $recipientId): IShare { |
1165 | - list($providerId, ) = $this->splitFullId($share->getFullId()); |
|
1165 | + list($providerId,) = $this->splitFullId($share->getFullId()); |
|
1166 | 1166 | $provider = $this->factory->getProvider($providerId); |
1167 | 1167 | |
1168 | 1168 | return $provider->restore($share, $recipientId); |
@@ -1183,7 +1183,7 @@ discard block |
||
1183 | 1183 | if ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) { |
1184 | 1184 | $sharedWith = $this->groupManager->get($share->getSharedWith()); |
1185 | 1185 | if (is_null($sharedWith)) { |
1186 | - throw new \InvalidArgumentException('Group "' . $share->getSharedWith() . '" does not exist'); |
|
1186 | + throw new \InvalidArgumentException('Group "'.$share->getSharedWith().'" does not exist'); |
|
1187 | 1187 | } |
1188 | 1188 | $recipient = $this->userManager->get($recipientId); |
1189 | 1189 | if (!$sharedWith->inGroup($recipient)) { |
@@ -1191,7 +1191,7 @@ discard block |
||
1191 | 1191 | } |
1192 | 1192 | } |
1193 | 1193 | |
1194 | - list($providerId, ) = $this->splitFullId($share->getFullId()); |
|
1194 | + list($providerId,) = $this->splitFullId($share->getFullId()); |
|
1195 | 1195 | $provider = $this->factory->getProvider($providerId); |
1196 | 1196 | |
1197 | 1197 | $provider->move($share, $recipientId); |
@@ -1200,7 +1200,7 @@ discard block |
||
1200 | 1200 | public function getSharesInFolder($userId, Folder $node, $reshares = false) { |
1201 | 1201 | $providers = $this->factory->getAllProviders(); |
1202 | 1202 | |
1203 | - return array_reduce($providers, function ($shares, IShareProvider $provider) use ($userId, $node, $reshares) { |
|
1203 | + return array_reduce($providers, function($shares, IShareProvider $provider) use ($userId, $node, $reshares) { |
|
1204 | 1204 | $newShares = $provider->getSharesInFolder($userId, $node, $reshares); |
1205 | 1205 | foreach ($newShares as $fid => $data) { |
1206 | 1206 | if (!isset($shares[$fid])) { |
@@ -1317,12 +1317,12 @@ discard block |
||
1317 | 1317 | $shares = $this->getSharedWith($userId, $shareType, $node, $limit, $offset); |
1318 | 1318 | |
1319 | 1319 | // Only get deleted shares |
1320 | - $shares = array_filter($shares, function (IShare $share) { |
|
1320 | + $shares = array_filter($shares, function(IShare $share) { |
|
1321 | 1321 | return $share->getPermissions() === 0; |
1322 | 1322 | }); |
1323 | 1323 | |
1324 | 1324 | // Only get shares where the owner still exists |
1325 | - $shares = array_filter($shares, function (IShare $share) { |
|
1325 | + $shares = array_filter($shares, function(IShare $share) { |
|
1326 | 1326 | return $this->userManager->userExists($share->getShareOwner()); |
1327 | 1327 | }); |
1328 | 1328 | |
@@ -1361,7 +1361,7 @@ discard block |
||
1361 | 1361 | * |
1362 | 1362 | * @return Share[] |
1363 | 1363 | */ |
1364 | - public function getSharesByPath(\OCP\Files\Node $path, $page=0, $perPage=50) { |
|
1364 | + public function getSharesByPath(\OCP\Files\Node $path, $page = 0, $perPage = 50) { |
|
1365 | 1365 | return []; |
1366 | 1366 | } |
1367 | 1367 | |
@@ -1606,7 +1606,7 @@ discard block |
||
1606 | 1606 | } |
1607 | 1607 | $al['users'][$owner] = [ |
1608 | 1608 | 'node_id' => $path->getId(), |
1609 | - 'node_path' => '/' . $ownerPath, |
|
1609 | + 'node_path' => '/'.$ownerPath, |
|
1610 | 1610 | ]; |
1611 | 1611 | } else { |
1612 | 1612 | $al['users'][] = $owner; |
@@ -1706,7 +1706,7 @@ discard block |
||
1706 | 1706 | * @return int |
1707 | 1707 | */ |
1708 | 1708 | public function shareApiLinkDefaultExpireDays() { |
1709 | - return (int)$this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
1709 | + return (int) $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
1710 | 1710 | } |
1711 | 1711 | |
1712 | 1712 | /** |
@@ -1734,7 +1734,7 @@ discard block |
||
1734 | 1734 | * @return int |
1735 | 1735 | */ |
1736 | 1736 | public function shareApiInternalDefaultExpireDays(): int { |
1737 | - return (int)$this->config->getAppValue('core', 'shareapi_internal_expire_after_n_days', '7'); |
|
1737 | + return (int) $this->config->getAppValue('core', 'shareapi_internal_expire_after_n_days', '7'); |
|
1738 | 1738 | } |
1739 | 1739 | |
1740 | 1740 | /** |