summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
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/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
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/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php')
-rw-r--r--apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php b/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
index 7fe107e0004..cd01e7ae94d 100644
--- a/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
+++ b/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
@@ -106,7 +106,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
string $principalPrefix):void {
$backends = $backendManager->getBackends();
- foreach($backends as $backend) {
+ foreach ($backends as $backend) {
$backendId = $backend->getBackendIdentifier();
try {
@@ -115,7 +115,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
} else {
$list = $backend->listAllRooms();
}
- } catch(BackendTemporarilyUnavailableException $ex) {
+ } catch (BackendTemporarilyUnavailableException $ex) {
continue;
}
@@ -124,7 +124,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
$deletedIds = array_diff($cachedList, $list);
$editedIds = array_intersect($list, $cachedList);
- foreach($newIds as $newId) {
+ foreach ($newIds as $newId) {
try {
if ($backend instanceof IResourceBackend) {
$resource = $backend->getResource($newId);
@@ -136,7 +136,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
if ($resource instanceof IMetadataProvider) {
$metadata = $this->getAllMetadataOfBackend($resource);
}
- } catch(BackendTemporarilyUnavailableException $ex) {
+ } catch (BackendTemporarilyUnavailableException $ex) {
continue;
}
@@ -146,7 +146,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
// when an event is actually scheduled with this resource / room
}
- foreach($deletedIds as $deletedId) {
+ foreach ($deletedIds as $deletedId) {
$id = $this->getIdForBackendAndResource($dbTable, $backendId, $deletedId);
$this->deleteFromCache($dbTable, $id);
$this->deleteMetadataFromCache($dbTableMetadata, $foreignKey, $id);
@@ -155,7 +155,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
$this->deleteCalendarDataForResource($principalPrefix, $principalName);
}
- foreach($editedIds as $editedId) {
+ foreach ($editedIds as $editedId) {
$id = $this->getIdForBackendAndResource($dbTable, $backendId, $editedId);
try {
@@ -169,7 +169,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
if ($resource instanceof IMetadataProvider) {
$metadata = $this->getAllMetadataOfBackend($resource);
}
- } catch(BackendTemporarilyUnavailableException $ex) {
+ } catch (BackendTemporarilyUnavailableException $ex) {
continue;
}
@@ -220,7 +220,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
string $foreignKey,
int $foreignId,
array $metadata):void {
- foreach($metadata as $key => $value) {
+ foreach ($metadata as $key => $value) {
$query = $this->dbConnection->getQueryBuilder();
$query->insert($table)
->values([
@@ -308,7 +308,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
->execute();
}
- foreach($deletedMetadata as $key => $value) {
+ foreach ($deletedMetadata as $key => $value) {
$query = $this->dbConnection->getQueryBuilder();
$query->delete($dbTable)
->where($query->expr()->eq($foreignKey, $query->createNamedParameter($id)))
@@ -317,7 +317,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
}
$existingKeys = array_keys(array_intersect_key($metadata, $cachedMetadata));
- foreach($existingKeys as $existingKey) {
+ foreach ($existingKeys as $existingKey) {
if ($metadata[$existingKey] !== $cachedMetadata[$existingKey]) {
$query = $this->dbConnection->getQueryBuilder();
$query->update($dbTable)
@@ -352,7 +352,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
$keys = $resource->getAllAvailableMetadataKeys();
$metadata = [];
- foreach($keys as $key) {
+ foreach ($keys as $key) {
$metadata[$key] = $resource->getMetadataForKey($key);
}
@@ -376,7 +376,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
$rows = $stmt->fetchAll(\PDO::FETCH_ASSOC);
$metadata = [];
- foreach($rows as $row) {
+ foreach ($rows as $row) {
$metadata[$row['key']] = $row['value'];
}