From 580c3f4ffe9608d2beb56d418c68b3b112420e76 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 10 Nov 2019 12:49:51 +0000 Subject: another bulk of composer updates (cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce) --- vendor/sabre/dav/lib/CalDAV/Principal/User.php | 83 +++++++++++++------------- 1 file changed, 42 insertions(+), 41 deletions(-) (limited to 'vendor/sabre/dav/lib/CalDAV/Principal/User.php') diff --git a/vendor/sabre/dav/lib/CalDAV/Principal/User.php b/vendor/sabre/dav/lib/CalDAV/Principal/User.php index 6e97e7cca..88bf4b4f7 100644 --- a/vendor/sabre/dav/lib/CalDAV/Principal/User.php +++ b/vendor/sabre/dav/lib/CalDAV/Principal/User.php @@ -1,12 +1,14 @@ principalBackend->getPrincipalByPath($this->getPrincipalURL() . '/' . $name); + public function getChild($name) + { + $principal = $this->principalBackend->getPrincipalByPath($this->getPrincipalURL().'/'.$name); if (!$principal) { - throw new DAV\Exception\NotFound('Node with name ' . $name . ' was not found'); + throw new DAV\Exception\NotFound('Node with name '.$name.' was not found'); } - if ($name === 'calendar-proxy-read') + if ('calendar-proxy-read' === $name) { return new ProxyRead($this->principalBackend, $this->principalProperties); + } - if ($name === 'calendar-proxy-write') + if ('calendar-proxy-write' === $name) { return new ProxyWrite($this->principalBackend, $this->principalProperties); + } - throw new DAV\Exception\NotFound('Node with name ' . $name . ' was not found'); - + throw new DAV\Exception\NotFound('Node with name '.$name.' was not found'); } /** - * Returns an array with all the child nodes + * Returns an array with all the child nodes. * * @return DAV\INode[] */ - function getChildren() { - + public function getChildren() + { $r = []; - if ($this->principalBackend->getPrincipalByPath($this->getPrincipalURL() . '/calendar-proxy-read')) { + if ($this->principalBackend->getPrincipalByPath($this->getPrincipalURL().'/calendar-proxy-read')) { $r[] = new ProxyRead($this->principalBackend, $this->principalProperties); } - if ($this->principalBackend->getPrincipalByPath($this->getPrincipalURL() . '/calendar-proxy-write')) { + if ($this->principalBackend->getPrincipalByPath($this->getPrincipalURL().'/calendar-proxy-write')) { $r[] = new ProxyWrite($this->principalBackend, $this->principalProperties); } return $r; - } /** - * Returns whether or not the child node exists + * Returns whether or not the child node exists. * * @param string $name + * * @return bool */ - function childExists($name) { - + public function childExists($name) + { try { $this->getChild($name); + return true; } catch (DAV\Exception\NotFound $e) { return false; } - } /** @@ -115,21 +117,20 @@ class User extends DAVACL\Principal implements DAV\ICollection { * * @return array */ - function getACL() { - + public function getACL() + { $acl = parent::getACL(); $acl[] = [ 'privilege' => '{DAV:}read', - 'principal' => $this->principalProperties['uri'] . '/calendar-proxy-read', + 'principal' => $this->principalProperties['uri'].'/calendar-proxy-read', 'protected' => true, ]; $acl[] = [ 'privilege' => '{DAV:}read', - 'principal' => $this->principalProperties['uri'] . '/calendar-proxy-write', + 'principal' => $this->principalProperties['uri'].'/calendar-proxy-write', 'protected' => true, ]; - return $acl; + return $acl; } - } -- cgit v1.2.3