diff options
Diffstat (limited to 'vendor/sabre/dav/lib/CalDAV/Subscriptions/Plugin.php')
-rw-r--r-- | vendor/sabre/dav/lib/CalDAV/Subscriptions/Plugin.php | 43 |
1 files changed, 18 insertions, 25 deletions
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, ]; - } } |