aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/lib/CalDAV/Principal
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-11-10 12:49:51 +0000
committerMario <mario@mariovavti.com>2019-11-10 14:10:03 +0100
commit580c3f4ffe9608d2beb56d418c68b3b112420e76 (patch)
tree82335d01179ac361d3f547a4b8e8c598d302e9f3 /vendor/sabre/dav/lib/CalDAV/Principal
parentd22766f458a8539a40a57f3946459a9be1f21cd6 (diff)
downloadvolse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.gz
volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.bz2
volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.zip
another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
Diffstat (limited to 'vendor/sabre/dav/lib/CalDAV/Principal')
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Principal/Collection.php17
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Principal/IProxyRead.php8
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Principal/IProxyWrite.php8
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Principal/ProxyRead.php95
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Principal/ProxyWrite.php99
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Principal/User.php83
6 files changed, 143 insertions, 167 deletions
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 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Principal;
use Sabre\DAVACL;
/**
- * Principal collection
+ * Principal collection.
*
* This is an alternative collection to the standard ACL principal collection.
* This collection adds support for the calendar-proxy-read and
@@ -16,18 +18,17 @@ use Sabre\DAVACL;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class Collection extends DAVACL\PrincipalCollection {
-
+class Collection extends DAVACL\PrincipalCollection
+{
/**
- * Returns a child object based on principal information
+ * Returns a child object based on principal information.
*
* @param array $principalInfo
+ *
* @return User
*/
- function getChildForPrincipal(array $principalInfo) {
-
+ public function getChildForPrincipal(array $principalInfo)
+ {
return new User($this->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 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Principal;
use Sabre\DAVACL;
/**
- * ProxyRead principal interface
+ * ProxyRead principal interface.
*
* Any principal node implementing this interface will be picked up as a 'proxy
* principal group'.
@@ -14,6 +16,6 @@ use Sabre\DAVACL;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-interface IProxyRead extends DAVACL\IPrincipal {
-
+interface IProxyRead extends DAVACL\IPrincipal
+{
}
diff --git a/vendor/sabre/dav/lib/CalDAV/Principal/IProxyWrite.php b/vendor/sabre/dav/lib/CalDAV/Principal/IProxyWrite.php
index eda87a4ff..2556039ca 100644
--- a/vendor/sabre/dav/lib/CalDAV/Principal/IProxyWrite.php
+++ b/vendor/sabre/dav/lib/CalDAV/Principal/IProxyWrite.php
@@ -1,11 +1,13 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Principal;
use Sabre\DAVACL;
/**
- * ProxyWrite principal interface
+ * ProxyWrite principal interface.
*
* Any principal node implementing this interface will be picked up as a 'proxy
* principal group'.
@@ -14,6 +16,6 @@ use Sabre\DAVACL;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-interface IProxyWrite extends DAVACL\IPrincipal {
-
+interface IProxyWrite extends DAVACL\IPrincipal
+{
}
diff --git a/vendor/sabre/dav/lib/CalDAV/Principal/ProxyRead.php b/vendor/sabre/dav/lib/CalDAV/Principal/ProxyRead.php
index e3881831e..1b24984bd 100644
--- a/vendor/sabre/dav/lib/CalDAV/Principal/ProxyRead.php
+++ b/vendor/sabre/dav/lib/CalDAV/Principal/ProxyRead.php
@@ -1,12 +1,14 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Principal;
use Sabre\DAV;
use Sabre\DAVACL;
/**
- * ProxyRead principal
+ * ProxyRead principal.
*
* This class represents a principal group, hosted under the main principal.
* This is needed to implement 'Calendar delegation' support. This class is
@@ -16,8 +18,8 @@ use Sabre\DAVACL;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class ProxyRead implements IProxyRead {
-
+class ProxyRead implements IProxyRead
+{
/**
* Principal information from the parent principal.
*
@@ -26,7 +28,7 @@ class ProxyRead implements IProxyRead {
protected $principalInfo;
/**
- * Principal backend
+ * Principal backend.
*
* @var DAVACL\PrincipalBackend\BackendInterface
*/
@@ -38,13 +40,12 @@ class ProxyRead implements IProxyRead {
* Note that you MUST supply the parent principal information.
*
* @param DAVACL\PrincipalBackend\BackendInterface $principalBackend
- * @param array $principalInfo
+ * @param array $principalInfo
*/
- function __construct(DAVACL\PrincipalBackend\BackendInterface $principalBackend, array $principalInfo) {
-
+ public function __construct(DAVACL\PrincipalBackend\BackendInterface $principalBackend, array $principalInfo)
+ {
$this->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 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Principal;
use Sabre\DAV;
use Sabre\DAVACL;
/**
- * ProxyWrite principal
+ * ProxyWrite principal.
*
* This class represents a principal group, hosted under the main principal.
* This is needed to implement 'Calendar delegation' support. This class is
@@ -16,35 +18,34 @@ use Sabre\DAVACL;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class ProxyWrite implements IProxyWrite {
-
+class ProxyWrite implements IProxyWrite
+{
/**
- * Parent principal information
+ * Parent principal information.
*
* @var array
*/
protected $principalInfo;
/**
- * Principal Backend
+ * Principal Backend.
*
* @var DAVACL\PrincipalBackend\BackendInterface
*/
protected $principalBackend;
/**
- * Creates the object
+ * Creates the object.
*
* Note that you MUST supply the parent principal information.
*
* @param DAVACL\PrincipalBackend\BackendInterface $principalBackend
- * @param array $principalInfo
+ * @param array $principalInfo
*/
- function __construct(DAVACL\PrincipalBackend\BackendInterface $principalBackend, array $principalInfo) {
-
+ public function __construct(DAVACL\PrincipalBackend\BackendInterface $principalBackend, array $principalInfo)
+ {
$this->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 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Principal;
use Sabre\DAV;
use Sabre\DAVACL;
/**
- * CalDAV principal
+ * CalDAV principal.
*
* This is a standard user-principal for CalDAV. This principal is also a
* collection and returns the caldav-proxy-read and caldav-proxy-write child
@@ -16,91 +18,91 @@ use Sabre\DAVACL;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class User extends DAVACL\Principal implements DAV\ICollection {
-
+class User extends DAVACL\Principal implements DAV\ICollection
+{
/**
- * Creates a new file in the directory
+ * Creates a new file in the directory.
+ *
+ * @param string $name Name of the file
+ * @param resource $data initial payload, passed as a readable stream resource
*
- * @param string $name Name of the file
- * @param resource $data Initial payload, passed as a readable stream resource.
* @throws DAV\Exception\Forbidden
- * @return void
*/
- function createFile($name, $data = null) {
-
- throw new DAV\Exception\Forbidden('Permission denied to create file (filename ' . $name . ')');
-
+ public function createFile($name, $data = null)
+ {
+ throw new DAV\Exception\Forbidden('Permission denied to create file (filename '.$name.')');
}
/**
- * Creates a new subdirectory
+ * Creates a new subdirectory.
*
* @param string $name
+ *
* @throws DAV\Exception\Forbidden
- * @return void
*/
- function createDirectory($name) {
-
+ public function createDirectory($name)
+ {
throw new DAV\Exception\Forbidden('Permission denied to create directory');
-
}
/**
- * Returns a specific child node, referenced by its name
+ * Returns a specific child node, referenced by its name.
*
* @param string $name
+ *
* @return DAV\INode
*/
- function getChild($name) {
-
- $principal = $this->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;
}
-
}