diff options
author | Joas Schilling <coding@schilljs.com> | 2019-09-27 15:19:08 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-10-01 09:25:18 +0200 |
commit | c975f6af6ab6956aee852dbaaaa3a28c9790249f (patch) | |
tree | f2deb50dac7a6a475515fd706760afadf1e5458f /lib | |
parent | 9c6415cf6ae2afad08922aa884aa5397a4025545 (diff) |
Don't use deprecated constants and dont count if !empty is enough
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Files/Util.php | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/Files/Util.php b/lib/Files/Util.php index c4dc0af10..3789ca37e 100644 --- a/lib/Files/Util.php +++ b/lib/Files/Util.php @@ -156,13 +156,13 @@ class Util { $reshares = false; $limit = 1; - $shares = $this->shareManager->getSharesBy($userId, \OCP\Share::SHARE_TYPE_LINK, $node, $reshares, $limit); - if (\count($shares) > 0) { + $shares = $this->shareManager->getSharesBy($userId, IShare::TYPE_LINK, $node, $reshares, $limit); + if (!empty($shares)) { return $shares[0]; } - $shares = $this->shareManager->getSharesBy($userId, \OCP\Share::SHARE_TYPE_EMAIL, $node, $reshares, $limit); - if (\count($shares) > 0) { + $shares = $this->shareManager->getSharesBy($userId, IShare::TYPE_EMAIL, $node, $reshares, $limit); + if (!empty($shares)) { return $shares[0]; } @@ -180,23 +180,23 @@ class Util { $reshares = false; $limit = 1; - $shares = $this->shareManager->getSharesBy($userId, \OCP\Share::SHARE_TYPE_USER, $node, $reshares, $limit); - if (\count($shares) > 0) { + $shares = $this->shareManager->getSharesBy($userId, IShare::TYPE_USER, $node, $reshares, $limit); + if (!empty($shares)) { return $shares[0]; } - $shares = $this->shareManager->getSharesBy($userId, \OCP\Share::SHARE_TYPE_GROUP, $node, $reshares, $limit); - if (\count($shares) > 0) { + $shares = $this->shareManager->getSharesBy($userId, IShare::TYPE_GROUP, $node, $reshares, $limit); + if (!empty($shares)) { return $shares[0]; } - $shares = $this->shareManager->getSharesBy($userId, \OCP\Share::SHARE_TYPE_CIRCLE, $node, $reshares, $limit); - if (\count($shares) > 0) { + $shares = $this->shareManager->getSharesBy($userId, IShare::TYPE_CIRCLE, $node, $reshares, $limit); + if (!empty($shares)) { return $shares[0]; } - $shares = $this->shareManager->getSharesBy($userId, \OCP\Share::SHARE_TYPE_ROOM, $node, $reshares, $limit); - if (\count($shares) > 0) { + $shares = $this->shareManager->getSharesBy($userId, IShare::TYPE_ROOM, $node, $reshares, $limit); + if (!empty($shares)) { return $shares[0]; } @@ -207,23 +207,23 @@ class Util { return null; } - $shares = $this->shareManager->getSharedWith($userId, \OCP\Share::SHARE_TYPE_USER, $node, $limit); - if (\count($shares) > 0) { + $shares = $this->shareManager->getSharedWith($userId, IShare::TYPE_USER, $node, $limit); + if (!empty($shares)) { return $shares[0]; } - $shares = $this->shareManager->getSharedWith($userId, \OCP\Share::SHARE_TYPE_GROUP, $node, $limit); - if (\count($shares) > 0) { + $shares = $this->shareManager->getSharedWith($userId, IShare::TYPE_GROUP, $node, $limit); + if (!empty($shares)) { return $shares[0]; } - $shares = $this->shareManager->getSharedWith($userId, \OCP\Share::SHARE_TYPE_CIRCLE, $node, $limit); - if (\count($shares) > 0) { + $shares = $this->shareManager->getSharedWith($userId, IShare::TYPE_CIRCLE, $node, $limit); + if (!empty($shares)) { return $shares[0]; } - $shares = $this->shareManager->getSharedWith($userId, \OCP\Share::SHARE_TYPE_ROOM, $node, $limit); - if (\count($shares) > 0) { + $shares = $this->shareManager->getSharedWith($userId, IShare::TYPE_ROOM, $node, $limit); + if (!empty($shares)) { return $shares[0]; } |