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) --- .../sabre/dav/lib/CalDAV/Principal/Collection.php | 17 ++-- .../sabre/dav/lib/CalDAV/Principal/IProxyRead.php | 8 +- .../sabre/dav/lib/CalDAV/Principal/IProxyWrite.php | 8 +- .../sabre/dav/lib/CalDAV/Principal/ProxyRead.php | 95 +++++++++------------ .../sabre/dav/lib/CalDAV/Principal/ProxyWrite.php | 99 +++++++++------------- vendor/sabre/dav/lib/CalDAV/Principal/User.php | 83 +++++++++--------- 6 files changed, 143 insertions(+), 167 deletions(-) (limited to 'vendor/sabre/dav/lib/CalDAV/Principal') diff --git a/vendor/sabre/dav/lib/CalDAV/Principal/Collection.php b/vendor/sabre/dav/lib/CalDAV/Principal/Collection.php index e19719a76..cae29c752 100644 --- a/vendor/sabre/dav/lib/CalDAV/Principal/Collection.php +++ b/vendor/sabre/dav/lib/CalDAV/Principal/Collection.php @@ -1,11 +1,13 @@ principalBackend, $principalInfo); - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Principal/IProxyRead.php b/vendor/sabre/dav/lib/CalDAV/Principal/IProxyRead.php index 7dd375932..96e6991c5 100644 --- a/vendor/sabre/dav/lib/CalDAV/Principal/IProxyRead.php +++ b/vendor/sabre/dav/lib/CalDAV/Principal/IProxyRead.php @@ -1,11 +1,13 @@ principalInfo = $principalInfo; $this->principalBackend = $principalBackend; - } /** @@ -52,103 +53,91 @@ class ProxyRead implements IProxyRead { * * @return string */ - function getName() { - + public function getName() + { return 'calendar-proxy-read'; - } /** - * Returns the last modification time - * - * @return null + * Returns the last modification time. */ - function getLastModified() { - + public function getLastModified() + { return null; - } /** - * Deletes the current node + * Deletes the current node. * * @throws DAV\Exception\Forbidden - * @return void */ - function delete() { - + public function delete() + { throw new DAV\Exception\Forbidden('Permission denied to delete node'); - } /** - * Renames the node + * Renames the node. * * @param string $name The new name + * * @throws DAV\Exception\Forbidden - * @return void */ - function setName($name) { - + public function setName($name) + { throw new DAV\Exception\Forbidden('Permission denied to rename file'); - } - /** - * Returns a list of alternative urls for a principal + * Returns a list of alternative urls for a principal. * * This can for example be an email address, or ldap url. * * @return array */ - function getAlternateUriSet() { - + public function getAlternateUriSet() + { return []; - } /** - * Returns the full principal url + * Returns the full principal url. * * @return string */ - function getPrincipalUrl() { - - return $this->principalInfo['uri'] . '/' . $this->getName(); - + public function getPrincipalUrl() + { + return $this->principalInfo['uri'].'/'.$this->getName(); } /** - * Returns the list of group members + * Returns the list of group members. * * If this principal is a group, this function should return * all member principal uri's for the group. * * @return array */ - function getGroupMemberSet() { - + public function getGroupMemberSet() + { return $this->principalBackend->getGroupMemberSet($this->getPrincipalUrl()); - } /** - * Returns the list of groups this principal is member of + * Returns the list of groups this principal is member of. * * If this principal is a member of a (list of) groups, this function * should return a list of principal uri's for it's members. * * @return array */ - function getGroupMembership() { - + public function getGroupMembership() + { return $this->principalBackend->getGroupMembership($this->getPrincipalUrl()); - } /** - * Sets a list of group members + * Sets a list of group members. * * If this principal is a group, this method sets all the group members. * The list of members is always overwritten, never appended to. @@ -156,26 +145,22 @@ class ProxyRead implements IProxyRead { * This method should throw an exception if the members could not be set. * * @param array $principals - * @return void */ - function setGroupMemberSet(array $principals) { - + public function setGroupMemberSet(array $principals) + { $this->principalBackend->setGroupMemberSet($this->getPrincipalUrl(), $principals); - } /** - * Returns the displayname + * Returns the displayname. * * This should be a human readable name for the principal. * If none is available, return the nodename. * * @return string */ - function getDisplayName() { - + public function getDisplayName() + { return $this->getName(); - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Principal/ProxyWrite.php b/vendor/sabre/dav/lib/CalDAV/Principal/ProxyWrite.php index 43dd9bf07..7b9c78e0a 100644 --- a/vendor/sabre/dav/lib/CalDAV/Principal/ProxyWrite.php +++ b/vendor/sabre/dav/lib/CalDAV/Principal/ProxyWrite.php @@ -1,12 +1,14 @@ principalInfo = $principalInfo; $this->principalBackend = $principalBackend; - } /** @@ -52,103 +53,91 @@ class ProxyWrite implements IProxyWrite { * * @return string */ - function getName() { - + public function getName() + { return 'calendar-proxy-write'; - } /** - * Returns the last modification time - * - * @return null + * Returns the last modification time. */ - function getLastModified() { - + public function getLastModified() + { return null; - } /** - * Deletes the current node + * Deletes the current node. * * @throws DAV\Exception\Forbidden - * @return void */ - function delete() { - + public function delete() + { throw new DAV\Exception\Forbidden('Permission denied to delete node'); - } /** - * Renames the node + * Renames the node. * * @param string $name The new name + * * @throws DAV\Exception\Forbidden - * @return void */ - function setName($name) { - + public function setName($name) + { throw new DAV\Exception\Forbidden('Permission denied to rename file'); - } - /** - * Returns a list of alternative urls for a principal + * Returns a list of alternative urls for a principal. * * This can for example be an email address, or ldap url. * * @return array */ - function getAlternateUriSet() { - + public function getAlternateUriSet() + { return []; - } /** - * Returns the full principal url + * Returns the full principal url. * * @return string */ - function getPrincipalUrl() { - - return $this->principalInfo['uri'] . '/' . $this->getName(); - + public function getPrincipalUrl() + { + return $this->principalInfo['uri'].'/'.$this->getName(); } /** - * Returns the list of group members + * Returns the list of group members. * * If this principal is a group, this function should return * all member principal uri's for the group. * * @return array */ - function getGroupMemberSet() { - + public function getGroupMemberSet() + { return $this->principalBackend->getGroupMemberSet($this->getPrincipalUrl()); - } /** - * Returns the list of groups this principal is member of + * Returns the list of groups this principal is member of. * * If this principal is a member of a (list of) groups, this function * should return a list of principal uri's for it's members. * * @return array */ - function getGroupMembership() { - + public function getGroupMembership() + { return $this->principalBackend->getGroupMembership($this->getPrincipalUrl()); - } /** - * Sets a list of group members + * Sets a list of group members. * * If this principal is a group, this method sets all the group members. * The list of members is always overwritten, never appended to. @@ -156,26 +145,22 @@ class ProxyWrite implements IProxyWrite { * This method should throw an exception if the members could not be set. * * @param array $principals - * @return void */ - function setGroupMemberSet(array $principals) { - + public function setGroupMemberSet(array $principals) + { $this->principalBackend->setGroupMemberSet($this->getPrincipalUrl(), $principals); - } /** - * Returns the displayname + * Returns the displayname. * * This should be a human readable name for the principal. * If none is available, return the nodename. * * @return string */ - function getDisplayName() { - + public function getDisplayName() + { return $this->getName(); - } - } 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