aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/lib/CalDAV/Subscriptions
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/lib/CalDAV/Subscriptions')
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Subscriptions/ISubscription.php9
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Subscriptions/Plugin.php43
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php86
3 files changed, 60 insertions, 78 deletions
diff --git a/vendor/sabre/dav/lib/CalDAV/Subscriptions/ISubscription.php b/vendor/sabre/dav/lib/CalDAV/Subscriptions/ISubscription.php
index 7ba259c7b..e83082c52 100644
--- a/vendor/sabre/dav/lib/CalDAV/Subscriptions/ISubscription.php
+++ b/vendor/sabre/dav/lib/CalDAV/Subscriptions/ISubscription.php
@@ -1,12 +1,14 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Subscriptions;
use Sabre\DAV\ICollection;
use Sabre\DAV\IProperties;
/**
- * ISubscription
+ * ISubscription.
*
* Nodes implementing this interface represent calendar subscriptions.
*
@@ -34,7 +36,6 @@ use Sabre\DAV\IProperties;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-interface ISubscription extends ICollection, IProperties {
-
-
+interface ISubscription extends ICollection, IProperties
+{
}
diff --git a/vendor/sabre/dav/lib/CalDAV/Subscriptions/Plugin.php b/vendor/sabre/dav/lib/CalDAV/Subscriptions/Plugin.php
index 877d96c6c..238866894 100644
--- a/vendor/sabre/dav/lib/CalDAV/Subscriptions/Plugin.php
+++ b/vendor/sabre/dav/lib/CalDAV/Subscriptions/Plugin.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Subscriptions;
use Sabre\DAV\INode;
@@ -17,8 +19,8 @@ use Sabre\DAV\ServerPlugin;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class Plugin extends ServerPlugin {
-
+class Plugin extends ServerPlugin
+{
/**
* This initializes the plugin.
*
@@ -28,10 +30,9 @@ class Plugin extends ServerPlugin {
* This method should set up the required event subscriptions.
*
* @param Server $server
- * @return void
*/
- function initialize(Server $server) {
-
+ public function initialize(Server $server)
+ {
$server->resourceTypeMapping['Sabre\\CalDAV\\Subscriptions\\ISubscription'] =
'{http://calendarserver.org/ns/}subscribed';
@@ -39,7 +40,6 @@ class Plugin extends ServerPlugin {
'Sabre\\DAV\\Xml\\Property\\Href';
$server->on('propFind', [$this, 'propFind'], 150);
-
}
/**
@@ -50,21 +50,19 @@ class Plugin extends ServerPlugin {
*
* @return array
*/
- function getFeatures() {
-
+ public function getFeatures()
+ {
return ['calendarserver-subscribed'];
-
}
/**
* Triggered after properties have been fetched.
*
* @param PropFind $propFind
- * @param INode $node
- * @return void
+ * @param INode $node
*/
- function propFind(PropFind $propFind, INode $node) {
-
+ public function propFind(PropFind $propFind, INode $node)
+ {
// There's a bunch of properties that must appear as a self-closing
// xml-element. This event handler ensures that this will be the case.
$props = [
@@ -74,13 +72,10 @@ class Plugin extends ServerPlugin {
];
foreach ($props as $prop) {
-
- if ($propFind->getStatus($prop) === 200) {
+ if (200 === $propFind->getStatus($prop)) {
$propFind->set($prop, '', 200);
}
-
}
-
}
/**
@@ -91,10 +86,9 @@ class Plugin extends ServerPlugin {
*
* @return string
*/
- function getPluginName() {
-
+ public function getPluginName()
+ {
return 'subscriptions';
-
}
/**
@@ -108,13 +102,12 @@ class Plugin extends ServerPlugin {
*
* @return array
*/
- function getPluginInfo() {
-
+ public function getPluginInfo()
+ {
return [
- 'name' => $this->getPluginName(),
+ 'name' => $this->getPluginName(),
'description' => 'This plugin allows users to store iCalendar subscriptions in their calendar-home.',
- 'link' => null,
+ 'link' => null,
];
-
}
}
diff --git a/vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php b/vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php
index 6a1851ed8..0b0282abe 100644
--- a/vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php
+++ b/vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Subscriptions;
use Sabre\CalDAV\Backend\SubscriptionSupport;
@@ -10,7 +12,7 @@ use Sabre\DAVACL\ACLTrait;
use Sabre\DAVACL\IACL;
/**
- * Subscription Node
+ * Subscription Node.
*
* This node represents a subscription.
*
@@ -18,32 +20,32 @@ use Sabre\DAVACL\IACL;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class Subscription extends Collection implements ISubscription, IACL {
-
+class Subscription extends Collection implements ISubscription, IACL
+{
use ACLTrait;
/**
- * caldavBackend
+ * caldavBackend.
*
* @var SubscriptionSupport
*/
protected $caldavBackend;
/**
- * subscriptionInfo
+ * subscriptionInfo.
*
* @var array
*/
protected $subscriptionInfo;
/**
- * Constructor
+ * Constructor.
*
* @param SubscriptionSupport $caldavBackend
- * @param array $subscriptionInfo
+ * @param array $subscriptionInfo
*/
- function __construct(SubscriptionSupport $caldavBackend, array $subscriptionInfo) {
-
+ public function __construct(SubscriptionSupport $caldavBackend, array $subscriptionInfo)
+ {
$this->caldavBackend = $caldavBackend;
$this->subscriptionInfo = $subscriptionInfo;
@@ -56,10 +58,9 @@ class Subscription extends Collection implements ISubscription, IACL {
foreach ($required as $r) {
if (!isset($subscriptionInfo[$r])) {
- throw new \InvalidArgumentException('The ' . $r . ' field is required when creating a subscription node');
+ throw new \InvalidArgumentException('The '.$r.' field is required when creating a subscription node');
}
}
-
}
/**
@@ -69,47 +70,41 @@ class Subscription extends Collection implements ISubscription, IACL {
*
* @return string
*/
- function getName() {
-
+ public function getName()
+ {
return $this->subscriptionInfo['uri'];
-
}
/**
- * Returns the last modification time
+ * Returns the last modification time.
*
* @return int
*/
- function getLastModified() {
-
+ public function getLastModified()
+ {
if (isset($this->subscriptionInfo['lastmodified'])) {
return $this->subscriptionInfo['lastmodified'];
}
-
}
/**
- * Deletes the current node
- *
- * @return void
+ * Deletes the current node.
*/
- function delete() {
-
+ public function delete()
+ {
$this->caldavBackend->deleteSubscription(
$this->subscriptionInfo['id']
);
-
}
/**
- * Returns an array with all the child nodes
+ * Returns an array with all the child nodes.
*
* @return \Sabre\DAV\INode[]
*/
- function getChildren() {
-
+ public function getChildren()
+ {
return [];
-
}
/**
@@ -122,15 +117,13 @@ class Subscription extends Collection implements ISubscription, IACL {
* Read the PropPatch documentation for more information.
*
* @param PropPatch $propPatch
- * @return void
*/
- function propPatch(PropPatch $propPatch) {
-
+ public function propPatch(PropPatch $propPatch)
+ {
return $this->caldavBackend->updateSubscription(
$this->subscriptionInfo['id'],
$propPatch
);
-
}
/**
@@ -146,29 +139,27 @@ class Subscription extends Collection implements ISubscription, IACL {
* The Server class will filter out the extra.
*
* @param array $properties
+ *
* @return array
*/
- function getProperties($properties) {
-
+ public function getProperties($properties)
+ {
$r = [];
foreach ($properties as $prop) {
-
switch ($prop) {
- case '{http://calendarserver.org/ns/}source' :
+ case '{http://calendarserver.org/ns/}source':
$r[$prop] = new Href($this->subscriptionInfo['source']);
break;
- default :
+ default:
if (array_key_exists($prop, $this->subscriptionInfo)) {
$r[$prop] = $this->subscriptionInfo[$prop];
}
break;
}
-
}
return $r;
-
}
/**
@@ -178,10 +169,9 @@ class Subscription extends Collection implements ISubscription, IACL {
*
* @return string|null
*/
- function getOwner() {
-
+ public function getOwner()
+ {
return $this->subscriptionInfo['principaluri'];
-
}
/**
@@ -196,8 +186,8 @@ class Subscription extends Collection implements ISubscription, IACL {
*
* @return array
*/
- function getACL() {
-
+ public function getACL()
+ {
return [
[
'privilege' => '{DAV:}all',
@@ -206,16 +196,14 @@ class Subscription extends Collection implements ISubscription, IACL {
],
[
'privilege' => '{DAV:}all',
- 'principal' => $this->getOwner() . '/calendar-proxy-write',
+ 'principal' => $this->getOwner().'/calendar-proxy-write',
'protected' => true,
],
[
'privilege' => '{DAV:}read',
- 'principal' => $this->getOwner() . '/calendar-proxy-read',
+ 'principal' => $this->getOwner().'/calendar-proxy-read',
'protected' => true,
- ]
+ ],
];
-
}
-
}