@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | // Server not found or other issue, we consider it not trusted |
| 224 | 224 | $this->trustedServerCache[$remote] = false; |
| 225 | 225 | $this->logger->error( |
| 226 | - 'Error checking if remote server is trusted (treating as untrusted): ' . $e->getMessage(), |
|
| 226 | + 'Error checking if remote server is trusted (treating as untrusted): '.$e->getMessage(), |
|
| 227 | 227 | ['exception' => $e] |
| 228 | 228 | ); |
| 229 | 229 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | 'message' => $userStatus->getMessage(), |
| 254 | 254 | 'icon' => $userStatus->getIcon(), |
| 255 | 255 | 'clearAt' => $userStatus->getClearAt() |
| 256 | - ? (int)$userStatus->getClearAt()->format('U') |
|
| 256 | + ? (int) $userStatus->getClearAt()->format('U') |
|
| 257 | 257 | : null, |
| 258 | 258 | ]; |
| 259 | 259 | } |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | // "share_with" and "share_with_displayname" for passwords of link |
| 267 | 267 | // shares was deprecated in Nextcloud 15, use "password" instead. |
| 268 | 268 | $result['share_with'] = $share->getPassword(); |
| 269 | - $result['share_with_displayname'] = '(' . $this->l->t('Shared link') . ')'; |
|
| 269 | + $result['share_with_displayname'] = '('.$this->l->t('Shared link').')'; |
|
| 270 | 270 | |
| 271 | 271 | $result['password'] = $share->getPassword(); |
| 272 | 272 | |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | |
| 348 | 348 | $result['attributes'] = null; |
| 349 | 349 | if ($attributes = $share->getAttributes()) { |
| 350 | - $result['attributes'] = (string)\json_encode($attributes->toArray()); |
|
| 350 | + $result['attributes'] = (string) \json_encode($attributes->toArray()); |
|
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | return $result; |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | } else { |
| 651 | 651 | // Use default permissions only for non-link shares to keep legacy behavior |
| 652 | 652 | if ($permissions === null) { |
| 653 | - $permissions = (int)$this->config->getAppValue('core', 'shareapi_default_permissions', (string)Constants::PERMISSION_ALL); |
|
| 653 | + $permissions = (int) $this->config->getAppValue('core', 'shareapi_default_permissions', (string) Constants::PERMISSION_ALL); |
|
| 654 | 654 | } |
| 655 | 655 | // Non-link shares always require read permissions (link shares could be file drop) |
| 656 | 656 | $permissions |= Constants::PERMISSION_READ; |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | } catch (HintException $e) { |
| 838 | 838 | $code = $e->getCode() === 0 ? 403 : $e->getCode(); |
| 839 | 839 | throw new OCSException($e->getHint(), $code); |
| 840 | - } catch (GenericShareException|\InvalidArgumentException $e) { |
|
| 840 | + } catch (GenericShareException | \InvalidArgumentException $e) { |
|
| 841 | 841 | $this->logger->error($e->getMessage(), ['exception' => $e]); |
| 842 | 842 | throw new OCSForbiddenException($e->getMessage(), $e); |
| 843 | 843 | } catch (\Exception $e) { |
@@ -866,7 +866,7 @@ discard block |
||
| 866 | 866 | |
| 867 | 867 | $shares = array_merge($userShares, $groupShares, $circleShares, $roomShares, $deckShares, $sciencemeshShares); |
| 868 | 868 | |
| 869 | - $filteredShares = array_filter($shares, function (IShare $share) { |
|
| 869 | + $filteredShares = array_filter($shares, function(IShare $share) { |
|
| 870 | 870 | return $share->getShareOwner() !== $this->userId && $share->getSharedBy() !== $this->userId; |
| 871 | 871 | }); |
| 872 | 872 | |
@@ -903,7 +903,7 @@ discard block |
||
| 903 | 903 | $nodes = $folder->getDirectoryListing(); |
| 904 | 904 | |
| 905 | 905 | /** @var IShare[] $shares */ |
| 906 | - $shares = array_reduce($nodes, function ($carry, $node) { |
|
| 906 | + $shares = array_reduce($nodes, function($carry, $node) { |
|
| 907 | 907 | $carry = array_merge($carry, $this->getAllShares($node, true)); |
| 908 | 908 | return $carry; |
| 909 | 909 | }, []); |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | if (!$resharingRight && $this->shareProviderResharingRights($this->userId, $share, $node)) { |
| 1124 | 1124 | $resharingRight = true; |
| 1125 | 1125 | } |
| 1126 | - } catch (InvalidPathException|NotFoundException $e) { |
|
| 1126 | + } catch (InvalidPathException | NotFoundException $e) { |
|
| 1127 | 1127 | } |
| 1128 | 1128 | } |
| 1129 | 1129 | |
@@ -1399,7 +1399,7 @@ discard block |
||
| 1399 | 1399 | $share = $this->shareManager->updateShare($share); |
| 1400 | 1400 | } catch (HintException $e) { |
| 1401 | 1401 | $code = $e->getCode() === 0 ? 403 : $e->getCode(); |
| 1402 | - throw new OCSException($e->getHint(), (int)$code); |
|
| 1402 | + throw new OCSException($e->getHint(), (int) $code); |
|
| 1403 | 1403 | } catch (\Exception $e) { |
| 1404 | 1404 | $this->logger->error($e->getMessage(), ['exception' => $e]); |
| 1405 | 1405 | throw new OCSBadRequestException('Failed to update share.', $e); |
@@ -1444,7 +1444,7 @@ discard block |
||
| 1444 | 1444 | } |
| 1445 | 1445 | } |
| 1446 | 1446 | |
| 1447 | - $result = array_values(array_filter(array_map(function (IShare $share) { |
|
| 1447 | + $result = array_values(array_filter(array_map(function(IShare $share) { |
|
| 1448 | 1448 | $userFolder = $this->rootFolder->getUserFolder($share->getSharedBy()); |
| 1449 | 1449 | $node = $userFolder->getFirstNodeById($share->getNodeId()); |
| 1450 | 1450 | if (!$node) { |
@@ -1457,13 +1457,13 @@ discard block |
||
| 1457 | 1457 | |
| 1458 | 1458 | try { |
| 1459 | 1459 | $formattedShare = $this->formatShare($share, $node); |
| 1460 | - $formattedShare['path'] = '/' . $share->getNode()->getName(); |
|
| 1460 | + $formattedShare['path'] = '/'.$share->getNode()->getName(); |
|
| 1461 | 1461 | $formattedShare['permissions'] = 0; |
| 1462 | 1462 | return $formattedShare; |
| 1463 | 1463 | } catch (NotFoundException $e) { |
| 1464 | 1464 | return null; |
| 1465 | 1465 | } |
| 1466 | - }, $pendingShares), function ($entry) { |
|
| 1466 | + }, $pendingShares), function($entry) { |
|
| 1467 | 1467 | return $entry !== null; |
| 1468 | 1468 | })); |
| 1469 | 1469 | |
@@ -1497,7 +1497,7 @@ discard block |
||
| 1497 | 1497 | $this->shareManager->acceptShare($share, $this->userId); |
| 1498 | 1498 | } catch (HintException $e) { |
| 1499 | 1499 | $code = $e->getCode() === 0 ? 403 : $e->getCode(); |
| 1500 | - throw new OCSException($e->getHint(), (int)$code); |
|
| 1500 | + throw new OCSException($e->getHint(), (int) $code); |
|
| 1501 | 1501 | } catch (\Exception $e) { |
| 1502 | 1502 | $this->logger->error($e->getMessage(), ['exception' => $e]); |
| 1503 | 1503 | throw new OCSBadRequestException('Failed to accept share.', $e); |
@@ -1765,7 +1765,7 @@ discard block |
||
| 1765 | 1765 | foreach ($providers as $prefix => $type) { |
| 1766 | 1766 | try { |
| 1767 | 1767 | if ($type === null || $this->shareManager->shareProviderExists($type)) { |
| 1768 | - return $this->shareManager->getShareById($prefix . ':' . $id, $this->userId); |
|
| 1768 | + return $this->shareManager->getShareById($prefix.':'.$id, $this->userId); |
|
| 1769 | 1769 | } |
| 1770 | 1770 | } catch (ShareNotFound $e) { |
| 1771 | 1771 | // Do nothing, continue to next provider |
@@ -1931,7 +1931,7 @@ discard block |
||
| 1931 | 1931 | if ($this->shareProviderResharingRights($viewer, $share, $node)) { |
| 1932 | 1932 | return true; |
| 1933 | 1933 | } |
| 1934 | - } catch (InvalidPathException|NotFoundException $e) { |
|
| 1934 | + } catch (InvalidPathException | NotFoundException $e) { |
|
| 1935 | 1935 | } |
| 1936 | 1936 | } |
| 1937 | 1937 | } |