diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-02 16:55:41 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-03 19:25:29 +0100 |
commit | 78be766cf543d738a3822a3cd614634acb7262d0 (patch) | |
tree | a1735fc055249aa046e65a6522a067dafcaa053b /lib/private/share20 | |
parent | c0322b3f983635ee3653a13837ae29e152e78803 (diff) | |
download | nextcloud-server-78be766cf543d738a3822a3cd614634acb7262d0.tar.gz nextcloud-server-78be766cf543d738a3822a3cd614634acb7262d0.zip |
[Share 2.0] Use strings for ids
* sharedWith
* sharedBy
* shareOwner
Now all set/get strings with the id. (userId, groupId,
federatedsharerId).
This to avoid a huge amount of if statements
Diffstat (limited to 'lib/private/share20')
-rw-r--r-- | lib/private/share20/share.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/share20/share.php b/lib/private/share20/share.php index f9cba10a07a..db91ad4a91d 100644 --- a/lib/private/share20/share.php +++ b/lib/private/share20/share.php @@ -121,6 +121,9 @@ class Share implements \OCP\Share\IShare { * @inheritdoc */ public function setSharedWith($sharedWith) { + if (!is_string($sharedWith)) { + throw new \InvalidArgumentException(); + } $this->sharedWith = $sharedWith; return $this; } @@ -170,6 +173,9 @@ class Share implements \OCP\Share\IShare { * @inheritdoc */ public function setSharedBy($sharedBy) { + if (!is_string($sharedBy)) { + throw new \InvalidArgumentException(); + } //TODO checks $this->sharedBy = $sharedBy; @@ -188,6 +194,9 @@ class Share implements \OCP\Share\IShare { * @inheritdoc */ public function setShareOwner($shareOwner) { + if (!is_string($shareOwner)) { + throw new \InvalidArgumentException(); + } //TODO checks $this->shareOwner = $shareOwner; |