diff options
author | Joas Schilling <coding@schilljs.com> | 2017-02-23 10:37:49 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-04-20 10:44:11 +0200 |
commit | 088f4422f904cf95ec66e897ce0f3d1daf482ca4 (patch) | |
tree | aeae2ffd25a9810e1729e45d61b129ad7c41587d /apps/dav/lib/CalDAV | |
parent | 62ef59616df68ba4d7cf1df57008b60e13049483 (diff) | |
download | nextcloud-server-088f4422f904cf95ec66e897ce0f3d1daf482ca4.tar.gz nextcloud-server-088f4422f904cf95ec66e897ce0f3d1daf482ca4.zip |
Fix remaining "PHP Inspection" warnings
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/lib/CalDAV')
-rw-r--r-- | apps/dav/lib/CalDAV/Calendar.php | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php index 696bbf20a41..a216e4e078b 100644 --- a/apps/dav/lib/CalDAV/Calendar.php +++ b/apps/dav/lib/CalDAV/Calendar.php @@ -30,6 +30,12 @@ use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\Exception\NotFound; use Sabre\DAV\PropPatch; +/** + * Class Calendar + * + * @package OCA\DAV\CalDAV + * @property BackendInterface|CalDavBackend $caldavBackend + */ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { public function __construct(BackendInterface $caldavBackend, $calendarInfo, IL10N $l10n) { @@ -67,9 +73,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { if ($this->isShared()) { throw new Forbidden(); } - /** @var CalDavBackend $calDavBackend */ - $calDavBackend = $this->caldavBackend; - $calDavBackend->updateShares($this, $add, $remove); + $this->caldavBackend->updateShares($this, $add, $remove); } /** @@ -88,9 +92,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { if ($this->isShared()) { return []; } - /** @var CalDavBackend $calDavBackend */ - $calDavBackend = $this->caldavBackend; - return $calDavBackend->getShares($this->getResourceId()); + return $this->caldavBackend->getShares($this->getResourceId()); } /** @@ -147,9 +149,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { return $acl; } - /** @var CalDavBackend $calDavBackend */ - $calDavBackend = $this->caldavBackend; - return $calDavBackend->applyShareAcl($this->getResourceId(), $acl); + return $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl); } public function getChildACL() { @@ -175,9 +175,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { throw new Forbidden(); } - /** @var CalDavBackend $calDavBackend */ - $calDavBackend = $this->caldavBackend; - $calDavBackend->updateShares($this, [], [ + $this->caldavBackend->updateShares($this, [], [ 'href' => $principal ]); return; @@ -201,7 +199,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { throw new NotFound('Calendar object not found'); } - if ($this->isShared() && $obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { + if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) { throw new NotFound('Calendar object not found'); } @@ -216,7 +214,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { $objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id']); $children = []; foreach ($objs as $obj) { - if ($this->isShared() && $obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { + if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) { continue; } $obj['acl'] = $this->getChildACL(); @@ -231,7 +229,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { $objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths); $children = []; foreach ($objs as $obj) { - if ($this->isShared() && $obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { + if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) { continue; } $obj['acl'] = $this->getChildACL(); @@ -246,7 +244,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { if (!$obj) { return false; } - if ($this->isShared() && $obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { + if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) { return false; } |