From 762726d988e12986b88e19766fb5b3a6c9fe6edc Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 1 Aug 2016 10:51:11 +0200 Subject: [PATCH] fix indent once and for all --- apps/dav/lib/CalDAV/CalDavBackend.php | 6 +- .../lib/CalDAV/Publishing/PublishPlugin.php | 159 +++++++++--------- 2 files changed, 83 insertions(+), 82 deletions(-) diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index cdab20f541e..e6a023bda64 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -1534,9 +1534,9 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription } /** - * @param boolean $value - * @param \OCA\DAV\CalDAV\Calendar $calendar - */ + * @param boolean $value + * @param \OCA\DAV\CalDAV\Calendar $calendar + */ public function setPublishStatus($value, $calendar) { $query = $this->db->getQueryBuilder(); if ($value) { diff --git a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php index e0bcfb7ef6a..99353253b05 100644 --- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php +++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php @@ -19,25 +19,25 @@ class PublishPlugin extends ServerPlugin const NS_CALENDARSERVER = 'http://calendarserver.org/ns/'; /** - * Reference to SabreDAV server object. - * - * @var \Sabre\DAV\Server - */ - protected $server; - - /** - * Config instance to get instance secret. - * - * @var IConfig - */ - protected $config; - - /** - * URL Generator for absolute URLs. - * - * @var IURLGenerator - */ - protected $urlGenerator; + * Reference to SabreDAV server object. + * + * @var \Sabre\DAV\Server + */ + protected $server; + + /** + * Config instance to get instance secret. + * + * @var IConfig + */ + protected $config; + + /** + * URL Generator for absolute URLs. + * + * @var IURLGenerator + */ + protected $urlGenerator; /** * PublishPlugin constructor. @@ -45,76 +45,77 @@ class PublishPlugin extends ServerPlugin * @param IConfig $config * @param IURLGenerator $urlGenerator */ - public function __construct(IConfig $config, IURLGenerator $urlGenerator) - { - $this->config = $config; - $this->urlGenerator = $urlGenerator; - } + public function __construct(IConfig $config, IURLGenerator $urlGenerator) + { + $this->config = $config; + $this->urlGenerator = $urlGenerator; + } /** - * This method should return a list of server-features. - * - * This is for example 'versioning' and is added to the DAV: header - * in an OPTIONS response. - * - * @return string[] - */ + * This method should return a list of server-features. + * + * This is for example 'versioning' and is added to the DAV: header + * in an OPTIONS response. + * + * @return string[] + */ public function getFeatures() - { - return ['oc-calendar-publishing']; // May have to be changed to be detected - } - - /** - * Returns a plugin name. - * - * Using this name other plugins will be able to access other plugins - * using Sabre\DAV\Server::getPlugin - * - * @return string - */ - public function getPluginName() - { - return 'oc-calendar-publishing'; - } - - /** - * This initializes the plugin. - * - * This function is called by Sabre\DAV\Server, after - * addPlugin is called. - * - * This method should set up the required event subscriptions. - * - * @param Server $server - */ - public function initialize(Server $server) - { - $this->server = $server; - - $this->server->on('method:POST', [$this, 'httpPost']); - $this->server->on('propFind', [$this, 'propFind']); - } + { + // May have to be changed to be detected + return ['oc-calendar-publishing']; + } + + /** + * Returns a plugin name. + * + * Using this name other plugins will be able to access other plugins + * using Sabre\DAV\Server::getPlugin + * + * @return string + */ + public function getPluginName() + { + return 'oc-calendar-publishing'; + } + + /** + * This initializes the plugin. + * + * This function is called by Sabre\DAV\Server, after + * addPlugin is called. + * + * This method should set up the required event subscriptions. + * + * @param Server $server + */ + public function initialize(Server $server) + { + $this->server = $server; + + $this->server->on('method:POST', [$this, 'httpPost']); + $this->server->on('propFind', [$this, 'propFind']); + } public function propFind(PropFind $propFind, INode $node) - { - if ($node instanceof Calendar) { - $token = md5($this->config->getSystemValue('secret', '').$node->getResourceId()); + { + if ($node instanceof Calendar) { + $token = md5($this->config->getSystemValue('secret', '').$node->getResourceId()); - $publishUrl = $this->urlGenerator->getAbsoluteURL($this->server->getBaseUri().'public-calendars/').$token; + $publishUrl = $this->urlGenerator->getAbsoluteURL($this->server->getBaseUri().'public-calendars/').$token; - $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node, $publishUrl) { - if ($node->getPublishStatus()) { + $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node, $publishUrl) { + if ($node->getPublishStatus()) { // We return the publish-url only if the calendar is published. - return new Publisher($publishUrl, true); - } - }); + return new Publisher($publishUrl, true); + } + }); - $propFind->handle('{'.self::NS_CALENDARSERVER.'}pre-publish-url', function () use ($node, $publishUrl) { + $propFind->handle('{'.self::NS_CALENDARSERVER.'}pre-publish-url', function () use ($node, $publishUrl) { // The pre-publish-url is always returned - return new Publisher($publishUrl, false); - }); - } - } + return new Publisher($publishUrl, false); + }); + } + } /** * We intercept this to handle POST requests on calendars. -- 2.39.5