diff --git a/apps/accessibility/lib/AccessibilityProvider.php b/apps/accessibility/lib/AccessibilityProvider.php
index ef8571528b..1325c73166 100644
--- a/apps/accessibility/lib/AccessibilityProvider.php
+++ b/apps/accessibility/lib/AccessibilityProvider.php
@@ -91,5 +91,4 @@ class AccessibilityProvider {
]
];
}
-
}
diff --git a/apps/accessibility/lib/Controller/ConfigController.php b/apps/accessibility/lib/Controller/ConfigController.php
index 726cca3107..65173ccace 100644
--- a/apps/accessibility/lib/Controller/ConfigController.php
+++ b/apps/accessibility/lib/Controller/ConfigController.php
@@ -107,7 +107,6 @@ class ConfigController extends OCSController {
*/
public function setConfig(string $key, $value): DataResponse {
if ($key === 'theme' || $key === 'font' || $key === 'highcontrast') {
-
if ($value === false || $value === '') {
throw new OCSBadRequestException('Invalid value: ' . $value);
}
@@ -142,7 +141,6 @@ class ConfigController extends OCSController {
*/
public function deleteConfig(string $key): DataResponse {
if ($key === 'theme' || $key === 'font' || $key === 'highcontrast') {
-
$this->config->deleteUserValue($this->userId, $this->appName, $key);
$userValues = $this->config->getUserKeys($this->userId, $this->appName);
@@ -156,5 +154,4 @@ class ConfigController extends OCSController {
throw new OCSBadRequestException('Invalid key: ' . $key);
}
-
}
diff --git a/apps/accessibility/lib/Migration/RepairUserConfig.php b/apps/accessibility/lib/Migration/RepairUserConfig.php
index a479afaf05..49f22860ac 100644
--- a/apps/accessibility/lib/Migration/RepairUserConfig.php
+++ b/apps/accessibility/lib/Migration/RepairUserConfig.php
@@ -86,5 +86,4 @@ class RepairUserConfig implements IRepairStep {
});
$output->finishProgress();
}
-
}
diff --git a/apps/admin_audit/lib/Actions/Action.php b/apps/admin_audit/lib/Actions/Action.php
index 16b2fd759c..3d8d39f0ce 100644
--- a/apps/admin_audit/lib/Actions/Action.php
+++ b/apps/admin_audit/lib/Actions/Action.php
@@ -53,8 +53,8 @@ class Action {
array $params,
array $elements,
bool $obfuscateParameters = false) {
- foreach($elements as $element) {
- if(!isset($params[$element])) {
+ foreach ($elements as $element) {
+ if (!isset($params[$element])) {
if ($obfuscateParameters) {
$this->logger->critical(
'$params["'.$element.'"] was missing.',
@@ -74,8 +74,8 @@ class Action {
}
$replaceArray = [];
- foreach($elements as $element) {
- if($params[$element] instanceof \DateTime) {
+ foreach ($elements as $element) {
+ if ($params[$element] instanceof \DateTime) {
$params[$element] = $params[$element]->format('Y-m-d H:i:s');
}
$replaceArray[] = $params[$element];
diff --git a/apps/admin_audit/lib/Actions/Sharing.php b/apps/admin_audit/lib/Actions/Sharing.php
index fef112e77d..4359360908 100644
--- a/apps/admin_audit/lib/Actions/Sharing.php
+++ b/apps/admin_audit/lib/Actions/Sharing.php
@@ -43,7 +43,7 @@ class Sharing extends Action {
* @param array $params
*/
public function shared(array $params) {
- if($params['shareType'] === Share::SHARE_TYPE_LINK) {
+ if ($params['shareType'] === Share::SHARE_TYPE_LINK) {
$this->log(
'The %s "%s" with ID "%s" has been shared via link with permissions "%s" (Share ID: %s)',
$params,
@@ -55,7 +55,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_USER) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_USER) {
$this->log(
'The %s "%s" with ID "%s" has been shared to the user "%s" with permissions "%s" (Share ID: %s)',
$params,
@@ -68,7 +68,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_GROUP) {
$this->log(
'The %s "%s" with ID "%s" has been shared to the group "%s" with permissions "%s" (Share ID: %s)',
$params,
@@ -81,7 +81,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_ROOM) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_ROOM) {
$this->log(
'The %s "%s" with ID "%s" has been shared to the room "%s" with permissions "%s" (Share ID: %s)',
$params,
@@ -94,7 +94,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_EMAIL) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_EMAIL) {
$this->log(
'The %s "%s" with ID "%s" has been shared to the email recipient "%s" with permissions "%s" (Share ID: %s)',
$params,
@@ -107,7 +107,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_CIRCLE) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_CIRCLE) {
$this->log(
'The %s "%s" with ID "%s" has been shared to the circle "%s" with permissions "%s" (Share ID: %s)',
$params,
@@ -120,7 +120,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_REMOTE) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_REMOTE) {
$this->log(
'The %s "%s" with ID "%s" has been shared to the remote user "%s" with permissions "%s" (Share ID: %s)',
$params,
@@ -133,7 +133,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_REMOTE_GROUP) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_REMOTE_GROUP) {
$this->log(
'The %s "%s" with ID "%s" has been shared to the remote group "%s" with permissions "%s" (Share ID: %s)',
$params,
@@ -155,7 +155,7 @@ class Sharing extends Action {
* @param array $params
*/
public function unshare(array $params) {
- if($params['shareType'] === Share::SHARE_TYPE_LINK) {
+ if ($params['shareType'] === Share::SHARE_TYPE_LINK) {
$this->log(
'The %s "%s" with ID "%s" has been unshared (Share ID: %s)',
$params,
@@ -166,7 +166,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_USER) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_USER) {
$this->log(
'The %s "%s" with ID "%s" has been unshared from the user "%s" (Share ID: %s)',
$params,
@@ -178,7 +178,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_GROUP) {
$this->log(
'The %s "%s" with ID "%s" has been unshared from the group "%s" (Share ID: %s)',
$params,
@@ -190,7 +190,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_ROOM) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_ROOM) {
$this->log(
'The %s "%s" with ID "%s" has been unshared from the room "%s" (Share ID: %s)',
$params,
@@ -202,7 +202,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_EMAIL) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_EMAIL) {
$this->log(
'The %s "%s" with ID "%s" has been unshared from the email recipient "%s" (Share ID: %s)',
$params,
@@ -214,7 +214,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_CIRCLE) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_CIRCLE) {
$this->log(
'The %s "%s" with ID "%s" has been unshared from the circle "%s" (Share ID: %s)',
$params,
@@ -226,7 +226,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_REMOTE) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_REMOTE) {
$this->log(
'The %s "%s" with ID "%s" has been unshared from the remote user "%s" (Share ID: %s)',
$params,
@@ -238,7 +238,7 @@ class Sharing extends Action {
'id',
]
);
- } elseif($params['shareType'] === Share::SHARE_TYPE_REMOTE_GROUP) {
+ } elseif ($params['shareType'] === Share::SHARE_TYPE_REMOTE_GROUP) {
$this->log(
'The %s "%s" with ID "%s" has been unshared from the remote group "%s" (Share ID: %s)',
$params,
diff --git a/apps/admin_audit/lib/Actions/Trashbin.php b/apps/admin_audit/lib/Actions/Trashbin.php
index 50a3d28a8a..a3e050a29f 100644
--- a/apps/admin_audit/lib/Actions/Trashbin.php
+++ b/apps/admin_audit/lib/Actions/Trashbin.php
@@ -29,7 +29,6 @@ declare(strict_types=1);
namespace OCA\AdminAudit\Actions;
class Trashbin extends Action {
-
public function delete(array $params) {
$this->log('File "%s" deleted from trash bin.',
['path' => $params['path']], ['path']
@@ -41,5 +40,4 @@ class Trashbin extends Action {
['path' => $params['filePath']], ['path']
);
}
-
}
diff --git a/apps/admin_audit/lib/Actions/UserManagement.php b/apps/admin_audit/lib/Actions/UserManagement.php
index ab231a796c..2bc733b5e1 100644
--- a/apps/admin_audit/lib/Actions/UserManagement.php
+++ b/apps/admin_audit/lib/Actions/UserManagement.php
@@ -100,7 +100,7 @@ class UserManagement extends Action {
* @param array $params
*/
public function change(array $params) {
- switch($params['feature']) {
+ switch ($params['feature']) {
case 'enabled':
$this->log(
$params['value'] === true
@@ -130,7 +130,7 @@ class UserManagement extends Action {
* @param IUser $user
*/
public function setPassword(IUser $user) {
- if($user->getBackendClassName() === 'Database') {
+ if ($user->getBackendClassName() === 'Database') {
$this->log(
'Password of user "%s" has been changed',
[
diff --git a/apps/admin_audit/lib/Actions/Versions.php b/apps/admin_audit/lib/Actions/Versions.php
index 612e5a8abd..8594d781d7 100644
--- a/apps/admin_audit/lib/Actions/Versions.php
+++ b/apps/admin_audit/lib/Actions/Versions.php
@@ -29,7 +29,6 @@ declare(strict_types=1);
namespace OCA\AdminAudit\Actions;
class Versions extends Action {
-
public function rollback(array $params) {
$this->log('Version "%s" of "%s" was restored.',
[
@@ -46,5 +45,4 @@ class Versions extends Action {
['path']
);
}
-
}
diff --git a/apps/admin_audit/lib/AppInfo/Application.php b/apps/admin_audit/lib/AppInfo/Application.php
index 7e6c5410f6..34c432a078 100644
--- a/apps/admin_audit/lib/AppInfo/Application.php
+++ b/apps/admin_audit/lib/AppInfo/Application.php
@@ -74,12 +74,11 @@ class Application extends App {
$default = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/audit.log';
$logFile = $config->getAppValue('admin_audit', 'logfile', $default);
- if($logFile === null) {
+ if ($logFile === null) {
$this->logger = $c->getLogger();
return;
}
$this->logger = $c->getLogFactory()->getCustomLogger($logFile);
-
}
public function register() {
@@ -152,7 +151,6 @@ class Application extends App {
}
protected function appHooks() {
-
$eventDispatcher = $this->getContainer()->getServer()->getEventDispatcher();
$eventDispatcher->addListener(ManagerEvent::EVENT_APP_ENABLE, function (ManagerEvent $event) {
$appActions = new AppManagement($this->logger);
@@ -166,7 +164,6 @@ class Application extends App {
$appActions = new AppManagement($this->logger);
$appActions->disableApp($event->getAppID());
});
-
}
protected function consoleHooks() {
diff --git a/apps/admin_audit/lib/BackgroundJobs/Rotate.php b/apps/admin_audit/lib/BackgroundJobs/Rotate.php
index 566b11cf37..f6e8f6d875 100644
--- a/apps/admin_audit/lib/BackgroundJobs/Rotate.php
+++ b/apps/admin_audit/lib/BackgroundJobs/Rotate.php
@@ -38,14 +38,14 @@ class Rotate extends TimedJob {
$default = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/audit.log';
$this->filePath = $config->getAppValue('admin_audit', 'logfile', $default);
- if($this->filePath === '') {
+ if ($this->filePath === '') {
// default log file, nothing to do
return;
}
$this->maxSize = $config->getSystemValue('log_rotate_size', 100 * 1024 * 1024);
- if($this->shouldRotateBySize()) {
+ if ($this->shouldRotateBySize()) {
$this->rotate();
}
}
diff --git a/apps/admin_audit/tests/Actions/SecurityTest.php b/apps/admin_audit/tests/Actions/SecurityTest.php
index 2d7560fac0..63453ca0ea 100644
--- a/apps/admin_audit/tests/Actions/SecurityTest.php
+++ b/apps/admin_audit/tests/Actions/SecurityTest.php
@@ -73,5 +73,4 @@ class SecurityTest extends TestCase {
$this->security->twofactorSuccess($this->user, ['provider' => 'myprovider']);
}
-
}
diff --git a/apps/cloud_federation_api/lib/AppInfo/Application.php b/apps/cloud_federation_api/lib/AppInfo/Application.php
index 0f808a88c0..0082217acc 100644
--- a/apps/cloud_federation_api/lib/AppInfo/Application.php
+++ b/apps/cloud_federation_api/lib/AppInfo/Application.php
@@ -27,7 +27,6 @@ use OCA\CloudFederationAPI\Capabilities;
use OCP\AppFramework\App;
class Application extends App {
-
public function __construct() {
parent::__construct('cloud_federation_api');
diff --git a/apps/cloud_federation_api/lib/Config.php b/apps/cloud_federation_api/lib/Config.php
index 6553ae7d9b..86f39f7f17 100644
--- a/apps/cloud_federation_api/lib/Config.php
+++ b/apps/cloud_federation_api/lib/Config.php
@@ -55,5 +55,4 @@ class Config {
return [];
}
}
-
}
diff --git a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php
index 3b8b29a49c..17d2bea323 100644
--- a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php
+++ b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php
@@ -166,7 +166,7 @@ class RequestHandlerController extends Controller {
}
if ($shareType === 'group') {
- if(!$this->groupManager->groupExists($shareWith)) {
+ if (!$this->groupManager->groupExists($shareWith)) {
return new JSONResponse(
['message' => 'Group "' . $shareWith . '" does not exists at ' . $this->urlGenerator->getBaseUrl()],
Http::STATUS_BAD_REQUEST
@@ -208,14 +208,13 @@ class RequestHandlerController extends Controller {
$user = $this->userManager->get($shareWith);
$recipientDisplayName = '';
- if($user) {
+ if ($user) {
$recipientDisplayName = $user->getDisplayName();
}
return new JSONResponse(
['recipientDisplayName' => $recipientDisplayName],
Http::STATUS_CREATED);
-
}
/**
@@ -267,8 +266,7 @@ class RequestHandlerController extends Controller {
return new JSONResponse($e->getReturnMessage(), Http::STATUS_BAD_REQUEST);
} catch (AuthenticationFailedException $e) {
return new JSONResponse(["message" => "RESOURCE_NOT_FOUND"], Http::STATUS_FORBIDDEN);
- }
- catch (\Exception $e) {
+ } catch (\Exception $e) {
return new JSONResponse(
['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()],
Http::STATUS_BAD_REQUEST
@@ -276,7 +274,6 @@ class RequestHandlerController extends Controller {
}
return new JSONResponse($result,Http::STATUS_CREATED);
-
}
/**
@@ -297,5 +294,4 @@ class RequestHandlerController extends Controller {
return $uid;
}
-
}
diff --git a/apps/comments/lib/AppInfo/Application.php b/apps/comments/lib/AppInfo/Application.php
index a4c01f3f62..9168948d7c 100644
--- a/apps/comments/lib/AppInfo/Application.php
+++ b/apps/comments/lib/AppInfo/Application.php
@@ -42,7 +42,6 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\Util;
class Application extends App {
-
const APP_ID = 'comments';
public function __construct(array $urlParams = []) {
diff --git a/apps/comments/lib/Collaboration/CommentersSorter.php b/apps/comments/lib/Collaboration/CommentersSorter.php
index 0db043f918..80f263acb0 100644
--- a/apps/comments/lib/Collaboration/CommentersSorter.php
+++ b/apps/comments/lib/Collaboration/CommentersSorter.php
@@ -48,12 +48,12 @@ class CommentersSorter implements ISorter {
*/
public function sort(array &$sortArray, array $context) {
$commenters = $this->retrieveCommentsInformation($context['itemType'], $context['itemId']);
- if(count($commenters) === 0) {
+ if (count($commenters) === 0) {
return;
}
foreach ($sortArray as $type => &$byType) {
- if(!isset($commenters[$type])) {
+ if (!isset($commenters[$type])) {
continue;
}
@@ -66,7 +66,7 @@ class CommentersSorter implements ISorter {
usort($workArray, function ($a, $b) use ($commenters, $type) {
$r = $this->compare($a[1], $b[1], $commenters[$type]);
- if($r === 0) {
+ if ($r === 0) {
$r = $a[0] - $b[0];
}
return $r;
@@ -84,16 +84,16 @@ class CommentersSorter implements ISorter {
*/
protected function retrieveCommentsInformation($type, $id) {
$comments = $this->commentsManager->getForObject($type, $id);
- if(count($comments) === 0) {
+ if (count($comments) === 0) {
return [];
}
$actors = [];
foreach ($comments as $comment) {
- if(!isset($actors[$comment->getActorType()])) {
+ if (!isset($actors[$comment->getActorType()])) {
$actors[$comment->getActorType()] = [];
}
- if(!isset($actors[$comment->getActorType()][$comment->getActorId()])) {
+ if (!isset($actors[$comment->getActorType()][$comment->getActorId()])) {
$actors[$comment->getActorType()][$comment->getActorId()] = 1;
} else {
$actors[$comment->getActorType()][$comment->getActorId()]++;
diff --git a/apps/comments/lib/Controller/Notifications.php b/apps/comments/lib/Controller/Notifications.php
index 6610b56b68..030a221a03 100644
--- a/apps/comments/lib/Controller/Notifications.php
+++ b/apps/comments/lib/Controller/Notifications.php
@@ -108,7 +108,7 @@ class Notifications extends Controller {
try {
$comment = $this->commentsManager->get($id);
- if($comment->getObjectType() !== 'files') {
+ if ($comment->getObjectType() !== 'files') {
return new NotFoundResponse();
}
$userFolder = $this->rootFolder->getUserFolder($currentUser->getUID());
diff --git a/apps/comments/lib/EventHandler.php b/apps/comments/lib/EventHandler.php
index 4364550a22..3d78ad4312 100644
--- a/apps/comments/lib/EventHandler.php
+++ b/apps/comments/lib/EventHandler.php
@@ -49,13 +49,13 @@ class EventHandler implements ICommentsEventHandler {
* @param CommentsEvent $event
*/
public function handle(CommentsEvent $event) {
- if($event->getComment()->getObjectType() !== 'files') {
+ if ($event->getComment()->getObjectType() !== 'files') {
// this is a 'files'-specific Handler
return;
}
$eventType = $event->getEvent();
- if($eventType === CommentsEvent::EVENT_ADD
+ if ($eventType === CommentsEvent::EVENT_ADD
) {
$this->notificationHandler($event);
$this->activityHandler($event);
@@ -67,7 +67,7 @@ class EventHandler implements ICommentsEventHandler {
CommentsEvent::EVENT_UPDATE,
CommentsEvent::EVENT_DELETE,
];
- if(in_array($eventType, $applicableEvents)) {
+ if (in_array($eventType, $applicableEvents)) {
$this->notificationHandler($event);
return;
}
diff --git a/apps/comments/lib/Listener/LoadAdditionalScripts.php b/apps/comments/lib/Listener/LoadAdditionalScripts.php
index ddaf288394..2ab67a45ab 100644
--- a/apps/comments/lib/Listener/LoadAdditionalScripts.php
+++ b/apps/comments/lib/Listener/LoadAdditionalScripts.php
@@ -43,5 +43,4 @@ class LoadAdditionalScripts implements IEventListener {
// we properly split it between files list and sidebar
Util::addScript(Application::APP_ID, 'comments');
}
-
}
diff --git a/apps/comments/lib/Listener/LoadSidebarScripts.php b/apps/comments/lib/Listener/LoadSidebarScripts.php
index 209c62dc40..29d1f2eb39 100644
--- a/apps/comments/lib/Listener/LoadSidebarScripts.php
+++ b/apps/comments/lib/Listener/LoadSidebarScripts.php
@@ -42,5 +42,4 @@ class LoadSidebarScripts implements IEventListener {
// we properly split it between files list and sidebar
Util::addScript(Application::APP_ID, 'comments');
}
-
}
diff --git a/apps/comments/lib/Notification/Listener.php b/apps/comments/lib/Notification/Listener.php
index ba645ac577..f157dd4cd3 100644
--- a/apps/comments/lib/Notification/Listener.php
+++ b/apps/comments/lib/Notification/Listener.php
@@ -45,7 +45,6 @@ class Listener {
IManager $notificationManager,
IUserManager $userManager
) {
-
$this->notificationManager = $notificationManager;
$this->userManager = $userManager;
}
@@ -57,15 +56,15 @@ class Listener {
$comment = $event->getComment();
$mentions = $this->extractMentions($comment->getMentions());
- if(empty($mentions)) {
+ if (empty($mentions)) {
// no one to notify
return;
}
$notification = $this->instantiateNotification($comment);
- foreach($mentions as $uid) {
- if(($comment->getActorType() === 'users' && $uid === $comment->getActorId())
+ foreach ($mentions as $uid) {
+ if (($comment->getActorType() === 'users' && $uid === $comment->getActorId())
|| !$this->userManager->userExists($uid)
) {
// do not notify unknown users or yourself
@@ -73,9 +72,8 @@ class Listener {
}
$notification->setUser($uid);
- if($event->getEvent() === CommentsEvent::EVENT_DELETE
- || $event->getEvent() === CommentsEvent::EVENT_PRE_UPDATE)
- {
+ if ($event->getEvent() === CommentsEvent::EVENT_DELETE
+ || $event->getEvent() === CommentsEvent::EVENT_PRE_UPDATE) {
$this->notificationManager->markProcessed($notification);
} else {
$this->notificationManager->notify($notification);
@@ -107,12 +105,12 @@ class Listener {
* @return string[] containing the mentions, e.g. ['alice', 'bob']
*/
public function extractMentions(array $mentions) {
- if(empty($mentions)) {
+ if (empty($mentions)) {
return [];
}
$uids = [];
- foreach($mentions as $mention) {
- if($mention['type'] === 'user') {
+ foreach ($mentions as $mention) {
+ if ($mention['type'] === 'user') {
$uids[] = $mention['id'];
}
}
diff --git a/apps/comments/lib/Notification/Notifier.php b/apps/comments/lib/Notification/Notifier.php
index 3b502c0c50..01a003eb8d 100644
--- a/apps/comments/lib/Notification/Notifier.php
+++ b/apps/comments/lib/Notification/Notifier.php
@@ -96,12 +96,12 @@ class Notifier implements INotifier {
* @since 9.0.0
*/
public function prepare(INotification $notification, string $languageCode): INotification {
- if($notification->getApp() !== 'comments') {
+ if ($notification->getApp() !== 'comments') {
throw new \InvalidArgumentException();
}
try {
$comment = $this->commentsManager->get($notification->getObjectId());
- } catch(NotFoundException $e) {
+ } catch (NotFoundException $e) {
// needs to be converted to InvalidArgumentException, otherwise none Notifications will be shown at all
throw new \InvalidArgumentException('Comment not found', 0, $e);
}
@@ -118,12 +118,12 @@ class Notifier implements INotifier {
switch ($notification->getSubject()) {
case 'mention':
$parameters = $notification->getSubjectParameters();
- if($parameters[0] !== 'files') {
+ if ($parameters[0] !== 'files') {
throw new \InvalidArgumentException('Unsupported comment object');
}
$userFolder = $this->rootFolder->getUserFolder($notification->getUser());
$nodes = $userFolder->getById((int)$parameters[1]);
- if(empty($nodes)) {
+ if (empty($nodes)) {
throw new AlreadyProcessedException();
}
$node = $nodes[0];
diff --git a/apps/comments/lib/Search/Result.php b/apps/comments/lib/Search/Result.php
index 36b0303fc4..9f0e693632 100644
--- a/apps/comments/lib/Search/Result.php
+++ b/apps/comments/lib/Search/Result.php
@@ -29,7 +29,6 @@ use OCP\Files\NotFoundException;
use OCP\Search\Result as BaseResult;
class Result extends BaseResult {
-
public $type = 'comment';
public $comment;
public $authorId;
@@ -108,5 +107,4 @@ class Result extends BaseResult {
return $prefix . mb_substr($message, $start, $end - $start) . $suffix;
}
-
}
diff --git a/apps/comments/tests/Unit/AppInfo/ApplicationTest.php b/apps/comments/tests/Unit/AppInfo/ApplicationTest.php
index d6dd02da24..dcf17896e4 100644
--- a/apps/comments/tests/Unit/AppInfo/ApplicationTest.php
+++ b/apps/comments/tests/Unit/AppInfo/ApplicationTest.php
@@ -64,7 +64,7 @@ class ApplicationTest extends TestCase {
Notifier::class,
];
- foreach($services as $service) {
+ foreach ($services as $service) {
$s = $c->query($service);
$this->assertInstanceOf($service, $s);
}
diff --git a/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php b/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php
index 82df3dce5e..f94d935e77 100644
--- a/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php
+++ b/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php
@@ -49,9 +49,9 @@ class CommentersSorterTest extends TestCase {
*/
public function testSort($data) {
$commentMocks = [];
- foreach($data['actors'] as $actorType => $actors) {
+ foreach ($data['actors'] as $actorType => $actors) {
foreach ($actors as $actorId => $noOfComments) {
- for($i=0;$i<$noOfComments;$i++) {
+ for ($i=0;$i<$noOfComments;$i++) {
$mock = $this->createMock(IComment::class);
$mock->expects($this->atLeastOnce())
->method('getActorType')
diff --git a/apps/comments/tests/Unit/EventHandlerTest.php b/apps/comments/tests/Unit/EventHandlerTest.php
index 3dd5d3d68a..bb1d660af1 100644
--- a/apps/comments/tests/Unit/EventHandlerTest.php
+++ b/apps/comments/tests/Unit/EventHandlerTest.php
@@ -116,5 +116,4 @@ class EventHandlerTest extends TestCase {
$this->eventHandler->handle($event);
}
-
}
diff --git a/apps/comments/tests/Unit/Notification/NotifierTest.php b/apps/comments/tests/Unit/Notification/NotifierTest.php
index 390624c2c8..dbb7917632 100644
--- a/apps/comments/tests/Unit/Notification/NotifierTest.php
+++ b/apps/comments/tests/Unit/Notification/NotifierTest.php
@@ -616,5 +616,4 @@ class NotifierTest extends TestCase {
$this->notifier->prepare($this->notification, $this->lc);
}
-
}
diff --git a/apps/contactsinteraction/lib/AddressBook.php b/apps/contactsinteraction/lib/AddressBook.php
index 6e01578037..ac433c7ce7 100644
--- a/apps/contactsinteraction/lib/AddressBook.php
+++ b/apps/contactsinteraction/lib/AddressBook.php
@@ -40,7 +40,6 @@ use Sabre\DAVACL\ACLTrait;
use Sabre\DAVACL\IACL;
class AddressBook extends ExternalAddressBook implements IACL {
-
public const URI = 'recent';
use ACLTrait;
@@ -174,5 +173,4 @@ class AddressBook extends ExternalAddressBook implements IACL {
list(, $uid) = \Sabre\Uri\split($this->principalUri);
return $uid;
}
-
}
diff --git a/apps/contactsinteraction/lib/AddressBookProvider.php b/apps/contactsinteraction/lib/AddressBookProvider.php
index 6d16d1da0a..4a4d5235a3 100644
--- a/apps/contactsinteraction/lib/AddressBookProvider.php
+++ b/apps/contactsinteraction/lib/AddressBookProvider.php
@@ -77,5 +77,4 @@ class AddressBookProvider implements IAddressBookProvider {
return null;
}
-
}
diff --git a/apps/contactsinteraction/lib/AppInfo/Application.php b/apps/contactsinteraction/lib/AppInfo/Application.php
index 3a7e0111f6..a3cb74f408 100644
--- a/apps/contactsinteraction/lib/AppInfo/Application.php
+++ b/apps/contactsinteraction/lib/AppInfo/Application.php
@@ -31,7 +31,6 @@ use OCP\Contacts\Events\ContactInteractedWithEvent;
use OCP\EventDispatcher\IEventDispatcher;
class Application extends App {
-
public const APP_ID = 'contactsinteraction';
public function __construct() {
@@ -43,5 +42,4 @@ class Application extends App {
private function registerListeners(IEventDispatcher $dispatcher): void {
$dispatcher->addServiceListener(ContactInteractedWithEvent::class, ContactInteractionListener::class);
}
-
}
diff --git a/apps/contactsinteraction/lib/BackgroundJob/CleanupJob.php b/apps/contactsinteraction/lib/BackgroundJob/CleanupJob.php
index 0efc9d54e8..9e3ab5bf3c 100644
--- a/apps/contactsinteraction/lib/BackgroundJob/CleanupJob.php
+++ b/apps/contactsinteraction/lib/BackgroundJob/CleanupJob.php
@@ -48,5 +48,4 @@ class CleanupJob extends TimedJob {
$time->modify('-7days');
$this->mapper->cleanUp($time->getTimestamp());
}
-
}
diff --git a/apps/contactsinteraction/lib/Card.php b/apps/contactsinteraction/lib/Card.php
index 264f0ebe96..56dca77b01 100644
--- a/apps/contactsinteraction/lib/Card.php
+++ b/apps/contactsinteraction/lib/Card.php
@@ -32,7 +32,6 @@ use Sabre\DAVACL\ACLTrait;
use Sabre\DAVACL\IACL;
class Card implements ICard, IACL {
-
use ACLTrait;
/** @var RecentContact */
@@ -133,5 +132,4 @@ class Card implements ICard, IACL {
function getLastModified(): ?int {
return $this->contact->getLastContact();
}
-
}
diff --git a/apps/contactsinteraction/lib/Db/CardSearchDao.php b/apps/contactsinteraction/lib/Db/CardSearchDao.php
index 8370203bb9..391dca60fa 100644
--- a/apps/contactsinteraction/lib/Db/CardSearchDao.php
+++ b/apps/contactsinteraction/lib/Db/CardSearchDao.php
@@ -88,5 +88,4 @@ class CardSearchDao {
return $card;
}
-
}
diff --git a/apps/contactsinteraction/lib/Db/RecentContact.php b/apps/contactsinteraction/lib/Db/RecentContact.php
index 71b58353ef..475de09341 100644
--- a/apps/contactsinteraction/lib/Db/RecentContact.php
+++ b/apps/contactsinteraction/lib/Db/RecentContact.php
@@ -69,5 +69,4 @@ class RecentContact extends Entity {
$this->addType('card', 'string');
$this->addType('lastContact', 'int');
}
-
}
diff --git a/apps/contactsinteraction/lib/Db/RecentContactMapper.php b/apps/contactsinteraction/lib/Db/RecentContactMapper.php
index 7fe98e6e4e..18a5bf6ced 100644
--- a/apps/contactsinteraction/lib/Db/RecentContactMapper.php
+++ b/apps/contactsinteraction/lib/Db/RecentContactMapper.php
@@ -31,7 +31,6 @@ use OCP\IDBConnection;
use OCP\IUser;
class RecentContactMapper extends QBMapper {
-
public const TABLE_NAME = 'recent_contact';
public function __construct(IDBConnection $db) {
@@ -114,5 +113,4 @@ class RecentContactMapper extends QBMapper {
$delete->execute();
}
-
}
diff --git a/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php b/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php
index 8e801f2e76..2c1aced82e 100644
--- a/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php
+++ b/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php
@@ -167,5 +167,4 @@ class ContactInteractionListener implements IEventListener {
return (new VCard($props))->serialize();
}
-
}
diff --git a/apps/contactsinteraction/lib/Migration/Version010000Date20200304152605.php b/apps/contactsinteraction/lib/Migration/Version010000Date20200304152605.php
index fea763106a..a2f0148056 100644
--- a/apps/contactsinteraction/lib/Migration/Version010000Date20200304152605.php
+++ b/apps/contactsinteraction/lib/Migration/Version010000Date20200304152605.php
@@ -89,5 +89,4 @@ class Version010000Date20200304152605 extends SimpleMigrationStep {
return $schema;
}
-
}
diff --git a/apps/dav/appinfo/app.php b/apps/dav/appinfo/app.php
index ff5a324946..5e2d5c5327 100644
--- a/apps/dav/appinfo/app.php
+++ b/apps/dav/appinfo/app.php
@@ -97,7 +97,7 @@ $eventHandler = function () use ($app) {
$job = $app->getContainer()->query(\OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob::class);
$job->run([]);
$app->getContainer()->getServer()->getJobList()->setLastRun($job);
- } catch(\Exception $ex) {
+ } catch (\Exception $ex) {
$app->getContainer()->getServer()->getLogger()->logException($ex);
}
};
diff --git a/apps/dav/bin/chunkperf.php b/apps/dav/bin/chunkperf.php
index 588fb3258d..bbb8e6de7f 100644
--- a/apps/dav/bin/chunkperf.php
+++ b/apps/dav/bin/chunkperf.php
@@ -65,7 +65,7 @@ $size = filesize($file);
$stream = fopen($file, 'r');
$index = 0;
-while(!feof($stream)) {
+while (!feof($stream)) {
request($client, 'PUT', "$uploadUrl/$index", fread($stream, $chunkSize));
$index++;
}
diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php
index caad7bf040..7a80c9b215 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 21ff40ba6b..79bd07e083 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 8ee43281b6..73d417dee9 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 af3486c436..a577a59161 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 6047d1b285..01f270362b 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 5d0b25d747..ad5bf7736a 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 d815b999c8..60eae25fdc 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 f1d5677590..72401d0f7d 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 8396bfb9a5..d0427b6c5c 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 7fe107e000..cd01e7ae94 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 f5863ddeaf..71b0b51587 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 804b88d032..4ca5ad17ae 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 0a070810bd..42b70f0a92 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 9a71553fd3..f044c2f820 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 5433956682..dcdc357723 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 208b923f53..2969e5f3ea 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 093a86dcad..7f81617b9a 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 9b96a4cfaa..dd3cb04848 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 1c7e0106fb..11b4bfe2c1 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 24121e4fff..9c7521cb6b 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 b7fff47347..5b237b0f06 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 9a402d3bf2..8bdde25662 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 b7cceec5bd..ace8482d9c 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 9f4a84e24c..52e9c330b2 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 88d43f0bb5..a42c704f53 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 b15468e460..298d877f5d 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 b7569cac8a..6d88244bbf 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 fe345d2480..6e7e20223c 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 916dc17ec6..f10773769c 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 df48b9127c..bc13efc1e5 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 17d0d06711..a79fffa598 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 61373327c6..00dee6b090 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 3893d24d80..b675b09e42 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 c83865d1ee..e6c41d02ac 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 0074b5c201..f3da0c03a6 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 2f182937a9..1b144fdbbf 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 c436d4fc32..93390f537e 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 48feaa0c58..7cf2d52768 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 96b4371bd7..2a28c9fc02 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 1e7d66d077..15228f9bc3 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 86aef36482..dc3cbdf06b 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 ac26e9f94c..10b065fc42 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 783c73968b..2cfeb1108f 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 d00e0886b6..fadf61fd7d 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 cd803abcdd..2ab06117c3 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 010e98d18e..4a9df56e6b 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 01ebdcd701..c63955202f 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 254f3e0a8e..771e44b7d3 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 54427404db..47551c8f17 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 ae4906c7d1..20616a65ed 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 f3b55ac4a3..8dea77bd0a 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 4d4af47f81..3cf9e0f9a6 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 74faa5d7df..097f52f957 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 1bcd3fbe41..0bd01184eb 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 6542db2365..4fb3ccf533 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 1a1900b263..bb911ffc03 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 2244e99170..81067f15b1 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 1d615a13ce..430fda4578 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 c0241de207..daced49373 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 7ebe3b03d1..18fc286fdd 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 00f14605ec..e63fbd2066 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("User <$user> has no calendars");
}
}
-
}
diff --git a/apps/dav/lib/Command/MoveCalendar.php b/apps/dav/lib/Command/MoveCalendar.php
index 8399fb5ed3..845e897069 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 9e3aecc60e..b72396c96c 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 d24c41409b..e02eef1cd5 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 55b0bdd4b4..ebdf3fde31 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 fadf83df06..94ee3d2a25 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 4d282b2118..275b41c87e 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 1a4cfbedb9..b6703a13a1 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 d763c4b4a6..8a892a0120 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 59c5c0a38e..cffc295d46 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 ee15d137b6..28264b0505 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 15ea9447ff..8457670be6 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 61945a51d7..cc01874e54 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 1ddebe06ee..b64feb22f4 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 2fb8a0293e..f5c0a3d9b0 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 51d453e3f2..31ea282308 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 ebe6d4cefa..67be788eb0 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 71b7e33d28..0e4ddd1f23 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 970524dca1..36b114b88f 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 13af4d888b..2db4faf50d 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 94ff9a0512..46659737e8 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 a330653e05..2871fd83e0 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 5851ed8158..c3e417b20a 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 cb39b3ca42..700625a229 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 dc65837c74..9a6b19ea3f 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 62c9915cc4..bca15e1568 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 d025ba2aac..2c108819e9 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 890e65a7fa..5f2bbdd12e 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 4c7c689bde..617847626c 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 1dd209a830..83f90fa4ba 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 e3a7dccffd..e292744cd2 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 2acc783eec..b6a96053cb 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 f6da755aaf..92187b92da 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 f740284f27..0f7f753b86 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 ef1e7236c9..ee4246011b 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 e3f248ee3e..72c3fb31b0 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 83995a31e5..33698810cf 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 adf139a3fd..aeb7350336 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 a50f171f6f..b25c33add8 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 04fe022360..f03c7cc2bd 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 ad917fb4b7..407f1a2853 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 bb04918716..ae69e33387 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 7da6549ee4..1293721040 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 f0c2b82ccb..67eed9c9b4 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 7852fa8431..68aab171ab 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 c63bb4fe1d..d76e65aa23 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 6c1c5a932f..c369f4da37 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 3c8198c539..f088011d1d 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 69ee9d9d88..f9b29d0af6 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 c383e0220f..8fc85be3bf 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 9c4045708d..f0f56921bd 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 9589ea11e0..47de5020d5 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 751580eabf..fd95196162 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 992205da72..2ec41ccfd1 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 6e2b7ef09d..22142b46e1 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 6dbdeaa6fd..b4201ef80c 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 72d20eb281..558aad72c0 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 c482de5b6d..ef608a8f1b 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 e691314b34..90d3b56959 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 6f32978d3d..618fb674ca 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 a71688777a..a581978868 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 ce76d929d8..3881e92293 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 655f8165a2..8642294e6b 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 ec556ed281..e36ec34dd8 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 c2604c8e27..4163d0d0ec 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 c7a3f4f60f..98c9ce0b6e 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 e4feaf5d42..7b00532495 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 e50c2a882c..53cba3eefa 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 1a432008a3..b71c16e231 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 4ca7b04188..b05ba07ead 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 ff0409c7ea..8074134299 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 e85480d4a2..bc4e6a8c4c 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 ee8ac58e3c..b47b462a45 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 560fc7c07b..6421abec3d 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 ce18b5277e..3dfddf5c0a 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';
}
-
}
diff --git a/apps/dav/templates/schedule-response-error.php b/apps/dav/templates/schedule-response-error.php
index c65875f3b0..010ea2ed6c 100644
--- a/apps/dav/templates/schedule-response-error.php
+++ b/apps/dav/templates/schedule-response-error.php
@@ -1,7 +1,7 @@
t('There was an error updating your attendance status.'));?>
t('Please contact the organizer directly.'));?>
-
+
diff --git a/apps/dav/tests/unit/Avatars/AvatarHomeTest.php b/apps/dav/tests/unit/Avatars/AvatarHomeTest.php
index 59edfed267..cce30d75fd 100644
--- a/apps/dav/tests/unit/Avatars/AvatarHomeTest.php
+++ b/apps/dav/tests/unit/Avatars/AvatarHomeTest.php
@@ -121,5 +121,4 @@ class AvatarHomeTest extends TestCase {
public function testGetLastModified() {
self::assertNull($this->home->getLastModified());
}
-
}
diff --git a/apps/dav/tests/unit/Avatars/AvatarNodeTest.php b/apps/dav/tests/unit/Avatars/AvatarNodeTest.php
index d93e842288..de81e90366 100644
--- a/apps/dav/tests/unit/Avatars/AvatarNodeTest.php
+++ b/apps/dav/tests/unit/Avatars/AvatarNodeTest.php
@@ -27,7 +27,6 @@ use OCP\IAvatar;
use Test\TestCase;
class AvatarNodeTest extends TestCase {
-
public function testGetName() {
/** @var IAvatar | \PHPUnit_Framework_MockObject_MockObject $a */
$a = $this->createMock(IAvatar::class);
diff --git a/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php b/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php
index 0704bf1e9d..b19c78d83c 100644
--- a/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php
+++ b/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php
@@ -53,8 +53,7 @@ class EventReminderJobTest extends TestCase {
$this->backgroundJob = new EventReminderJob($this->reminderService, $this->config);
}
- public function data(): array
- {
+ public function data(): array {
return [
[true, true, true],
[true, false, false],
@@ -81,7 +80,6 @@ class EventReminderJobTest extends TestCase {
->method('getAppValue')
->with('dav', 'sendEventRemindersMode', 'backgroundjob')
->willReturn($sendEventRemindersMode ? 'backgroundjob' : 'cron');
-
}
if ($expectCall) {
diff --git a/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php b/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php
index d260ed352e..cc960b4e5d 100644
--- a/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php
+++ b/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php
@@ -147,7 +147,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
$res6->method('getAllAvailableMetadataKeys')->willReturn(['meta99', 'meta123']);
$res6->method('getMetadataForKey')->willReturnCallback(function ($key) {
- switch($key) {
+ switch ($key) {
case 'meta99':
return 'value99-new';
@@ -166,7 +166,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
$res7->method('getBackend')->willReturn($backend3);
$res7->method('getAllAvailableMetadataKeys')->willReturn(['meta1']);
$res7->method('getMetadataForKey')->willReturnCallback(function ($key) {
- switch($key) {
+ switch ($key) {
case 'meta1':
return 'value1';
@@ -182,7 +182,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
$res8->method('getBackend')->willReturn($backend4);
$res8->method('getAllAvailableMetadataKeys')->willReturn(['meta2']);
$res8->method('getMetadataForKey')->willReturnCallback(function ($key) {
- switch($key) {
+ switch ($key) {
case 'meta2':
return 'value2';
@@ -218,7 +218,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
$rows = [];
$ids = [];
$stmt = $query->execute();
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$ids[$row['backend_id'] . '::' . $row['resource_id']] = $row['id'];
unset($row['id']);
$rows[] = $row;
@@ -288,7 +288,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
$rows2 = [];
$stmt = $query2->execute();
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
unset($row['id']);
$rows2[] = $row;
}
diff --git a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
index db823598c3..ff62bdaa6d 100644
--- a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
+++ b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
@@ -172,7 +172,6 @@ abstract class AbstractCalDavBackend extends TestCase {
}
protected function createEvent($calendarId, $start = '20130912T130000Z', $end = '20130912T140000Z') {
-
$randomPart = self::getUniqueID();
$calData = <<addToAssertionCount(1);
return;
@@ -213,7 +212,7 @@ EOD;
}
protected function assertNotAcl($principal, $privilege, $acl) {
- foreach($acl as $a) {
+ foreach ($acl as $a) {
if ($a['principal'] === $principal && $a['privilege'] === $privilege) {
$this->fail("ACL contains $principal / $privilege");
return;
diff --git a/apps/dav/tests/unit/CalDAV/Activity/Filter/GenericTest.php b/apps/dav/tests/unit/CalDAV/Activity/Filter/GenericTest.php
index 4574a0e9aa..7cc02ee008 100644
--- a/apps/dav/tests/unit/CalDAV/Activity/Filter/GenericTest.php
+++ b/apps/dav/tests/unit/CalDAV/Activity/Filter/GenericTest.php
@@ -33,7 +33,6 @@ use Test\TestCase;
* @group DB
*/
class GenericTest extends TestCase {
-
public function dataFilters() {
return [
[Calendar::class],
diff --git a/apps/dav/tests/unit/CalDAV/Activity/Setting/GenericTest.php b/apps/dav/tests/unit/CalDAV/Activity/Setting/GenericTest.php
index 1f1a442959..44c05e8b0a 100644
--- a/apps/dav/tests/unit/CalDAV/Activity/Setting/GenericTest.php
+++ b/apps/dav/tests/unit/CalDAV/Activity/Setting/GenericTest.php
@@ -31,7 +31,6 @@ use OCP\Activity\ISetting;
use Test\TestCase;
class GenericTest extends TestCase {
-
public function dataSettings() {
return [
[Calendar::class],
diff --git a/apps/dav/tests/unit/CalDAV/CachedSubscriptionObjectTest.php b/apps/dav/tests/unit/CalDAV/CachedSubscriptionObjectTest.php
index bb0e9aa22c..51acfae820 100644
--- a/apps/dav/tests/unit/CalDAV/CachedSubscriptionObjectTest.php
+++ b/apps/dav/tests/unit/CalDAV/CachedSubscriptionObjectTest.php
@@ -29,7 +29,6 @@ use OCA\DAV\CalDAV\CachedSubscriptionObject;
use OCA\DAV\CalDAV\CalDavBackend;
class CachedSubscriptionObjectTest extends \Test\TestCase {
-
public function testGet() {
$backend = $this->createMock(CalDavBackend::class);
$calendarInfo = [
@@ -92,5 +91,4 @@ class CachedSubscriptionObjectTest extends \Test\TestCase {
$calendarObject = new CachedSubscriptionObject($backend, $calendarInfo, $objectData);
$calendarObject->delete();
}
-
}
diff --git a/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php b/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php
index d0df178cc7..bc6942062b 100644
--- a/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php
+++ b/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php
@@ -31,7 +31,6 @@ use OCA\DAV\CalDAV\CalDavBackend;
use Sabre\DAV\PropPatch;
class CachedSubscriptionTest extends \Test\TestCase {
-
public function testGetACL() {
$backend = $this->createMock(CalDavBackend::class);
$calendarInfo = [
diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
index 8cb6b9fbf1..76335f00bf 100644
--- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
@@ -49,9 +49,7 @@ use Sabre\DAVACL\IACL;
* @package OCA\DAV\Tests\unit\CalDAV
*/
class CalDavBackendTest extends AbstractCalDavBackend {
-
public function testCalendarOperations() {
-
$calendarId = $this->createTestCalendar();
// update it's display name
@@ -206,7 +204,6 @@ EOD;
}
public function testCalendarObjectsOperations() {
-
$calendarId = $this->createTestCalendar();
// create a card
@@ -313,7 +310,6 @@ EOD;
}
public function testMultiCalendarObjects() {
-
$calendarId = $this->createTestCalendar();
// create an event
@@ -392,7 +388,7 @@ EOD;
// get the cards
$calendarObjects = $this->backend->getMultipleCalendarObjects($calendarId, [$uri1, $uri2]);
$this->assertCount(2, $calendarObjects);
- foreach($calendarObjects as $card) {
+ foreach ($calendarObjects as $card) {
$this->assertArrayHasKey('id', $card);
$this->assertArrayHasKey('uri', $card);
$this->assertArrayHasKey('lastmodified', $card);
@@ -988,8 +984,7 @@ EOD;
$this->assertEquals(null, $this->backend->getCalendarObject($subscriptionId, $uri, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION));
}
- public function testCalendarMovement()
- {
+ public function testCalendarMovement() {
$this->backend->createCalendar(self::UNIT_TEST_USER, 'Example', []);
$this->assertCount(1, $this->backend->getCalendarsForUser(self::UNIT_TEST_USER));
diff --git a/apps/dav/tests/unit/CalDAV/CalendarTest.php b/apps/dav/tests/unit/CalDAV/CalendarTest.php
index 534661af6c..da3a6f9e55 100644
--- a/apps/dav/tests/unit/CalDAV/CalendarTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalendarTest.php
@@ -296,7 +296,6 @@ class CalendarTest extends TestCase {
* @param bool $isShared
*/
public function testPrivateClassification($expectedChildren, $isShared) {
-
$calObject0 = ['uri' => 'event-0', 'classification' => CalDavBackend::CLASSIFICATION_PUBLIC];
$calObject1 = ['uri' => 'event-1', 'classification' => CalDavBackend::CLASSIFICATION_CONFIDENTIAL];
$calObject2 = ['uri' => 'event-2', 'classification' => CalDavBackend::CLASSIFICATION_PRIVATE];
@@ -323,7 +322,6 @@ class CalendarTest extends TestCase {
if ($isShared) {
$calendarInfo['{http://owncloud.org/ns}owner-principal'] = 'user1';
-
}
$c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config);
$children = $c->getChildren();
@@ -570,7 +568,7 @@ EOD;
$backend->expects($this->any())
->method('getCalendarObject')
->willReturnCallback(function ($cId, $uri) use ($publicObject, $confidentialObject) {
- switch($uri) {
+ switch ($uri) {
case 'event-0':
return $publicObject;
@@ -633,7 +631,6 @@ EOD;
$this->assertEquals(
$this->fixLinebreak($roCalendar->getChild('event-1')->get()),
$this->fixLinebreak($confidentialObjectCleaned));
-
}
private function fixLinebreak($str) {
diff --git a/apps/dav/tests/unit/CalDAV/Integration/ExternalCalendarTest.php b/apps/dav/tests/unit/CalDAV/Integration/ExternalCalendarTest.php
index a669808715..8d2fab953a 100644
--- a/apps/dav/tests/unit/CalDAV/Integration/ExternalCalendarTest.php
+++ b/apps/dav/tests/unit/CalDAV/Integration/ExternalCalendarTest.php
@@ -27,7 +27,6 @@ use OCA\DAV\CalDAV\Integration\ExternalCalendar;
use Test\TestCase;
class ExternalCalendarTest extends TestCase {
-
private $abstractExternalCalendar;
protected function setUp(): void {
diff --git a/apps/dav/tests/unit/CalDAV/PluginTest.php b/apps/dav/tests/unit/CalDAV/PluginTest.php
index 6a7d6f7885..2068c0c57f 100644
--- a/apps/dav/tests/unit/CalDAV/PluginTest.php
+++ b/apps/dav/tests/unit/CalDAV/PluginTest.php
@@ -28,7 +28,7 @@ namespace OCA\DAV\Tests\unit\CalDAV;
use OCA\DAV\CalDAV\Plugin;
use Test\TestCase;
-class PluginTest extends TestCase {
+class PluginTest extends TestCase {
/** @var Plugin */
private $plugin;
diff --git a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php
index 2560fec981..0e58c36b39 100644
--- a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php
+++ b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php
@@ -52,7 +52,6 @@ use Test\TestCase;
* @package OCA\DAV\Tests\unit\CalDAV
*/
class PublicCalendarRootTest extends TestCase {
-
const UNIT_TEST_USER = '';
/** @var CalDavBackend */
private $backend;
@@ -136,7 +135,6 @@ class PublicCalendarRootTest extends TestCase {
}
public function testGetChild() {
-
$calendar = $this->createPublicCalendar();
$publicCalendars = $this->backend->getPublicCalendars();
@@ -170,5 +168,4 @@ class PublicCalendarRootTest extends TestCase {
return $calendar;
}
-
}
diff --git a/apps/dav/tests/unit/CalDAV/PublicCalendarTest.php b/apps/dav/tests/unit/CalDAV/PublicCalendarTest.php
index 1ef3287f15..5710a1793c 100644
--- a/apps/dav/tests/unit/CalDAV/PublicCalendarTest.php
+++ b/apps/dav/tests/unit/CalDAV/PublicCalendarTest.php
@@ -38,7 +38,6 @@ class PublicCalendarTest extends CalendarTest {
* @param bool $isShared
*/
public function testPrivateClassification($expectedChildren, $isShared) {
-
$calObject0 = ['uri' => 'event-0', 'classification' => CalDavBackend::CLASSIFICATION_PUBLIC];
$calObject1 = ['uri' => 'event-1', 'classification' => CalDavBackend::CLASSIFICATION_CONFIDENTIAL];
$calObject2 = ['uri' => 'event-2', 'classification' => CalDavBackend::CLASSIFICATION_PRIVATE];
diff --git a/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php b/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php
index 1e3ccc8075..7a555220d8 100644
--- a/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php
+++ b/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php
@@ -31,7 +31,6 @@ use Sabre\Xml\Writer;
use Test\TestCase;
class PublisherTest extends TestCase {
-
const NS_CALENDARSERVER = 'http://calendarserver.org/ns/';
public function testSerializePublished() {
diff --git a/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php b/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php
index 12278a8054..cf30df723c 100644
--- a/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php
+++ b/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php
@@ -79,7 +79,6 @@ class PluginTest extends TestCase {
}
public function testPublishing() {
-
$this->book->expects($this->once())->method('setPublishStatus')->with(true);
// setup request
@@ -91,7 +90,6 @@ class PluginTest extends TestCase {
}
public function testUnPublishing() {
-
$this->book->expects($this->once())->method('setPublishStatus')->with(false);
// setup request
diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/AudioProviderTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/AudioProviderTest.php
index 5e18be2742..9004a42f98 100644
--- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/AudioProviderTest.php
+++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/AudioProviderTest.php
@@ -30,9 +30,7 @@ namespace OCA\DAV\Tests\unit\CalDAV\Reminder\NotificationProvider;
use OCA\DAV\CalDAV\Reminder\NotificationProvider\AudioProvider;
class AudioProviderTest extends PushProviderTest {
-
public function testNotificationType():void {
$this->assertEquals(AudioProvider::NOTIFICATION_TYPE, 'AUDIO');
}
-
}
diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php
index 796ac38e1b..cd111c44ae 100644
--- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php
+++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php
@@ -43,7 +43,6 @@ use OCP\Mail\IMessage;
use Sabre\VObject\Component\VCalendar;
class EmailProviderTest extends AbstractNotificationProviderTest {
-
const USER_EMAIL = 'frodo@hobb.it';
/** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php
index 568a65b77d..eb4e3310aa 100644
--- a/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php
+++ b/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php
@@ -103,8 +103,7 @@ class NotifierTest extends TestCase {
}
- public function testPrepareWrongApp(): void
- {
+ public function testPrepareWrongApp(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Notification not from this app');
@@ -138,8 +137,7 @@ class NotifierTest extends TestCase {
$this->notifier->prepare($notification, 'en');
}
- public function dataPrepare(): array
- {
+ public function dataPrepare(): array {
return [
[
'calendar_reminder',
@@ -176,8 +174,7 @@ class NotifierTest extends TestCase {
* @param string $message
* @throws \Exception
*/
- public function testPrepare(string $subjectType, array $subjectParams, string $subject, array $messageParams, string $message): void
- {
+ public function testPrepare(string $subjectType, array $subjectParams, string $subject, array $messageParams, string $message): void {
/** @var INotification|\PHPUnit\Framework\MockObject\MockObject $notification */
$notification = $this->createMock(INotification::class);
diff --git a/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php b/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php
index 1dbd45ea4c..e614da37f4 100644
--- a/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php
@@ -130,7 +130,6 @@ abstract class AbstractPrincipalBackendTest extends TestCase {
'{http://nextcloud.com/ns}meta99' => 'value99'
]
], $actual);
-
}
public function testGetNoPrincipalsByPrefixForWrongPrincipalPrefix() {
@@ -586,5 +585,4 @@ abstract class AbstractPrincipalBackendTest extends TestCase {
])
->execute();
}
-
}
diff --git a/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php b/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php
index a666aec95a..a9946d7454 100644
--- a/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php
+++ b/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php
@@ -54,33 +54,33 @@ use Test\TestCase;
class IMipPluginTest extends TestCase {
/** @var IMessage|MockObject */
- private $mailMessage;
+ private $mailMessage;
- /** @var IMailer|MockObject */
- private $mailer;
+ /** @var IMailer|MockObject */
+ private $mailer;
- /** @var IEMailTemplate|MockObject */
- private $emailTemplate;
+ /** @var IEMailTemplate|MockObject */
+ private $emailTemplate;
- /** @var IAttachment|MockObject */
- private $emailAttachment;
+ /** @var IAttachment|MockObject */
+ private $emailAttachment;
- /** @var ITimeFactory|MockObject */
- private $timeFactory;
+ /** @var ITimeFactory|MockObject */
+ private $timeFactory;
- /** @var IConfig|MockObject */
- private $config;
+ /** @var IConfig|MockObject */
+ private $config;
- /** @var IUserManager|MockObject */
- private $userManager;
+ /** @var IUserManager|MockObject */
+ private $userManager;
- /** @var IQueryBuilder|MockObject */
- private $queryBuilder;
+ /** @var IQueryBuilder|MockObject */
+ private $queryBuilder;
- /** @var IMipPlugin */
- private $plugin;
+ /** @var IMipPlugin */
+ private $plugin;
- protected function setUp(): void {
+ protected function setUp(): void {
$this->mailMessage = $this->createMock(IMessage::class);
$this->mailMessage->method('setFrom')->willReturn($this->mailMessage);
$this->mailMessage->method('setReplyTo')->willReturn($this->mailMessage);
@@ -186,7 +186,6 @@ class IMipPluginTest extends TestCase {
* @dataProvider dataNoMessageSendForPastEvents
*/
public function testNoMessageSendForPastEvents(array $veventParams, bool $expectsMail) {
-
$this->config
->method('getAppValue')
->with('dav', 'invitation_link_recipients', 'yes')
@@ -319,8 +318,7 @@ class IMipPluginTest extends TestCase {
->willReturn($this->queryBuilder);
$this->queryBuilder->expects($this->at(9))
->method('execute');
- }
- else {
+ } else {
$this->queryBuilder->expects($this->never())
->method('insert')
->with('calendar_invitations');
diff --git a/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php b/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php
index 97d4e552fa..859dccbe48 100644
--- a/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php
+++ b/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php
@@ -32,7 +32,7 @@ use Sabre\VObject\Parameter;
use Sabre\VObject\Property\ICalendar\CalAddress;
use Test\TestCase;
-class PluginTest extends TestCase {
+class PluginTest extends TestCase {
/** @var Plugin */
private $plugin;
/** @var Server|\PHPUnit_Framework_MockObject_MockObject */
diff --git a/apps/dav/tests/unit/CalDAV/Search/Request/CalendarSearchReportTest.php b/apps/dav/tests/unit/CalDAV/Search/Request/CalendarSearchReportTest.php
index 178a05f112..5211df8867 100644
--- a/apps/dav/tests/unit/CalDAV/Search/Request/CalendarSearchReportTest.php
+++ b/apps/dav/tests/unit/CalDAV/Search/Request/CalendarSearchReportTest.php
@@ -30,7 +30,6 @@ use Sabre\Xml\Reader;
use Test\TestCase;
class CalendarSearchReportTest extends TestCase {
-
private $elementMap = [
'{http://nextcloud.com/ns}calendar-search' =>
'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport',
diff --git a/apps/dav/tests/unit/CalDAV/Search/SearchPluginTest.php b/apps/dav/tests/unit/CalDAV/Search/SearchPluginTest.php
index a789753065..c6c468b9d6 100644
--- a/apps/dav/tests/unit/CalDAV/Search/SearchPluginTest.php
+++ b/apps/dav/tests/unit/CalDAV/Search/SearchPluginTest.php
@@ -32,7 +32,6 @@ use Sabre\Xml\Service;
use Test\TestCase;
class SearchPluginTest extends TestCase {
-
protected $server;
/** @var \OCA\DAV\CalDAV\Search\SearchPlugin $plugin */
diff --git a/apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php b/apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php
index 82c8442324..2d57ad3b7d 100644
--- a/apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php
+++ b/apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php
@@ -28,7 +28,6 @@ use OCA\DAV\CalDAV\WebcalCaching\Plugin;
use OCP\IRequest;
class PluginTest extends \Test\TestCase {
-
public function testDisabled() {
$request = $this->createMock(IRequest::class);
$request->expects($this->at(0))
diff --git a/apps/dav/tests/unit/CapabilitiesTest.php b/apps/dav/tests/unit/CapabilitiesTest.php
index 1e9c4bdf83..720d91fc17 100644
--- a/apps/dav/tests/unit/CapabilitiesTest.php
+++ b/apps/dav/tests/unit/CapabilitiesTest.php
@@ -29,7 +29,7 @@ use Test\TestCase;
/**
* @package OCA\DAV\Tests\unit
*/
-class CapabilitiesTest extends TestCase {
+class CapabilitiesTest extends TestCase {
public function testGetCapabilities() {
$capabilities = new Capabilities();
$expected = [
diff --git a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
index 326e77a58b..e4e2d4aef8 100644
--- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
+++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
@@ -134,7 +134,6 @@ class AddressBookImplTest extends TestCase {
* @param array $properties
*/
public function testCreate($properties) {
-
$uid = 'uid';
/** @var \PHPUnit_Framework_MockObject_MockObject | AddressBookImpl $addressBookImpl */
@@ -173,7 +172,6 @@ class AddressBookImplTest extends TestCase {
}
public function testUpdate() {
-
$uid = 'uid';
$uri = 'bla.vcf';
$properties = ['URI' => $uri, 'UID' => $uid, 'FN' => 'John Doe'];
@@ -288,7 +286,6 @@ class AddressBookImplTest extends TestCase {
$this->assertSame('uid1',
$this->invokePrivate($addressBookImpl, 'createUid', [])
);
-
}
public function testCreateEmptyVCard() {
diff --git a/apps/dav/tests/unit/CardDAV/AddressBookTest.php b/apps/dav/tests/unit/CardDAV/AddressBookTest.php
index c7557c2947..0edc130c90 100644
--- a/apps/dav/tests/unit/CardDAV/AddressBookTest.php
+++ b/apps/dav/tests/unit/CardDAV/AddressBookTest.php
@@ -32,7 +32,6 @@ use Sabre\DAV\PropPatch;
use Test\TestCase;
class AddressBookTest extends TestCase {
-
public function testDelete() {
/** @var \PHPUnit_Framework_MockObject_MockObject | CardDavBackend $backend */
$backend = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock();
@@ -152,4 +151,5 @@ class AddressBookTest extends TestCase {
'read-only property is false and no owner' => [true, false, false],
'read-only property is true and no owner' => [false, true, false],
];
- }}
+ }
+}
diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
index 9d23280f60..e7d2197a6e 100644
--- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
+++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
@@ -206,7 +206,6 @@ class CardDavBackendTest extends TestCase {
}
public function testAddressBookSharing() {
-
$this->userManager->expects($this->any())
->method('userExists')
->willReturn(true);
@@ -333,7 +332,9 @@ class CardDavBackendTest extends TestCase {
// get all the cards
$cards = $this->backend->getCards($bookId);
$this->assertEquals(3, count($cards));
- usort($cards, function ($a, $b) { return $a['id'] < $b['id'] ? -1 : 1; });
+ usort($cards, function ($a, $b) {
+ return $a['id'] < $b['id'] ? -1 : 1;
+ });
$this->assertEquals($this->vcardTest0, $cards[0]['carddata']);
$this->assertEquals($this->vcardTest1, $cards[1]['carddata']);
@@ -342,8 +343,10 @@ class CardDavBackendTest extends TestCase {
// get the cards 1 & 2 (not 0)
$cards = $this->backend->getMultipleCards($bookId, [$uri1, $uri2]);
$this->assertEquals(2, count($cards));
- usort($cards, function ($a, $b) { return $a['id'] < $b['id'] ? -1 : 1; });
- foreach($cards as $index => $card) {
+ usort($cards, function ($a, $b) {
+ return $a['id'] < $b['id'] ? -1 : 1;
+ });
+ foreach ($cards as $index => $card) {
$this->assertArrayHasKey('id', $card);
$this->assertArrayHasKey('uri', $card);
$this->assertArrayHasKey('lastmodified', $card);
@@ -361,7 +364,6 @@ class CardDavBackendTest extends TestCase {
}
public function testMultipleUIDOnDifferentAddressbooks() {
-
$this->backend = $this->getMockBuilder(CardDavBackend::class)
->setConstructorArgs([$this->db, $this->principal, $this->userManager, $this->groupManager, $this->dispatcher])
->setMethods(['updateProperties'])->getMock();
@@ -486,7 +488,6 @@ class CardDavBackendTest extends TestCase {
}
public function testSharing() {
-
$this->userManager->expects($this->any())
->method('userExists')
->willReturn(true);
@@ -525,7 +526,6 @@ class CardDavBackendTest extends TestCase {
}
public function testUpdateProperties() {
-
$bookId = 42;
$cardUri = 'card-uri';
$cardId = 2;
@@ -574,7 +574,6 @@ class CardDavBackendTest extends TestCase {
}
public function testPurgeProperties() {
-
$query = $this->db->getQueryBuilder();
$query->insert('cards_properties')
->values(
@@ -608,7 +607,6 @@ class CardDavBackendTest extends TestCase {
$this->assertSame(1, count($result));
$this->assertSame(1 ,(int)$result[0]['addressbookid']);
$this->assertSame(2 ,(int)$result[0]['cardid']);
-
}
public function testGetCardId() {
@@ -664,7 +662,7 @@ class CardDavBackendTest extends TestCase {
$vCardIds = [];
$query = $this->db->getQueryBuilder();
- for($i=0; $i < 3; $i++) {
+ for ($i=0; $i < 3; $i++) {
$query->insert($this->dbCardsTable)
->values(
[
@@ -794,7 +792,7 @@ class CardDavBackendTest extends TestCase {
public function testGetContact() {
$query = $this->db->getQueryBuilder();
- for($i=0; $i<2; $i++) {
+ for ($i=0; $i<2; $i++) {
$query->insert($this->dbCardsTable)
->values(
[
diff --git a/apps/dav/tests/unit/CardDAV/ConverterTest.php b/apps/dav/tests/unit/CardDAV/ConverterTest.php
index 7e93c05a3f..da2255a717 100644
--- a/apps/dav/tests/unit/CardDAV/ConverterTest.php
+++ b/apps/dav/tests/unit/CardDAV/ConverterTest.php
@@ -103,23 +103,23 @@ class ConverterTest extends TestCase {
$this->assertInstanceOf('Sabre\VObject\Component\VCard', $vCard);
$cardData = $vCard->jsonSerialize();
$this->compareData($expectedVCard, $cardData);
-
} else {
$this->assertSame($expectedVCard, $vCard);
}
-
}
protected function compareData($expected, $data) {
foreach ($expected as $key => $value) {
$found = false;
foreach ($data[1] as $d) {
- if($d[0] === $key && $d[3] === $value) {
+ if ($d[0] === $key && $d[3] === $value) {
$found = true;
break;
}
}
- if (!$found) $this->assertTrue(false, 'Expected data: ' . $key . ' not found.');
+ if (!$found) {
+ $this->assertTrue(false, 'Expected data: ' . $key . ' not found.');
+ }
}
}
@@ -183,7 +183,6 @@ class ConverterTest extends TestCase {
* @param $fullName
*/
public function testNameSplitter($expected, $fullName) {
-
$converter = new Converter($this->accountManager);
$r = $converter->splitFullName($fullName);
$r = implode(';', $r);
diff --git a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php
index 6cdfe04e8a..076c9119cd 100644
--- a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php
+++ b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php
@@ -185,7 +185,6 @@ class ImageExportPluginTest extends TestCase {
$this->response->expects($this->once())
->method('setBody')
->with('imgdata');
-
} else {
$this->cache->method('get')
->with(1, 'card', $size, $card)
diff --git a/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php b/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php
index e0abbf7857..647af7db69 100644
--- a/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php
+++ b/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php
@@ -66,7 +66,6 @@ class PluginTest extends TestCase {
}
public function testSharing() {
-
$this->book->expects($this->once())->method('updateShares')->with([[
'href' => 'principal:principals/admin',
'commonName' => null,
diff --git a/apps/dav/tests/unit/CardDAV/SyncServiceTest.php b/apps/dav/tests/unit/CardDAV/SyncServiceTest.php
index 9015528763..f3dc3f95fa 100644
--- a/apps/dav/tests/unit/CardDAV/SyncServiceTest.php
+++ b/apps/dav/tests/unit/CardDAV/SyncServiceTest.php
@@ -216,5 +216,4 @@ class SyncServiceTest extends TestCase {
$ss->method('getCertPath')->willReturn('');
return $ss;
}
-
}
diff --git a/apps/dav/tests/unit/Command/ListCalendarsTest.php b/apps/dav/tests/unit/Command/ListCalendarsTest.php
index 72c76ecc7a..8960a9d772 100644
--- a/apps/dav/tests/unit/Command/ListCalendarsTest.php
+++ b/apps/dav/tests/unit/Command/ListCalendarsTest.php
@@ -63,8 +63,7 @@ class ListCalendarsTest extends TestCase {
}
- public function testWithBadUser()
- {
+ public function testWithBadUser() {
$this->expectException(\InvalidArgumentException::class);
$this->userManager->expects($this->once())
@@ -79,8 +78,7 @@ class ListCalendarsTest extends TestCase {
$this->assertContains("User <" . self::USERNAME . "> in unknown", $commandTester->getDisplay());
}
- public function testWithCorrectUserWithNoCalendars()
- {
+ public function testWithCorrectUserWithNoCalendars() {
$this->userManager->expects($this->once())
->method('userExists')
->with(self::USERNAME)
@@ -98,8 +96,7 @@ class ListCalendarsTest extends TestCase {
$this->assertContains("User <" . self::USERNAME . "> has no calendars\n", $commandTester->getDisplay());
}
- public function dataExecute()
- {
+ public function dataExecute() {
return [
[false, '✓'],
[true, 'x']
@@ -109,8 +106,7 @@ class ListCalendarsTest extends TestCase {
/**
* @dataProvider dataExecute
*/
- public function testWithCorrectUser(bool $readOnly, string $output)
- {
+ public function testWithCorrectUser(bool $readOnly, string $output) {
$this->userManager->expects($this->once())
->method('userExists')
->with(self::USERNAME)
diff --git a/apps/dav/tests/unit/Command/MoveCalendarTest.php b/apps/dav/tests/unit/Command/MoveCalendarTest.php
index 36553ff65a..156043411d 100644
--- a/apps/dav/tests/unit/Command/MoveCalendarTest.php
+++ b/apps/dav/tests/unit/Command/MoveCalendarTest.php
@@ -97,8 +97,7 @@ class MoveCalendarTest extends TestCase {
* @param $userOriginExists
* @param $userDestinationExists
*/
- public function testWithBadUserOrigin($userOriginExists, $userDestinationExists)
- {
+ public function testWithBadUserOrigin($userOriginExists, $userDestinationExists) {
$this->expectException(\InvalidArgumentException::class);
$this->userManager->expects($this->at(0))
@@ -122,8 +121,7 @@ class MoveCalendarTest extends TestCase {
}
- public function testMoveWithInexistantCalendar()
- {
+ public function testMoveWithInexistantCalendar() {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('User has no calendar named . You can run occ dav:list-calendars to list calendars URIs for this user.');
@@ -150,8 +148,7 @@ class MoveCalendarTest extends TestCase {
}
- public function testMoveWithExistingDestinationCalendar()
- {
+ public function testMoveWithExistingDestinationCalendar() {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('User already has a calendar named .');
@@ -171,7 +168,7 @@ class MoveCalendarTest extends TestCase {
'id' => 1234,
]);
- $this->calDav->expects($this->at(1))->method('getCalendarByUri')
+ $this->calDav->expects($this->at(1))->method('getCalendarByUri')
->with('principals/users/user2', 'personal')
->willReturn([
'id' => 1234,
@@ -185,8 +182,7 @@ class MoveCalendarTest extends TestCase {
]);
}
- public function testMove()
- {
+ public function testMove() {
$this->userManager->expects($this->at(0))
->method('userExists')
->with('user')
@@ -221,8 +217,7 @@ class MoveCalendarTest extends TestCase {
$this->assertContains("[OK] Calendar was moved from user to ", $commandTester->getDisplay());
}
- public function dataTestMoveWithDestinationNotPartOfGroup(): array
- {
+ public function dataTestMoveWithDestinationNotPartOfGroup(): array {
return [
[true],
[false]
@@ -232,8 +227,7 @@ class MoveCalendarTest extends TestCase {
/**
* @dataProvider dataTestMoveWithDestinationNotPartOfGroup
*/
- public function testMoveWithDestinationNotPartOfGroup(bool $shareWithGroupMembersOnly)
- {
+ public function testMoveWithDestinationNotPartOfGroup(bool $shareWithGroupMembersOnly) {
$this->userManager->expects($this->at(0))
->method('userExists')
->with('user')
@@ -276,8 +270,7 @@ class MoveCalendarTest extends TestCase {
]);
}
- public function testMoveWithDestinationPartOfGroup()
- {
+ public function testMoveWithDestinationPartOfGroup() {
$this->userManager->expects($this->at(0))
->method('userExists')
->with('user')
@@ -322,8 +315,7 @@ class MoveCalendarTest extends TestCase {
$this->assertContains("[OK] Calendar was moved from user to ", $commandTester->getDisplay());
}
- public function testMoveWithDestinationNotPartOfGroupAndForce()
- {
+ public function testMoveWithDestinationNotPartOfGroupAndForce() {
$this->userManager->expects($this->at(0))
->method('userExists')
->with('user')
@@ -370,8 +362,7 @@ class MoveCalendarTest extends TestCase {
$this->assertContains("[OK] Calendar was moved from user to ", $commandTester->getDisplay());
}
- public function dataTestMoveWithCalendarAlreadySharedToDestination(): array
- {
+ public function dataTestMoveWithCalendarAlreadySharedToDestination(): array {
return [
[true],
[false]
@@ -381,8 +372,7 @@ class MoveCalendarTest extends TestCase {
/**
* @dataProvider dataTestMoveWithCalendarAlreadySharedToDestination
*/
- public function testMoveWithCalendarAlreadySharedToDestination(bool $force)
- {
+ public function testMoveWithCalendarAlreadySharedToDestination(bool $force) {
$this->userManager->expects($this->at(0))
->method('userExists')
->with('user')
diff --git a/apps/dav/tests/unit/Command/RemoveInvalidSharesTest.php b/apps/dav/tests/unit/Command/RemoveInvalidSharesTest.php
index ce830e3f69..2416ec6978 100644
--- a/apps/dav/tests/unit/Command/RemoveInvalidSharesTest.php
+++ b/apps/dav/tests/unit/Command/RemoveInvalidSharesTest.php
@@ -36,7 +36,6 @@ use Test\TestCase;
* @group DB
*/
class RemoveInvalidSharesTest extends TestCase {
-
protected function setUp(): void {
parent::setUp();
$db = \OC::$server->getDatabaseConnection();
diff --git a/apps/dav/tests/unit/Comments/CommentsNodeTest.php b/apps/dav/tests/unit/Comments/CommentsNodeTest.php
index a219b0a5c7..6bb0033ecb 100644
--- a/apps/dav/tests/unit/Comments/CommentsNodeTest.php
+++ b/apps/dav/tests/unit/Comments/CommentsNodeTest.php
@@ -488,7 +488,7 @@ class CommentsNodeTest extends \Test\TestCase {
$properties = $this->node->getProperties(null);
- foreach($properties as $name => $value) {
+ foreach ($properties as $name => $value) {
$this->assertArrayHasKey($name, $expected);
$this->assertSame($expected[$name], $value);
unset($expected[$name]);
@@ -499,8 +499,10 @@ class CommentsNodeTest extends \Test\TestCase {
public function readCommentProvider() {
$creationDT = new \DateTime('2016-01-19 18:48:00');
$diff = new \DateInterval('PT2H');
- $readDT1 = clone $creationDT; $readDT1->sub($diff);
- $readDT2 = clone $creationDT; $readDT2->add($diff);
+ $readDT1 = clone $creationDT;
+ $readDT1->sub($diff);
+ $readDT2 = clone $creationDT;
+ $readDT2->add($diff);
return [
[$creationDT, $readDT1, 'true'],
[$creationDT, $readDT2, 'false'],
diff --git a/apps/dav/tests/unit/Comments/CommentsPluginTest.php b/apps/dav/tests/unit/Comments/CommentsPluginTest.php
index 7210e96b12..c2234f116f 100644
--- a/apps/dav/tests/unit/Comments/CommentsPluginTest.php
+++ b/apps/dav/tests/unit/Comments/CommentsPluginTest.php
@@ -772,7 +772,4 @@ class CommentsPluginTest extends \Test\TestCase {
$this->plugin->onReport(CommentsPluginImplementation::REPORT_NAME, $parameters, '/' . $path);
}
-
-
-
}
diff --git a/apps/dav/tests/unit/Comments/RootCollectionTest.php b/apps/dav/tests/unit/Comments/RootCollectionTest.php
index f039c0d6ea..68098f2aeb 100644
--- a/apps/dav/tests/unit/Comments/RootCollectionTest.php
+++ b/apps/dav/tests/unit/Comments/RootCollectionTest.php
@@ -146,7 +146,7 @@ class RootCollectionTest extends \Test\TestCase {
$this->prepareForInitCollections();
$children = $this->collection->getChildren();
$this->assertFalse(empty($children));
- foreach($children as $child) {
+ foreach ($children as $child) {
$this->assertTrue($child instanceof EntityTypeCollectionImplementation);
}
}
diff --git a/apps/dav/tests/unit/Connector/PublicAuthTest.php b/apps/dav/tests/unit/Connector/PublicAuthTest.php
index ccf7d50320..bcec84d414 100644
--- a/apps/dav/tests/unit/Connector/PublicAuthTest.php
+++ b/apps/dav/tests/unit/Connector/PublicAuthTest.php
@@ -267,5 +267,4 @@ class PublicAuthTest extends \Test\TestCase {
$this->assertFalse($result);
}
-
}
diff --git a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
index 37663ebc0d..d2f2d8f2d4 100644
--- a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
@@ -135,5 +135,4 @@ class BlockLegacyClientPluginTest extends TestCase {
->willReturn(null);
$this->blockLegacyClientVersionPlugin->beforeHandler($request);
}
-
}
diff --git a/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php
index c5150d8a58..9585fae9cf 100644
--- a/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php
@@ -61,7 +61,7 @@ class CommentsPropertiesPluginTest extends \Test\TestCase {
public function nodeProvider() {
$mocks = [];
- foreach(['\OCA\DAV\Connector\Sabre\File', '\OCA\DAV\Connector\Sabre\Directory', '\Sabre\DAV\INode'] as $class) {
+ foreach (['\OCA\DAV\Connector\Sabre\File', '\OCA\DAV\Connector\Sabre\Directory', '\Sabre\DAV\INode'] as $class) {
$mocks[] = $this->getMockBuilder($class)
->disableOriginalConstructor()
->getMock();
@@ -84,7 +84,7 @@ class CommentsPropertiesPluginTest extends \Test\TestCase {
->disableOriginalConstructor()
->getMock();
- if($expectedSuccessful) {
+ if ($expectedSuccessful) {
$propFind->expects($this->exactly(3))
->method('handle');
} else {
@@ -157,11 +157,10 @@ class CommentsPropertiesPluginTest extends \Test\TestCase {
->willReturn(42);
$unread = $this->plugin->getUnreadCount($node);
- if(is_null($user)) {
+ if (is_null($user)) {
$this->assertNull($unread);
} else {
$this->assertSame($unread, 42);
}
}
-
}
diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
index 94ef048eb5..d3d17eefec 100644
--- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
@@ -34,7 +34,6 @@ use OCA\DAV\Connector\Sabre\Directory;
use OCP\Files\ForbiddenException;
class TestViewDirectory extends \OC\Files\View {
-
private $updatables;
private $deletables;
private $canRename;
diff --git a/apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php b/apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php
index 1b48ccf77f..1f6a80f388 100644
--- a/apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php
@@ -26,7 +26,6 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre\Exception;
use OCA\DAV\Connector\Sabre\Exception\Forbidden;
class ForbiddenTest extends \Test\TestCase {
-
public function testSerialization() {
// create xml doc
diff --git a/apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php b/apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php
index abe1d2e285..bb3b421f63 100644
--- a/apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php
@@ -27,7 +27,6 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre\Exception;
use OCA\DAV\Connector\Sabre\Exception\InvalidPath;
class InvalidPathTest extends \Test\TestCase {
-
public function testSerialization() {
// create xml doc
diff --git a/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php
index ff9fac3ff1..468624ce8a 100644
--- a/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php
@@ -97,5 +97,4 @@ class ExceptionLoggerPluginTest extends TestCase {
[4, 'This path leads to nowhere', new InvalidPath('This path leads to nowhere')]
];
}
-
}
diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php
index d366726e91..52b94f6381 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php
@@ -1080,7 +1080,7 @@ class FileTest extends TestCase {
}
$files = [];
list($storage, $internalPath) = $userView->resolvePath($path);
- if($storage instanceof Local) {
+ if ($storage instanceof Local) {
$realPath = $storage->getSourcePath($internalPath);
$dh = opendir($realPath);
while (($file = readdir($dh)) !== false) {
diff --git a/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php b/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php
index be14400fad..5a4424cb32 100644
--- a/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php
@@ -61,5 +61,4 @@ class MaintenancePluginTest extends TestCase {
$this->maintenancePlugin->checkMaintenanceMode();
}
-
}
diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
index bc49fb442a..c6d0a6a340 100644
--- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
@@ -44,7 +44,6 @@ use OCA\DAV\Connector\Sabre\ObjectTree;
* @package OCA\DAV\Tests\Unit\Connector\Sabre
*/
class ObjectTreeTest extends \Test\TestCase {
-
public function copyDataProvider() {
return [
// copy into same dir
@@ -152,7 +151,6 @@ class ObjectTreeTest extends \Test\TestCase {
$type,
$enableChunkingHeader
) {
-
if ($enableChunkingHeader) {
$_SERVER['HTTP_OC_CHUNKED'] = true;
}
@@ -284,8 +282,8 @@ class ObjectTreeTest extends \Test\TestCase {
$view->expects($this->once())
->method('resolvePath')
->willReturnCallback(function ($path) use ($storage) {
- return [$storage, ltrim($path, '/')];
- });
+ return [$storage, ltrim($path, '/')];
+ });
$rootNode = $this->getMockBuilder(Directory::class)
->disableOriginalConstructor()
diff --git a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
index 93cae17d53..0f2305be23 100644
--- a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
@@ -759,41 +759,41 @@ class PrincipalTest extends TestCase {
->method('shareApiEnabled')
->willReturn(true);
- $this->shareManager->expects($this->once())
+ $this->shareManager->expects($this->once())
->method('shareWithGroupMembersOnly')
->willReturn(true);
- $user = $this->createMock(IUser::class);
- $this->userSession->expects($this->once())
+ $user = $this->createMock(IUser::class);
+ $this->userSession->expects($this->once())
->method('getUser')
->willReturn($user);
- $this->groupManager->expects($this->at(0))
+ $this->groupManager->expects($this->at(0))
->method('getUserGroupIds')
->with($user)
->willReturn(['group1', 'group2']);
- $user2 = $this->createMock(IUser::class);
- $user2->method('getUID')->willReturn('user2');
- $user3 = $this->createMock(IUser::class);
- $user3->method('getUID')->willReturn('user3');
+ $user2 = $this->createMock(IUser::class);
+ $user2->method('getUID')->willReturn('user2');
+ $user3 = $this->createMock(IUser::class);
+ $user3->method('getUID')->willReturn('user3');
- $this->userManager->expects($this->once())
+ $this->userManager->expects($this->once())
->method('getByEmail')
->with($email)
->willReturn([$email === 'user2@foo.bar' ? $user2 : $user3]);
- if ($email === 'user2@foo.bar') {
- $this->groupManager->expects($this->at(1))
+ if ($email === 'user2@foo.bar') {
+ $this->groupManager->expects($this->at(1))
->method('getUserGroupIds')
->with($user2)
->willReturn(['group1', 'group3']);
- } else {
- $this->groupManager->expects($this->at(1))
+ } else {
+ $this->groupManager->expects($this->at(1))
->method('getUserGroupIds')
->with($user3)
->willReturn(['group3', 'group3']);
- }
+ }
$this->assertEquals($expects, $this->connector->findByUri($uri, 'principals/users'));
}
@@ -813,16 +813,16 @@ class PrincipalTest extends TestCase {
->method('shareApiEnabled')
->willReturn(true);
- $this->shareManager->expects($this->once())
+ $this->shareManager->expects($this->once())
->method('shareWithGroupMembersOnly')
->willReturn(false);
- $user2 = $this->createMock(IUser::class);
- $user2->method('getUID')->willReturn('user2');
- $user3 = $this->createMock(IUser::class);
- $user3->method('getUID')->willReturn('user3');
+ $user2 = $this->createMock(IUser::class);
+ $user2->method('getUID')->willReturn('user2');
+ $user3 = $this->createMock(IUser::class);
+ $user3->method('getUID')->willReturn('user3');
- $this->userManager->expects($this->once())
+ $this->userManager->expects($this->once())
->method('getByEmail')
->with($email)
->willReturn([$email === 'user2@foo.bar' ? $user2 : $user3]);
diff --git a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
index e83aec4d19..dd1cc70046 100644
--- a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
@@ -40,7 +40,6 @@ use OCP\Share\IShare;
use Sabre\DAV\Tree;
class SharesPluginTest extends \Test\TestCase {
-
const SHARETYPES_PROPERTYNAME = \OCA\DAV\Connector\Sabre\SharesPlugin::SHARETYPES_PROPERTYNAME;
/**
diff --git a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php
index 37dd72ab88..0cfa9c5229 100644
--- a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php
@@ -41,7 +41,6 @@ use Sabre\DAV\Tree;
* See the COPYING-README file.
*/
class TagsPluginTest extends \Test\TestCase {
-
const TAGS_PROPERTYNAME = \OCA\DAV\Connector\Sabre\TagsPlugin::TAGS_PROPERTYNAME;
const FAVORITE_PROPERTYNAME = \OCA\DAV\Connector\Sabre\TagsPlugin::FAVORITE_PROPERTYNAME;
const TAG_FAVORITE = \OCA\DAV\Connector\Sabre\TagsPlugin::TAG_FAVORITE;
@@ -430,5 +429,4 @@ class TagsPluginTest extends \Test\TestCase {
$this->assertFalse(false, isset($result[self::TAGS_PROPERTYNAME]));
$this->assertEquals(200, isset($result[self::FAVORITE_PROPERTYNAME]));
}
-
}
diff --git a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php
index 18f73d9685..1e2cef4e37 100644
--- a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php
+++ b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php
@@ -122,5 +122,4 @@ class BirthdayCalendarControllerTest extends TestCase {
$response = $this->controller->disable();
$this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $response);
}
-
}
diff --git a/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php b/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php
index 721c2c4b07..cd7f4c2434 100644
--- a/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php
+++ b/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php
@@ -88,7 +88,5 @@ class SapiMock extends Sapi {
* @return void
*/
static function sendResponse(ResponseInterface $response) {
-
}
-
}
diff --git a/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php b/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php
index 42c38cf5ce..da812016f2 100644
--- a/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php
+++ b/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php
@@ -66,7 +66,6 @@ class CustomPropertiesBackendTest extends TestCase {
$this->dbConnection,
$this->user
);
-
}
protected function tearDown(): void {
diff --git a/apps/dav/tests/unit/DAV/Sharing/PluginTest.php b/apps/dav/tests/unit/DAV/Sharing/PluginTest.php
index 07a9e2ce9f..56d0867f01 100644
--- a/apps/dav/tests/unit/DAV/Sharing/PluginTest.php
+++ b/apps/dav/tests/unit/DAV/Sharing/PluginTest.php
@@ -68,7 +68,6 @@ class PluginTest extends TestCase {
}
public function testSharing() {
-
$this->book->expects($this->once())->method('updateShares')->with([[
'href' => 'principal:principals/admin',
'commonName' => null,
diff --git a/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php b/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php
index 698e39a521..1bb1f6d838 100644
--- a/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php
+++ b/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php
@@ -137,6 +137,4 @@ class SystemPrincipalBackendTest extends TestCase {
$result = $backend->getGroupMembership('principals/system/system');
$this->assertEquals([], $result);
}
-
-
}
diff --git a/apps/dav/tests/unit/Migration/CalDAVRemoveEmptyValueTest.php b/apps/dav/tests/unit/Migration/CalDAVRemoveEmptyValueTest.php
index dcc79d71ce..6279583350 100644
--- a/apps/dav/tests/unit/Migration/CalDAVRemoveEmptyValueTest.php
+++ b/apps/dav/tests/unit/Migration/CalDAVRemoveEmptyValueTest.php
@@ -37,7 +37,7 @@ use Test\TestCase;
* @package OCA\DAV\Tests\Unit\DAV\Migration
* @group DB
*/
-class CalDAVRemoveEmptyValueTest extends TestCase {
+class CalDAVRemoveEmptyValueTest extends TestCase {
/** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */
private $logger;
diff --git a/apps/dav/tests/unit/Migration/RefreshWebcalJobRegistrarTest.php b/apps/dav/tests/unit/Migration/RefreshWebcalJobRegistrarTest.php
index 84dbe56a76..6856915961 100644
--- a/apps/dav/tests/unit/Migration/RefreshWebcalJobRegistrarTest.php
+++ b/apps/dav/tests/unit/Migration/RefreshWebcalJobRegistrarTest.php
@@ -145,5 +145,4 @@ class RefreshWebcalJobRegistrarTest extends TestCase {
$this->migration->run($output);
}
-
}
diff --git a/apps/dav/tests/unit/Migration/RegenerateBirthdayCalendarsTest.php b/apps/dav/tests/unit/Migration/RegenerateBirthdayCalendarsTest.php
index 85a34d2569..ef7f258094 100644
--- a/apps/dav/tests/unit/Migration/RegenerateBirthdayCalendarsTest.php
+++ b/apps/dav/tests/unit/Migration/RegenerateBirthdayCalendarsTest.php
@@ -98,6 +98,4 @@ class RegenerateBirthdayCalendarsTest extends TestCase {
$this->migration->run($output);
}
-
-
}
diff --git a/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php b/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php
index 1b09c96c94..1c39f30527 100644
--- a/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php
+++ b/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php
@@ -92,7 +92,8 @@ class AppleProvisioningPluginTest extends TestCase {
$plugin = new AppleProvisioningPlugin($this->userSession,
$this->urlGenerator, $this->themingDefaults, $this->request, $this->l10n,
- function () {});
+ function () {
+ });
$server->expects($this->at(0))
->method('on')
@@ -266,5 +267,4 @@ EOF
$this->assertFalse($returnValue);
}
-
}
diff --git a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php
index ec80d916b5..dc47c20f34 100644
--- a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php
+++ b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php
@@ -43,7 +43,6 @@ use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
class SystemTagPluginTest extends \Test\TestCase {
-
const ID_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::ID_PROPERTYNAME;
const DISPLAYNAME_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::DISPLAYNAME_PROPERTYNAME;
const USERVISIBLE_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::USERVISIBLE_PROPERTYNAME;
@@ -748,5 +747,4 @@ class SystemTagPluginTest extends \Test\TestCase {
$this->plugin->httpPost($request, $response);
}
-
}
diff --git a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php
index 2a4c832c71..f7b3431510 100644
--- a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php
+++ b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php
@@ -64,7 +64,7 @@ class AssemblyStreamTest extends \Test\TestCase {
$stream = \OCA\DAV\Upload\AssemblyStream::wrap($nodes);
$offset = floor(strlen($expected) * 0.6);
- if(fseek($stream, $offset) === -1) {
+ if (fseek($stream, $offset) === -1) {
$this->fail('fseek failed');
}
diff --git a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php
index f4f91c0e76..abbded089d 100644
--- a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php
+++ b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php
@@ -164,5 +164,4 @@ class ChunkingPluginTest extends TestCase {
$this->assertFalse($this->plugin->beforeMove('source', 'target'));
}
-
}
diff --git a/apps/dav/tests/unit/Upload/FutureFileTest.php b/apps/dav/tests/unit/Upload/FutureFileTest.php
index 248d4c826a..793241cda7 100644
--- a/apps/dav/tests/unit/Upload/FutureFileTest.php
+++ b/apps/dav/tests/unit/Upload/FutureFileTest.php
@@ -29,7 +29,6 @@ namespace OCA\DAV\Tests\unit\Upload;
use OCA\DAV\Connector\Sabre\Directory;
class FutureFileTest extends \Test\TestCase {
-
public function testGetContentType() {
$f = $this->mockFutureFile();
$this->assertEquals('application/octet-stream', $f->getContentType());
diff --git a/apps/encryption/lib/AppInfo/Application.php b/apps/encryption/lib/AppInfo/Application.php
index fcd7ef569b..688564887d 100644
--- a/apps/encryption/lib/AppInfo/Application.php
+++ b/apps/encryption/lib/AppInfo/Application.php
@@ -78,7 +78,6 @@ class Application extends \OCP\AppFramework\App {
*/
public function registerHooks() {
if (!$this->config->getSystemValueBool('maintenance')) {
-
$container = $this->getContainer();
$server = $container->getServer();
// Register our hooks and fire them.
@@ -97,7 +96,6 @@ class Application extends \OCP\AppFramework\App {
]);
$hookManager->fireHooks();
-
} else {
// Logout user if we are in maintenance to force re-login
$this->getContainer()->getServer()->getUserSession()->logout();
@@ -112,8 +110,7 @@ class Application extends \OCP\AppFramework\App {
Encryption::ID,
Encryption::DISPLAY_NAME,
function () use ($container) {
-
- return new Encryption(
+ return new Encryption(
$container->query('Crypt'),
$container->query('KeyManager'),
$container->query('Util'),
@@ -123,8 +120,7 @@ class Application extends \OCP\AppFramework\App {
$container->getServer()->getLogger(),
$container->getServer()->getL10N($container->getAppName())
);
- });
-
+ });
}
public function registerServices() {
@@ -261,6 +257,5 @@ class Application extends \OCP\AppFramework\App {
);
}
);
-
}
}
diff --git a/apps/encryption/lib/Command/DisableMasterKey.php b/apps/encryption/lib/Command/DisableMasterKey.php
index 18bf0b3903..d59e3b586c 100644
--- a/apps/encryption/lib/Command/DisableMasterKey.php
+++ b/apps/encryption/lib/Command/DisableMasterKey.php
@@ -50,7 +50,6 @@ class DisableMasterKey extends Command {
public function __construct(Util $util,
IConfig $config,
QuestionHelper $questionHelper) {
-
$this->util = $util;
$this->config = $config;
$this->questionHelper = $questionHelper;
@@ -64,10 +63,9 @@ class DisableMasterKey extends Command {
}
protected function execute(InputInterface $input, OutputInterface $output) {
-
$isMasterKeyEnabled = $this->util->isMasterKeyEnabled();
- if(!$isMasterKeyEnabled) {
+ if (!$isMasterKeyEnabled) {
$output->writeln('Master key already disabled');
} else {
$question = new ConfirmationQuestion(
@@ -83,7 +81,5 @@ class DisableMasterKey extends Command {
$output->writeln('aborted.');
}
}
-
}
-
}
diff --git a/apps/encryption/lib/Command/EnableMasterKey.php b/apps/encryption/lib/Command/EnableMasterKey.php
index d1148c88cc..6c4645e721 100644
--- a/apps/encryption/lib/Command/EnableMasterKey.php
+++ b/apps/encryption/lib/Command/EnableMasterKey.php
@@ -49,7 +49,6 @@ class EnableMasterKey extends Command {
public function __construct(Util $util,
IConfig $config,
QuestionHelper $questionHelper) {
-
$this->util = $util;
$this->config = $config;
$this->questionHelper = $questionHelper;
@@ -63,10 +62,9 @@ class EnableMasterKey extends Command {
}
protected function execute(InputInterface $input, OutputInterface $output) {
-
$isAlreadyEnabled = $this->util->isMasterKeyEnabled();
- if($isAlreadyEnabled) {
+ if ($isAlreadyEnabled) {
$output->writeln('Master key already enabled');
} else {
$question = new ConfirmationQuestion(
@@ -79,7 +77,5 @@ class EnableMasterKey extends Command {
$output->writeln('aborted.');
}
}
-
}
-
}
diff --git a/apps/encryption/lib/Command/RecoverUser.php b/apps/encryption/lib/Command/RecoverUser.php
index 9d98b38de4..a4d7b2407d 100644
--- a/apps/encryption/lib/Command/RecoverUser.php
+++ b/apps/encryption/lib/Command/RecoverUser.php
@@ -54,7 +54,6 @@ class RecoverUser extends Command {
IConfig $config,
IUserManager $userManager,
QuestionHelper $questionHelper) {
-
$this->util = $util;
$this->questionHelper = $questionHelper;
$this->userManager = $userManager;
@@ -74,10 +73,9 @@ class RecoverUser extends Command {
}
protected function execute(InputInterface $input, OutputInterface $output) {
-
$isMasterKeyEnabled = $this->util->isMasterKeyEnabled();
- if($isMasterKeyEnabled) {
+ if ($isMasterKeyEnabled) {
$output->writeln('You use the master key, no individual user recovery needed.');
return;
}
@@ -90,7 +88,7 @@ class RecoverUser extends Command {
}
$recoveryKeyEnabled = $this->util->isRecoveryEnabledForUser($uid);
- if($recoveryKeyEnabled === false) {
+ if ($recoveryKeyEnabled === false) {
$output->writeln('Recovery key is not enabled for: ' . $uid);
return;
}
@@ -108,7 +106,5 @@ class RecoverUser extends Command {
$output->write('Start to recover users files... This can take some time...');
$this->userManager->get($uid)->setPassword($newLoginPassword, $recoveryPassword);
$output->writeln('Done.');
-
}
-
}
diff --git a/apps/encryption/lib/Controller/RecoveryController.php b/apps/encryption/lib/Controller/RecoveryController.php
index 534e00e1b2..509ff2a039 100644
--- a/apps/encryption/lib/Controller/RecoveryController.php
+++ b/apps/encryption/lib/Controller/RecoveryController.php
@@ -161,7 +161,6 @@ class RecoveryController extends Controller {
*/
public function userSetRecovery($userEnableRecovery) {
if ($userEnableRecovery === '0' || $userEnableRecovery === '1') {
-
$result = $this->recovery->setRecoveryForUser($userEnableRecovery);
if ($result) {
@@ -180,7 +179,6 @@ class RecoveryController extends Controller {
]
);
}
-
}
return new DataResponse(
[
@@ -189,5 +187,4 @@ class RecoveryController extends Controller {
]
], Http::STATUS_BAD_REQUEST);
}
-
}
diff --git a/apps/encryption/lib/Controller/SettingsController.php b/apps/encryption/lib/Controller/SettingsController.php
index 545f544625..f918f17676 100644
--- a/apps/encryption/lib/Controller/SettingsController.php
+++ b/apps/encryption/lib/Controller/SettingsController.php
@@ -150,7 +150,6 @@ class SettingsController extends Controller {
Http::STATUS_BAD_REQUEST
);
}
-
}
/**
diff --git a/apps/encryption/lib/Controller/StatusController.php b/apps/encryption/lib/Controller/StatusController.php
index d3925e4482..40159627b0 100644
--- a/apps/encryption/lib/Controller/StatusController.php
+++ b/apps/encryption/lib/Controller/StatusController.php
@@ -67,10 +67,9 @@ class StatusController extends Controller {
* @return DataResponse
*/
public function getStatus() {
-
$status = 'error';
$message = 'no valid init status';
- switch($this->session->getStatus()) {
+ switch ($this->session->getStatus()) {
case Session::INIT_EXECUTED:
$status = 'interactionNeeded';
$message = (string)$this->l->t(
@@ -102,5 +101,4 @@ class StatusController extends Controller {
]
);
}
-
}
diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php
index b8e7ebab85..24b1f21ecd 100644
--- a/apps/encryption/lib/Crypto/Crypt.php
+++ b/apps/encryption/lib/Crypto/Crypt.php
@@ -54,7 +54,6 @@ use OCP\IUserSession;
* @package OCA\Encryption\Crypto
*/
class Crypt {
-
const DEFAULT_CIPHER = 'AES-256-CTR';
// default cipher from old Nextcloud versions
const LEGACY_CIPHER = 'AES-128-CFB';
@@ -109,7 +108,6 @@ class Crypt {
* @return array|bool
*/
public function createKeyPair() {
-
$log = $this->logger;
$res = $this->getOpenSSLPKey();
@@ -176,7 +174,6 @@ class Crypt {
* @throws EncryptionFailedException
*/
public function symmetricEncryptFileContent($plainContent, $passPhrase, $version, $position) {
-
if (!$plainContent) {
$this->logger->error('Encryption Library, symmetrical encryption failed no content given',
['app' => 'encryption']);
@@ -207,7 +204,6 @@ class Crypt {
* @throws \InvalidArgumentException
*/
public function generateHeader($keyFormat = 'hash') {
-
if (in_array($keyFormat, $this->supportedKeyFormats, true) === false) {
throw new \InvalidArgumentException('key format "' . $keyFormat . '" is not supported');
}
@@ -267,8 +263,8 @@ class Crypt {
}
// Workaround for OpenSSL 0.9.8. Fallback to an old cipher that should work.
- if(OPENSSL_VERSION_NUMBER < 0x1000101f) {
- if($cipher === 'AES-256-CTR' || $cipher === 'AES-128-CTR') {
+ if (OPENSSL_VERSION_NUMBER < 0x1000101f) {
+ if ($cipher === 'AES-256-CTR' || $cipher === 'AES-128-CTR') {
$cipher = self::LEGACY_CIPHER;
}
}
@@ -284,7 +280,7 @@ class Crypt {
* @throws \InvalidArgumentException
*/
protected function getKeySize($cipher) {
- if(isset($this->supportedCiphersAndKeySize[$cipher])) {
+ if (isset($this->supportedCiphersAndKeySize[$cipher])) {
return $this->supportedCiphersAndKeySize[$cipher];
}
@@ -389,7 +385,6 @@ class Crypt {
* @return false|string
*/
public function decryptPrivateKey($privateKey, $password = '', $uid = '') {
-
$header = $this->parseHeader($privateKey);
if (isset($header['cipher'])) {
diff --git a/apps/encryption/lib/Crypto/DecryptAll.php b/apps/encryption/lib/Crypto/DecryptAll.php
index a488c72652..ed43bc7545 100644
--- a/apps/encryption/lib/Crypto/DecryptAll.php
+++ b/apps/encryption/lib/Crypto/DecryptAll.php
@@ -78,10 +78,9 @@ class DecryptAll {
* @return bool
*/
public function prepare(InputInterface $input, OutputInterface $output, $user) {
-
$question = new Question('Please enter the recovery key password: ');
- if($this->util->isMasterKeyEnabled()) {
+ if ($this->util->isMasterKeyEnabled()) {
$output->writeln('Use master key to decrypt all files');
$user = $this->keyManager->getMasterKeyId();
$password =$this->keyManager->getMasterKeyPassword();
diff --git a/apps/encryption/lib/Crypto/EncryptAll.php b/apps/encryption/lib/Crypto/EncryptAll.php
index d0aaafd061..8fa2214234 100644
--- a/apps/encryption/lib/Crypto/EncryptAll.php
+++ b/apps/encryption/lib/Crypto/EncryptAll.php
@@ -131,7 +131,6 @@ class EncryptAll {
* @param OutputInterface $output
*/
public function encryptAll(InputInterface $input, OutputInterface $output) {
-
$this->input = $input;
$this->output = $output;
@@ -184,7 +183,7 @@ class EncryptAll {
$progress->setFormat(" %message% \n [%bar%]");
$progress->start();
- foreach($this->userManager->getBackends() as $backend) {
+ foreach ($this->userManager->getBackends() as $backend) {
$limit = 500;
$offset = 0;
do {
@@ -203,7 +202,7 @@ class EncryptAll {
}
}
$offset += $limit;
- } while(count($users) >= $limit);
+ } while (count($users) >= $limit);
}
$progress->setMessage('Key-pair created for all users');
@@ -231,7 +230,6 @@ class EncryptAll {
}
$progress->setMessage("all files encrypted");
$progress->finish();
-
}
/**
@@ -241,7 +239,7 @@ class EncryptAll {
*/
protected function encryptAllUserFilesWithMasterKey(ProgressBar $progress) {
$userNo = 1;
- foreach($this->userManager->getBackends() as $backend) {
+ foreach ($this->userManager->getBackends() as $backend) {
$limit = 500;
$offset = 0;
do {
@@ -252,7 +250,7 @@ class EncryptAll {
$userNo++;
}
$offset += $limit;
- } while(count($users) >= $limit);
+ } while (count($users) >= $limit);
}
}
@@ -264,12 +262,11 @@ class EncryptAll {
* @param string $userCount
*/
protected function encryptUsersFiles($uid, ProgressBar $progress, $userCount) {
-
$this->setupUserFS($uid);
$directories = [];
$directories[] = '/' . $uid . '/files';
- while($root = array_pop($directories)) {
+ while ($root = array_pop($directories)) {
$content = $this->rootView->getDirectoryContent($root);
foreach ($content as $file) {
$path = $root . '/' . $file['name'];
@@ -279,7 +276,7 @@ class EncryptAll {
} else {
$progress->setMessage("encrypt files for user $userCount: $path");
$progress->advance();
- if($this->encryptFile($path) === false) {
+ if ($this->encryptFile($path) === false) {
$progress->setMessage("encrypt files for user $userCount: $path (already encrypted)");
$progress->advance();
}
@@ -461,7 +458,6 @@ class EncryptAll {
$table->setRows($rows);
$table->render();
}
-
}
/**
@@ -471,7 +467,6 @@ class EncryptAll {
* @return array an array of the html mail body and the plain text mail body
*/
protected function createMailBody($password) {
-
$html = new \OC_Template("encryption", "mail", "");
$html->assign('password', $password);
$htmlMail = $html->fetchPage();
@@ -482,5 +477,4 @@ class EncryptAll {
return [$htmlMail, $plainTextMail];
}
-
}
diff --git a/apps/encryption/lib/Crypto/Encryption.php b/apps/encryption/lib/Crypto/Encryption.php
index f976a0815d..57cf4e2eda 100644
--- a/apps/encryption/lib/Crypto/Encryption.php
+++ b/apps/encryption/lib/Crypto/Encryption.php
@@ -45,7 +45,6 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class Encryption implements IEncryptionModule {
-
const ID = 'OC_DEFAULT_MODULE';
const DISPLAY_NAME = 'Default encryption module';
@@ -184,7 +183,7 @@ class Encryption implements IEncryptionModule {
$this->isWriteOperation = false;
$this->writeCache = '';
- if($this->session->isReady() === false) {
+ if ($this->session->isReady() === false) {
// if the master key is enabled we can initialize encryption
// with a empty password and user name
if ($this->util->isMasterKeyEnabled()) {
@@ -221,7 +220,7 @@ class Encryption implements IEncryptionModule {
// if we read a part file we need to increase the version by 1
// because the version number was also increased by writing
// the part file
- if(Scanner::isPartialFile($path)) {
+ if (Scanner::isPartialFile($path)) {
$this->version = $this->version + 1;
}
}
@@ -313,7 +312,6 @@ class Encryption implements IEncryptionModule {
// Clear the write cache, ready for reuse - it has been
// flushed and its old contents processed
$this->writeCache = '';
-
}
$encrypted = '';
@@ -340,7 +338,6 @@ class Encryption implements IEncryptionModule {
// Clear $data ready for next round
$data = '';
-
} else {
// Read the chunk from the start of $data
@@ -352,9 +349,7 @@ class Encryption implements IEncryptionModule {
// $data, leaving only unprocessed data in $data
// var, for handling on the next round
$data = substr($data, $this->unencryptedBlockSizeSigned);
-
}
-
}
return $encrypted;
@@ -389,7 +384,6 @@ class Encryption implements IEncryptionModule {
* @return boolean
*/
public function update($path, $uid, array $accessList) {
-
if (empty($accessList)) {
if (isset(self::$rememberVersion[$path])) {
$this->keyManager->setVersion($path, self::$rememberVersion[$path], new View());
@@ -401,7 +395,6 @@ class Encryption implements IEncryptionModule {
$fileKey = $this->keyManager->getFileKey($path, $uid);
if (!empty($fileKey)) {
-
$publicKeys = [];
if ($this->useMasterPassword === true) {
$publicKeys[$this->keyManager->getMasterKeyId()] = $this->keyManager->getPublicMasterKey();
@@ -422,7 +415,6 @@ class Encryption implements IEncryptionModule {
$this->keyManager->deleteAllFileKeys($path);
$this->keyManager->setAllFileKeys($path, $encryptedFileKey);
-
} else {
$this->logger->debug('no file key found, we assume that the file "{file}" is not encrypted',
['file' => $path, 'app' => 'encryption']);
diff --git a/apps/encryption/lib/Exceptions/MultiKeyDecryptException.php b/apps/encryption/lib/Exceptions/MultiKeyDecryptException.php
index 9bb01249d9..79ec2c3c82 100644
--- a/apps/encryption/lib/Exceptions/MultiKeyDecryptException.php
+++ b/apps/encryption/lib/Exceptions/MultiKeyDecryptException.php
@@ -26,5 +26,4 @@ namespace OCA\Encryption\Exceptions;
use OCP\Encryption\Exceptions\GenericEncryptionException;
class MultiKeyDecryptException extends GenericEncryptionException {
-
}
diff --git a/apps/encryption/lib/Exceptions/MultiKeyEncryptException.php b/apps/encryption/lib/Exceptions/MultiKeyEncryptException.php
index f4a03d259c..4916a4ceba 100644
--- a/apps/encryption/lib/Exceptions/MultiKeyEncryptException.php
+++ b/apps/encryption/lib/Exceptions/MultiKeyEncryptException.php
@@ -26,5 +26,4 @@ namespace OCA\Encryption\Exceptions;
use OCP\Encryption\Exceptions\GenericEncryptionException;
class MultiKeyEncryptException extends GenericEncryptionException {
-
}
diff --git a/apps/encryption/lib/Exceptions/PrivateKeyMissingException.php b/apps/encryption/lib/Exceptions/PrivateKeyMissingException.php
index f7014fa270..4d14b191dd 100644
--- a/apps/encryption/lib/Exceptions/PrivateKeyMissingException.php
+++ b/apps/encryption/lib/Exceptions/PrivateKeyMissingException.php
@@ -32,10 +32,9 @@ class PrivateKeyMissingException extends GenericEncryptionException {
* @param string $userId
*/
public function __construct($userId) {
- if(empty($userId)) {
+ if (empty($userId)) {
$userId = "";
}
parent::__construct("Private Key missing for user: $userId");
}
-
}
diff --git a/apps/encryption/lib/Exceptions/PublicKeyMissingException.php b/apps/encryption/lib/Exceptions/PublicKeyMissingException.php
index d6f12b3669..e0667d42a2 100644
--- a/apps/encryption/lib/Exceptions/PublicKeyMissingException.php
+++ b/apps/encryption/lib/Exceptions/PublicKeyMissingException.php
@@ -31,10 +31,9 @@ class PublicKeyMissingException extends GenericEncryptionException {
* @param string $userId
*/
public function __construct($userId) {
- if(empty($userId)) {
+ if (empty($userId)) {
$userId = "";
}
parent::__construct("Public Key missing for user: $userId");
}
-
}
diff --git a/apps/encryption/lib/HookManager.php b/apps/encryption/lib/HookManager.php
index a40f56fa37..324c0d718d 100644
--- a/apps/encryption/lib/HookManager.php
+++ b/apps/encryption/lib/HookManager.php
@@ -26,7 +26,6 @@ namespace OCA\Encryption;
use OCA\Encryption\Hooks\Contracts\IHook;
class HookManager {
-
private $hookInstances = [];
/**
@@ -42,7 +41,6 @@ class HookManager {
}
$this->hookInstances[] = $instance;
}
-
} elseif ($instances instanceof IHook) {
$this->hookInstances[] = $instances;
}
@@ -58,7 +56,5 @@ class HookManager {
*/
$instance->addHooks();
}
-
}
-
}
diff --git a/apps/encryption/lib/Hooks/UserHooks.php b/apps/encryption/lib/Hooks/UserHooks.php
index 16655dfe68..399e2865d0 100644
--- a/apps/encryption/lib/Hooks/UserHooks.php
+++ b/apps/encryption/lib/Hooks/UserHooks.php
@@ -109,7 +109,6 @@ class UserHooks implements IHook {
Session $session,
Crypt $crypt,
Recovery $recovery) {
-
$this->keyManager = $keyManager;
$this->userManager = $userManager;
$this->logger = $logger;
@@ -258,7 +257,6 @@ class UserHooks implements IHook {
// current logged in user changes his own password
if ($user && $params['uid'] === $user->getUID()) {
-
$privateKey = $this->session->getPrivateKey();
// Encrypt private key with new user pwd as passphrase
diff --git a/apps/encryption/lib/KeyManager.php b/apps/encryption/lib/KeyManager.php
index 8b286e0094..a62a4ca27f 100644
--- a/apps/encryption/lib/KeyManager.php
+++ b/apps/encryption/lib/KeyManager.php
@@ -120,7 +120,6 @@ class KeyManager {
ILogger $log,
Util $util
) {
-
$this->util = $util;
$this->session = $session;
$this->keyStorage = $keyStorage;
@@ -179,7 +178,6 @@ class KeyManager {
* check if a key pair for the master key exists, if not we create one
*/
public function validateMasterKey() {
-
if ($this->util->isMasterKeyEnabled() === false) {
return;
}
@@ -358,11 +356,10 @@ class KeyManager {
* @return boolean
*/
public function init($uid, $passPhrase) {
-
$this->session->setStatus(Session::INIT_EXECUTED);
try {
- if($this->util->isMasterKeyEnabled()) {
+ if ($this->util->isMasterKeyEnabled()) {
$uid = $this->getMasterKeyId();
$passPhrase = $this->getMasterKeyPassword();
$privateKey = $this->getSystemPrivateKey($uid);
@@ -462,7 +459,7 @@ class KeyManager {
*/
public function getVersion($path, View $view) {
$fileInfo = $view->getFileInfo($path);
- if($fileInfo === false) {
+ if ($fileInfo === false) {
return 0;
}
return $fileInfo->getEncryptedVersion();
@@ -478,7 +475,7 @@ class KeyManager {
public function setVersion($path, $version, View $view) {
$fileInfo= $view->getFileInfo($path);
- if($fileInfo !== false) {
+ if ($fileInfo !== false) {
$cache = $fileInfo->getStorage()->getCache();
$cache->update($fileInfo->getId(), ['encrypted' => $version, 'encryptedVersion' => $version]);
}
@@ -642,7 +639,6 @@ class KeyManager {
}
return $keys;
-
}
/**
@@ -685,7 +681,6 @@ class KeyManager {
if ($this->recoveryKeyExists() &&
$this->util->isRecoveryEnabledForUser($uid)) {
-
$publicKeys[$this->getRecoveryKeyId()] = $this->getRecoveryKey();
}
@@ -700,7 +695,7 @@ class KeyManager {
*/
public function getMasterKeyPassword() {
$password = $this->config->getSystemValue('secret');
- if (empty($password)){
+ if (empty($password)) {
throw new \Exception('Can not get secret from Nextcloud instance');
}
diff --git a/apps/encryption/lib/Migration/SetMasterKeyStatus.php b/apps/encryption/lib/Migration/SetMasterKeyStatus.php
index ade393cede..322b991ae9 100644
--- a/apps/encryption/lib/Migration/SetMasterKeyStatus.php
+++ b/apps/encryption/lib/Migration/SetMasterKeyStatus.php
@@ -73,5 +73,4 @@ class SetMasterKeyStatus implements IRepairStep {
$appVersion = $this->config->getAppValue('encryption', 'installed_version', '0.0.0');
return version_compare($appVersion, '2.0.0', '<');
}
-
}
diff --git a/apps/encryption/lib/Recovery.php b/apps/encryption/lib/Recovery.php
index 657d41b61d..7d7132999e 100644
--- a/apps/encryption/lib/Recovery.php
+++ b/apps/encryption/lib/Recovery.php
@@ -95,7 +95,7 @@ class Recovery {
if (!$keyManager->recoveryKeyExists()) {
$keyPair = $this->crypt->createKeyPair();
- if(!is_array($keyPair)) {
+ if (!is_array($keyPair)) {
return false;
}
@@ -120,7 +120,7 @@ class Recovery {
public function changeRecoveryKeyPassword($newPassword, $oldPassword) {
$recoveryKey = $this->keyManager->getSystemPrivateKey($this->keyManager->getRecoveryKeyId());
$decryptedRecoveryKey = $this->crypt->decryptPrivateKey($recoveryKey, $oldPassword);
- if($decryptedRecoveryKey === false) {
+ if ($decryptedRecoveryKey === false) {
return false;
}
$encryptedRecoveryKey = $this->crypt->encryptPrivateKey($decryptedRecoveryKey, $newPassword);
@@ -180,7 +180,6 @@ class Recovery {
* @return bool
*/
public function setRecoveryForUser($value) {
-
try {
$this->config->setUserValue($this->user->getUID(),
'encryption',
@@ -253,7 +252,7 @@ class Recovery {
$encryptedKey = $this->keyManager->getSystemPrivateKey($this->keyManager->getRecoveryKeyId());
$privateKey = $this->crypt->decryptPrivateKey($encryptedKey, $recoveryPassword);
- if($privateKey !== false) {
+ if ($privateKey !== false) {
$this->recoverAllFiles('/' . $user . '/files/', $privateKey, $user);
}
}
@@ -277,7 +276,6 @@ class Recovery {
$this->recoverFile($filePath, $privateKey, $uid);
}
}
-
}
/**
@@ -309,8 +307,5 @@ class Recovery {
$encryptedKeyfiles = $this->crypt->multiKeyEncrypt($fileKey, $publicKeys);
$this->keyManager->setAllFileKeys($path, $encryptedKeyfiles);
}
-
}
-
-
}
diff --git a/apps/encryption/lib/Session.php b/apps/encryption/lib/Session.php
index 58357b2efe..4398f9c4e0 100644
--- a/apps/encryption/lib/Session.php
+++ b/apps/encryption/lib/Session.php
@@ -184,5 +184,4 @@ class Session {
$this->session->remove('decryptAllKey');
$this->session->remove('decryptAllUid');
}
-
}
diff --git a/apps/encryption/lib/Settings/Admin.php b/apps/encryption/lib/Settings/Admin.php
index 91ce234ef5..d3b64bee4e 100644
--- a/apps/encryption/lib/Settings/Admin.php
+++ b/apps/encryption/lib/Settings/Admin.php
@@ -125,5 +125,4 @@ class Admin implements ISettings {
public function getPriority() {
return 11;
}
-
}
diff --git a/apps/encryption/lib/Util.php b/apps/encryption/lib/Util.php
index 681f025417..2b11b8151c 100644
--- a/apps/encryption/lib/Util.php
+++ b/apps/encryption/lib/Util.php
@@ -182,7 +182,6 @@ class Util {
throw new \BadMethodCallException('Unknown user: ' .
'method expects path to a user folder relative to the data folder');
}
-
}
return $owner;
@@ -197,5 +196,4 @@ class Util {
public function getStorage($path) {
return $this->files->getMount($path)->getStorage();
}
-
}
diff --git a/apps/encryption/templates/settings-admin.php b/apps/encryption/templates/settings-admin.php
index 48cc4d40da..1ae93dfb0e 100644
--- a/apps/encryption/templates/settings-admin.php
+++ b/apps/encryption/templates/settings-admin.php
@@ -6,17 +6,19 @@ style('encryption', 'settings-admin');
?>