summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
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
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')
-rw-r--r--apps/dav/lib/AppInfo/Application.php4
-rw-r--r--apps/dav/lib/AppInfo/PluginManager.php1
-rw-r--r--apps/dav/lib/Avatars/AvatarHome.php4
-rw-r--r--apps/dav/lib/Avatars/AvatarNode.php1
-rw-r--r--apps/dav/lib/Avatars/RootCollection.php1
-rw-r--r--apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php4
-rw-r--r--apps/dav/lib/BackgroundJob/CleanupDirectLinksJob.php1
-rw-r--r--apps/dav/lib/BackgroundJob/RefreshWebcalJob.php4
-rw-r--r--apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php1
-rw-r--r--apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php24
-rw-r--r--apps/dav/lib/BackgroundJob/UploadCleanup.php1
-rw-r--r--apps/dav/lib/CalDAV/Activity/Backend.php2
-rw-r--r--apps/dav/lib/CalDAV/Activity/Provider/Calendar.php4
-rw-r--r--apps/dav/lib/CalDAV/Activity/Provider/Event.php1
-rw-r--r--apps/dav/lib/CalDAV/Activity/Provider/Todo.php1
-rw-r--r--apps/dav/lib/CalDAV/BirthdayService.php9
-rw-r--r--apps/dav/lib/CalDAV/CachedSubscription.php5
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php124
-rw-r--r--apps/dav/lib/CalDAV/Calendar.php7
-rw-r--r--apps/dav/lib/CalDAV/CalendarImpl.php2
-rw-r--r--apps/dav/lib/CalDAV/CalendarManager.php2
-rw-r--r--apps/dav/lib/CalDAV/CalendarObject.php12
-rw-r--r--apps/dav/lib/CalDAV/CalendarRoot.php1
-rw-r--r--apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php1
-rw-r--r--apps/dav/lib/CalDAV/Integration/ExternalCalendar.php1
-rw-r--r--apps/dav/lib/CalDAV/Integration/ICalendarProvider.php1
-rw-r--r--apps/dav/lib/CalDAV/Plugin.php2
-rw-r--r--apps/dav/lib/CalDAV/Principal/Collection.php1
-rw-r--r--apps/dav/lib/CalDAV/Principal/User.php1
-rw-r--r--apps/dav/lib/CalDAV/Proxy/ProxyMapper.php1
-rw-r--r--apps/dav/lib/CalDAV/PublicCalendarRoot.php1
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php2
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php8
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php1
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php2
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php1
-rw-r--r--apps/dav/lib/CalDAV/Reminder/Notifier.php2
-rw-r--r--apps/dav/lib/CalDAV/Reminder/ReminderService.php29
-rw-r--r--apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php23
-rw-r--r--apps/dav/lib/CalDAV/Schedule/IMipPlugin.php5
-rw-r--r--apps/dav/lib/CalDAV/Search/SearchPlugin.php1
-rw-r--r--apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php1
-rw-r--r--apps/dav/lib/CalDAV/WebcalCaching/Plugin.php2
-rw-r--r--apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php16
-rw-r--r--apps/dav/lib/Capabilities.php1
-rw-r--r--apps/dav/lib/CardDAV/AddressBook.php2
-rw-r--r--apps/dav/lib/CardDAV/AddressBookImpl.php9
-rw-r--r--apps/dav/lib/CardDAV/AddressBookRoot.php3
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php49
-rw-r--r--apps/dav/lib/CardDAV/ContactsManager.php1
-rw-r--r--apps/dav/lib/CardDAV/Converter.php3
-rw-r--r--apps/dav/lib/CardDAV/HasPhotoPlugin.php3
-rw-r--r--apps/dav/lib/CardDAV/ImageExportPlugin.php1
-rw-r--r--apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php2
-rw-r--r--apps/dav/lib/CardDAV/Integration/IAddressBookProvider.php1
-rw-r--r--apps/dav/lib/CardDAV/MultiGetExportPlugin.php3
-rw-r--r--apps/dav/lib/CardDAV/PhotoCache.php3
-rw-r--r--apps/dav/lib/CardDAV/Plugin.php3
-rw-r--r--apps/dav/lib/CardDAV/SyncService.php23
-rw-r--r--apps/dav/lib/CardDAV/UserAddressBooks.php2
-rw-r--r--apps/dav/lib/Command/ListCalendars.php3
-rw-r--r--apps/dav/lib/Command/MoveCalendar.php3
-rw-r--r--apps/dav/lib/Command/RemoveInvalidShares.php2
-rw-r--r--apps/dav/lib/Comments/CommentNode.php18
-rw-r--r--apps/dav/lib/Comments/CommentsPlugin.php24
-rw-r--r--apps/dav/lib/Comments/EntityCollection.php8
-rw-r--r--apps/dav/lib/Comments/EntityTypeCollection.php5
-rw-r--r--apps/dav/lib/Comments/RootCollection.php9
-rw-r--r--apps/dav/lib/Connector/LegacyDAVACL.php4
-rw-r--r--apps/dav/lib/Connector/PublicAuth.php1
-rw-r--r--apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php1
-rw-r--r--apps/dav/lib/Connector/Sabre/Auth.php22
-rw-r--r--apps/dav/lib/Connector/Sabre/BearerAuth.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/ChecksumList.php1
-rw-r--r--apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php6
-rw-r--r--apps/dav/lib/Connector/Sabre/DavAclPlugin.php6
-rw-r--r--apps/dav/lib/Connector/Sabre/Directory.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/Exception/EntityTooLarge.php3
-rw-r--r--apps/dav/lib/Connector/Sabre/Exception/FileLocked.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/Exception/Forbidden.php1
-rw-r--r--apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/Exception/PasswordLoginForbidden.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/Exception/UnsupportedMediaType.php3
-rw-r--r--apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php1
-rw-r--r--apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php11
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php5
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php8
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesReportPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/Node.php3
-rw-r--r--apps/dav/lib/Connector/Sabre/ObjectTree.php1
-rw-r--r--apps/dav/lib/Connector/Sabre/Principal.php8
-rw-r--r--apps/dav/lib/Connector/Sabre/QuotaPlugin.php3
-rw-r--r--apps/dav/lib/Connector/Sabre/ServerFactory.php5
-rw-r--r--apps/dav/lib/Connector/Sabre/SharesPlugin.php1
-rw-r--r--apps/dav/lib/Connector/Sabre/TagList.php3
-rw-r--r--apps/dav/lib/Connector/Sabre/TagsPlugin.php4
-rw-r--r--apps/dav/lib/Controller/InvitationResponseController.php2
-rw-r--r--apps/dav/lib/DAV/CustomPropertiesBackend.php1
-rw-r--r--apps/dav/lib/DAV/GroupPrincipalBackend.php3
-rw-r--r--apps/dav/lib/DAV/PublicAuth.php1
-rw-r--r--apps/dav/lib/DAV/Sharing/Backend.php7
-rw-r--r--apps/dav/lib/DAV/Sharing/IShareable.php1
-rw-r--r--apps/dav/lib/DAV/Sharing/Plugin.php8
-rw-r--r--apps/dav/lib/DAV/Sharing/Xml/Invite.php10
-rw-r--r--apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php6
-rw-r--r--apps/dav/lib/DAV/SystemPrincipalBackend.php1
-rw-r--r--apps/dav/lib/Db/DirectMapper.php1
-rw-r--r--apps/dav/lib/Direct/DirectFile.php1
-rw-r--r--apps/dav/lib/Direct/DirectHome.php1
-rw-r--r--apps/dav/lib/Direct/ServerFactory.php2
-rw-r--r--apps/dav/lib/Files/BrowserErrorPagePlugin.php2
-rw-r--r--apps/dav/lib/Files/FileSearchBackend.php2
-rw-r--r--apps/dav/lib/Files/LazySearchBackend.php2
-rw-r--r--apps/dav/lib/Files/RootCollection.php1
-rw-r--r--apps/dav/lib/Files/Sharing/FilesDropPlugin.php1
-rw-r--r--apps/dav/lib/HookManager.php4
-rw-r--r--apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php2
-rw-r--r--apps/dav/lib/Migration/ChunkCleanup.php1
-rw-r--r--apps/dav/lib/Migration/RefreshWebcalJobRegistrar.php2
-rw-r--r--apps/dav/lib/Migration/Version1004Date20170919104507.php1
-rw-r--r--apps/dav/lib/Migration/Version1004Date20170926103422.php1
-rw-r--r--apps/dav/lib/Migration/Version1005Date20180530124431.php2
-rw-r--r--apps/dav/lib/Migration/Version1008Date20181105110300.php1
-rw-r--r--apps/dav/lib/Migration/Version1011Date20190725113607.php2
-rw-r--r--apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php1
-rw-r--r--apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php44
-rw-r--r--apps/dav/lib/RootCollection.php2
-rw-r--r--apps/dav/lib/Server.php4
-rw-r--r--apps/dav/lib/SystemTag/SystemTagPlugin.php6
-rw-r--r--apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php2
-rw-r--r--apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php1
-rw-r--r--apps/dav/lib/Traits/PrincipalProxyTrait.php1
-rw-r--r--apps/dav/lib/Upload/AssemblyStream.php2
-rw-r--r--apps/dav/lib/Upload/RootCollection.php1
135 files changed, 272 insertions, 485 deletions
diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php
index caad7bf040b..7a80c9b2152 100644
--- a/apps/dav/lib/AppInfo/Application.php
+++ b/apps/dav/lib/AppInfo/Application.php
@@ -53,7 +53,6 @@ use OCP\IUser;
use Symfony\Component\EventDispatcher\GenericEvent;
class Application extends App {
-
const APP_ID = 'dav';
/**
@@ -265,9 +264,8 @@ class Application extends App {
$notificationProviderManager->registerProvider(AudioProvider::class);
$notificationProviderManager->registerProvider(EmailProvider::class);
$notificationProviderManager->registerProvider(PushProvider::class);
- } catch(\Exception $ex) {
+ } catch (\Exception $ex) {
$this->getContainer()->getServer()->getLogger()->logException($ex);
}
}
-
}
diff --git a/apps/dav/lib/AppInfo/PluginManager.php b/apps/dav/lib/AppInfo/PluginManager.php
index 21ff40ba6b8..79bd07e0835 100644
--- a/apps/dav/lib/AppInfo/PluginManager.php
+++ b/apps/dav/lib/AppInfo/PluginManager.php
@@ -303,5 +303,4 @@ class PluginManager {
$this->calendarPlugins[] = $instantiatedCalendarPlugin;
}
}
-
}
diff --git a/apps/dav/lib/Avatars/AvatarHome.php b/apps/dav/lib/Avatars/AvatarHome.php
index 8ee43281b62..73d417dee90 100644
--- a/apps/dav/lib/Avatars/AvatarHome.php
+++ b/apps/dav/lib/Avatars/AvatarHome.php
@@ -79,7 +79,7 @@ class AvatarHome implements ICollection {
return [
$this->getChild('96.jpeg')
];
- } catch(NotFound $exception) {
+ } catch (NotFound $exception) {
return [];
}
}
@@ -116,6 +116,4 @@ class AvatarHome implements ICollection {
public function getLastModified() {
return null;
}
-
-
}
diff --git a/apps/dav/lib/Avatars/AvatarNode.php b/apps/dav/lib/Avatars/AvatarNode.php
index af3486c4368..a577a591616 100644
--- a/apps/dav/lib/Avatars/AvatarNode.php
+++ b/apps/dav/lib/Avatars/AvatarNode.php
@@ -93,6 +93,5 @@ class AvatarNode extends File {
return (int)$timestamp;
}
return $timestamp;
-
}
}
diff --git a/apps/dav/lib/Avatars/RootCollection.php b/apps/dav/lib/Avatars/RootCollection.php
index 6047d1b285e..01f270362b7 100644
--- a/apps/dav/lib/Avatars/RootCollection.php
+++ b/apps/dav/lib/Avatars/RootCollection.php
@@ -47,5 +47,4 @@ class RootCollection extends AbstractPrincipalCollection {
public function getName() {
return 'avatars';
}
-
}
diff --git a/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php b/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php
index 5d0b25d747b..ad5bf7736ab 100644
--- a/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php
+++ b/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php
@@ -117,7 +117,7 @@ class BuildReminderIndexBackgroundJob extends QueuedJob {
->orderBy('id', 'ASC');
$stmt = $query->execute();
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$offset = $row['id'];
if (is_resource($row['calendardata'])) {
$row['calendardata'] = stream_get_contents($row['calendardata']);
@@ -126,7 +126,7 @@ class BuildReminderIndexBackgroundJob extends QueuedJob {
try {
$this->reminderService->onTouchCalendarObject('\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject', $row);
- } catch(\Exception $ex) {
+ } catch (\Exception $ex) {
$this->logger->logException($ex);
}
diff --git a/apps/dav/lib/BackgroundJob/CleanupDirectLinksJob.php b/apps/dav/lib/BackgroundJob/CleanupDirectLinksJob.php
index d815b999c87..60eae25fdcc 100644
--- a/apps/dav/lib/BackgroundJob/CleanupDirectLinksJob.php
+++ b/apps/dav/lib/BackgroundJob/CleanupDirectLinksJob.php
@@ -48,5 +48,4 @@ class CleanupDirectLinksJob extends TimedJob {
// Delete all shares expired 24 hours ago
$this->mapper->deleteExpired($this->timeFactory->getTime() - 60*60*24);
}
-
}
diff --git a/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php b/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php
index f1d56775903..72401d0f7d1 100644
--- a/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php
+++ b/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php
@@ -92,7 +92,7 @@ class RefreshWebcalJob extends Job {
try {
/** @var DateInterval $dateInterval */
$dateInterval = DateTimeParser::parseDuration($refreshRate);
- } catch(InvalidDataException $ex) {
+ } catch (InvalidDataException $ex) {
$this->logger->logException($ex);
$this->logger->warning("Subscription $subscriptionId could not be refreshed, refreshrate in database is invalid");
return;
@@ -142,7 +142,7 @@ class RefreshWebcalJob extends Job {
RefreshWebcalService::STRIP_TODOS,
];
- foreach($forceInt as $column) {
+ foreach ($forceInt as $column) {
if (isset($row[$column])) {
$row[$column] = (int) $row[$column];
}
diff --git a/apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php b/apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php
index 8396bfb9a5a..d0427b6c5c3 100644
--- a/apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php
+++ b/apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php
@@ -64,5 +64,4 @@ class RegisterRegenerateBirthdayCalendars extends QueuedJob {
]);
});
}
-
}
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'];
}
diff --git a/apps/dav/lib/BackgroundJob/UploadCleanup.php b/apps/dav/lib/BackgroundJob/UploadCleanup.php
index f5863ddeafe..71b0b515872 100644
--- a/apps/dav/lib/BackgroundJob/UploadCleanup.php
+++ b/apps/dav/lib/BackgroundJob/UploadCleanup.php
@@ -86,5 +86,4 @@ class UploadCleanup extends TimedJob {
$this->jobList->remove(self::class, $argument);
}
}
-
}
diff --git a/apps/dav/lib/CalDAV/Activity/Backend.php b/apps/dav/lib/CalDAV/Activity/Backend.php
index 804b88d0322..4ca5ad17aeb 100644
--- a/apps/dav/lib/CalDAV/Activity/Backend.php
+++ b/apps/dav/lib/CalDAV/Activity/Backend.php
@@ -469,7 +469,7 @@ class Backend {
protected function getObjectNameAndType(array $objectData) {
$vObject = Reader::read($objectData['calendardata']);
$component = $componentType = null;
- foreach($vObject->getComponents() as $component) {
+ foreach ($vObject->getComponents() as $component) {
if (in_array($component->name, ['VEVENT', 'VTODO'])) {
$componentType = $component->name;
break;
diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php
index 0a070810bdb..42b70f0a928 100644
--- a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php
+++ b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php
@@ -36,7 +36,6 @@ use OCP\IUserManager;
use OCP\L10N\IFactory;
class Calendar extends Base {
-
const SUBJECT_ADD = 'calendar_add';
const SUBJECT_UPDATE = 'calendar_update';
const SUBJECT_DELETE = 'calendar_delete';
@@ -111,12 +110,10 @@ class Calendar extends Base {
$subject = $this->l->t('{actor} updated calendar {calendar}');
} elseif ($event->getSubject() === self::SUBJECT_UPDATE . '_self') {
$subject = $this->l->t('You updated calendar {calendar}');
-
} elseif ($event->getSubject() === self::SUBJECT_PUBLISH . '_self') {
$subject = $this->l->t('You shared calendar {calendar} as public link');
} elseif ($event->getSubject() === self::SUBJECT_UNPUBLISH . '_self') {
$subject = $this->l->t('You removed public link for calendar {calendar}');
-
} elseif ($event->getSubject() === self::SUBJECT_SHARE_USER) {
$subject = $this->l->t('{actor} shared calendar {calendar} with you');
} elseif ($event->getSubject() === self::SUBJECT_SHARE_USER . '_you') {
@@ -131,7 +128,6 @@ class Calendar extends Base {
$subject = $this->l->t('{actor} unshared calendar {calendar} from {user}');
} elseif ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_self') {
$subject = $this->l->t('{actor} unshared calendar {calendar} from themselves');
-
} elseif ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_you') {
$subject = $this->l->t('You shared calendar {calendar} with group {group}');
} elseif ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_by') {
diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Event.php b/apps/dav/lib/CalDAV/Activity/Provider/Event.php
index 9a71553fd31..f044c2f8208 100644
--- a/apps/dav/lib/CalDAV/Activity/Provider/Event.php
+++ b/apps/dav/lib/CalDAV/Activity/Provider/Event.php
@@ -34,7 +34,6 @@ use OCP\IUserManager;
use OCP\L10N\IFactory;
class Event extends Base {
-
const SUBJECT_OBJECT_ADD = 'object_add';
const SUBJECT_OBJECT_UPDATE = 'object_update';
const SUBJECT_OBJECT_DELETE = 'object_delete';
diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php
index 54339566823..dcdc3577233 100644
--- a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php
+++ b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php
@@ -60,7 +60,6 @@ class Todo extends Event {
$subject = $this->l->t('{actor} updated todo {todo} in list {calendar}');
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_self') {
$subject = $this->l->t('You updated todo {todo} in list {calendar}');
-
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_completed') {
$subject = $this->l->t('{actor} solved todo {todo} in list {calendar}');
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_completed_self') {
diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php
index 208b923f531..2969e5f3ead 100644
--- a/apps/dav/lib/CalDAV/BirthdayService.php
+++ b/apps/dav/lib/CalDAV/BirthdayService.php
@@ -49,7 +49,6 @@ use Sabre\VObject\Reader;
* @package OCA\DAV\CalDAV
*/
class BirthdayService {
-
const BIRTHDAY_CALENDAR_URI = 'contact_birthdays';
/** @var GroupPrincipalBackend */
@@ -298,7 +297,7 @@ class BirthdayService {
$calendar = $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI);
$calendarObjects = $this->calDavBackEnd->getCalendarObjects($calendar['id'], CalDavBackend::CALENDAR_TYPE_CALENDAR);
- foreach($calendarObjects as $calendarObject) {
+ foreach ($calendarObjects as $calendarObject) {
$this->calDavBackEnd->deleteCalendarObject($calendar['id'], $calendarObject['uri'], CalDavBackend::CALENDAR_TYPE_CALENDAR);
}
}
@@ -311,9 +310,9 @@ class BirthdayService {
$principal = 'principals/users/'.$user;
$this->ensureCalendarExists($principal);
$books = $this->cardDavBackEnd->getAddressBooksForUser($principal);
- foreach($books as $book) {
+ foreach ($books as $book) {
$cards = $this->cardDavBackEnd->getCards($book['id']);
- foreach($cards as $card) {
+ foreach ($cards as $card) {
$this->onCardChanged((int) $book['id'], $card['uri'], $card['carddata']);
}
}
@@ -455,7 +454,7 @@ class BirthdayService {
return '';
}
} else {
- switch($field) {
+ switch ($field) {
case 'BDAY':
return implode('', [
$name,
diff --git a/apps/dav/lib/CalDAV/CachedSubscription.php b/apps/dav/lib/CalDAV/CachedSubscription.php
index 093a86dcad0..7f81617b9a4 100644
--- a/apps/dav/lib/CalDAV/CachedSubscription.php
+++ b/apps/dav/lib/CalDAV/CachedSubscription.php
@@ -136,7 +136,6 @@ class CachedSubscription extends \Sabre\CalDAV\Calendar {
$obj['acl'] = $this->getChildACL();
return new CachedSubscriptionObject($this->caldavBackend, $this->calendarInfo, $obj);
-
}
/**
@@ -146,7 +145,7 @@ class CachedSubscription extends \Sabre\CalDAV\Calendar {
$objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id'], CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
$children = [];
- foreach($objs as $obj) {
+ foreach ($objs as $obj) {
$children[] = new CachedSubscriptionObject($this->caldavBackend, $this->calendarInfo, $obj);
}
@@ -161,7 +160,7 @@ class CachedSubscription extends \Sabre\CalDAV\Calendar {
$objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
$children = [];
- foreach($objs as $obj) {
+ foreach ($objs as $obj) {
$children[] = new CachedSubscriptionObject($this->caldavBackend, $this->calendarInfo, $obj);
}
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index 9b96a4cfaaa..dd3cb048483 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -77,7 +77,6 @@ use Symfony\Component\EventDispatcher\GenericEvent;
* @package OCA\DAV\CalDAV
*/
class CalDavBackend extends AbstractBackend implements SyncSupport, SubscriptionSupport, SchedulingSupport {
-
const CALENDAR_TYPE_CALENDAR = 0;
const CALENDAR_TYPE_SUBSCRIPTION = 1;
@@ -273,8 +272,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$stmt = $query->execute();
$calendars = [];
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
-
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$components = [];
if ($row['components']) {
$components = explode(',',$row['components']);
@@ -291,7 +289,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
];
- foreach($this->propertyMap as $xmlName=>$dbName) {
+ foreach ($this->propertyMap as $xmlName=>$dbName) {
$calendar[$xmlName] = $row[$dbName];
}
@@ -332,7 +330,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->execute();
$readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
- while($row = $result->fetch()) {
+ while ($row = $result->fetch()) {
if ($row['principaluri'] === $principalUri) {
continue;
}
@@ -369,7 +367,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$readOnlyPropertyName => $readOnly,
];
- foreach($this->propertyMap as $xmlName=>$dbName) {
+ foreach ($this->propertyMap as $xmlName=>$dbName) {
$calendar[$xmlName] = $row[$dbName];
}
@@ -402,7 +400,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->orderBy('calendarorder', 'ASC');
$stmt = $query->execute();
$calendars = [];
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$components = [];
if ($row['components']) {
$components = explode(',',$row['components']);
@@ -416,7 +414,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
];
- foreach($this->propertyMap as $xmlName=>$dbName) {
+ foreach ($this->propertyMap as $xmlName=>$dbName) {
$calendar[$xmlName] = $row[$dbName];
}
@@ -471,7 +469,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->andWhere($query->expr()->eq('s.type', $query->createNamedParameter('calendar')))
->execute();
- while($row = $result->fetch()) {
+ while ($row = $result->fetch()) {
list(, $name) = Uri\split($row['principaluri']);
$row['displayname'] = $row['displayname'] . "($name)";
$components = [];
@@ -491,7 +489,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC,
];
- foreach($this->propertyMap as $xmlName=>$dbName) {
+ foreach ($this->propertyMap as $xmlName=>$dbName) {
$calendar[$xmlName] = $row[$dbName];
}
@@ -557,14 +555,13 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC,
];
- foreach($this->propertyMap as $xmlName=>$dbName) {
+ foreach ($this->propertyMap as $xmlName=>$dbName) {
$calendar[$xmlName] = $row[$dbName];
}
$this->addOwnerPrincipal($calendar);
return $calendar;
-
}
/**
@@ -610,7 +607,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
];
- foreach($this->propertyMap as $xmlName=>$dbName) {
+ foreach ($this->propertyMap as $xmlName=>$dbName) {
$calendar[$xmlName] = $row[$dbName];
}
@@ -660,7 +657,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
];
- foreach($this->propertyMap as $xmlName=>$dbName) {
+ foreach ($this->propertyMap as $xmlName=>$dbName) {
$calendar[$xmlName] = $row[$dbName];
}
@@ -704,7 +701,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
];
- foreach($this->subscriptionPropertyMap as $xmlName=>$dbName) {
+ foreach ($this->subscriptionPropertyMap as $xmlName=>$dbName) {
if (!is_null($row[$dbName])) {
$subscription[$xmlName] = $row[$dbName];
}
@@ -753,7 +750,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$values['transparent'] = (int) ($properties[$transp]->getValue() === 'transparent');
}
- foreach($this->propertyMap as $xmlName=>$dbName) {
+ foreach ($this->propertyMap as $xmlName=>$dbName) {
if (isset($properties[$xmlName])) {
$values[$dbName] = $properties[$xmlName];
}
@@ -761,7 +758,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$query = $this->db->getQueryBuilder();
$query->insert('calendars');
- foreach($values as $column => $value) {
+ foreach ($values as $column => $value) {
$query->setValue($column, $query->createNamedParameter($value));
}
$query->execute();
@@ -803,7 +800,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$propPatch->handle($supportedProperties, function ($mutations) use ($calendarId) {
$newValues = [];
foreach ($mutations as $propertyName => $propertyValue) {
-
switch ($propertyName) {
case '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp':
$fieldName = 'transparent';
@@ -814,7 +810,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$newValues[$fieldName] = $propertyValue;
break;
}
-
}
$query = $this->db->getQueryBuilder();
$query->update('calendars');
@@ -923,7 +918,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$stmt = $query->execute();
$result = [];
- foreach($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) {
+ foreach ($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) {
$result[] = [
'id' => $row['id'],
'uri' => $row['uri'],
@@ -966,7 +961,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$stmt = $query->execute();
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
- if(!$row) {
+ if (!$row) {
return null;
}
@@ -1326,7 +1321,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$requirePostFilter = false;
}
}
-
}
$columns = ['uri'];
if ($requirePostFilter) {
@@ -1352,13 +1346,13 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$stmt = $query->execute();
$result = [];
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
if ($requirePostFilter) {
// validateFilterForObject will parse the calendar data
// catch parsing errors
try {
$matches = $this->validateFilterForObject($row, $filters);
- } catch(ParseException $ex) {
+ } catch (ParseException $ex) {
$this->logger->logException($ex, [
'app' => 'dav',
'message' => 'Caught parsing exception for calendar data. This usually indicates invalid calendar data. calendar-id:'.$id.' uri:'.$row['uri']
@@ -1400,7 +1394,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$uriMapper = [];
- foreach($calendars as $calendar) {
+ foreach ($calendars as $calendar) {
if ($calendar['{http://owncloud.org/ns}owner-principal'] === $principalUri) {
$ownCalendars[] = $calendar['id'];
} else {
@@ -1415,14 +1409,14 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$query = $this->db->getQueryBuilder();
// Calendar id expressions
$calendarExpressions = [];
- foreach($ownCalendars as $id) {
+ foreach ($ownCalendars as $id) {
$calendarExpressions[] = $query->expr()->andX(
$query->expr()->eq('c.calendarid',
$query->createNamedParameter($id)),
$query->expr()->eq('c.calendartype',
$query->createNamedParameter(self::CALENDAR_TYPE_CALENDAR)));
}
- foreach($sharedCalendars as $id) {
+ foreach ($sharedCalendars as $id) {
$calendarExpressions[] = $query->expr()->andX(
$query->expr()->eq('c.calendarid',
$query->createNamedParameter($id)),
@@ -1440,7 +1434,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
// Component expressions
$compExpressions = [];
- foreach($filters['comps'] as $comp) {
+ foreach ($filters['comps'] as $comp) {
$compExpressions[] = $query->expr()
->eq('c.componenttype', $query->createNamedParameter($comp));
}
@@ -1459,13 +1453,13 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
}
$propParamExpressions = [];
- foreach($filters['props'] as $prop) {
+ foreach ($filters['props'] as $prop) {
$propParamExpressions[] = $query->expr()->andX(
$query->expr()->eq('i.name', $query->createNamedParameter($prop)),
$query->expr()->isNull('i.parameter')
);
}
- foreach($filters['params'] as $param) {
+ foreach ($filters['params'] as $param) {
$propParamExpressions[] = $query->expr()->andX(
$query->expr()->eq('i.name', $query->createNamedParameter($param['property'])),
$query->expr()->eq('i.parameter', $query->createNamedParameter($param['parameter']))
@@ -1497,7 +1491,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$stmt = $query->execute();
$result = [];
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$path = $uriMapper[$row['calendarid']] . '/' . $row['uri'];
if (!in_array($path, $result)) {
$result[] = $path;
@@ -1538,7 +1532,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
}
$or = $innerQuery->expr()->orX();
- foreach($searchProperties as $searchProperty) {
+ foreach ($searchProperties as $searchProperty) {
$or->add($innerQuery->expr()->eq('op.name',
$outerQuery->createNamedParameter($searchProperty)));
}
@@ -1557,7 +1551,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
if (isset($options['timerange']['start']) && $options['timerange']['start'] instanceof DateTime) {
$outerQuery->andWhere($outerQuery->expr()->gt('lastoccurence',
$outerQuery->createNamedParameter($options['timerange']['start']->getTimeStamp())));
-
}
if (isset($options['timerange']['end']) && $options['timerange']['end'] instanceof DateTime) {
$outerQuery->andWhere($outerQuery->expr()->lt('firstoccurence',
@@ -1567,7 +1560,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
if (isset($options['types'])) {
$or = $outerQuery->expr()->orX();
- foreach($options['types'] as $type) {
+ foreach ($options['types'] as $type) {
$or->add($outerQuery->expr()->eq('componenttype',
$outerQuery->createNamedParameter($type)));
}
@@ -1592,7 +1585,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$comps = $calendarData->getComponents();
$objects = [];
$timezones = [];
- foreach($comps as $comp) {
+ foreach ($comps as $comp) {
if ($comp instanceof VTimeZone) {
$timezones[] = $comp;
} else {
@@ -1629,7 +1622,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
});
$validationRules = $comp->getValidationRules();
- foreach($subComponents as $subComponent) {
+ foreach ($subComponents as $subComponent) {
$name = $subComponent->name;
if (!isset($data[$name])) {
$data[$name] = [];
@@ -1637,7 +1630,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$data[$name][] = $this->transformSearchData($subComponent);
}
- foreach($properties as $property) {
+ foreach ($properties as $property) {
$name = $property->name;
if (!isset($validationRules[$name])) {
$validationRules[$name] = '*';
@@ -1696,7 +1689,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @return string|null
*/
function getCalendarObjectByUID($principalUri, $uid) {
-
$query = $this->db->getQueryBuilder();
$query->selectAlias('c.uri', 'calendaruri')->selectAlias('co.uri', 'objecturi')
->from('calendarobjects', 'co')
@@ -1789,7 +1781,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
];
if ($syncToken) {
-
$query = "SELECT `uri`, `operation` FROM `*PREFIX*calendarchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `calendarid` = ? AND `calendartype` = ? ORDER BY `synctoken`";
if ($limit>0) {
$query.= " LIMIT " . (int)$limit;
@@ -1803,15 +1794,12 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
// This loop ensures that any duplicates are overwritten, only the
// last change on a node is relevant.
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
-
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$changes[$row['uri']] = $row['operation'];
-
}
- foreach($changes as $uri => $operation) {
-
- switch($operation) {
+ foreach ($changes as $uri => $operation) {
+ switch ($operation) {
case 1:
$result['added'][] = $uri;
break;
@@ -1822,7 +1810,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$result['deleted'][] = $uri;
break;
}
-
}
} else {
// No synctoken supplied, this is the initial sync.
@@ -1833,7 +1820,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$result['added'] = $stmt->fetchAll(\PDO::FETCH_COLUMN);
}
return $result;
-
}
/**
@@ -1885,8 +1871,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$stmt =$query->execute();
$subscriptions = [];
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
-
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$subscription = [
'id' => $row['id'],
'uri' => $row['uri'],
@@ -1898,14 +1883,13 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
];
- foreach($this->subscriptionPropertyMap as $xmlName=>$dbName) {
+ foreach ($this->subscriptionPropertyMap as $xmlName=>$dbName) {
if (!is_null($row[$dbName])) {
$subscription[$xmlName] = $row[$dbName];
}
}
$subscriptions[] = $subscription;
-
}
return $subscriptions;
@@ -1923,7 +1907,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @return mixed
*/
function createSubscription($principalUri, $uri, array $properties) {
-
if (!isset($properties['{http://calendarserver.org/ns/}source'])) {
throw new Forbidden('The {http://calendarserver.org/ns/}source property is required when creating subscriptions');
}
@@ -1937,11 +1920,11 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$propertiesBoolean = ['striptodos', 'stripalarms', 'stripattachments'];
- foreach($this->subscriptionPropertyMap as $xmlName=>$dbName) {
+ foreach ($this->subscriptionPropertyMap as $xmlName=>$dbName) {
if (array_key_exists($xmlName, $properties)) {
- $values[$dbName] = $properties[$xmlName];
- if (in_array($dbName, $propertiesBoolean)) {
- $values[$dbName] = true;
+ $values[$dbName] = $properties[$xmlName];
+ if (in_array($dbName, $propertiesBoolean)) {
+ $values[$dbName] = true;
}
}
}
@@ -1994,10 +1977,9 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @suppress SqlInjectionChecker
*/
$propPatch->handle($supportedProperties, function ($mutations) use ($subscriptionId) {
-
$newValues = [];
- foreach($mutations as $propertyName=>$propertyValue) {
+ foreach ($mutations as $propertyName=>$propertyValue) {
if ($propertyName === '{http://calendarserver.org/ns/}source') {
$newValues['source'] = $propertyValue->getHref();
} else {
@@ -2009,7 +1991,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$query = $this->db->getQueryBuilder();
$query->update('calendarsubscriptions')
->set('lastmodified', $query->createNamedParameter(time()));
- foreach($newValues as $fieldName=>$value) {
+ foreach ($newValues as $fieldName=>$value) {
$query->set($fieldName, $query->createNamedParameter($value));
}
$query->where($query->expr()->eq('id', $query->createNamedParameter($subscriptionId)))
@@ -2024,7 +2006,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
]));
return true;
-
});
}
@@ -2090,7 +2071,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
- if(!$row) {
+ if (!$row) {
return null;
}
@@ -2122,7 +2103,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->execute();
$result = [];
- foreach($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) {
+ foreach ($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) {
$result[] = [
'calendardata' => $row['calendardata'],
'uri' => $row['uri'],
@@ -2205,7 +2186,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$stmt->execute([
$calendarId
]);
-
}
/**
@@ -2224,7 +2204,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @return array
*/
public function getDenormalizedData($calendarData) {
-
$vObject = Reader::read($calendarData);
$componentType = null;
$component = null;
@@ -2232,7 +2211,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$lastOccurrence = null;
$uid = null;
$classification = self::CLASSIFICATION_PUBLIC;
- foreach($vObject->getComponents() as $component) {
+ foreach ($vObject->getComponents() as $component) {
if ($component->name!=='VTIMEZONE') {
$componentType = $component->name;
$uid = (string)$component->UID;
@@ -2266,14 +2245,12 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$lastOccurrence = $maxDate->getTimestamp();
} else {
$end = $it->getDtEnd();
- while($it->valid() && $end < $maxDate) {
+ while ($it->valid() && $end < $maxDate) {
$end = $it->getDtEnd();
$it->next();
-
}
$lastOccurrence = $end->getTimestamp();
}
-
}
}
@@ -2297,7 +2274,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'uid' => $uid,
'classification' => $classification
];
-
}
/**
@@ -2346,7 +2322,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @return string|null
*/
public function setPublishStatus($value, $calendar) {
-
$calendarId = $calendar->getResourceId();
$this->dispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::publishCalendar', new GenericEvent(
'\OCA\DAV\CalDAV\CalDavBackend::updateShares',
@@ -2490,7 +2465,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->execute();
$ids = $result->fetchAll();
- foreach($ids as $id) {
+ foreach ($ids as $id) {
$this->deleteCalendar($id['id']);
}
}
@@ -2507,7 +2482,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$stmt = $query->execute();
$uris = [];
- foreach($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) {
+ foreach ($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) {
$uris[] = $row['uri'];
}
$stmt->closeCursor();
@@ -2528,7 +2503,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->andWhere($query->expr()->eq('calendartype', $query->createNamedParameter(self::CALENDAR_TYPE_SUBSCRIPTION)))
->execute();
- foreach($uris as $uri) {
+ foreach ($uris as $uri) {
$this->addChange($subscriptionId, $uri, 3, self::CALENDAR_TYPE_SUBSCRIPTION);
}
}
@@ -2540,8 +2515,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @param string $uriOrigin
* @param string $uriDestination
*/
- public function moveCalendar($uriName, $uriOrigin, $uriDestination)
- {
+ public function moveCalendar($uriName, $uriOrigin, $uriDestination) {
$query = $this->db->getQueryBuilder();
$query->update('calendars')
->set('principaluri', $query->createNamedParameter($uriDestination))
diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php
index 1c7e0106fb6..11b4bfe2c1d 100644
--- a/apps/dav/lib/CalDAV/Calendar.php
+++ b/apps/dav/lib/CalDAV/Calendar.php
@@ -280,7 +280,6 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
}
public function getChild($name) {
-
$obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $name);
if (!$obj) {
@@ -294,11 +293,9 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
$obj['acl'] = $this->getChildACL();
return new CalendarObject($this->caldavBackend, $this->l10n, $this->calendarInfo, $obj);
-
}
public function getChildren() {
-
$objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id']);
$children = [];
foreach ($objs as $obj) {
@@ -309,11 +306,9 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
$children[] = new CalendarObject($this->caldavBackend, $this->l10n, $this->calendarInfo, $obj);
}
return $children;
-
}
public function getMultipleChildren(array $paths) {
-
$objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths);
$children = [];
foreach ($objs as $obj) {
@@ -324,7 +319,6 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
$children[] = new CalendarObject($this->caldavBackend, $this->l10n, $this->calendarInfo, $obj);
}
return $children;
-
}
public function childExists($name) {
@@ -340,7 +334,6 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
}
public function calendarQuery(array $filters) {
-
$uris = $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters);
if ($this->isShared()) {
return array_filter($uris, function ($uri) {
diff --git a/apps/dav/lib/CalDAV/CalendarImpl.php b/apps/dav/lib/CalDAV/CalendarImpl.php
index 24121e4fff5..9c7521cb6ba 100644
--- a/apps/dav/lib/CalDAV/CalendarImpl.php
+++ b/apps/dav/lib/CalDAV/CalendarImpl.php
@@ -101,7 +101,7 @@ class CalendarImpl implements ICalendar {
$permissions = $this->calendar->getACL();
$result = 0;
foreach ($permissions as $permission) {
- switch($permission['privilege']) {
+ switch ($permission['privilege']) {
case '{DAV:}read':
$result |= Constants::PERMISSION_READ;
break;
diff --git a/apps/dav/lib/CalDAV/CalendarManager.php b/apps/dav/lib/CalDAV/CalendarManager.php
index b7fff47347f..5b237b0f060 100644
--- a/apps/dav/lib/CalDAV/CalendarManager.php
+++ b/apps/dav/lib/CalDAV/CalendarManager.php
@@ -66,7 +66,7 @@ class CalendarManager {
* @param array $calendars
*/
private function register(IManager $cm, array $calendars) {
- foreach($calendars as $calendarInfo) {
+ foreach ($calendars as $calendarInfo) {
$calendar = new Calendar($this->backend, $calendarInfo, $this->l10n, $this->config);
$cm->registerCalendar(new CalendarImpl(
$calendar,
diff --git a/apps/dav/lib/CalDAV/CalendarObject.php b/apps/dav/lib/CalDAV/CalendarObject.php
index 9a402d3bf2c..8bdde256628 100644
--- a/apps/dav/lib/CalDAV/CalendarObject.php
+++ b/apps/dav/lib/CalDAV/CalendarObject.php
@@ -96,19 +96,19 @@ class CalendarObject extends \Sabre\CalDAV\CalendarObject {
private function createConfidentialObject(Component\VCalendar $vObject) {
/** @var Component $vElement */
$vElement = null;
- if(isset($vObject->VEVENT)) {
+ if (isset($vObject->VEVENT)) {
$vElement = $vObject->VEVENT;
}
- if(isset($vObject->VJOURNAL)) {
+ if (isset($vObject->VJOURNAL)) {
$vElement = $vObject->VJOURNAL;
}
- if(isset($vObject->VTODO)) {
+ if (isset($vObject->VTODO)) {
$vElement = $vObject->VTODO;
}
- if(!is_null($vElement)) {
+ if (!is_null($vElement)) {
foreach ($vElement->children() as &$property) {
/** @var Property $property */
- switch($property->name) {
+ switch ($property->name) {
case 'CREATED':
case 'DTSTART':
case 'RRULE':
@@ -136,7 +136,7 @@ class CalendarObject extends \Sabre\CalDAV\CalendarObject {
private function removeVAlarms(Component\VCalendar $vObject) {
$subcomponents = $vObject->getComponents();
- foreach($subcomponents as $subcomponent) {
+ foreach ($subcomponents as $subcomponent) {
unset($subcomponent->VALARM);
}
}
diff --git a/apps/dav/lib/CalDAV/CalendarRoot.php b/apps/dav/lib/CalDAV/CalendarRoot.php
index b7cceec5bd1..ace8482d9c7 100644
--- a/apps/dav/lib/CalDAV/CalendarRoot.php
+++ b/apps/dav/lib/CalDAV/CalendarRoot.php
@@ -26,7 +26,6 @@
namespace OCA\DAV\CalDAV;
class CalendarRoot extends \Sabre\CalDAV\CalendarRoot {
-
function getChildForPrincipal(array $principal) {
return new CalendarHome($this->caldavBackend, $principal);
}
diff --git a/apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php b/apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php
index 9f4a84e24c5..52e9c330b2f 100644
--- a/apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php
+++ b/apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php
@@ -93,5 +93,4 @@ class ICSExportPlugin extends \Sabre\CalDAV\ICSExportPlugin {
return $vcalendar;
}
-
}
diff --git a/apps/dav/lib/CalDAV/Integration/ExternalCalendar.php b/apps/dav/lib/CalDAV/Integration/ExternalCalendar.php
index 88d43f0bb55..a42c704f53c 100644
--- a/apps/dav/lib/CalDAV/Integration/ExternalCalendar.php
+++ b/apps/dav/lib/CalDAV/Integration/ExternalCalendar.php
@@ -89,7 +89,6 @@ abstract class ExternalCalendar implements CalDAV\ICalendar, DAV\IProperties {
*/
final public function createDirectory($name) {
throw new DAV\Exception\MethodNotAllowed('Creating collections in calendar objects is not allowed');
-
}
/**
diff --git a/apps/dav/lib/CalDAV/Integration/ICalendarProvider.php b/apps/dav/lib/CalDAV/Integration/ICalendarProvider.php
index b15468e460d..298d877f5da 100644
--- a/apps/dav/lib/CalDAV/Integration/ICalendarProvider.php
+++ b/apps/dav/lib/CalDAV/Integration/ICalendarProvider.php
@@ -67,5 +67,4 @@ interface ICalendarProvider {
* @return ExternalCalendar|null Calendar if it exists, null otherwise
*/
public function getCalendarInCalendarHome(string $principalUri, string $calendarUri): ?ExternalCalendar;
-
}
diff --git a/apps/dav/lib/CalDAV/Plugin.php b/apps/dav/lib/CalDAV/Plugin.php
index b7569cac8a4..6d88244bbf1 100644
--- a/apps/dav/lib/CalDAV/Plugin.php
+++ b/apps/dav/lib/CalDAV/Plugin.php
@@ -25,7 +25,6 @@
namespace OCA\DAV\CalDAV;
class Plugin extends \Sabre\CalDAV\Plugin {
-
const SYSTEM_CALENDAR_ROOT = 'system-calendars';
/**
@@ -52,5 +51,4 @@ class Plugin extends \Sabre\CalDAV\Plugin {
return self::SYSTEM_CALENDAR_ROOT . '/calendar-rooms/' . $principalId;
}
}
-
}
diff --git a/apps/dav/lib/CalDAV/Principal/Collection.php b/apps/dav/lib/CalDAV/Principal/Collection.php
index fe345d24801..6e7e20223c8 100644
--- a/apps/dav/lib/CalDAV/Principal/Collection.php
+++ b/apps/dav/lib/CalDAV/Principal/Collection.php
@@ -39,5 +39,4 @@ class Collection extends \Sabre\CalDAV\Principal\Collection {
function getChildForPrincipal(array $principalInfo) {
return new User($this->principalBackend, $principalInfo);
}
-
}
diff --git a/apps/dav/lib/CalDAV/Principal/User.php b/apps/dav/lib/CalDAV/Principal/User.php
index 916dc17ec61..f10773769ca 100644
--- a/apps/dav/lib/CalDAV/Principal/User.php
+++ b/apps/dav/lib/CalDAV/Principal/User.php
@@ -51,5 +51,4 @@ class User extends \Sabre\CalDAV\Principal\User {
];
return $acl;
}
-
}
diff --git a/apps/dav/lib/CalDAV/Proxy/ProxyMapper.php b/apps/dav/lib/CalDAV/Proxy/ProxyMapper.php
index df48b9127cc..bc13efc1e5a 100644
--- a/apps/dav/lib/CalDAV/Proxy/ProxyMapper.php
+++ b/apps/dav/lib/CalDAV/Proxy/ProxyMapper.php
@@ -36,7 +36,6 @@ use OCP\IDBConnection;
* @package OCA\DAV\CalDAV\Proxy
*/
class ProxyMapper extends QBMapper {
-
const PERMISSION_READ = 1;
const PERMISSION_WRITE = 2;
diff --git a/apps/dav/lib/CalDAV/PublicCalendarRoot.php b/apps/dav/lib/CalDAV/PublicCalendarRoot.php
index 17d0d06711c..a79fffa598a 100644
--- a/apps/dav/lib/CalDAV/PublicCalendarRoot.php
+++ b/apps/dav/lib/CalDAV/PublicCalendarRoot.php
@@ -53,7 +53,6 @@ class PublicCalendarRoot extends Collection {
$this->caldavBackend = $caldavBackend;
$this->l10n = $l10n;
$this->config = $config;
-
}
/**
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php
index 61373327c6c..00dee6b0907 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php
@@ -44,7 +44,7 @@ use Sabre\VObject\Property;
*
* @package OCA\DAV\CalDAV\Reminder\NotificationProvider
*/
-abstract class AbstractProvider implements INotificationProvider {
+abstract class AbstractProvider implements INotificationProvider {
/** @var string */
public const NOTIFICATION_TYPE = '';
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
index 3893d24d802..b675b09e427 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
@@ -99,7 +99,7 @@ class EmailProvider extends AbstractProvider {
$sortedByLanguage = $this->sortEMailAddressesByLanguage($emailAddresses, $fallbackLanguage);
$organizer = $this->getOrganizerEMailAndNameFromEvent($vevent);
- foreach($sortedByLanguage as $lang => $emailAddresses) {
+ foreach ($sortedByLanguage as $lang => $emailAddresses) {
if (!$this->hasL10NForLang($lang)) {
$lang = $fallbackLanguage;
}
@@ -212,7 +212,7 @@ class EmailProvider extends AbstractProvider {
string $defaultLanguage):array {
$sortedByLanguage = [];
- foreach($emails as $emailAddress => $parameters) {
+ foreach ($emails as $emailAddress => $parameters) {
if (isset($parameters['LANG'])) {
$lang = $parameters['LANG'];
} else {
@@ -260,7 +260,7 @@ class EmailProvider extends AbstractProvider {
}
$emailAddressesOfDelegates = $delegates->getParts();
- foreach($emailAddressesOfDelegates as $addressesOfDelegate) {
+ foreach ($emailAddressesOfDelegates as $addressesOfDelegate) {
if (strcasecmp($addressesOfDelegate, 'mailto:') === 0) {
$emailAddresses[substr($addressesOfDelegate, 7)] = [];
}
@@ -345,7 +345,7 @@ class EmailProvider extends AbstractProvider {
private function getEMailAddressesOfAllUsersWithWriteAccessToCalendar(array $users):array {
$emailAddresses = [];
- foreach($users as $user) {
+ foreach ($users as $user) {
$emailAddress = $user->getEMailAddress();
if ($emailAddress) {
$lang = $this->getLangForUser($user);
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php
index c83865d1eea..e6c41d02ac4 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php
@@ -39,5 +39,4 @@ class ProviderNotAvailableException extends \Exception {
public function __construct(string $type) {
parent::__construct("No notification provider for type $type available");
}
-
}
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php
index 0074b5c201c..f3da0c03a68 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php
@@ -97,7 +97,7 @@ class PushProvider extends AbstractProvider {
// Empty Notification ObjectId will be catched by OC\Notification\Notification
$eventUUIDHash = $eventUUID ? hash('sha256', $eventUUID, false) : '';
- foreach($users as $user) {
+ foreach ($users as $user) {
/** @var INotification $notification */
$notification = $this->manager->createNotification();
$notification->setApp(Application::APP_ID)
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php b/apps/dav/lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php
index 2f182937a93..1b144fdbbf0 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php
@@ -38,5 +38,4 @@ class NotificationTypeDoesNotExistException extends \Exception {
public function __construct(string $type) {
parent::__construct("Type $type is not an accepted type of notification");
}
-
}
diff --git a/apps/dav/lib/CalDAV/Reminder/Notifier.php b/apps/dav/lib/CalDAV/Reminder/Notifier.php
index c436d4fc329..93390f537ef 100644
--- a/apps/dav/lib/CalDAV/Reminder/Notifier.php
+++ b/apps/dav/lib/CalDAV/Reminder/Notifier.php
@@ -110,7 +110,7 @@ class Notifier implements INotifier {
$this->l10n = $this->l10nFactory->get('dav', $languageCode);
// Handle notifier subjects
- switch($notification->getSubject()) {
+ switch ($notification->getSubject()) {
case 'calendar_reminder':
return $this->prepareReminderNotification($notification);
diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php
index 48feaa0c589..7cf2d52768d 100644
--- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php
+++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php
@@ -111,7 +111,7 @@ class ReminderService {
public function processReminders():void {
$reminders = $this->backend->getRemindersToProcess();
- foreach($reminders as $reminder) {
+ foreach ($reminders as $reminder) {
$calendarData = is_resource($reminder['calendardata'])
? stream_get_contents($reminder['calendardata'])
: $reminder['calendardata'];
@@ -163,7 +163,7 @@ class ReminderService {
return;
}
- switch($action) {
+ switch ($action) {
case '\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject':
$this->onCalendarObjectCreate($objectData);
break;
@@ -206,14 +206,14 @@ class ReminderService {
$now = $this->timeFactory->getDateTime();
$isRecurring = $masterItem ? $this->isRecurring($masterItem) : false;
- foreach($recurrenceExceptions as $recurrenceException) {
+ foreach ($recurrenceExceptions as $recurrenceException) {
$eventHash = $this->getEventHash($recurrenceException);
if (!isset($recurrenceException->VALARM)) {
continue;
}
- foreach($recurrenceException->VALARM as $valarm) {
+ foreach ($recurrenceException->VALARM as $valarm) {
/** @var VAlarm $valarm */
$alarmHash = $this->getAlarmHash($valarm);
$triggerTime = $valarm->getEffectiveTriggerTime();
@@ -237,7 +237,7 @@ class ReminderService {
return;
}
- foreach($masterItem->VALARM as $valarm) {
+ foreach ($masterItem->VALARM as $valarm) {
$masterAlarms[] = $this->getAlarmHash($valarm);
}
@@ -250,7 +250,7 @@ class ReminderService {
return;
}
- while($iterator->valid() && count($processedAlarms) < count($masterAlarms)) {
+ while ($iterator->valid() && count($processedAlarms) < count($masterAlarms)) {
$event = $iterator->getEventObject();
// Recurrence-exceptions are handled separately, so just ignore them here
@@ -259,7 +259,7 @@ class ReminderService {
continue;
}
- foreach($event->VALARM as $valarm) {
+ foreach ($event->VALARM as $valarm) {
/** @var VAlarm $valarm */
$alarmHash = $this->getAlarmHash($valarm);
if (\in_array($alarmHash, $processedAlarms, true)) {
@@ -365,7 +365,7 @@ class ReminderService {
];
$repeat = isset($valarm->REPEAT) ? (int) $valarm->REPEAT->getValue() : 0;
- for($i = 0; $i < $repeat; $i++) {
+ for ($i = 0; $i < $repeat; $i++) {
if ($valarm->DURATION === null) {
continue;
}
@@ -394,7 +394,7 @@ class ReminderService {
* @param array $reminders
*/
private function writeRemindersToDatabase(array $reminders): void {
- foreach($reminders as $reminder) {
+ foreach ($reminders as $reminder) {
$this->backend->insertReminder(
(int) $reminder['calendar_id'],
(int) $reminder['object_id'],
@@ -422,7 +422,6 @@ class ReminderService {
!$reminder['is_recurring'] ||
!$reminder['is_relative'] ||
$reminder['is_recurrence_exception']) {
-
$this->backend->removeReminder($reminder['id']);
return;
}
@@ -440,7 +439,7 @@ class ReminderService {
return;
}
- while($iterator->valid()) {
+ while ($iterator->valid()) {
$event = $iterator->getEventObject();
// Recurrence-exceptions are handled separately, so just ignore them here
@@ -455,7 +454,7 @@ class ReminderService {
continue;
}
- foreach($event->VALARM as $valarm) {
+ foreach ($event->VALARM as $valarm) {
/** @var VAlarm $valarm */
$alarmHash = $this->getAlarmHash($valarm);
if ($alarmHash !== $reminder['alarm_hash']) {
@@ -608,7 +607,7 @@ class ReminderService {
// Handle recurrence-exceptions first, because recurrence-expansion is expensive
if ($isRecurrenceException) {
- foreach($recurrenceExceptions as $recurrenceException) {
+ foreach ($recurrenceExceptions as $recurrenceException) {
if ($this->getEffectiveRecurrenceIdOfVEvent($recurrenceException) === $recurrenceId) {
return $recurrenceException;
}
@@ -678,7 +677,7 @@ class ReminderService {
try {
return VObject\Reader::read($calendarData,
VObject\Reader::OPTION_FORGIVING);
- } catch(ParseException $ex) {
+ } catch (ParseException $ex) {
return null;
}
}
@@ -707,7 +706,7 @@ class ReminderService {
private function getAllVEventsFromVCalendar(VObject\Component\VCalendar $vcalendar):array {
$vevents = [];
- foreach($vcalendar->children() as $child) {
+ foreach ($vcalendar->children() as $child) {
if (!($child instanceof VObject\Component)) {
continue;
}
diff --git a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php
index 96b4371bd7c..2a28c9fc02c 100644
--- a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php
+++ b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php
@@ -125,7 +125,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$metaDataRows = $metaDataStmt->fetchAll(\PDO::FETCH_ASSOC);
$metaDataById = [];
- foreach($metaDataRows as $metaDataRow) {
+ foreach ($metaDataRows as $metaDataRow) {
if (!isset($metaDataById[$metaDataRow[$this->dbForeignKeyName]])) {
$metaDataById[$metaDataRow[$this->dbForeignKeyName]] = [];
}
@@ -134,7 +134,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$metaDataRow['value'];
}
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$id = $row['id'];
if (isset($metaDataById[$id])) {
@@ -142,7 +142,6 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
} else {
$principals[] = $this->rowToPrincipal($row);
}
-
}
$stmt->closeCursor();
@@ -175,7 +174,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$stmt = $query->execute();
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
- if(!$row) {
+ if (!$row) {
return null;
}
@@ -187,7 +186,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$metaDataRows = $metaDataStmt->fetchAll(\PDO::FETCH_ASSOC);
$metadata = [];
- foreach($metaDataRows as $metaDataRow) {
+ foreach ($metaDataRows as $metaDataRow) {
$metadata[$metaDataRow['key']] = $metaDataRow['value'];
}
@@ -206,7 +205,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$stmt = $query->execute();
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
- if(!$row) {
+ if (!$row) {
return null;
}
@@ -218,7 +217,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$metaDataRows = $metaDataStmt->fetchAll(\PDO::FETCH_ASSOC);
$metadata = [];
- foreach($metaDataRows as $metaDataRow) {
+ foreach ($metaDataRows as $metaDataRow) {
$metadata[$metaDataRow['key']] = $metaDataRow['value'];
}
@@ -265,7 +264,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$stmt = $query->execute();
$principals = [];
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
if (!$this->isAllowedToAccessResource($row, $usersGroups)) {
continue;
}
@@ -284,7 +283,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$stmt = $query->execute();
$principals = [];
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
if (!$this->isAllowedToAccessResource($row, $usersGroups)) {
continue;
}
@@ -352,7 +351,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$stmt = $query->execute();
$rows = [];
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$id = $row[$this->dbForeignKeyName];
$principalRow = $this->getPrincipalById($id);
@@ -388,7 +387,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$stmt = $query->execute();
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
- if(!$row) {
+ if (!$row) {
return null;
}
if (!$this->isAllowedToAccessResource($row, $usersGroups)) {
@@ -415,7 +414,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$stmt = $query->execute();
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
- if(!$row) {
+ if (!$row) {
return null;
}
if (!$this->isAllowedToAccessResource($row, $usersGroups)) {
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
index 1e7d66d0772..15228f9bc3d 100644
--- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
+++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
@@ -316,7 +316,7 @@ class IMipPlugin extends SabreIMipPlugin {
$this->logger->error('Unable to deliver message to {failed}', ['app' => 'dav', 'failed' => implode(', ', $failed)]);
$iTipMessage->scheduleStatus = '5.0; EMail delivery failed';
}
- } catch(\Exception $ex) {
+ } catch (\Exception $ex) {
$this->logger->logException($ex, ['app' => 'dav']);
$iTipMessage->scheduleStatus = '5.0; EMail delivery failed';
}
@@ -358,10 +358,9 @@ class IMipPlugin extends SabreIMipPlugin {
$lastOccurrence = $maxDate->getTimestamp();
} else {
$end = $it->getDtEnd();
- while($it->valid() && $end < $maxDate) {
+ while ($it->valid() && $end < $maxDate) {
$end = $it->getDtEnd();
$it->next();
-
}
$lastOccurrence = $end->getTimestamp();
}
diff --git a/apps/dav/lib/CalDAV/Search/SearchPlugin.php b/apps/dav/lib/CalDAV/Search/SearchPlugin.php
index 86aef36482b..dc3cbdf06ba 100644
--- a/apps/dav/lib/CalDAV/Search/SearchPlugin.php
+++ b/apps/dav/lib/CalDAV/Search/SearchPlugin.php
@@ -142,7 +142,6 @@ class SearchPlugin extends ServerPlugin {
// If we're dealing with the calendar home, the calendar home itself is
// responsible for the calendar-query
if ($node instanceof CalendarHome && $depth === 2) {
-
$nodePaths = $node->calendarSearch($report->filters, $report->limit, $report->offset);
foreach ($nodePaths as $path) {
diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php
index ac26e9f94c8..10b065fc426 100644
--- a/apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php
+++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php
@@ -45,7 +45,6 @@ class ParamFilter implements XmlDeserializable {
if (!is_string($property)) {
throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}param-filter requires a valid property attribute');
-
}
if (!is_string($parameter)) {
throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}param-filter requires a valid parameter attribute');
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;
}
diff --git a/apps/dav/lib/Capabilities.php b/apps/dav/lib/Capabilities.php
index cd803abcdd3..2ab06117c38 100644
--- a/apps/dav/lib/Capabilities.php
+++ b/apps/dav/lib/Capabilities.php
@@ -25,7 +25,6 @@ namespace OCA\DAV;
use OCP\Capabilities\ICapability;
class Capabilities implements ICapability {
-
public function getCapabilities() {
return [
'dav' => [
diff --git a/apps/dav/lib/CardDAV/AddressBook.php b/apps/dav/lib/CardDAV/AddressBook.php
index 010e98d18e7..4a9df56e6b4 100644
--- a/apps/dav/lib/CardDAV/AddressBook.php
+++ b/apps/dav/lib/CardDAV/AddressBook.php
@@ -155,14 +155,12 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareable {
}
public function getChild($name) {
-
$obj = $this->carddavBackend->getCard($this->addressBookInfo['id'], $name);
if (!$obj) {
throw new NotFound('Card not found');
}
$obj['acl'] = $this->getChildACL();
return new Card($this->carddavBackend, $this->addressBookInfo, $obj);
-
}
/**
diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php
index 01ebdcd7019..c63955202f4 100644
--- a/apps/dav/lib/CardDAV/AddressBookImpl.php
+++ b/apps/dav/lib/CardDAV/AddressBookImpl.php
@@ -65,7 +65,6 @@ class AddressBookImpl implements IAddressBook {
array $addressBookInfo,
CardDavBackend $backend,
IURLGenerator $urlGenerator) {
-
$this->addressBook = $addressBook;
$this->addressBookInfo = $addressBookInfo;
$this->backend = $backend;
@@ -156,7 +155,6 @@ class AddressBookImpl implements IAddressBook {
}
return $this->vCard2Array($uri, $vCard);
-
}
/**
@@ -167,7 +165,7 @@ class AddressBookImpl implements IAddressBook {
$permissions = $this->addressBook->getACL();
$result = 0;
foreach ($permissions as $permission) {
- switch($permission['privilege']) {
+ switch ($permission['privilege']) {
case '{DAV:}read':
$result |= Constants::PERMISSION_READ;
break;
@@ -261,7 +259,6 @@ class AddressBookImpl implements IAddressBook {
]) . '?photo';
$result['PHOTO'] = 'VALUE=uri:' . $url;
-
} elseif ($property->name === 'X-SOCIALPROFILE') {
$type = $this->getTypeFromProperty($property);
@@ -273,7 +270,7 @@ class AddressBookImpl implements IAddressBook {
$result[$property->name][$type] = $property->getValue();
}
- // The following properties can be set multiple times
+ // The following properties can be set multiple times
} elseif (in_array($property->name, ['CLOUD', 'EMAIL', 'IMPP', 'TEL', 'URL', 'X-ADDRESSBOOKSERVER-MEMBER'])) {
if (!isset($result[$property->name])) {
$result[$property->name] = [];
@@ -288,8 +285,6 @@ class AddressBookImpl implements IAddressBook {
} else {
$result[$property->name][] = $property->getValue();
}
-
-
} else {
$result[$property->name] = $property->getValue();
}
diff --git a/apps/dav/lib/CardDAV/AddressBookRoot.php b/apps/dav/lib/CardDAV/AddressBookRoot.php
index 254f3e0a8e9..771e44b7d32 100644
--- a/apps/dav/lib/CardDAV/AddressBookRoot.php
+++ b/apps/dav/lib/CardDAV/AddressBookRoot.php
@@ -61,7 +61,6 @@ class AddressBookRoot extends \Sabre\CardDAV\AddressBookRoot {
}
function getName() {
-
if ($this->principalPrefix === 'principals') {
return parent::getName();
}
@@ -70,7 +69,5 @@ class AddressBookRoot extends \Sabre\CardDAV\AddressBookRoot {
// We are only interested in the second part.
return $parts[1];
-
}
-
}
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index 54427404db5..47551c8f170 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -55,7 +55,6 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
class CardDavBackend implements BackendInterface, SyncSupport {
-
const PERSONAL_ADDRESSBOOK_URI = 'contacts';
const PERSONAL_ADDRESSBOOK_NAME = 'Contacts';
@@ -155,7 +154,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$addressBooks = [];
$result = $query->execute();
- while($row = $result->fetch()) {
+ while ($row = $result->fetch()) {
$addressBooks[$row['id']] = [
'id' => $row['id'],
'uri' => $row['uri'],
@@ -190,7 +189,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
->execute();
$readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
- while($row = $result->fetch()) {
+ while ($row = $result->fetch()) {
if ($row['principaluri'] === $principalUri) {
continue;
}
@@ -241,7 +240,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$addressBooks = [];
$result = $query->execute();
- while($row = $result->fetch()) {
+ while ($row = $result->fetch()) {
$addressBooks[$row['id']] = [
'id' => $row['id'],
'uri' => $row['uri'],
@@ -364,11 +363,9 @@ class CardDavBackend implements BackendInterface, SyncSupport {
* @suppress SqlInjectionChecker
*/
$propPatch->handle($supportedProperties, function ($mutations) use ($addressBookId) {
-
$updates = [];
- foreach($mutations as $property=>$newValue) {
-
- switch($property) {
+ foreach ($mutations as $property=>$newValue) {
+ switch ($property) {
case '{DAV:}displayname':
$updates['displayname'] = $newValue;
break;
@@ -380,7 +377,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$query = $this->db->getQueryBuilder();
$query->update('addressbooks');
- foreach($updates as $key=>$value) {
+ foreach ($updates as $key=>$value) {
$query->set($key, $query->createNamedParameter($value));
}
$query->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId)))
@@ -389,7 +386,6 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$this->addChange($addressBookId, "", 2);
return true;
-
});
}
@@ -411,9 +407,8 @@ class CardDavBackend implements BackendInterface, SyncSupport {
'synctoken' => 1
];
- foreach($properties as $property=>$newValue) {
-
- switch($property) {
+ foreach ($properties as $property=>$newValue) {
+ switch ($property) {
case '{DAV:}displayname':
$values['displayname'] = $newValue;
break;
@@ -423,12 +418,11 @@ class CardDavBackend implements BackendInterface, SyncSupport {
default:
throw new BadRequest('Unknown property: ' . $property);
}
-
}
// Fallback to make sure the displayname is set. Some clients may refuse
// to work with addressbooks not having a displayname.
- if(is_null($values['displayname'])) {
+ if (is_null($values['displayname'])) {
$values['displayname'] = $url;
}
@@ -475,7 +469,6 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$query->delete($this->dbCardsPropertiesTable)
->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
->execute();
-
}
/**
@@ -506,7 +499,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$cards = [];
$result = $query->execute();
- while($row = $result->fetch()) {
+ while ($row = $result->fetch()) {
$row['etag'] = '"' . $row['etag'] . '"';
$row['carddata'] = $this->readBlob($row['carddata']);
$cards[] = $row;
@@ -680,7 +673,6 @@ class CardDavBackend implements BackendInterface, SyncSupport {
* @return string
*/
function updateCard($addressBookId, $cardUri, $cardData) {
-
$uid = $this->getUID($cardData);
$etag = md5($cardData);
$query = $this->db->getQueryBuilder();
@@ -804,7 +796,9 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$stmt->execute([ $addressBookId ]);
$currentToken = $stmt->fetchColumn(0);
- if (is_null($currentToken)) return null;
+ if (is_null($currentToken)) {
+ return null;
+ }
$result = [
'syncToken' => $currentToken,
@@ -814,7 +808,6 @@ class CardDavBackend implements BackendInterface, SyncSupport {
];
if ($syncToken) {
-
$query = "SELECT `uri`, `operation` FROM `*PREFIX*addressbookchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `addressbookid` = ? ORDER BY `synctoken`";
if ($limit>0) {
$query .= " LIMIT " . (int)$limit;
@@ -828,15 +821,12 @@ class CardDavBackend implements BackendInterface, SyncSupport {
// This loop ensures that any duplicates are overwritten, only the
// last change on a node is relevant.
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
-
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$changes[$row['uri']] = $row['operation'];
-
}
- foreach($changes as $uri => $operation) {
-
- switch($operation) {
+ foreach ($changes as $uri => $operation) {
+ switch ($operation) {
case 1:
$result['added'][] = $uri;
break;
@@ -847,7 +837,6 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$result['deleted'][] = $uri;
break;
}
-
}
} else {
// No synctoken supplied, this is the initial sync.
@@ -924,7 +913,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
// No need for like when the pattern is empty
if ('' !== $pattern) {
- if(\array_key_exists('escape_like_param', $options) && $options['escape_like_param'] === false) {
+ if (\array_key_exists('escape_like_param', $options) && $options['escape_like_param'] === false) {
$query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter($pattern)));
} else {
$query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
@@ -1053,11 +1042,11 @@ class CardDavBackend implements BackendInterface, SyncSupport {
);
foreach ($vCard->children() as $property) {
- if(!in_array($property->name, self::$indexProperties)) {
+ if (!in_array($property->name, self::$indexProperties)) {
continue;
}
$preferred = 0;
- foreach($property->parameters as $parameter) {
+ foreach ($property->parameters as $parameter) {
if ($parameter->name === 'TYPE' && strtoupper($parameter->getValue()) === 'PREF') {
$preferred = 1;
break;
diff --git a/apps/dav/lib/CardDAV/ContactsManager.php b/apps/dav/lib/CardDAV/ContactsManager.php
index ae4906c7d15..20616a65edc 100644
--- a/apps/dav/lib/CardDAV/ContactsManager.php
+++ b/apps/dav/lib/CardDAV/ContactsManager.php
@@ -86,5 +86,4 @@ class ContactsManager {
);
}
}
-
}
diff --git a/apps/dav/lib/CardDAV/Converter.php b/apps/dav/lib/CardDAV/Converter.php
index f3b55ac4a30..8dea77bd0a6 100644
--- a/apps/dav/lib/CardDAV/Converter.php
+++ b/apps/dav/lib/CardDAV/Converter.php
@@ -50,7 +50,6 @@ class Converter {
* @return VCard|null
*/
public function createCardFromUser(IUser $user) {
-
$userData = $this->accountManager->getUser($user);
$uid = $user->getUID();
@@ -68,7 +67,6 @@ class Converter {
}
foreach ($userData as $property => $value) {
-
$shareWithTrustedServers =
$value['scope'] === AccountManager::VISIBILITY_CONTACTS_ONLY ||
$value['scope'] === AccountManager::VISIBILITY_PUBLIC;
@@ -150,5 +148,4 @@ class Converter {
return null;
}
}
-
}
diff --git a/apps/dav/lib/CardDAV/HasPhotoPlugin.php b/apps/dav/lib/CardDAV/HasPhotoPlugin.php
index 4d4af47f812..3cf9e0f9a61 100644
--- a/apps/dav/lib/CardDAV/HasPhotoPlugin.php
+++ b/apps/dav/lib/CardDAV/HasPhotoPlugin.php
@@ -57,7 +57,6 @@ class HasPhotoPlugin extends ServerPlugin {
* @return void
*/
function propFind(PropFind $propFind, INode $node) {
-
$ns = '{http://nextcloud.com/ns}';
if ($node instanceof Card) {
@@ -96,7 +95,5 @@ class HasPhotoPlugin extends ServerPlugin {
'name' => $this->getPluginName(),
'description' => 'Return a boolean stating if the vcard have a photo property set or not.'
];
-
}
-
}
diff --git a/apps/dav/lib/CardDAV/ImageExportPlugin.php b/apps/dav/lib/CardDAV/ImageExportPlugin.php
index 74faa5d7df9..097f52f9576 100644
--- a/apps/dav/lib/CardDAV/ImageExportPlugin.php
+++ b/apps/dav/lib/CardDAV/ImageExportPlugin.php
@@ -65,7 +65,6 @@ class ImageExportPlugin extends ServerPlugin {
* @return bool
*/
public function httpGet(RequestInterface $request, ResponseInterface $response) {
-
$queryParams = $request->getQueryParameters();
// TODO: in addition to photo we should also add logo some point in time
if (!array_key_exists('photo', $queryParams)) {
diff --git a/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php b/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php
index 1bcd3fbe419..0bd01184eba 100644
--- a/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php
+++ b/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php
@@ -87,7 +87,6 @@ abstract class ExternalAddressBook implements IAddressBook, DAV\IProperties {
*/
final public function createDirectory($name) {
throw new DAV\Exception\MethodNotAllowed('Creating collections in address book objects is not allowed');
-
}
/**
@@ -130,5 +129,4 @@ abstract class ExternalAddressBook implements IAddressBook, DAV\IProperties {
public static function doesViolateReservedName(string $uri): bool {
return strpos($uri, self::PREFIX) === 0;
}
-
}
diff --git a/apps/dav/lib/CardDAV/Integration/IAddressBookProvider.php b/apps/dav/lib/CardDAV/Integration/IAddressBookProvider.php
index 6542db23650..4fb3ccf5337 100644
--- a/apps/dav/lib/CardDAV/Integration/IAddressBookProvider.php
+++ b/apps/dav/lib/CardDAV/Integration/IAddressBookProvider.php
@@ -68,5 +68,4 @@ interface IAddressBookProvider {
*@since 19.0.0
*/
public function getAddressBookInAddressBookHome(string $principalUri, string $uri): ?ExternalAddressBook;
-
}
diff --git a/apps/dav/lib/CardDAV/MultiGetExportPlugin.php b/apps/dav/lib/CardDAV/MultiGetExportPlugin.php
index 1a1900b2633..bb911ffc033 100644
--- a/apps/dav/lib/CardDAV/MultiGetExportPlugin.php
+++ b/apps/dav/lib/CardDAV/MultiGetExportPlugin.php
@@ -55,7 +55,6 @@ class MultiGetExportPlugin extends DAV\ServerPlugin {
* @return bool
*/
public function httpReport(RequestInterface $request, ResponseInterface $response) {
-
$queryParams = $request->getQueryParameters();
if (!array_key_exists('export', $queryParams)) {
return;
@@ -118,7 +117,5 @@ class MultiGetExportPlugin extends DAV\ServerPlugin {
'name' => $this->getPluginName(),
'description' => 'Intercept a multi-get request and return a single vcf file instead.'
];
-
}
-
}
diff --git a/apps/dav/lib/CardDAV/PhotoCache.php b/apps/dav/lib/CardDAV/PhotoCache.php
index 2244e99170c..81067f15b17 100644
--- a/apps/dav/lib/CardDAV/PhotoCache.php
+++ b/apps/dav/lib/CardDAV/PhotoCache.php
@@ -164,7 +164,6 @@ class PhotoCache {
$file = $folder->newFile($path);
$file->putContent($photo->data());
} catch (NotPermittedException $e) {
-
}
}
@@ -180,7 +179,7 @@ class PhotoCache {
try {
return $this->appData->getFolder($hash);
} catch (NotFoundException $e) {
- if($createIfNotExists) {
+ if ($createIfNotExists) {
return $this->appData->newFolder($hash);
} else {
throw $e;
diff --git a/apps/dav/lib/CardDAV/Plugin.php b/apps/dav/lib/CardDAV/Plugin.php
index 1d615a13ced..430fda4578d 100644
--- a/apps/dav/lib/CardDAV/Plugin.php
+++ b/apps/dav/lib/CardDAV/Plugin.php
@@ -30,7 +30,6 @@ use Sabre\DAV\PropFind;
use Sabre\DAV\Server;
class Plugin extends \Sabre\CardDAV\Plugin {
-
function initialize(Server $server) {
$server->on('propFind', [$this, 'propFind']);
parent::initialize($server);
@@ -65,11 +64,9 @@ class Plugin extends \Sabre\CardDAV\Plugin {
* @return void
*/
function propFind(PropFind $propFind, INode $node) {
-
$ns = '{http://owncloud.org/ns}';
if ($node instanceof AddressBook) {
-
$propFind->handle($ns . 'groups', function () use ($node) {
return new Groups($node->getContactsGroups());
});
diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php
index c0241de2076..daced49373e 100644
--- a/apps/dav/lib/CardDAV/SyncService.php
+++ b/apps/dav/lib/CardDAV/SyncService.php
@@ -196,17 +196,17 @@ class SyncService {
* @param string $syncToken
* @return array
*/
- protected function requestSyncReport($url, $userName, $addressBookUrl, $sharedSecret, $syncToken) {
- $client = $this->getClient($url, $userName, $sharedSecret);
+ protected function requestSyncReport($url, $userName, $addressBookUrl, $sharedSecret, $syncToken) {
+ $client = $this->getClient($url, $userName, $sharedSecret);
- $body = $this->buildSyncCollectionRequestBody($syncToken);
+ $body = $this->buildSyncCollectionRequestBody($syncToken);
- $response = $client->request('REPORT', $addressBookUrl, $body, [
- 'Content-Type' => 'application/xml'
- ]);
+ $response = $client->request('REPORT', $addressBookUrl, $body, [
+ 'Content-Type' => 'application/xml'
+ ]);
- return $this->parseMultiStatus($response['body']);
- }
+ return $this->parseMultiStatus($response['body']);
+ }
/**
* @param string $url
@@ -225,7 +225,6 @@ class SyncService {
* @return string
*/
private function buildSyncCollectionRequestBody($syncToken) {
-
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->formatOutput = true;
$root = $dom->createElementNS('DAV:', 'd:sync-collection');
@@ -297,7 +296,7 @@ class SyncService {
*/
public function deleteUser($userOrCardId) {
$systemAddressBook = $this->getLocalSystemAddressBook();
- if ($userOrCardId instanceof IUser){
+ if ($userOrCardId instanceof IUser) {
$name = $userOrCardId->getBackendClassName();
$userId = $userOrCardId->getUID();
@@ -331,7 +330,7 @@ class SyncService {
// remove no longer existing
$allCards = $this->backend->getCards($systemAddressBook['id']);
- foreach($allCards as $card) {
+ foreach ($allCards as $card) {
$vCard = Reader::read($card['carddata']);
$uid = $vCard->UID->getValue();
// load backend and see if user exists
@@ -340,6 +339,4 @@ class SyncService {
}
}
}
-
-
}
diff --git a/apps/dav/lib/CardDAV/UserAddressBooks.php b/apps/dav/lib/CardDAV/UserAddressBooks.php
index 7ebe3b03d11..18fc286fdd9 100644
--- a/apps/dav/lib/CardDAV/UserAddressBooks.php
+++ b/apps/dav/lib/CardDAV/UserAddressBooks.php
@@ -108,7 +108,6 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {
* @return array
*/
function getACL() {
-
$acl = parent::getACL();
if ($this->principalUri === 'principals/system/system') {
$acl[] = [
@@ -120,5 +119,4 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {
return $acl;
}
-
}
diff --git a/apps/dav/lib/Command/ListCalendars.php b/apps/dav/lib/Command/ListCalendars.php
index 00f14605eca..e63fbd2066e 100644
--- a/apps/dav/lib/Command/ListCalendars.php
+++ b/apps/dav/lib/Command/ListCalendars.php
@@ -70,7 +70,7 @@ class ListCalendars extends Command {
$calendars = $this->caldav->getCalendarsForUser("principals/users/$user");
$calendarTableData = [];
- foreach($calendars as $calendar) {
+ foreach ($calendars as $calendar) {
// skip birthday calendar
if ($calendar['uri'] === BirthdayService::BIRTHDAY_CALENDAR_URI) {
continue;
@@ -101,5 +101,4 @@ class ListCalendars extends Command {
$output->writeln("<info>User <$user> has no calendars</info>");
}
}
-
}
diff --git a/apps/dav/lib/Command/MoveCalendar.php b/apps/dav/lib/Command/MoveCalendar.php
index 8399fb5ed32..845e8970698 100644
--- a/apps/dav/lib/Command/MoveCalendar.php
+++ b/apps/dav/lib/Command/MoveCalendar.php
@@ -146,8 +146,7 @@ class MoveCalendar extends Command {
* @param string $userDestination
* @param bool $force
*/
- private function checkShares(array $calendar, string $userOrigin, string $userDestination, bool $force = false)
- {
+ private function checkShares(array $calendar, string $userOrigin, string $userDestination, bool $force = false) {
$shares = $this->calDav->getShares($calendar['id']);
foreach ($shares as $share) {
list(, $prefix, $userOrGroup) = explode('/', $share['href'], 3);
diff --git a/apps/dav/lib/Command/RemoveInvalidShares.php b/apps/dav/lib/Command/RemoveInvalidShares.php
index 9e3aecc60ed..b72396c96cd 100644
--- a/apps/dav/lib/Command/RemoveInvalidShares.php
+++ b/apps/dav/lib/Command/RemoveInvalidShares.php
@@ -62,7 +62,7 @@ class RemoveInvalidShares extends Command {
->from('dav_shares')
->execute();
- while($row = $result->fetch()) {
+ while ($row = $result->fetch()) {
$principaluri = $row['principaluri'];
$p = $this->principalBackend->getPrincipalByPath($principaluri);
if ($p === null) {
diff --git a/apps/dav/lib/Comments/CommentNode.php b/apps/dav/lib/Comments/CommentNode.php
index d24c41409ba..e02eef1cd51 100644
--- a/apps/dav/lib/Comments/CommentNode.php
+++ b/apps/dav/lib/Comments/CommentNode.php
@@ -88,8 +88,8 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties {
$methods = array_filter($methods, function ($name) {
return strpos($name, 'get') === 0;
});
- foreach($methods as $getter) {
- if($getter === 'getMentions') {
+ foreach ($methods as $getter) {
+ if ($getter === 'getMentions') {
continue; // special treatment
}
$name = '{'.self::NS_OWNCLOUD.'}' . lcfirst(substr($getter, 3));
@@ -131,7 +131,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties {
protected function checkWriteAccessOnComment() {
$user = $this->userSession->getUser();
- if($this->comment->getActorType() !== 'users'
+ if ($this->comment->getActorType() !== 'users'
|| is_null($user)
|| $this->comment->getActorId() !== $user->getUID()
) {
@@ -195,7 +195,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties {
return true;
} catch (\Exception $e) {
$this->logger->logException($e, ['app' => 'dav/comments']);
- if($e instanceof MessageTooLongException) {
+ if ($e instanceof MessageTooLongException) {
$msg = 'Message exceeds allowed character limit of ';
throw new BadRequest($msg . IComment::MAX_MESSAGE_LENGTH, 0, $e);
}
@@ -239,14 +239,14 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties {
$properties = array_keys($this->properties);
$result = [];
- foreach($properties as $property) {
+ foreach ($properties as $property) {
$getter = $this->properties[$property];
- if(method_exists($this->comment, $getter)) {
+ if (method_exists($this->comment, $getter)) {
$result[$property] = $this->comment->$getter();
}
}
- if($this->comment->getActorType() === 'users') {
+ if ($this->comment->getActorType() === 'users') {
$user = $this->userManager->get($this->comment->getActorId());
$displayName = is_null($user) ? null : $user->getDisplayName();
$result[self::PROPERTY_NAME_ACTOR_DISPLAYNAME] = $displayName;
@@ -256,13 +256,13 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties {
$unread = null;
$user = $this->userSession->getUser();
- if(!is_null($user)) {
+ if (!is_null($user)) {
$readUntil = $this->commentsManager->getReadMark(
$this->comment->getObjectType(),
$this->comment->getObjectId(),
$user
);
- if(is_null($readUntil)) {
+ if (is_null($readUntil)) {
$unread = 'true';
} else {
$unread = $this->comment->getCreationDateTime() > $readUntil;
diff --git a/apps/dav/lib/Comments/CommentsPlugin.php b/apps/dav/lib/Comments/CommentsPlugin.php
index 55b0bdd4b40..ebdf3fde318 100644
--- a/apps/dav/lib/Comments/CommentsPlugin.php
+++ b/apps/dav/lib/Comments/CommentsPlugin.php
@@ -85,7 +85,7 @@ class CommentsPlugin extends ServerPlugin {
*/
function initialize(Server $server) {
$this->server = $server;
- if(strpos($this->server->getRequestUri(), 'comments/') !== 0) {
+ if (strpos($this->server->getRequestUri(), 'comments/') !== 0) {
return;
}
@@ -158,7 +158,7 @@ class CommentsPlugin extends ServerPlugin {
*/
public function onReport($reportName, $report, $uri) {
$node = $this->server->tree->getNodeForPath($uri);
- if(!$node instanceof EntityCollection || $reportName !== self::REPORT_NAME) {
+ if (!$node instanceof EntityCollection || $reportName !== self::REPORT_NAME) {
throw new ReportNotSupported();
}
$args = ['limit' => 0, 'offset' => 0, 'datetime' => null];
@@ -168,31 +168,30 @@ class CommentsPlugin extends ServerPlugin {
$this::REPORT_PARAM_TIMESTAMP
];
$ns = '{' . $this::NS_OWNCLOUD . '}';
- foreach($report as $parameter) {
- if(!in_array($parameter['name'], $acceptableParameters) || empty($parameter['value'])) {
+ foreach ($report as $parameter) {
+ if (!in_array($parameter['name'], $acceptableParameters) || empty($parameter['value'])) {
continue;
}
$args[str_replace($ns, '', $parameter['name'])] = $parameter['value'];
}
- if(!is_null($args['datetime'])) {
+ if (!is_null($args['datetime'])) {
$args['datetime'] = new \DateTime($args['datetime']);
}
$results = $node->findChildren($args['limit'], $args['offset'], $args['datetime']);
$responses = [];
- foreach($results as $node) {
+ foreach ($results as $node) {
$nodePath = $this->server->getRequestUri() . '/' . $node->comment->getId();
$resultSet = $this->server->getPropertiesForPath($nodePath, CommentNode::getPropertyNames());
- if(isset($resultSet[0]) && isset($resultSet[0][200])) {
+ if (isset($resultSet[0]) && isset($resultSet[0][200])) {
$responses[] = new Response(
$this->server->getBaseUri() . $nodePath,
[200 => $resultSet[0][200]],
200
);
}
-
}
$xml = $this->server->xml->write(
@@ -228,13 +227,13 @@ class CommentsPlugin extends ServerPlugin {
$actorType = $data['actorType'];
$actorId = null;
- if($actorType === 'users') {
+ if ($actorType === 'users') {
$user = $this->userSession->getUser();
- if(!is_null($user)) {
+ if (!is_null($user)) {
$actorId = $user->getUID();
}
}
- if(is_null($actorId)) {
+ if (is_null($actorId)) {
throw new BadRequest('Invalid actor "' . $actorType .'"');
}
@@ -251,7 +250,4 @@ class CommentsPlugin extends ServerPlugin {
throw new BadRequest($msg . \OCP\Comments\IComment::MAX_MESSAGE_LENGTH, 0, $e);
}
}
-
-
-
}
diff --git a/apps/dav/lib/Comments/EntityCollection.php b/apps/dav/lib/Comments/EntityCollection.php
index fadf83df063..94ee3d2a250 100644
--- a/apps/dav/lib/Comments/EntityCollection.php
+++ b/apps/dav/lib/Comments/EntityCollection.php
@@ -65,9 +65,9 @@ class EntityCollection extends RootCollection implements IProperties {
IUserSession $userSession,
ILogger $logger
) {
- foreach(['id', 'name'] as $property) {
+ foreach (['id', 'name'] as $property) {
$$property = trim($$property);
- if(empty($$property) || !is_string($$property)) {
+ if (empty($$property) || !is_string($$property)) {
throw new \InvalidArgumentException('"' . $property . '" parameter must be non-empty string');
}
}
@@ -134,7 +134,7 @@ class EntityCollection extends RootCollection implements IProperties {
function findChildren($limit = 0, $offset = 0, \DateTime $datetime = null) {
$comments = $this->commentsManager->getForObject($this->name, $this->id, $limit, $offset, $datetime);
$result = [];
- foreach($comments as $comment) {
+ foreach ($comments as $comment) {
$result[] = new CommentNode(
$this->commentsManager,
$comment,
@@ -187,7 +187,7 @@ class EntityCollection extends RootCollection implements IProperties {
function getProperties($properties) {
$marker = null;
$user = $this->userSession->getUser();
- if(!is_null($user)) {
+ if (!is_null($user)) {
$marker = $this->commentsManager->getReadMark($this->name, $this->id, $user);
}
return [self::PROPERTY_NAME_READ_MARKER => $marker];
diff --git a/apps/dav/lib/Comments/EntityTypeCollection.php b/apps/dav/lib/Comments/EntityTypeCollection.php
index 4d282b21184..275b41c87e0 100644
--- a/apps/dav/lib/Comments/EntityTypeCollection.php
+++ b/apps/dav/lib/Comments/EntityTypeCollection.php
@@ -69,7 +69,7 @@ class EntityTypeCollection extends RootCollection {
\Closure $childExistsFunction
) {
$name = trim($name);
- if(empty($name) || !is_string($name)) {
+ if (empty($name) || !is_string($name)) {
throw new \InvalidArgumentException('"name" parameter must be non-empty string');
}
$this->name = $name;
@@ -91,7 +91,7 @@ class EntityTypeCollection extends RootCollection {
* @throws NotFound
*/
function getChild($name) {
- if(!$this->childExists($name)) {
+ if (!$this->childExists($name)) {
throw new NotFound('Entity does not exist or is not available');
}
return new EntityCollection(
@@ -123,5 +123,4 @@ class EntityTypeCollection extends RootCollection {
function childExists($name) {
return call_user_func($this->childExistsFunction, $name);
}
-
}
diff --git a/apps/dav/lib/Comments/RootCollection.php b/apps/dav/lib/Comments/RootCollection.php
index 1a4cfbedb9e..b6703a13a11 100644
--- a/apps/dav/lib/Comments/RootCollection.php
+++ b/apps/dav/lib/Comments/RootCollection.php
@@ -70,8 +70,7 @@ class RootCollection implements ICollection {
IUserManager $userManager,
IUserSession $userSession,
EventDispatcherInterface $dispatcher,
- ILogger $logger)
- {
+ ILogger $logger) {
$this->commentsManager = $commentsManager;
$this->logger = $logger;
$this->userManager = $userManager;
@@ -87,11 +86,11 @@ class RootCollection implements ICollection {
* @throws NotAuthenticated
*/
protected function initCollections() {
- if($this->entityTypeCollections !== null) {
+ if ($this->entityTypeCollections !== null) {
return;
}
$user = $this->userSession->getUser();
- if(is_null($user)) {
+ if (is_null($user)) {
throw new NotAuthenticated();
}
@@ -145,7 +144,7 @@ class RootCollection implements ICollection {
*/
function getChild($name) {
$this->initCollections();
- if(isset($this->entityTypeCollections[$name])) {
+ if (isset($this->entityTypeCollections[$name])) {
return $this->entityTypeCollections[$name];
}
throw new NotFound('Entity type "' . $name . '" not found."');
diff --git a/apps/dav/lib/Connector/LegacyDAVACL.php b/apps/dav/lib/Connector/LegacyDAVACL.php
index d763c4b4a68..8a892a01203 100644
--- a/apps/dav/lib/Connector/LegacyDAVACL.php
+++ b/apps/dav/lib/Connector/LegacyDAVACL.php
@@ -38,7 +38,9 @@ class LegacyDAVACL extends DavAclPlugin {
public function getCurrentUserPrincipals() {
$principalV2 = $this->getCurrentUserPrincipal();
- if (is_null($principalV2)) return [];
+ if (is_null($principalV2)) {
+ return [];
+ }
$principalV1 = $this->convertPrincipal($principalV2, false);
return array_merge(
diff --git a/apps/dav/lib/Connector/PublicAuth.php b/apps/dav/lib/Connector/PublicAuth.php
index 59c5c0a38e6..cffc295d46d 100644
--- a/apps/dav/lib/Connector/PublicAuth.php
+++ b/apps/dav/lib/Connector/PublicAuth.php
@@ -98,7 +98,6 @@ class PublicAuth extends AbstractBasic {
// check if the share is password protected
if ($share->getPassword() !== null) {
-
if ($share->getShareType() === IShare::TYPE_LINK
|| $share->getShareType() === IShare::TYPE_EMAIL
|| $share->getShareType() === IShare::TYPE_CIRCLE) {
diff --git a/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php b/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php
index ee15d137b63..28264b05057 100644
--- a/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php
@@ -72,7 +72,6 @@ class AppEnabledPlugin extends ServerPlugin {
* @return void
*/
public function initialize(\Sabre\DAV\Server $server) {
-
$this->server = $server;
$this->server->on('beforeMethod:*', [$this, 'checkAppEnabled'], 30);
}
diff --git a/apps/dav/lib/Connector/Sabre/Auth.php b/apps/dav/lib/Connector/Sabre/Auth.php
index 15ea9447ffd..8457670be6b 100644
--- a/apps/dav/lib/Connector/Sabre/Auth.php
+++ b/apps/dav/lib/Connector/Sabre/Auth.php
@@ -50,8 +50,6 @@ use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
class Auth extends AbstractBasic {
-
-
const DAV_AUTHENTICATED = 'AUTHENTICATED_TO_DAV_BACKEND';
/** @var ISession */
@@ -173,12 +171,12 @@ class Auth extends AbstractBasic {
*/
private function requiresCSRFCheck() {
// GET requires no check at all
- if($this->request->getMethod() === 'GET') {
+ if ($this->request->getMethod() === 'GET') {
return false;
}
// Official Nextcloud clients require no checks
- if($this->request->isUserAgent([
+ if ($this->request->isUserAgent([
IRequest::USER_AGENT_CLIENT_DESKTOP,
IRequest::USER_AGENT_CLIENT_ANDROID,
IRequest::USER_AGENT_CLIENT_IOS,
@@ -187,17 +185,17 @@ class Auth extends AbstractBasic {
}
// If not logged-in no check is required
- if(!$this->userSession->isLoggedIn()) {
+ if (!$this->userSession->isLoggedIn()) {
return false;
}
// POST always requires a check
- if($this->request->getMethod() === 'POST') {
+ if ($this->request->getMethod() === 'POST') {
return true;
}
// If logged-in AND DAV authenticated no check is required
- if($this->userSession->isLoggedIn() &&
+ if ($this->userSession->isLoggedIn() &&
$this->isDavAuthenticated($this->userSession->getUser()->getUID())) {
return false;
}
@@ -214,10 +212,10 @@ class Auth extends AbstractBasic {
private function auth(RequestInterface $request, ResponseInterface $response) {
$forcedLogout = false;
- if(!$this->request->passesCSRFCheck() &&
+ if (!$this->request->passesCSRFCheck() &&
$this->requiresCSRFCheck()) {
// In case of a fail with POST we need to recheck the credentials
- if($this->request->getMethod() === 'POST') {
+ if ($this->request->getMethod() === 'POST') {
$forcedLogout = true;
} else {
$response->setStatus(401);
@@ -225,10 +223,10 @@ class Auth extends AbstractBasic {
}
}
- if($forcedLogout) {
+ if ($forcedLogout) {
$this->userSession->logout();
} else {
- if($this->twoFactorManager->needsSecondFactor($this->userSession->getUser())) {
+ if ($this->twoFactorManager->needsSecondFactor($this->userSession->getUser())) {
throw new \Sabre\DAV\Exception\NotAuthenticated('2FA challenge not passed.');
}
if (
@@ -254,7 +252,7 @@ class Auth extends AbstractBasic {
}
$data = parent::check($request, $response);
- if($data[0] === true) {
+ if ($data[0] === true) {
$startPos = strrpos($data[1], '/') + 1;
$user = $this->userSession->getUser()->getUID();
$data[1] = substr_replace($data[1], $user, $startPos);
diff --git a/apps/dav/lib/Connector/Sabre/BearerAuth.php b/apps/dav/lib/Connector/Sabre/BearerAuth.php
index 61945a51d7b..cc01874e541 100644
--- a/apps/dav/lib/Connector/Sabre/BearerAuth.php
+++ b/apps/dav/lib/Connector/Sabre/BearerAuth.php
@@ -72,10 +72,10 @@ class BearerAuth extends AbstractBearer {
public function validateBearerToken($bearerToken) {
\OC_Util::setupFS();
- if(!$this->userSession->isLoggedIn()) {
+ if (!$this->userSession->isLoggedIn()) {
$this->userSession->tryTokenLogin($this->request);
}
- if($this->userSession->isLoggedIn()) {
+ if ($this->userSession->isLoggedIn()) {
return $this->setupUserFs($this->userSession->getUser()->getUID());
}
diff --git a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php
index 1ddebe06ee1..b64feb22f48 100644
--- a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php
@@ -65,7 +65,7 @@ class BlockLegacyClientPlugin extends ServerPlugin {
*/
public function beforeHandler(RequestInterface $request) {
$userAgent = $request->getHeader('User-Agent');
- if($userAgent === null) {
+ if ($userAgent === null) {
return;
}
@@ -74,7 +74,7 @@ class BlockLegacyClientPlugin extends ServerPlugin {
// Match on the mirall version which is in scheme "Mozilla/5.0 (%1) mirall/%2" or
// "mirall/%1" for older releases
preg_match("/(?:mirall\\/)([\d.]+)/i", $userAgent, $versionMatches);
- if(isset($versionMatches[1]) &&
+ if (isset($versionMatches[1]) &&
version_compare($versionMatches[1], $minimumSupportedDesktopVersion) === -1) {
throw new \Sabre\DAV\Exception\Forbidden('Unsupported client version.');
}
diff --git a/apps/dav/lib/Connector/Sabre/ChecksumList.php b/apps/dav/lib/Connector/Sabre/ChecksumList.php
index 2fb8a0293e7..f5c0a3d9b01 100644
--- a/apps/dav/lib/Connector/Sabre/ChecksumList.php
+++ b/apps/dav/lib/Connector/Sabre/ChecksumList.php
@@ -64,7 +64,6 @@ class ChecksumList implements XmlSerializable {
* @return void
*/
function xmlSerialize(Writer $writer) {
-
foreach ($this->checksums as $checksum) {
$writer->writeElement('{' . self::NS_OWNCLOUD . '}checksum', $checksum);
}
diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
index 51d453e3f2a..31ea282308e 100644
--- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
@@ -32,7 +32,6 @@ use Sabre\DAV\PropFind;
use Sabre\DAV\ServerPlugin;
class CommentPropertiesPlugin extends ServerPlugin {
-
const PROPERTY_NAME_HREF = '{http://owncloud.org/ns}comments-href';
const PROPERTY_NAME_COUNT = '{http://owncloud.org/ns}comments-count';
const PROPERTY_NAME_UNREAD = '{http://owncloud.org/ns}comments-unread';
@@ -134,7 +133,7 @@ class CommentPropertiesPlugin extends ServerPlugin {
public function getCommentsLink(Node $node) {
$href = $this->server->getBaseUri();
$entryPoint = strpos($href, '/remote.php/');
- if($entryPoint === false) {
+ if ($entryPoint === false) {
// in case we end up somewhere else, unexpectedly.
return null;
}
@@ -152,7 +151,7 @@ class CommentPropertiesPlugin extends ServerPlugin {
*/
public function getUnreadCount(Node $node) {
$user = $this->userSession->getUser();
- if(is_null($user)) {
+ if (is_null($user)) {
return null;
}
@@ -160,5 +159,4 @@ class CommentPropertiesPlugin extends ServerPlugin {
return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId(), $lastRead);
}
-
}
diff --git a/apps/dav/lib/Connector/Sabre/DavAclPlugin.php b/apps/dav/lib/Connector/Sabre/DavAclPlugin.php
index ebe6d4cefab..67be788eb04 100644
--- a/apps/dav/lib/Connector/Sabre/DavAclPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/DavAclPlugin.php
@@ -50,11 +50,11 @@ class DavAclPlugin extends \Sabre\DAVACL\Plugin {
function checkPrivileges($uri, $privileges, $recursion = self::R_PARENT, $throwExceptions = true) {
$access = parent::checkPrivileges($uri, $privileges, $recursion, false);
- if($access === false && $throwExceptions) {
+ if ($access === false && $throwExceptions) {
/** @var INode $node */
$node = $this->server->tree->getNodeForPath($uri);
- switch(get_class($node)) {
+ switch (get_class($node)) {
case AddressBook::class:
$type = 'Addressbook';
break;
@@ -77,7 +77,7 @@ class DavAclPlugin extends \Sabre\DAVACL\Plugin {
public function propFind(PropFind $propFind, INode $node) {
// If the node is neither readable nor writable then fail unless its of
// the standard user-principal
- if(!($node instanceof User)) {
+ if (!($node instanceof User)) {
$path = $propFind->getPath();
$readPermissions = $this->checkPrivileges($path, '{DAV:}read', self::R_PARENT, false);
$writePermissions = $this->checkPrivileges($path, '{DAV:}write', self::R_PARENT, false);
diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php
index 71b7e33d284..0e4ddd1f232 100644
--- a/apps/dav/lib/Connector/Sabre/Directory.php
+++ b/apps/dav/lib/Connector/Sabre/Directory.php
@@ -118,7 +118,6 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node
* @throws \Sabre\DAV\Exception\ServiceUnavailable
*/
public function createFile($name, $data = null) {
-
try {
// for chunked upload also updating a existing file is a "createFile"
// because we create all the chunks before re-assemble them to the existing file.
@@ -131,7 +130,6 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node
) {
throw new \Sabre\DAV\Exception\Forbidden();
}
-
} else {
// For non-chunked upload it is enough to check if we can create a new file
if (!$this->fileView->isCreatable($this->path)) {
@@ -293,7 +291,6 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node
// TODO: resolve chunk file name here and implement "updateFile"
$path = $this->path . '/' . $name;
return $this->fileView->file_exists($path);
-
}
/**
@@ -304,7 +301,6 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node
* @throws \Sabre\DAV\Exception\Forbidden
*/
public function delete() {
-
if ($this->path === '' || $this->path === '/' || !$this->info->isDeletable()) {
throw new \Sabre\DAV\Exception\Forbidden();
}
diff --git a/apps/dav/lib/Connector/Sabre/Exception/EntityTooLarge.php b/apps/dav/lib/Connector/Sabre/Exception/EntityTooLarge.php
index 970524dca1c..36b114b88fb 100644
--- a/apps/dav/lib/Connector/Sabre/Exception/EntityTooLarge.php
+++ b/apps/dav/lib/Connector/Sabre/Exception/EntityTooLarge.php
@@ -39,9 +39,6 @@ class EntityTooLarge extends \Sabre\DAV\Exception {
* @return int
*/
public function getHTTPCode() {
-
return 413;
-
}
-
}
diff --git a/apps/dav/lib/Connector/Sabre/Exception/FileLocked.php b/apps/dav/lib/Connector/Sabre/Exception/FileLocked.php
index 13af4d888bb..2db4faf50d7 100644
--- a/apps/dav/lib/Connector/Sabre/Exception/FileLocked.php
+++ b/apps/dav/lib/Connector/Sabre/Exception/FileLocked.php
@@ -29,9 +29,8 @@ namespace OCA\DAV\Connector\Sabre\Exception;
use Exception;
class FileLocked extends \Sabre\DAV\Exception {
-
public function __construct($message = "", $code = 0, Exception $previous = null) {
- if($previous instanceof \OCP\Files\LockNotAcquiredException) {
+ if ($previous instanceof \OCP\Files\LockNotAcquiredException) {
$message = sprintf('Target file %s is locked by another process.', $previous->path);
}
parent::__construct($message, $code, $previous);
@@ -43,7 +42,6 @@ class FileLocked extends \Sabre\DAV\Exception {
* @return int
*/
public function getHTTPCode() {
-
return 423;
}
}
diff --git a/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php b/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php
index 94ff9a05123..46659737e87 100644
--- a/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php
+++ b/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php
@@ -23,7 +23,6 @@
namespace OCA\DAV\Connector\Sabre\Exception;
class Forbidden extends \Sabre\DAV\Exception\Forbidden {
-
const NS_OWNCLOUD = 'http://owncloud.org/ns';
/**
diff --git a/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php b/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php
index a330653e05c..2871fd83e09 100644
--- a/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php
+++ b/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php
@@ -26,7 +26,6 @@ namespace OCA\DAV\Connector\Sabre\Exception;
use Sabre\DAV\Exception;
class InvalidPath extends Exception {
-
const NS_OWNCLOUD = 'http://owncloud.org/ns';
/**
@@ -50,9 +49,7 @@ class InvalidPath extends Exception {
* @return int
*/
public function getHTTPCode() {
-
return 400;
-
}
/**
@@ -76,5 +73,4 @@ class InvalidPath extends Exception {
$error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage());
$errorNode->appendChild($error);
}
-
}
diff --git a/apps/dav/lib/Connector/Sabre/Exception/PasswordLoginForbidden.php b/apps/dav/lib/Connector/Sabre/Exception/PasswordLoginForbidden.php
index 5851ed8158a..c3e417b20ad 100644
--- a/apps/dav/lib/Connector/Sabre/Exception/PasswordLoginForbidden.php
+++ b/apps/dav/lib/Connector/Sabre/Exception/PasswordLoginForbidden.php
@@ -29,7 +29,6 @@ use Sabre\DAV\Exception\NotAuthenticated;
use Sabre\DAV\Server;
class PasswordLoginForbidden extends NotAuthenticated {
-
const NS_OWNCLOUD = 'http://owncloud.org/ns';
public function getHTTPCode() {
@@ -52,5 +51,4 @@ class PasswordLoginForbidden extends NotAuthenticated {
$error = $errorNode->ownerDocument->createElementNS('o:', 'o:hint', 'password login forbidden');
$errorNode->appendChild($error);
}
-
}
diff --git a/apps/dav/lib/Connector/Sabre/Exception/UnsupportedMediaType.php b/apps/dav/lib/Connector/Sabre/Exception/UnsupportedMediaType.php
index cb39b3ca423..700625a2299 100644
--- a/apps/dav/lib/Connector/Sabre/Exception/UnsupportedMediaType.php
+++ b/apps/dav/lib/Connector/Sabre/Exception/UnsupportedMediaType.php
@@ -39,9 +39,6 @@ class UnsupportedMediaType extends \Sabre\DAV\Exception {
* @return int
*/
public function getHTTPCode() {
-
return 415;
-
}
-
}
diff --git a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php
index dc65837c746..9a6b19ea3fa 100644
--- a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php
@@ -103,7 +103,6 @@ class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin {
* @return void
*/
public function initialize(\Sabre\DAV\Server $server) {
-
$server->on('exception', [$this, 'logException'], 10);
}
diff --git a/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php b/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php
index 62c9915cc4e..bca15e15688 100644
--- a/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php
@@ -104,11 +104,11 @@ class FakeLockerPlugin extends ServerPlugin {
* @param array $conditions
*/
public function validateTokens(RequestInterface $request, &$conditions) {
- foreach($conditions as &$fileCondition) {
- if(isset($fileCondition['tokens'])) {
- foreach($fileCondition['tokens'] as &$token) {
- if(isset($token['token'])) {
- if(substr($token['token'], 0, 16) === 'opaquelocktoken:') {
+ foreach ($conditions as &$fileCondition) {
+ if (isset($fileCondition['tokens'])) {
+ foreach ($fileCondition['tokens'] as &$token) {
+ if (isset($token['token'])) {
+ if (substr($token['token'], 0, 16) === 'opaquelocktoken:') {
$token['validToken'] = true;
}
}
@@ -126,7 +126,6 @@ class FakeLockerPlugin extends ServerPlugin {
*/
public function fakeLockProvider(RequestInterface $request,
ResponseInterface $response) {
-
$lockInfo = new LockInfo();
$lockInfo->token = md5($request->getPath());
$lockInfo->uri = $request->getPath();
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php
index d025ba2aaca..2c108819e9f 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -70,7 +70,6 @@ use Sabre\DAV\Exception\ServiceUnavailable;
use Sabre\DAV\IFile;
class File extends Node implements IFile {
-
protected $request;
/**
@@ -175,7 +174,6 @@ class File extends Node implements IFile {
}
if ($partStorage->instanceOfStorage(Storage\IWriteStreamStorage::class)) {
-
if (!is_resource($data)) {
$tmpData = fopen('php://temp', 'r+');
if ($data !== null) {
@@ -199,7 +197,6 @@ class File extends Node implements IFile {
$result = feof($wrappedData);
}
}
-
} else {
$target = $partStorage->fopen($internalPartPath, 'wb');
if ($target === false) {
@@ -230,7 +227,6 @@ class File extends Node implements IFile {
throw new BadRequest('Expected filesize of ' . $expected . ' bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) ' . $count . ' bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.');
}
}
-
} catch (\Exception $e) {
$context = [];
@@ -332,7 +328,6 @@ class File extends Node implements IFile {
$this->fileView->putFileInfo($this->path, ['checksum' => '']);
$this->refreshInfo();
}
-
} catch (StorageNotAvailableException $e) {
throw new ServiceUnavailable("Failed to check file size: " . $e->getMessage(), 0, $e);
}
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index 890e65a7fa5..5f2bbdd12e3 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -252,7 +252,9 @@ class FilesPlugin extends ServerPlugin {
function httpGet(RequestInterface $request, ResponseInterface $response) {
// Only handle valid files
$node = $this->tree->getNodeForPath($request->getPath());
- if (!($node instanceof IFile)) return;
+ if (!($node instanceof IFile)) {
+ return;
+ }
// adds a 'Content-Disposition: attachment' header in case no disposition
// header has been set before
@@ -290,7 +292,6 @@ class FilesPlugin extends ServerPlugin {
* @return void
*/
public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node) {
-
$httpRequest = $this->server->httpRequest;
if ($node instanceof \OCA\DAV\Connector\Sabre\Node) {
@@ -412,7 +413,6 @@ class FilesPlugin extends ServerPlugin {
$propFind->handle(self::UPLOAD_TIME_PROPERTYNAME, function () use ($node) {
return $node->getFileInfo()->getUploadTime();
});
-
}
if ($node instanceof \OCA\DAV\Connector\Sabre\Directory) {
@@ -433,7 +433,6 @@ class FilesPlugin extends ServerPlugin {
* @return array
*/
protected function ncPermissions2ocmPermissions($ncPermissions) {
-
$ocmPermissions = [];
if ($ncPermissions & Constants::PERMISSION_SHARE) {
@@ -450,7 +449,6 @@ class FilesPlugin extends ServerPlugin {
}
return $ocmPermissions;
-
}
/**
diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
index 4c7c689bde3..617847626cc 100644
--- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
@@ -151,7 +151,6 @@ class FilesReportPlugin extends ServerPlugin {
* @return void
*/
public function initialize(\Sabre\DAV\Server $server) {
-
$server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
$this->server = $server;
@@ -282,7 +281,6 @@ class FilesReportPlugin extends ServerPlugin {
if ($filterRule['name'] === $ns . 'favorite') {
$favoriteFilter = true;
}
-
}
if ($favoriteFilter !== null) {
diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php
index 1dd209a8303..83f90fa4ba2 100644
--- a/apps/dav/lib/Connector/Sabre/Node.php
+++ b/apps/dav/lib/Connector/Sabre/Node.php
@@ -323,7 +323,7 @@ abstract class Node implements \Sabre\DAV\INode {
$shares = $this->shareManager->getSharedWith($user, $shareType, $this, -1);
foreach ($shares as $share) {
$note = $share->getNote();
- if($share->getShareOwner() !== $user && !empty($note)) {
+ if ($share->getShareOwner() !== $user && !empty($note)) {
return $note;
}
}
@@ -416,5 +416,4 @@ abstract class Node implements \Sabre\DAV\INode {
return (int)$mtimeFromRequest;
}
-
}
diff --git a/apps/dav/lib/Connector/Sabre/ObjectTree.php b/apps/dav/lib/Connector/Sabre/ObjectTree.php
index e3a7dccffdc..e292744cd2f 100644
--- a/apps/dav/lib/Connector/Sabre/ObjectTree.php
+++ b/apps/dav/lib/Connector/Sabre/ObjectTree.php
@@ -181,7 +181,6 @@ class ObjectTree extends CachingTree {
$this->cache[$path] = $node;
return $node;
-
}
/**
diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php
index 2acc783eecf..b6a96053cb3 100644
--- a/apps/dav/lib/Connector/Sabre/Principal.php
+++ b/apps/dav/lib/Connector/Sabre/Principal.php
@@ -132,7 +132,7 @@ class Principal implements BackendInterface {
$principals = [];
if ($prefixPath === $this->principalPrefix) {
- foreach($this->userManager->search('') as $user) {
+ foreach ($this->userManager->search('') as $user) {
$principals[] = $this->userToPrincipal($user);
}
}
@@ -206,7 +206,7 @@ class Principal implements BackendInterface {
if ($this->hasGroups || $needGroups) {
$userGroups = $this->groupManager->getUserGroups($user);
- foreach($userGroups as $userGroup) {
+ foreach ($userGroups as $userGroup) {
$groups[] = 'principals/groups/' . urlencode($userGroup->getGID());
}
}
@@ -477,9 +477,9 @@ class Principal implements BackendInterface {
try {
$circle = \OCA\Circles\Api\v1\Circles::detailsCircle($circleUniqueId, true);
- } catch(QueryException $ex) {
+ } catch (QueryException $ex) {
return null;
- } catch(CircleDoesNotExistException $ex) {
+ } catch (CircleDoesNotExistException $ex) {
return null;
}
diff --git a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
index f6da755aaf7..92187b92daf 100644
--- a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
@@ -72,7 +72,6 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
* @return void
*/
public function initialize(\Sabre\DAV\Server $server) {
-
$this->server = $server;
$server->on('beforeWriteContent', [$this, 'beforeWriteContent'], 10);
@@ -153,7 +152,7 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
if ($length) {
list($parentPath, $newName) = \Sabre\Uri\split($path);
- if(is_null($parentPath)) {
+ if (is_null($parentPath)) {
$parentPath = '';
}
$req = $this->server->httpRequest;
diff --git a/apps/dav/lib/Connector/Sabre/ServerFactory.php b/apps/dav/lib/Connector/Sabre/ServerFactory.php
index f740284f271..0f7f753b86f 100644
--- a/apps/dav/lib/Connector/Sabre/ServerFactory.php
+++ b/apps/dav/lib/Connector/Sabre/ServerFactory.php
@@ -128,7 +128,7 @@ class ServerFactory {
$server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin());
// Some WebDAV clients do require Class 2 WebDAV support (locking), since
// we do not provide locking we emulate it using a fake locking plugin.
- if($this->request->isUserAgent([
+ if ($this->request->isUserAgent([
'/WebDAVFS/',
'/OneNote/',
'/Microsoft-WebDAV-MiniRedir/',
@@ -173,7 +173,7 @@ class ServerFactory {
);
$server->addPlugin(new \OCA\DAV\Connector\Sabre\QuotaPlugin($view, true));
- if($this->userSession->isLoggedIn()) {
+ if ($this->userSession->isLoggedIn()) {
$server->addPlugin(new \OCA\DAV\Connector\Sabre\TagsPlugin($objectTree, $this->tagManager));
$server->addPlugin(new \OCA\DAV\Connector\Sabre\SharesPlugin(
$objectTree,
@@ -216,7 +216,6 @@ class ServerFactory {
foreach ($pluginManager->getAppPlugins() as $appPlugin) {
$server->addPlugin($appPlugin);
}
-
}, 30); // priority 30: after auth (10) and acl(20), before lock(50) and handling the request
return $server;
}
diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php
index ef1e7236c9b..ee4246011bf 100644
--- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php
@@ -35,7 +35,6 @@ use Sabre\DAV\PropFind;
* Sabre Plugin to provide share-related properties
*/
class SharesPlugin extends \Sabre\DAV\ServerPlugin {
-
const NS_OWNCLOUD = 'http://owncloud.org/ns';
const NS_NEXTCLOUD = 'http://nextcloud.org/ns';
const SHARETYPES_PROPERTYNAME = '{http://owncloud.org/ns}share-types';
diff --git a/apps/dav/lib/Connector/Sabre/TagList.php b/apps/dav/lib/Connector/Sabre/TagList.php
index e3f248ee3e2..72c3fb31b07 100644
--- a/apps/dav/lib/Connector/Sabre/TagList.php
+++ b/apps/dav/lib/Connector/Sabre/TagList.php
@@ -56,9 +56,7 @@ class TagList implements Element {
* @return array
*/
public function getTags() {
-
return $this->tags;
-
}
/**
@@ -117,7 +115,6 @@ class TagList implements Element {
* @return void
*/
function xmlSerialize(Writer $writer) {
-
foreach ($this->tags as $tag) {
$writer->writeElement('{' . self::NS_OWNCLOUD . '}tag', $tag);
}
diff --git a/apps/dav/lib/Connector/Sabre/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php
index 83995a31e57..33698810cfb 100644
--- a/apps/dav/lib/Connector/Sabre/TagsPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/TagsPlugin.php
@@ -52,8 +52,7 @@ namespace OCA\DAV\Connector\Sabre;
use Sabre\DAV\PropFind;
use Sabre\DAV\PropPatch;
-class TagsPlugin extends \Sabre\DAV\ServerPlugin
-{
+class TagsPlugin extends \Sabre\DAV\ServerPlugin {
// namespace
const NS_OWNCLOUD = 'http://owncloud.org/ns';
@@ -114,7 +113,6 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
* @return void
*/
public function initialize(\Sabre\DAV\Server $server) {
-
$server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
$server->xml->elementMap[self::TAGS_PROPERTYNAME] = TagList::class;
diff --git a/apps/dav/lib/Controller/InvitationResponseController.php b/apps/dav/lib/Controller/InvitationResponseController.php
index adf139a3fd3..aeb7350336b 100644
--- a/apps/dav/lib/Controller/InvitationResponseController.php
+++ b/apps/dav/lib/Controller/InvitationResponseController.php
@@ -172,7 +172,7 @@ class InvitationResponseController extends Controller {
$stmt = $query->execute();
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
- if(!$row) {
+ if (!$row) {
return null;
}
diff --git a/apps/dav/lib/DAV/CustomPropertiesBackend.php b/apps/dav/lib/DAV/CustomPropertiesBackend.php
index a50f171f6f3..b25c33add82 100644
--- a/apps/dav/lib/DAV/CustomPropertiesBackend.php
+++ b/apps/dav/lib/DAV/CustomPropertiesBackend.php
@@ -236,7 +236,6 @@ class CustomPropertiesBackend implements BackendInterface {
* @return bool
*/
private function updateProperties(string $path, array $properties) {
-
$deleteStatement = 'DELETE FROM `*PREFIX*properties`' .
' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?';
diff --git a/apps/dav/lib/DAV/GroupPrincipalBackend.php b/apps/dav/lib/DAV/GroupPrincipalBackend.php
index 04fe0223607..f03c7cc2bdd 100644
--- a/apps/dav/lib/DAV/GroupPrincipalBackend.php
+++ b/apps/dav/lib/DAV/GroupPrincipalBackend.php
@@ -36,7 +36,6 @@ use Sabre\DAV\PropPatch;
use Sabre\DAVACL\PrincipalBackend\BackendInterface;
class GroupPrincipalBackend implements BackendInterface {
-
const PRINCIPAL_PREFIX = 'principals/groups';
/** @var IGroupManager */
@@ -78,7 +77,7 @@ class GroupPrincipalBackend implements BackendInterface {
$principals = [];
if ($prefixPath === self::PRINCIPAL_PREFIX) {
- foreach($this->groupManager->search('') as $user) {
+ foreach ($this->groupManager->search('') as $user) {
$principals[] = $this->groupToPrincipal($user);
}
}
diff --git a/apps/dav/lib/DAV/PublicAuth.php b/apps/dav/lib/DAV/PublicAuth.php
index ad917fb4b76..407f1a2853f 100644
--- a/apps/dav/lib/DAV/PublicAuth.php
+++ b/apps/dav/lib/DAV/PublicAuth.php
@@ -68,7 +68,6 @@ class PublicAuth implements BackendInterface {
* @return array
*/
function check(RequestInterface $request, ResponseInterface $response) {
-
if ($this->isRequestPublic($request)) {
return [true, "principals/system/public"];
}
diff --git a/apps/dav/lib/DAV/Sharing/Backend.php b/apps/dav/lib/DAV/Sharing/Backend.php
index bb04918716e..ae69e33387c 100644
--- a/apps/dav/lib/DAV/Sharing/Backend.php
+++ b/apps/dav/lib/DAV/Sharing/Backend.php
@@ -70,13 +70,13 @@ class Backend {
* @param string[] $remove
*/
public function updateShares(IShareable $shareable, array $add, array $remove) {
- foreach($add as $element) {
+ foreach ($add as $element) {
$principal = $this->principalBackend->findByUri($element['href'], '');
if ($principal !== '') {
$this->shareWith($shareable, $element);
}
}
- foreach($remove as $element) {
+ foreach ($remove as $element) {
$principal = $this->principalBackend->findByUri($element, '');
if ($principal !== '') {
$this->unshare($shareable, $element);
@@ -195,7 +195,7 @@ class Backend {
->execute();
$shares = [];
- while($row = $result->fetch()) {
+ while ($row = $result->fetch()) {
$p = $this->principalBackend->getPrincipalByPath($row['principaluri']);
$shares[]= [
'href' => "principal:${row['principaluri']}",
@@ -218,7 +218,6 @@ class Backend {
* @return array
*/
public function applyShareAcl($resourceId, $acl) {
-
$shares = $this->getShares($resourceId);
foreach ($shares as $share) {
$acl[] = [
diff --git a/apps/dav/lib/DAV/Sharing/IShareable.php b/apps/dav/lib/DAV/Sharing/IShareable.php
index 7da6549ee4f..1293721040a 100644
--- a/apps/dav/lib/DAV/Sharing/IShareable.php
+++ b/apps/dav/lib/DAV/Sharing/IShareable.php
@@ -74,5 +74,4 @@ interface IShareable extends INode {
* @return string
*/
public function getOwner();
-
}
diff --git a/apps/dav/lib/DAV/Sharing/Plugin.php b/apps/dav/lib/DAV/Sharing/Plugin.php
index f0c2b82ccbf..67eed9c9b4a 100644
--- a/apps/dav/lib/DAV/Sharing/Plugin.php
+++ b/apps/dav/lib/DAV/Sharing/Plugin.php
@@ -37,7 +37,6 @@ use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
class Plugin extends ServerPlugin {
-
const NS_OWNCLOUD = 'http://owncloud.org/ns';
const NS_NEXTCLOUD = 'http://nextcloud.com/ns';
@@ -117,13 +116,13 @@ class Plugin extends ServerPlugin {
* @return null|false
*/
function httpPost(RequestInterface $request, ResponseInterface $response) {
-
$path = $request->getPath();
// Only handling xml
$contentType = $request->getHeader('Content-Type');
- if (strpos($contentType, 'application/xml') === false && strpos($contentType, 'text/xml') === false)
+ if (strpos($contentType, 'application/xml') === false && strpos($contentType, 'text/xml') === false) {
return;
+ }
// Making sure the node exists
try {
@@ -191,14 +190,11 @@ class Plugin extends ServerPlugin {
*/
function propFind(PropFind $propFind, INode $node) {
if ($node instanceof IShareable) {
-
$propFind->handle('{' . Plugin::NS_OWNCLOUD . '}invite', function () use ($node) {
return new Invite(
$node->getShares()
);
});
-
}
}
-
}
diff --git a/apps/dav/lib/DAV/Sharing/Xml/Invite.php b/apps/dav/lib/DAV/Sharing/Xml/Invite.php
index 7852fa8431b..68aab171ab7 100644
--- a/apps/dav/lib/DAV/Sharing/Xml/Invite.php
+++ b/apps/dav/lib/DAV/Sharing/Xml/Invite.php
@@ -85,10 +85,8 @@ class Invite implements XmlSerializable {
* @param array $users
*/
function __construct(array $users, array $organizer = null) {
-
$this->users = $users;
$this->organizer = $organizer;
-
}
/**
@@ -97,9 +95,7 @@ class Invite implements XmlSerializable {
* @return array
*/
function getValue() {
-
return $this->users;
-
}
/**
@@ -122,11 +118,9 @@ class Invite implements XmlSerializable {
* @return void
*/
function xmlSerialize(Writer $writer) {
-
$cs = '{' . Plugin::NS_OWNCLOUD . '}';
if (!is_null($this->organizer)) {
-
$writer->startElement($cs . 'organizer');
$writer->writeElement('{DAV:}href', $this->organizer['href']);
@@ -140,11 +134,9 @@ class Invite implements XmlSerializable {
$writer->writeElement($cs . 'last-name', $this->organizer['lastName']);
}
$writer->endElement(); // organizer
-
}
foreach ($this->users as $user) {
-
$writer->startElement($cs . 'user');
$writer->writeElement('{DAV:}href', $user['href']);
if (isset($user['commonName']) && $user['commonName']) {
@@ -165,8 +157,6 @@ class Invite implements XmlSerializable {
}
$writer->endElement(); //user
-
}
-
}
}
diff --git a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php
index c63bb4fe1d1..d76e65aa232 100644
--- a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php
+++ b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php
@@ -28,7 +28,6 @@ use Sabre\Xml\Reader;
use Sabre\Xml\XmlDeserializable;
class ShareRequest implements XmlDeserializable {
-
public $set = [];
public $remove = [];
@@ -40,14 +39,11 @@ class ShareRequest implements XmlDeserializable {
* @param array $remove
*/
function __construct(array $set, array $remove) {
-
$this->set = $set;
$this->remove = $remove;
-
}
static function xmlDeserialize(Reader $reader) {
-
$elements = $reader->parseInnerTree([
'{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue',
'{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue',
@@ -81,7 +77,5 @@ class ShareRequest implements XmlDeserializable {
}
return new self($set, $remove);
-
}
-
}
diff --git a/apps/dav/lib/DAV/SystemPrincipalBackend.php b/apps/dav/lib/DAV/SystemPrincipalBackend.php
index 6c1c5a932fb..c369f4da375 100644
--- a/apps/dav/lib/DAV/SystemPrincipalBackend.php
+++ b/apps/dav/lib/DAV/SystemPrincipalBackend.php
@@ -69,7 +69,6 @@ class SystemPrincipalBackend extends AbstractBackend {
* @return array
*/
function getPrincipalByPath($path) {
-
if ($path === 'principals/system/system') {
$principal = [
'uri' => 'principals/system/system',
diff --git a/apps/dav/lib/Db/DirectMapper.php b/apps/dav/lib/Db/DirectMapper.php
index 3c8198c5390..f088011d1dc 100644
--- a/apps/dav/lib/Db/DirectMapper.php
+++ b/apps/dav/lib/Db/DirectMapper.php
@@ -31,7 +31,6 @@ use OCP\AppFramework\Db\Mapper;
use OCP\IDBConnection;
class DirectMapper extends Mapper {
-
public function __construct(IDBConnection $db) {
parent::__construct($db, 'directlink', Direct::class);
}
diff --git a/apps/dav/lib/Direct/DirectFile.php b/apps/dav/lib/Direct/DirectFile.php
index 69ee9d9d883..f9b29d0af6e 100644
--- a/apps/dav/lib/Direct/DirectFile.php
+++ b/apps/dav/lib/Direct/DirectFile.php
@@ -108,5 +108,4 @@ class DirectFile implements IFile {
return $this->file;
}
-
}
diff --git a/apps/dav/lib/Direct/DirectHome.php b/apps/dav/lib/Direct/DirectHome.php
index c383e0220f8..8fc85be3bf1 100644
--- a/apps/dav/lib/Direct/DirectHome.php
+++ b/apps/dav/lib/Direct/DirectHome.php
@@ -116,5 +116,4 @@ class DirectHome implements ICollection {
public function getLastModified(): int {
return 0;
}
-
}
diff --git a/apps/dav/lib/Direct/ServerFactory.php b/apps/dav/lib/Direct/ServerFactory.php
index 9c4045708d2..f0f56921bdc 100644
--- a/apps/dav/lib/Direct/ServerFactory.php
+++ b/apps/dav/lib/Direct/ServerFactory.php
@@ -57,7 +57,5 @@ class ServerFactory {
$server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin($this->config));
return $server;
-
-
}
}
diff --git a/apps/dav/lib/Files/BrowserErrorPagePlugin.php b/apps/dav/lib/Files/BrowserErrorPagePlugin.php
index 9589ea11e0e..47de5020d56 100644
--- a/apps/dav/lib/Files/BrowserErrorPagePlugin.php
+++ b/apps/dav/lib/Files/BrowserErrorPagePlugin.php
@@ -98,7 +98,7 @@ class BrowserErrorPagePlugin extends ServerPlugin {
$request = \OC::$server->getRequest();
$templateName = 'exception';
- if($httpCode === 403 || $httpCode === 404) {
+ if ($httpCode === 403 || $httpCode === 404) {
$templateName = (string)$httpCode;
}
diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php
index 751580eabfc..fd951961623 100644
--- a/apps/dav/lib/Files/FileSearchBackend.php
+++ b/apps/dav/lib/Files/FileSearchBackend.php
@@ -419,7 +419,7 @@ class FileSearchBackend implements ISearchBackend {
} else {
throw new \InvalidArgumentException("searching by '$propertyName' is only allowed with a literal value");
}
- } else{
+ } else {
throw new \InvalidArgumentException("searching by '$propertyName' is not allowed inside a '{DAV:}or' or '{DAV:}not'");
}
} else {
diff --git a/apps/dav/lib/Files/LazySearchBackend.php b/apps/dav/lib/Files/LazySearchBackend.php
index 992205da72b..2ec41ccfd12 100644
--- a/apps/dav/lib/Files/LazySearchBackend.php
+++ b/apps/dav/lib/Files/LazySearchBackend.php
@@ -67,6 +67,4 @@ class LazySearchBackend implements ISearchBackend {
return [];
}
}
-
-
}
diff --git a/apps/dav/lib/Files/RootCollection.php b/apps/dav/lib/Files/RootCollection.php
index 6e2b7ef09d2..22142b46e1c 100644
--- a/apps/dav/lib/Files/RootCollection.php
+++ b/apps/dav/lib/Files/RootCollection.php
@@ -61,5 +61,4 @@ class RootCollection extends AbstractPrincipalCollection {
function getName() {
return 'files';
}
-
}
diff --git a/apps/dav/lib/Files/Sharing/FilesDropPlugin.php b/apps/dav/lib/Files/Sharing/FilesDropPlugin.php
index 6dbdeaa6fd9..b4201ef80c1 100644
--- a/apps/dav/lib/Files/Sharing/FilesDropPlugin.php
+++ b/apps/dav/lib/Files/Sharing/FilesDropPlugin.php
@@ -67,7 +67,6 @@ class FilesDropPlugin extends ServerPlugin {
}
public function beforeMethod(RequestInterface $request, ResponseInterface $response) {
-
if (!$this->enabled) {
return;
}
diff --git a/apps/dav/lib/HookManager.php b/apps/dav/lib/HookManager.php
index 72d20eb2813..558aad72c03 100644
--- a/apps/dav/lib/HookManager.php
+++ b/apps/dav/lib/HookManager.php
@@ -123,7 +123,7 @@ class HookManager {
public function postDeleteUser($params) {
$uid = $params['uid'];
- if (isset($this->usersToDelete[$uid])){
+ if (isset($this->usersToDelete[$uid])) {
$this->syncService->deleteUser($this->usersToDelete[$uid]);
}
@@ -138,7 +138,7 @@ class HookManager {
}
public function postUnassignedUserId($uid) {
- if (isset($this->usersToDelete[$uid])){
+ if (isset($this->usersToDelete[$uid])) {
$this->syncService->deleteUser($this->usersToDelete[$uid]);
}
}
diff --git a/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php
index c482de5b6df..ef608a8f1be 100644
--- a/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php
+++ b/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php
@@ -102,7 +102,7 @@ class BuildCalendarSearchIndexBackgroundJob extends QueuedJob {
->orderBy('id', 'ASC');
$stmt = $query->execute();
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$offset = $row['id'];
$calendarData = $row['calendardata'];
diff --git a/apps/dav/lib/Migration/ChunkCleanup.php b/apps/dav/lib/Migration/ChunkCleanup.php
index e691314b34a..90d3b569591 100644
--- a/apps/dav/lib/Migration/ChunkCleanup.php
+++ b/apps/dav/lib/Migration/ChunkCleanup.php
@@ -93,5 +93,4 @@ class ChunkCleanup implements IRepairStep {
$this->config->setAppValue('dav', 'chunks_migrated', '1');
}
-
}
diff --git a/apps/dav/lib/Migration/RefreshWebcalJobRegistrar.php b/apps/dav/lib/Migration/RefreshWebcalJobRegistrar.php
index 6f32978d3d8..618fb674ca3 100644
--- a/apps/dav/lib/Migration/RefreshWebcalJobRegistrar.php
+++ b/apps/dav/lib/Migration/RefreshWebcalJobRegistrar.php
@@ -68,7 +68,7 @@ class RefreshWebcalJobRegistrar implements IRepairStep {
$stmt = $query->execute();
$count = 0;
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$args = [
'principaluri' => $row['principaluri'],
'uri' => $row['uri'],
diff --git a/apps/dav/lib/Migration/Version1004Date20170919104507.php b/apps/dav/lib/Migration/Version1004Date20170919104507.php
index a71688777a0..a581978868c 100644
--- a/apps/dav/lib/Migration/Version1004Date20170919104507.php
+++ b/apps/dav/lib/Migration/Version1004Date20170919104507.php
@@ -56,5 +56,4 @@ class Version1004Date20170919104507 extends SimpleMigrationStep {
return $schema;
}
-
}
diff --git a/apps/dav/lib/Migration/Version1004Date20170926103422.php b/apps/dav/lib/Migration/Version1004Date20170926103422.php
index ce76d929d8b..3881e922935 100644
--- a/apps/dav/lib/Migration/Version1004Date20170926103422.php
+++ b/apps/dav/lib/Migration/Version1004Date20170926103422.php
@@ -52,5 +52,4 @@ class Version1004Date20170926103422 extends BigIntMigration {
'schedulingobjects' => ['id'],
];
}
-
}
diff --git a/apps/dav/lib/Migration/Version1005Date20180530124431.php b/apps/dav/lib/Migration/Version1005Date20180530124431.php
index 655f8165a23..8642294e6bc 100644
--- a/apps/dav/lib/Migration/Version1005Date20180530124431.php
+++ b/apps/dav/lib/Migration/Version1005Date20180530124431.php
@@ -44,7 +44,7 @@ class Version1005Date20180530124431 extends SimpleMigrationStep {
$schema = $schemaClosure();
$types = ['resources', 'rooms'];
- foreach($types as $type) {
+ foreach ($types as $type) {
if (!$schema->hasTable('calendar_' . $type)) {
$table = $schema->createTable('calendar_' . $type);
diff --git a/apps/dav/lib/Migration/Version1008Date20181105110300.php b/apps/dav/lib/Migration/Version1008Date20181105110300.php
index ec556ed281d..e36ec34dd8d 100644
--- a/apps/dav/lib/Migration/Version1008Date20181105110300.php
+++ b/apps/dav/lib/Migration/Version1008Date20181105110300.php
@@ -76,5 +76,4 @@ class Version1008Date20181105110300 extends SimpleMigrationStep {
->set('source', 'source_copy')
->execute();
}
-
}
diff --git a/apps/dav/lib/Migration/Version1011Date20190725113607.php b/apps/dav/lib/Migration/Version1011Date20190725113607.php
index c2604c8e274..4163d0d0ec6 100644
--- a/apps/dav/lib/Migration/Version1011Date20190725113607.php
+++ b/apps/dav/lib/Migration/Version1011Date20190725113607.php
@@ -49,7 +49,7 @@ class Version1011Date20190725113607 extends SimpleMigrationStep {
$schema = $schemaClosure();
$types = ['resource', 'room'];
- foreach($types as $type) {
+ foreach ($types as $type) {
if (!$schema->hasTable($this->getMetadataTableName($type))) {
$table = $schema->createTable($this->getMetadataTableName($type));
diff --git a/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php b/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php
index c7a3f4f60f1..98c9ce0b6e1 100644
--- a/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php
+++ b/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php
@@ -30,7 +30,6 @@ use Sabre\DAV\IProperties;
use Sabre\DAV\PropPatch;
class AppleProvisioningNode implements INode, IProperties {
-
const FILENAME = 'apple-provisioning.mobileconfig';
protected $timeFactory;
diff --git a/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php b/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php
index e4feaf5d42f..7b00532495e 100644
--- a/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php
+++ b/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php
@@ -157,28 +157,28 @@ class AppleProvisioningPlugin extends ServerPlugin {
$xmlSkeleton = $this->getTemplate();
$body = vsprintf($xmlSkeleton, array_map(function ($v) {
- return \htmlspecialchars($v, ENT_XML1, 'UTF-8');
- }, [
- $description,
- $server_url,
- $userId,
- $serverPort,
- $caldavDescription,
- $caldavDisplayname,
- $caldavIdentifier,
- $caldavUUID,
- $description,
- $server_url,
- $userId,
- $serverPort,
- $carddavDescription,
- $carddavDisplayname,
- $carddavIdentifier,
- $carddavUUID,
- $description,
- $profileIdentifier,
- $profileUUID
- ]
+ return \htmlspecialchars($v, ENT_XML1, 'UTF-8');
+ }, [
+ $description,
+ $server_url,
+ $userId,
+ $serverPort,
+ $caldavDescription,
+ $caldavDisplayname,
+ $caldavIdentifier,
+ $caldavUUID,
+ $description,
+ $server_url,
+ $userId,
+ $serverPort,
+ $carddavDescription,
+ $carddavDisplayname,
+ $carddavIdentifier,
+ $carddavUUID,
+ $description,
+ $profileIdentifier,
+ $profileUUID
+ ]
));
$response->setStatus(200);
diff --git a/apps/dav/lib/RootCollection.php b/apps/dav/lib/RootCollection.php
index e50c2a882ca..53cba3eefa0 100644
--- a/apps/dav/lib/RootCollection.php
+++ b/apps/dav/lib/RootCollection.php
@@ -48,7 +48,6 @@ use OCP\AppFramework\Utility\ITimeFactory;
use Sabre\DAV\SimpleCollection;
class RootCollection extends SimpleCollection {
-
public function __construct() {
$config = \OC::$server->getConfig();
$l10n = \OC::$server->getL10N('dav');
@@ -176,5 +175,4 @@ class RootCollection extends SimpleCollection {
parent::__construct('root', $children);
}
-
}
diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php
index 1a432008a3a..b71c16e2319 100644
--- a/apps/dav/lib/Server.php
+++ b/apps/dav/lib/Server.php
@@ -126,7 +126,7 @@ class Server {
$authPlugin->addBackend($authBackend);
// debugging
- if(\OC::$server->getConfig()->getSystemValue('debug', false)) {
+ if (\OC::$server->getConfig()->getSystemValue('debug', false)) {
$this->server->addPlugin(new \Sabre\DAV\Browser\Plugin());
} else {
$this->server->addPlugin(new DummyGetResponsePlugin());
@@ -201,7 +201,7 @@ class Server {
// Some WebDAV clients do require Class 2 WebDAV support (locking), since
// we do not provide locking we emulate it using a fake locking plugin.
- if($request->isUserAgent([
+ if ($request->isUserAgent([
'/WebDAVFS/',
'/OneNote/',
'/^Microsoft-WebDAV/',// Microsoft-WebDAV-MiniRedir/6.1.7601
diff --git a/apps/dav/lib/SystemTag/SystemTagPlugin.php b/apps/dav/lib/SystemTag/SystemTagPlugin.php
index 4ca7b041884..b05ba07ead2 100644
--- a/apps/dav/lib/SystemTag/SystemTagPlugin.php
+++ b/apps/dav/lib/SystemTag/SystemTagPlugin.php
@@ -103,7 +103,6 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin {
* @return void
*/
public function initialize(\Sabre\DAV\Server $server) {
-
$server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
$server->protectedProperties[] = self::ID_PROPERTYNAME;
@@ -194,8 +193,8 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin {
}
}
- if($userVisible === false || $userAssignable === false || !empty($groups)) {
- if(!$this->userSession->isLoggedIn() || !$this->groupManager->isAdmin($this->userSession->getUser()->getUID())) {
+ if ($userVisible === false || $userAssignable === false || !empty($groups)) {
+ if (!$this->userSession->isLoggedIn() || !$this->groupManager->isAdmin($this->userSession->getUser()->getUID())) {
throw new BadRequest('Not sufficient permissions');
}
}
@@ -323,6 +322,5 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin {
return true;
});
-
}
}
diff --git a/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php b/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php
index ff0409c7ea0..80741342991 100644
--- a/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php
+++ b/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php
@@ -120,7 +120,7 @@ class SystemTagsObjectTypeCollection implements ICollection {
*/
function getChild($objectId) {
// make sure the object exists and is reachable
- if(!$this->childExists($objectId)) {
+ if (!$this->childExists($objectId)) {
throw new NotFound('Entity does not exist or is not available');
}
return new SystemTagsObjectMappingCollection(
diff --git a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php
index e85480d4a2f..bc4e6a8c4c4 100644
--- a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php
+++ b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php
@@ -91,5 +91,4 @@ class SystemTagsRelationsCollection extends SimpleCollection {
function setName($name) {
throw new Forbidden('Permission denied to rename this collection');
}
-
}
diff --git a/apps/dav/lib/Traits/PrincipalProxyTrait.php b/apps/dav/lib/Traits/PrincipalProxyTrait.php
index ee8ac58e3c6..b47b462a450 100644
--- a/apps/dav/lib/Traits/PrincipalProxyTrait.php
+++ b/apps/dav/lib/Traits/PrincipalProxyTrait.php
@@ -193,7 +193,6 @@ trait PrincipalProxyTrait {
return $proxy === 'calendar-proxy-read'
|| $proxy === 'calendar-proxy-write';
-
}
/**
diff --git a/apps/dav/lib/Upload/AssemblyStream.php b/apps/dav/lib/Upload/AssemblyStream.php
index 560fc7c07bc..6421abec3d5 100644
--- a/apps/dav/lib/Upload/AssemblyStream.php
+++ b/apps/dav/lib/Upload/AssemblyStream.php
@@ -115,7 +115,7 @@ class AssemblyStream implements \Icewind\Streams\File {
$stream = $this->getStream($this->nodes[$nodeIndex]);
$nodeOffset = $offset - $nodeStart;
- if(fseek($stream, $nodeOffset) === -1) {
+ if (fseek($stream, $nodeOffset) === -1) {
return false;
}
$this->currentNode = $nodeIndex;
diff --git a/apps/dav/lib/Upload/RootCollection.php b/apps/dav/lib/Upload/RootCollection.php
index ce18b5277ec..3dfddf5c0a4 100644
--- a/apps/dav/lib/Upload/RootCollection.php
+++ b/apps/dav/lib/Upload/RootCollection.php
@@ -55,5 +55,4 @@ class RootCollection extends AbstractPrincipalCollection {
public function getName(): string {
return 'uploads';
}
-
}