@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | /** |
4 | 4 | * @copyright Copyright (c) 2016, ownCloud, Inc. |
5 | 5 | * |
@@ -212,11 +212,11 @@ discard block |
||
212 | 212 | // "name (type, owner) [id]", depending on the Circles app version. |
213 | 213 | $hasCircleId = (substr($share->getSharedWith(), -1) === ']'); |
214 | 214 | |
215 | - $displayNameLength = ($hasCircleId? strrpos($share->getSharedWith(), ' '): strlen($share->getSharedWith())); |
|
215 | + $displayNameLength = ($hasCircleId ? strrpos($share->getSharedWith(), ' ') : strlen($share->getSharedWith())); |
|
216 | 216 | $result['share_with_displayname'] = substr($share->getSharedWith(), 0, $displayNameLength); |
217 | 217 | |
218 | - $shareWithStart = ($hasCircleId? strrpos($share->getSharedWith(), '[') + 1: 0); |
|
219 | - $shareWithLength = ($hasCircleId? -1: strpos($share->getSharedWith(), ' ')); |
|
218 | + $shareWithStart = ($hasCircleId ? strrpos($share->getSharedWith(), '[') + 1 : 0); |
|
219 | + $shareWithLength = ($hasCircleId ? -1 : strpos($share->getSharedWith(), ' ')); |
|
220 | 220 | $result['share_with'] = substr($share->getSharedWith(), $shareWithStart, $shareWithLength); |
221 | 221 | } |
222 | 222 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | // FIXME: If we inject the contacts manager it gets initialized bofore any address books are registered |
239 | 239 | $result = \OC::$server->getContactsManager()->search($query, [$property]); |
240 | 240 | foreach ($result as $r) { |
241 | - foreach($r[$property] as $value) { |
|
241 | + foreach ($r[$property] as $value) { |
|
242 | 242 | if ($value === $query) { |
243 | 243 | return $r['FN']; |
244 | 244 | } |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | |
520 | 520 | $shares = array_merge($userShares, $groupShares, $circleShares); |
521 | 521 | |
522 | - $shares = array_filter($shares, function (IShare $share) { |
|
522 | + $shares = array_filter($shares, function(IShare $share) { |
|
523 | 523 | return $share->getShareOwner() !== $this->currentUser; |
524 | 524 | }); |
525 | 525 | |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_USER, $node, false, -1, 0)); |
559 | 559 | $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_GROUP, $node, false, -1, 0)); |
560 | 560 | $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_LINK, $node, false, -1, 0)); |
561 | - if($this->shareManager->shareProviderExists(\OCP\Share::SHARE_TYPE_EMAIL)) { |
|
561 | + if ($this->shareManager->shareProviderExists(\OCP\Share::SHARE_TYPE_EMAIL)) { |
|
562 | 562 | $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_EMAIL, $node, false, -1, 0)); |
563 | 563 | } |
564 | 564 | if ($this->shareManager->outgoingServer2ServerSharesAllowed()) { |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | } |
721 | 721 | |
722 | 722 | if ($permissions !== null) { |
723 | - $newPermissions = (int)$permissions; |
|
723 | + $newPermissions = (int) $permissions; |
|
724 | 724 | $newPermissions = $newPermissions & ~Constants::PERMISSION_SHARE; |
725 | 725 | } |
726 | 726 | |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | |
779 | 779 | } else { |
780 | 780 | if ($permissions !== null) { |
781 | - $permissions = (int)$permissions; |
|
781 | + $permissions = (int) $permissions; |
|
782 | 782 | $share->setPermissions($permissions); |
783 | 783 | } |
784 | 784 | |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | |
907 | 907 | // First check if it is an internal share. |
908 | 908 | try { |
909 | - $share = $this->shareManager->getShareById('ocinternal:' . $id); |
|
909 | + $share = $this->shareManager->getShareById('ocinternal:'.$id); |
|
910 | 910 | return $share; |
911 | 911 | } catch (ShareNotFound $e) { |
912 | 912 | // Do nothing, just try the other share type |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | |
916 | 916 | try { |
917 | 917 | if ($this->shareManager->shareProviderExists(\OCP\Share::SHARE_TYPE_CIRCLE)) { |
918 | - $share = $this->shareManager->getShareById('ocCircleShare:' . $id); |
|
918 | + $share = $this->shareManager->getShareById('ocCircleShare:'.$id); |
|
919 | 919 | return $share; |
920 | 920 | } |
921 | 921 | } catch (ShareNotFound $e) { |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | |
925 | 925 | try { |
926 | 926 | if ($this->shareManager->shareProviderExists(\OCP\Share::SHARE_TYPE_EMAIL)) { |
927 | - $share = $this->shareManager->getShareById('ocMailShare:' . $id); |
|
927 | + $share = $this->shareManager->getShareById('ocMailShare:'.$id); |
|
928 | 928 | return $share; |
929 | 929 | } |
930 | 930 | } catch (ShareNotFound $e) { |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | if (!$this->shareManager->outgoingServer2ServerSharesAllowed()) { |
935 | 935 | throw new ShareNotFound(); |
936 | 936 | } |
937 | - $share = $this->shareManager->getShareById('ocFederatedSharing:' . $id); |
|
937 | + $share = $this->shareManager->getShareById('ocFederatedSharing:'.$id); |
|
938 | 938 | |
939 | 939 | return $share; |
940 | 940 | } |