summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV/WebcalCaching
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
commitcaff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch)
tree186d494c2aea5dea7255d3584ef5d595fc6e6194 /apps/dav/lib/CalDAV/WebcalCaching
parentedf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff)
downloadnextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.tar.gz
nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.zip
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav/lib/CalDAV/WebcalCaching')
-rw-r--r--apps/dav/lib/CalDAV/WebcalCaching/Plugin.php2
-rw-r--r--apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php16
2 files changed, 9 insertions, 9 deletions
diff --git a/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php b/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php
index 783c73968be..2cfeb1108f1 100644
--- a/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php
+++ b/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php
@@ -111,7 +111,7 @@ class Plugin extends ServerPlugin {
}
$calendarHome->enableCachedSubscriptionsForThisRequest();
- } catch(NotFound $ex) {
+ } catch (NotFound $ex) {
return;
}
}
diff --git a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php
index d00e0886b61..fadf61fd7de 100644
--- a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php
+++ b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php
@@ -137,7 +137,7 @@ class RefreshWebcalService {
$calendarData = $vObject->serialize();
try {
$this->calDavBackend->createCalendarObject($subscription['id'], $uri, $calendarData, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
- } catch(BadRequest $ex) {
+ } catch (BadRequest $ex) {
$this->logger->logException($ex);
}
}
@@ -148,7 +148,7 @@ class RefreshWebcalService {
}
$this->updateSubscription($subscription, $mutations);
- } catch(ParseException $ex) {
+ } catch (ParseException $ex) {
$subscriptionId = $subscription['id'];
$this->logger->logException($ex);
@@ -274,11 +274,11 @@ class RefreshWebcalService {
$contentType = $response->getHeader('Content-Type');
$contentType = explode(';', $contentType, 2)[0];
- switch($contentType) {
+ switch ($contentType) {
case 'application/calendar+json':
try {
$jCalendar = Reader::readJson($body, Reader::OPTION_FORGIVING);
- } catch(Exception $ex) {
+ } catch (Exception $ex) {
// In case of a parsing error return null
$this->logger->debug("Subscription $subscriptionId could not be parsed");
return null;
@@ -288,7 +288,7 @@ class RefreshWebcalService {
case 'application/calendar+xml':
try {
$xCalendar = Reader::readXML($body);
- } catch(Exception $ex) {
+ } catch (Exception $ex) {
// In case of a parsing error return null
$this->logger->debug("Subscription $subscriptionId could not be parsed");
return null;
@@ -299,14 +299,14 @@ class RefreshWebcalService {
default:
try {
$vCalendar = Reader::read($body);
- } catch(Exception $ex) {
+ } catch (Exception $ex) {
// In case of a parsing error return null
$this->logger->debug("Subscription $subscriptionId could not be parsed");
return null;
}
return $vCalendar->serialize();
}
- } catch(Exception $ex) {
+ } catch (Exception $ex) {
$this->logger->logException($ex);
$this->logger->warning("Subscription $subscriptionId could not be refreshed due to a network error");
@@ -349,7 +349,7 @@ class RefreshWebcalService {
// check if new refresh rate is even valid
try {
DateTimeParser::parseDuration($newRefreshRate);
- } catch(InvalidDataException $ex) {
+ } catch (InvalidDataException $ex) {
return null;
}