diff options
author | Joas Schilling <coding@schilljs.com> | 2023-11-23 10:22:34 +0100 |
---|---|---|
committer | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2023-11-23 10:36:13 +0100 |
commit | aa5f037af71c915424c6dcfd5ad2dc82797dc0d6 (patch) | |
tree | 843203cd1346158aab3515687e37a90e78c929e9 /apps/dav/lib | |
parent | 272719ed1cba6836ea0a597bb9767754eeb1e0d4 (diff) | |
download | nextcloud-server-aa5f037af71c915424c6dcfd5ad2dc82797dc0d6.tar.gz nextcloud-server-aa5f037af71c915424c6dcfd5ad2dc82797dc0d6.zip |
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'apps/dav/lib')
158 files changed, 595 insertions, 611 deletions
diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php index 52f44ee0235..1284e7cae75 100644 --- a/apps/dav/lib/AppInfo/Application.php +++ b/apps/dav/lib/AppInfo/Application.php @@ -69,10 +69,6 @@ use OCA\DAV\Events\CardDeletedEvent; use OCA\DAV\Events\CardUpdatedEvent; use OCA\DAV\Events\SubscriptionCreatedEvent; use OCA\DAV\Events\SubscriptionDeletedEvent; -use OCA\DAV\Listener\OutOfOfficeListener; -use OCP\Accounts\UserUpdatedEvent; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\Federation\Events\TrustedServerRemovedEvent; use OCA\DAV\HookManager; use OCA\DAV\Listener\ActivityUpdaterListener; use OCA\DAV\Listener\AddressbookListener; @@ -84,6 +80,7 @@ use OCA\DAV\Listener\CalendarPublicationListener; use OCA\DAV\Listener\CalendarShareUpdateListener; use OCA\DAV\Listener\CardListener; use OCA\DAV\Listener\ClearPhotoCacheListener; +use OCA\DAV\Listener\OutOfOfficeListener; use OCA\DAV\Listener\SubscriptionListener; use OCA\DAV\Listener\TrustedServerRemovedListener; use OCA\DAV\Listener\UserPreferenceListener; @@ -93,6 +90,7 @@ use OCA\DAV\Search\TasksSearchProvider; use OCA\DAV\SetupChecks\NeedsSystemAddressBookSync; use OCA\DAV\UserMigration\CalendarMigrator; use OCA\DAV\UserMigration\ContactsMigrator; +use OCP\Accounts\UserUpdatedEvent; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; @@ -102,6 +100,8 @@ use OCP\Calendar\IManager as ICalendarManager; use OCP\Config\BeforePreferenceDeletedEvent; use OCP\Config\BeforePreferenceSetEvent; use OCP\Contacts\IManager as IContactsManager; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\Federation\Events\TrustedServerRemovedEvent; use OCP\Files\AppData\IAppDataFactory; use OCP\IUser; use OCP\User\Events\OutOfOfficeChangedEvent; @@ -224,8 +224,8 @@ class Application extends App implements IBootstrap { } public function registerHooks(HookManager $hm, - IEventDispatcher $dispatcher, - IAppContainer $container) { + IEventDispatcher $dispatcher, + IAppContainer $container) { $hm->setup(); // first time login event setup @@ -268,8 +268,8 @@ class Application extends App implements IBootstrap { } private function setupContactsProvider(IContactsManager $contactsManager, - IAppContainer $container, - string $userID): void { + IAppContainer $container, + string $userID): void { /** @var ContactsManager $cm */ $cm = $container->query(ContactsManager::class); $urlGenerator = $container->getServer()->getURLGenerator(); @@ -277,7 +277,7 @@ class Application extends App implements IBootstrap { } private function setupSystemContactsProvider(IContactsManager $contactsManager, - IAppContainer $container): void { + IAppContainer $container): void { /** @var ContactsManager $cm */ $cm = $container->query(ContactsManager::class); $urlGenerator = $container->getServer()->getURLGenerator(); @@ -285,7 +285,7 @@ class Application extends App implements IBootstrap { } public function registerCalendarManager(ICalendarManager $calendarManager, - IAppContainer $container): void { + IAppContainer $container): void { $calendarManager->register(function () use ($container, $calendarManager) { $user = \OC::$server->getUserSession()->getUser(); if ($user !== null) { @@ -295,14 +295,14 @@ class Application extends App implements IBootstrap { } private function setupCalendarProvider(ICalendarManager $calendarManager, - IAppContainer $container, - $userId) { + IAppContainer $container, + $userId) { $cm = $container->query(CalendarManager::class); $cm->setupCalendarProvider($calendarManager, $userId); } public function registerCalendarReminders(NotificationProviderManager $manager, - LoggerInterface $logger): void { + LoggerInterface $logger): void { try { $manager->registerProvider(AudioProvider::class); $manager->registerProvider(EmailProvider::class); diff --git a/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php b/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php index a2607ca13c4..d1cafbf57c2 100644 --- a/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php +++ b/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php @@ -59,10 +59,10 @@ class BuildReminderIndexBackgroundJob extends QueuedJob { * BuildReminderIndexBackgroundJob constructor. */ public function __construct(IDBConnection $db, - ReminderService $reminderService, - LoggerInterface $logger, - IJobList $jobList, - ITimeFactory $timeFactory) { + ReminderService $reminderService, + LoggerInterface $logger, + IJobList $jobList, + ITimeFactory $timeFactory) { parent::__construct($timeFactory); $this->db = $db; $this->reminderService = $reminderService; diff --git a/apps/dav/lib/BackgroundJob/CalendarRetentionJob.php b/apps/dav/lib/BackgroundJob/CalendarRetentionJob.php index b57ed07d5c2..96ceb644489 100644 --- a/apps/dav/lib/BackgroundJob/CalendarRetentionJob.php +++ b/apps/dav/lib/BackgroundJob/CalendarRetentionJob.php @@ -34,7 +34,7 @@ class CalendarRetentionJob extends TimedJob { private $service; public function __construct(ITimeFactory $time, - RetentionService $service) { + RetentionService $service) { parent::__construct($time); $this->service = $service; diff --git a/apps/dav/lib/BackgroundJob/EventReminderJob.php b/apps/dav/lib/BackgroundJob/EventReminderJob.php index 55cecf5519d..f628a728404 100644 --- a/apps/dav/lib/BackgroundJob/EventReminderJob.php +++ b/apps/dav/lib/BackgroundJob/EventReminderJob.php @@ -40,8 +40,8 @@ class EventReminderJob extends TimedJob { private $config; public function __construct(ITimeFactory $time, - ReminderService $reminderService, - IConfig $config) { + ReminderService $reminderService, + IConfig $config) { parent::__construct($time); $this->reminderService = $reminderService; $this->config = $config; diff --git a/apps/dav/lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php b/apps/dav/lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php index 8e72e8f076c..220050b3927 100644 --- a/apps/dav/lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php +++ b/apps/dav/lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php @@ -39,8 +39,8 @@ class GenerateBirthdayCalendarBackgroundJob extends QueuedJob { private $config; public function __construct(ITimeFactory $time, - BirthdayService $birthdayService, - IConfig $config) { + BirthdayService $birthdayService, + IConfig $config) { parent::__construct($time); $this->birthdayService = $birthdayService; diff --git a/apps/dav/lib/BackgroundJob/PruneOutdatedSyncTokensJob.php b/apps/dav/lib/BackgroundJob/PruneOutdatedSyncTokensJob.php index deca55a26cb..74969069387 100644 --- a/apps/dav/lib/BackgroundJob/PruneOutdatedSyncTokensJob.php +++ b/apps/dav/lib/BackgroundJob/PruneOutdatedSyncTokensJob.php @@ -25,11 +25,11 @@ declare(strict_types=1); */ namespace OCA\DAV\BackgroundJob; -use OCP\AppFramework\Utility\ITimeFactory; -use OCP\BackgroundJob\TimedJob; use OCA\DAV\AppInfo\Application; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\CardDAV\CardDavBackend; +use OCP\AppFramework\Utility\ITimeFactory; +use OCP\BackgroundJob\TimedJob; use OCP\IConfig; use Psr\Log\LoggerInterface; diff --git a/apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php b/apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php index 85da81b3b91..8c0b5e3ea45 100644 --- a/apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php +++ b/apps/dav/lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php @@ -49,8 +49,8 @@ class RegisterRegenerateBirthdayCalendars extends QueuedJob { * @param IJobList $jobList */ public function __construct(ITimeFactory $time, - IUserManager $userManager, - IJobList $jobList) { + IUserManager $userManager, + IJobList $jobList) { parent::__construct($time); $this->userManager = $userManager; $this->jobList = $jobList; diff --git a/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php b/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php index f0ff16d3f2f..b4571e2509d 100644 --- a/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php +++ b/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php @@ -55,10 +55,10 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { private $calDavBackend; public function __construct(ITimeFactory $time, - IResourceManager $resourceManager, - IRoomManager $roomManager, - IDBConnection $dbConnection, - CalDavBackend $calDavBackend) { + IResourceManager $resourceManager, + IRoomManager $roomManager, + IDBConnection $dbConnection, + CalDavBackend $calDavBackend) { parent::__construct($time); $this->resourceManager = $resourceManager; $this->roomManager = $roomManager; @@ -101,10 +101,10 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { * @param string $principalPrefix */ private function runForBackend($backendManager, - string $dbTable, - string $dbTableMetadata, - string $foreignKey, - string $principalPrefix): void { + string $dbTable, + string $dbTableMetadata, + string $foreignKey, + string $principalPrefix): void { $backends = $backendManager->getBackends(); foreach ($backends as $backend) { @@ -194,8 +194,8 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { * @return int Insert id */ private function addToCache(string $table, - string $backendId, - $remote): int { + string $backendId, + $remote): int { $query = $this->dbConnection->getQueryBuilder(); $query->insert($table) ->values([ @@ -219,9 +219,9 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { * @param array $metadata */ private function addMetadataToCache(string $table, - string $foreignKey, - int $foreignId, - array $metadata): void { + string $foreignKey, + int $foreignId, + array $metadata): void { foreach ($metadata as $key => $value) { $query = $this->dbConnection->getQueryBuilder(); $query->insert($table) @@ -241,7 +241,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { * @param int $id */ private function deleteFromCache(string $table, - int $id): void { + int $id): void { $query = $this->dbConnection->getQueryBuilder(); $query->delete($table) ->where($query->expr()->eq('id', $query->createNamedParameter($id))) @@ -254,8 +254,8 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { * @param int $id */ private function deleteMetadataFromCache(string $table, - string $foreignKey, - int $id): void { + string $foreignKey, + int $id): void { $query = $this->dbConnection->getQueryBuilder(); $query->delete($table) ->where($query->expr()->eq($foreignKey, $query->createNamedParameter($id))) @@ -270,8 +270,8 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { * @param IResource|IRoom $remote */ private function updateCache(string $table, - int $id, - $remote): void { + int $id, + $remote): void { $query = $this->dbConnection->getQueryBuilder(); $query->update($table) ->set('email', $query->createNamedParameter($remote->getEMail())) @@ -292,10 +292,10 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { * @param array $cachedMetadata */ private function updateMetadataCache(string $dbTable, - string $foreignKey, - int $id, - array $metadata, - array $cachedMetadata): void { + string $foreignKey, + int $id, + array $metadata, + array $cachedMetadata): void { $newMetadata = array_diff_key($metadata, $cachedMetadata); $deletedMetadata = array_diff_key($cachedMetadata, $metadata); @@ -371,8 +371,8 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { * @return array */ private function getAllMetadataOfCache(string $table, - string $foreignKey, - int $id): array { + string $foreignKey, + int $id): array { $query = $this->dbConnection->getQueryBuilder(); $query->select(['key', 'value']) ->from($table) @@ -398,7 +398,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { * @return array */ private function getAllCachedByBackend(string $tableName, - string $backendId): array { + string $backendId): array { $query = $this->dbConnection->getQueryBuilder(); $query->select('resource_id') ->from($tableName) @@ -417,7 +417,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { * @param $principalUri */ private function deleteCalendarDataForResource(string $principalPrefix, - string $principalUri): void { + string $principalUri): void { $calendar = $this->calDavBackend->getCalendarByUri( implode('/', [$principalPrefix, $principalUri]), CalDavBackend::RESOURCE_BOOKING_CALENDAR_URI); @@ -438,8 +438,8 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob { * @return int */ private function getIdForBackendAndResource(string $table, - string $backendId, - string $resourceId): int { + string $backendId, + string $resourceId): int { $query = $this->dbConnection->getQueryBuilder(); $query->select('id') ->from($table) diff --git a/apps/dav/lib/BackgroundJob/UploadCleanup.php b/apps/dav/lib/BackgroundJob/UploadCleanup.php index 3a6f296deaf..c35aff4d15a 100644 --- a/apps/dav/lib/BackgroundJob/UploadCleanup.php +++ b/apps/dav/lib/BackgroundJob/UploadCleanup.php @@ -32,7 +32,6 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\IJobList; use OCP\BackgroundJob\TimedJob; -use OCP\Files\Node; use OCP\Files\File; use OCP\Files\Folder; use OCP\Files\IRootFolder; diff --git a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php index 43fccbf233e..53184be6f25 100644 --- a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php +++ b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php @@ -46,11 +46,11 @@ class UserStatusAutomation extends TimedJob { protected IConfig $config; public function __construct(ITimeFactory $timeFactory, - IDBConnection $connection, - IJobList $jobList, - LoggerInterface $logger, - IManager $manager, - IConfig $config) { + IDBConnection $connection, + IJobList $jobList, + LoggerInterface $logger, + IManager $manager, + IConfig $config) { parent::__construct($timeFactory); $this->connection = $connection; $this->jobList = $jobList; diff --git a/apps/dav/lib/BulkUpload/BulkUploadPlugin.php b/apps/dav/lib/BulkUpload/BulkUploadPlugin.php index dab4bbffc6e..66e2a9efa2e 100644 --- a/apps/dav/lib/BulkUpload/BulkUploadPlugin.php +++ b/apps/dav/lib/BulkUpload/BulkUploadPlugin.php @@ -23,15 +23,15 @@ namespace OCA\DAV\BulkUpload; +use OCA\DAV\Connector\Sabre\MtimeSanitizer; +use OCP\AppFramework\Http; +use OCP\Files\DavUtil; +use OCP\Files\Folder; use Psr\Log\LoggerInterface; use Sabre\DAV\Server; use Sabre\DAV\ServerPlugin; use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; -use OCP\Files\DavUtil; -use OCP\Files\Folder; -use OCP\AppFramework\Http; -use OCA\DAV\Connector\Sabre\MtimeSanitizer; class BulkUploadPlugin extends ServerPlugin { private Folder $userFolder; diff --git a/apps/dav/lib/BulkUpload/MultipartRequestParser.php b/apps/dav/lib/BulkUpload/MultipartRequestParser.php index 16c83fee64e..930e86c28b5 100644 --- a/apps/dav/lib/BulkUpload/MultipartRequestParser.php +++ b/apps/dav/lib/BulkUpload/MultipartRequestParser.php @@ -22,11 +22,11 @@ namespace OCA\DAV\BulkUpload; -use Sabre\HTTP\RequestInterface; +use OCP\AppFramework\Http; use Sabre\DAV\Exception; use Sabre\DAV\Exception\BadRequest; use Sabre\DAV\Exception\LengthRequired; -use OCP\AppFramework\Http; +use Sabre\HTTP\RequestInterface; class MultipartRequestParser { diff --git a/apps/dav/lib/CalDAV/AppCalendar/AppCalendar.php b/apps/dav/lib/CalDAV/AppCalendar/AppCalendar.php index d67f1f5a816..68b71404371 100644 --- a/apps/dav/lib/CalDAV/AppCalendar/AppCalendar.php +++ b/apps/dav/lib/CalDAV/AppCalendar/AppCalendar.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /** @@ -25,8 +26,8 @@ declare(strict_types=1); namespace OCA\DAV\CalDAV\AppCalendar; -use OCA\DAV\CalDAV\Plugin; use OCA\DAV\CalDAV\Integration\ExternalCalendar; +use OCA\DAV\CalDAV\Plugin; use OCP\Calendar\ICalendar; use OCP\Calendar\ICreateFromString; use OCP\Constants; diff --git a/apps/dav/lib/CalDAV/AppCalendar/AppCalendarPlugin.php b/apps/dav/lib/CalDAV/AppCalendar/AppCalendarPlugin.php index cdf7cb9059a..ddf76e27f3a 100644 --- a/apps/dav/lib/CalDAV/AppCalendar/AppCalendarPlugin.php +++ b/apps/dav/lib/CalDAV/AppCalendar/AppCalendarPlugin.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /** diff --git a/apps/dav/lib/CalDAV/AppCalendar/CalendarObject.php b/apps/dav/lib/CalDAV/AppCalendar/CalendarObject.php index 985b137c955..bfcab35f74e 100644 --- a/apps/dav/lib/CalDAV/AppCalendar/CalendarObject.php +++ b/apps/dav/lib/CalDAV/AppCalendar/CalendarObject.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /** diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index 70b2e859f89..95176283f11 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -67,11 +67,11 @@ class BirthdayService { * BirthdayService constructor. */ public function __construct(CalDavBackend $calDavBackEnd, - CardDavBackend $cardDavBackEnd, - GroupPrincipalBackend $principalBackend, - IConfig $config, - IDBConnection $dbConnection, - IL10N $l10n) { + CardDavBackend $cardDavBackEnd, + GroupPrincipalBackend $principalBackend, + IConfig $config, + IDBConnection $dbConnection, + IL10N $l10n) { $this->calDavBackEnd = $calDavBackEnd; $this->cardDavBackEnd = $cardDavBackEnd; $this->principalBackend = $principalBackend; @@ -81,8 +81,8 @@ class BirthdayService { } public function onCardChanged(int $addressBookId, - string $cardUri, - string $cardData): void { + string $cardUri, + string $cardData): void { if (!$this->isGloballyEnabled()) { return; } @@ -117,7 +117,7 @@ class BirthdayService { } public function onCardDeleted(int $addressBookId, - string $cardUri): void { + string $cardUri): void { if (!$this->isGloballyEnabled()) { return; } @@ -164,9 +164,9 @@ class BirthdayService { * @throws InvalidDataException */ public function buildDateFromContact(string $cardData, - string $dateField, - string $postfix, - ?string $reminderOffset):?VCalendar { + string $dateField, + string $postfix, + ?string $reminderOffset):?VCalendar { if (empty($cardData)) { return null; } @@ -322,7 +322,7 @@ class BirthdayService { * @return bool */ public function birthdayEvenChanged(string $existingCalendarData, - VCalendar $newCalendarData):bool { + VCalendar $newCalendarData):bool { try { $existingBirthday = Reader::read($existingCalendarData); } catch (Exception $ex) { @@ -366,11 +366,11 @@ class BirthdayService { * @throws \Sabre\DAV\Exception\BadRequest */ private function updateCalendar(string $cardUri, - string $cardData, - array $book, - int $calendarId, - array $type, - ?string $reminderOffset):void { + string $cardData, + array $book, + int $calendarId, + array $type, + ?string $reminderOffset):void { $objectUri = $book['uri'] . '-' . $cardUri . $type['postfix'] . '.ics'; $calendarData = $this->buildDateFromContact($cardData, $type['field'], $type['postfix'], $reminderOffset); $existing = $this->calDavBackEnd->getCalendarObject($calendarId, $objectUri); @@ -469,9 +469,9 @@ class BirthdayService { * @return string The formatted title */ private function formatTitle(string $field, - string $name, - int $year = null, - bool $supports4Byte = true):string { + string $name, + int $year = null, + bool $supports4Byte = true):string { if ($supports4Byte) { switch ($field) { case 'BDAY': diff --git a/apps/dav/lib/CalDAV/CalendarImpl.php b/apps/dav/lib/CalDAV/CalendarImpl.php index de20c9ac3ae..397cff38037 100644 --- a/apps/dav/lib/CalDAV/CalendarImpl.php +++ b/apps/dav/lib/CalDAV/CalendarImpl.php @@ -33,7 +33,6 @@ use OCA\DAV\CalDAV\InvitationResponse\InvitationResponseServer; use OCP\Calendar\Exceptions\CalendarException; use OCP\Calendar\ICreateFromString; use OCP\Calendar\IHandleImipMessage; -use OCP\Calendar\ISchedulingInformation; use OCP\Constants; use Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp; use Sabre\DAV\Exception\Conflict; @@ -52,8 +51,8 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { private array $calendarInfo; public function __construct(Calendar $calendar, - array $calendarInfo, - CalDavBackend $backend) { + array $calendarInfo, + CalDavBackend $backend) { $this->calendar = $calendar; $this->calendarInfo = $calendarInfo; $this->backend = $backend; diff --git a/apps/dav/lib/CalDAV/CalendarObject.php b/apps/dav/lib/CalDAV/CalendarObject.php index 32bcff900c2..7f4bd9054e0 100644 --- a/apps/dav/lib/CalDAV/CalendarObject.php +++ b/apps/dav/lib/CalDAV/CalendarObject.php @@ -45,8 +45,8 @@ class CalendarObject extends \Sabre\CalDAV\CalendarObject { * @param array $objectData */ public function __construct(CalDavBackend $caldavBackend, IL10N $l10n, - array $calendarInfo, - array $objectData) { + array $calendarInfo, + array $objectData) { parent::__construct($caldavBackend, $calendarInfo, $objectData); if ($this->isShared()) { diff --git a/apps/dav/lib/CalDAV/EventComparisonService.php b/apps/dav/lib/CalDAV/EventComparisonService.php index d8d6ea07ed2..0f9914dcf98 100644 --- a/apps/dav/lib/CalDAV/EventComparisonService.php +++ b/apps/dav/lib/CalDAV/EventComparisonService.php @@ -25,15 +25,9 @@ declare(strict_types=1); */ namespace OCA\DAV\CalDAV; -use OCA\DAV\AppInfo\Application; use OCA\DAV\CalDAV\Schedule\IMipService; -use OCP\AppFramework\Utility\ITimeFactory; -use OCP\IConfig; use Sabre\VObject\Component\VCalendar; use Sabre\VObject\Component\VEvent; -use Sabre\VObject\Component\VTimeZone; -use Sabre\VObject\Component\VTodo; -use function max; class EventComparisonService { diff --git a/apps/dav/lib/CalDAV/FreeBusy/FreeBusyGenerator.php b/apps/dav/lib/CalDAV/FreeBusy/FreeBusyGenerator.php index 29daca4e092..84dd05dfa55 100644 --- a/apps/dav/lib/CalDAV/FreeBusy/FreeBusyGenerator.php +++ b/apps/dav/lib/CalDAV/FreeBusy/FreeBusyGenerator.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /* * * @@ -25,8 +26,6 @@ declare(strict_types=1); namespace OCA\DAV\CalDAV\FreeBusy; -use DateTimeInterface; -use DateTimeZone; use Sabre\VObject\Component\VCalendar; /** diff --git a/apps/dav/lib/CalDAV/PublicCalendarRoot.php b/apps/dav/lib/CalDAV/PublicCalendarRoot.php index 4f7dfea2682..a652b6ef1e5 100644 --- a/apps/dav/lib/CalDAV/PublicCalendarRoot.php +++ b/apps/dav/lib/CalDAV/PublicCalendarRoot.php @@ -52,7 +52,7 @@ class PublicCalendarRoot extends Collection { * @param IConfig $config */ public function __construct(CalDavBackend $caldavBackend, IL10N $l10n, - IConfig $config, LoggerInterface $logger) { + IConfig $config, LoggerInterface $logger) { $this->caldavBackend = $caldavBackend; $this->l10n = $l10n; $this->config = $config; diff --git a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php index 1d8505af8ae..fedd918e6a4 100644 --- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php +++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php @@ -114,7 +114,7 @@ class PublishPlugin extends ServerPlugin { $this->server = $server; $this->server->on('method:POST', [$this, 'httpPost']); - $this->server->on('propFind', [$this, 'propFind']); + $this->server->on('propFind', [$this, 'propFind']); } public function propFind(PropFind $propFind, INode $node) { @@ -184,72 +184,72 @@ class PublishPlugin extends ServerPlugin { case '{'.self::NS_CALENDARSERVER.'}publish-calendar': - // We can only deal with IShareableCalendar objects - if (!$node instanceof Calendar) { - return; - } - $this->server->transactionType = 'post-publish-calendar'; + // We can only deal with IShareableCalendar objects + if (!$node instanceof Calendar) { + return; + } + $this->server->transactionType = 'post-publish-calendar'; - // Getting ACL info - $acl = $this->server->getPlugin('acl'); + // Getting ACL info + $acl = $this->server->getPlugin('acl'); - // If there's no ACL support, we allow everything - if ($acl) { - /** @var \Sabre\DAVACL\Plugin $acl */ - $acl->checkPrivileges($path, '{DAV:}write'); + // If there's no ACL support, we allow everything + if ($acl) { + /** @var \Sabre\DAVACL\Plugin $acl */ + $acl->checkPrivileges($path, '{DAV:}write'); - $limitSharingToOwner = $this->config->getAppValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes'; - $isOwner = $acl->getCurrentUserPrincipal() === $node->getOwner(); - if ($limitSharingToOwner && !$isOwner) { - return; + $limitSharingToOwner = $this->config->getAppValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes'; + $isOwner = $acl->getCurrentUserPrincipal() === $node->getOwner(); + if ($limitSharingToOwner && !$isOwner) { + return; + } } - } - $node->setPublishStatus(true); + $node->setPublishStatus(true); - // iCloud sends back the 202, so we will too. - $response->setStatus(202); + // iCloud sends back the 202, so we will too. + $response->setStatus(202); - // Adding this because sending a response body may cause issues, - // and I wanted some type of indicator the response was handled. - $response->setHeader('X-Sabre-Status', 'everything-went-well'); + // Adding this because sending a response body may cause issues, + // and I wanted some type of indicator the response was handled. + $response->setHeader('X-Sabre-Status', 'everything-went-well'); - // Breaking the event chain - return false; + // Breaking the event chain + return false; case '{'.self::NS_CALENDARSERVER.'}unpublish-calendar': - // We can only deal with IShareableCalendar objects - if (!$node instanceof Calendar) { - return; - } - $this->server->transactionType = 'post-unpublish-calendar'; + // We can only deal with IShareableCalendar objects + if (!$node instanceof Calendar) { + return; + } + $this->server->transactionType = 'post-unpublish-calendar'; - // Getting ACL info - $acl = $this->server->getPlugin('acl'); + // Getting ACL info + $acl = $this->server->getPlugin('acl'); - // If there's no ACL support, we allow everything - if ($acl) { - /** @var \Sabre\DAVACL\Plugin $acl */ - $acl->checkPrivileges($path, '{DAV:}write'); + // If there's no ACL support, we allow everything + if ($acl) { + /** @var \Sabre\DAVACL\Plugin $acl */ + $acl->checkPrivileges($path, '{DAV:}write'); - $limitSharingToOwner = $this->config->getAppValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes'; - $isOwner = $acl->getCurrentUserPrincipal() === $node->getOwner(); - if ($limitSharingToOwner && !$isOwner) { - return; + $limitSharingToOwner = $this->config->getAppValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes'; + $isOwner = $acl->getCurrentUserPrincipal() === $node->getOwner(); + if ($limitSharingToOwner && !$isOwner) { + return; + } } - } - $node->setPublishStatus(false); + $node->setPublishStatus(false); - $response->setStatus(200); + $response->setStatus(200); - // Adding this because sending a response body may cause issues, - // and I wanted some type of indicator the response was handled. - $response->setHeader('X-Sabre-Status', 'everything-went-well'); + // Adding this because sending a response body may cause issues, + // and I wanted some type of indicator the response was handled. + $response->setHeader('X-Sabre-Status', 'everything-went-well'); - // Breaking the event chain - return false; + // Breaking the event chain + return false; } } diff --git a/apps/dav/lib/CalDAV/Reminder/Backend.php b/apps/dav/lib/CalDAV/Reminder/Backend.php index b0476e9594c..f1f5d8c4ac3 100644 --- a/apps/dav/lib/CalDAV/Reminder/Backend.php +++ b/apps/dav/lib/CalDAV/Reminder/Backend.php @@ -51,7 +51,7 @@ class Backend { * @param ITimeFactory $timeFactory */ public function __construct(IDBConnection $db, - ITimeFactory $timeFactory) { + ITimeFactory $timeFactory) { $this->db = $db; $this->timeFactory = $timeFactory; } @@ -114,17 +114,17 @@ class Backend { * @return int The insert id */ public function insertReminder(int $calendarId, - int $objectId, - string $uid, - bool $isRecurring, - int $recurrenceId, - bool $isRecurrenceException, - string $eventHash, - string $alarmHash, - string $type, - bool $isRelative, - int $notificationDate, - bool $isRepeatBased):int { + int $objectId, + string $uid, + bool $isRecurring, + int $recurrenceId, + bool $isRecurrenceException, + string $eventHash, + string $alarmHash, + string $type, + bool $isRelative, + int $notificationDate, + bool $isRepeatBased):int { $query = $this->db->getQueryBuilder(); $query->insert('calendar_reminders') ->values([ @@ -153,7 +153,7 @@ class Backend { * @param int $newNotificationDate */ public function updateReminder(int $reminderId, - int $newNotificationDate):void { + int $newNotificationDate):void { $query = $this->db->getQueryBuilder(); $query->update('calendar_reminders') ->set('notification_date', $query->createNamedParameter($newNotificationDate)) diff --git a/apps/dav/lib/CalDAV/Reminder/INotificationProvider.php b/apps/dav/lib/CalDAV/Reminder/INotificationProvider.php index e8cbfdd0ab3..1eb3932e611 100644 --- a/apps/dav/lib/CalDAV/Reminder/INotificationProvider.php +++ b/apps/dav/lib/CalDAV/Reminder/INotificationProvider.php @@ -48,7 +48,7 @@ interface INotificationProvider { * @return void */ public function send(VEvent $vevent, - ?string $calendarDisplayName, - array $principalEmailAddresses, - array $users = []): void; + ?string $calendarDisplayName, + array $principalEmailAddresses, + array $users = []): void; } diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php index bccbec5fe3c..52c994554cc 100644 --- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php +++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php @@ -69,9 +69,9 @@ abstract class AbstractProvider implements INotificationProvider { protected $config; public function __construct(LoggerInterface $logger, - L10NFactory $l10nFactory, - IURLGenerator $urlGenerator, - IConfig $config) { + L10NFactory $l10nFactory, + IURLGenerator $urlGenerator, + IConfig $config) { $this->logger = $logger; $this->l10nFactory = $l10nFactory; $this->urlGenerator = $urlGenerator; @@ -88,9 +88,9 @@ abstract class AbstractProvider implements INotificationProvider { * @return void */ abstract public function send(VEvent $vevent, - ?string $calendarDisplayName, - array $principalEmailAddresses, - array $users = []): void; + ?string $calendarDisplayName, + array $principalEmailAddresses, + array $users = []): void; /** * @return string diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php index da275efdcf1..262ceb479f0 100644 --- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php +++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php @@ -58,10 +58,10 @@ class EmailProvider extends AbstractProvider { private IMailer $mailer; public function __construct(IConfig $config, - IMailer $mailer, - LoggerInterface $logger, - L10NFactory $l10nFactory, - IURLGenerator $urlGenerator) { + IMailer $mailer, + LoggerInterface $logger, + L10NFactory $l10nFactory, + IURLGenerator $urlGenerator) { parent::__construct($logger, $l10nFactory, $urlGenerator, $config); $this->mailer = $mailer; } @@ -76,9 +76,9 @@ class EmailProvider extends AbstractProvider { * @throws \Exception */ public function send(VEvent $vevent, - ?string $calendarDisplayName, - array $principalEmailAddresses, - array $users = []):void { + ?string $calendarDisplayName, + array $principalEmailAddresses, + array $users = []):void { $fallbackLanguage = $this->getFallbackLanguage(); $organizerEmailAddress = null; @@ -162,9 +162,9 @@ class EmailProvider extends AbstractProvider { * @param array $eventData */ private function addBulletList(IEMailTemplate $template, - IL10N $l10n, - string $calendarDisplayName, - VEvent $vevent):void { + IL10N $l10n, + string $calendarDisplayName, + VEvent $vevent):void { $template->addBodyListItem($calendarDisplayName, $l10n->t('Calendar:'), $this->getAbsoluteImagePath('actions/info.png')); @@ -220,7 +220,7 @@ class EmailProvider extends AbstractProvider { * @return array<string, string[]> */ private function sortEMailAddressesByLanguage(array $emails, - string $defaultLanguage):array { + string $defaultLanguage):array { $sortedByLanguage = []; foreach ($emails as $emailAddress => $parameters) { @@ -435,7 +435,7 @@ class EmailProvider extends AbstractProvider { } private function isDayEqual(DateTime $dtStart, - DateTime $dtEnd):bool { + DateTime $dtEnd):bool { return $dtStart->format('Y-m-d') === $dtEnd->format('Y-m-d'); } diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php index ab7f12c570a..79e4e44e6d8 100644 --- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php +++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php @@ -59,11 +59,11 @@ class PushProvider extends AbstractProvider { private $timeFactory; public function __construct(IConfig $config, - IManager $manager, - LoggerInterface $logger, - L10NFactory $l10nFactory, - IURLGenerator $urlGenerator, - ITimeFactory $timeFactory) { + IManager $manager, + LoggerInterface $logger, + L10NFactory $l10nFactory, + IURLGenerator $urlGenerator, + ITimeFactory $timeFactory) { parent::__construct($logger, $l10nFactory, $urlGenerator, $config); $this->manager = $manager; $this->timeFactory = $timeFactory; @@ -79,9 +79,9 @@ class PushProvider extends AbstractProvider { * @throws \Exception */ public function send(VEvent $vevent, - ?string $calendarDisplayName, - array $principalEmailAddresses, - array $users = []):void { + ?string $calendarDisplayName, + array $principalEmailAddresses, + array $users = []):void { if ($this->config->getAppValue('dav', 'sendEventRemindersPush', 'yes') !== 'yes') { return; } diff --git a/apps/dav/lib/CalDAV/Reminder/Notifier.php b/apps/dav/lib/CalDAV/Reminder/Notifier.php index c658ef2ff01..271d8e88fa7 100644 --- a/apps/dav/lib/CalDAV/Reminder/Notifier.php +++ b/apps/dav/lib/CalDAV/Reminder/Notifier.php @@ -66,8 +66,8 @@ class Notifier implements INotifier { * @param ITimeFactory $timeFactory */ public function __construct(IFactory $factory, - IURLGenerator $urlGenerator, - ITimeFactory $timeFactory) { + IURLGenerator $urlGenerator, + ITimeFactory $timeFactory) { $this->l10nFactory = $factory; $this->urlGenerator = $urlGenerator; $this->timeFactory = $timeFactory; @@ -102,7 +102,7 @@ class Notifier implements INotifier { * @throws \Exception */ public function prepare(INotification $notification, - string $languageCode):INotification { + string $languageCode):INotification { if ($notification->getApp() !== Application::APP_ID) { throw new \InvalidArgumentException('Notification not from this app'); } @@ -289,7 +289,7 @@ class Notifier implements INotifier { * @return bool */ private function isDayEqual(DateTime $dtStart, - DateTime $dtEnd):bool { + DateTime $dtEnd):bool { return $dtStart->format('Y-m-d') === $dtEnd->format('Y-m-d'); } diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php index d4b22911099..9ededb8d015 100644 --- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php +++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php @@ -98,14 +98,14 @@ class ReminderService { ]; public function __construct(Backend $backend, - NotificationProviderManager $notificationProviderManager, - IUserManager $userManager, - IGroupManager $groupManager, - CalDavBackend $caldavBackend, - ITimeFactory $timeFactory, - IConfig $config, - LoggerInterface $logger, - Principal $principalConnector) { + NotificationProviderManager $notificationProviderManager, + IUserManager $userManager, + IGroupManager $groupManager, + CalDavBackend $caldavBackend, + ITimeFactory $timeFactory, + IConfig $config, + LoggerInterface $logger, + Principal $principalConnector) { $this->backend = $backend; $this->notificationProviderManager = $notificationProviderManager; $this->userManager = $userManager; @@ -390,12 +390,12 @@ class ReminderService { * @return array */ private function getRemindersForVAlarm(VAlarm $valarm, - array $objectData, - DateTimeZone $calendarTimeZone, - string $eventHash = null, - string $alarmHash = null, - bool $isRecurring = false, - bool $isRecurrenceException = false):array { + array $objectData, + DateTimeZone $calendarTimeZone, + string $eventHash = null, + string $alarmHash = null, + bool $isRecurring = false, + bool $isRecurrenceException = false):array { if ($eventHash === null) { $eventHash = $this->getEventHash($valarm->parent); } @@ -490,7 +490,7 @@ class ReminderService { * @param VEvent $vevent */ private function deleteOrProcessNext(array $reminder, - VObject\Component\VEvent $vevent):void { + VObject\Component\VEvent $vevent):void { if ($reminder['is_repeat_based'] || !$reminder['is_recurring'] || !$reminder['is_relative'] || @@ -673,8 +673,8 @@ class ReminderService { * @return VEvent|null */ private function getVEventByRecurrenceId(VObject\Component\VCalendar $vcalendar, - int $recurrenceId, - bool $isRecurrenceException):?VEvent { + int $recurrenceId, + bool $isRecurrenceException):?VEvent { $vevents = $this->getAllVEventsFromVCalendar($vcalendar); if (count($vevents) === 0) { return null; diff --git a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php index 32642bee195..92c61e72780 100644 --- a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php +++ b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php @@ -75,13 +75,13 @@ abstract class AbstractPrincipalBackend implements BackendInterface { private $cuType; public function __construct(IDBConnection $dbConnection, - IUserSession $userSession, - IGroupManager $groupManager, - LoggerInterface $logger, - ProxyMapper $proxyMapper, - string $principalPrefix, - string $dbPrefix, - string $cuType) { + IUserSession $userSession, + IGroupManager $groupManager, + LoggerInterface $logger, + ProxyMapper $proxyMapper, + string $principalPrefix, + string $dbPrefix, + string $cuType) { $this->db = $dbConnection; $this->userSession = $userSession; $this->groupManager = $groupManager; @@ -165,7 +165,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { } [, $name] = \Sabre\Uri\split($path); - [$backendId, $resourceId] = explode('-', $name, 2); + [$backendId, $resourceId] = explode('-', $name, 2); $query = $this->db->getQueryBuilder(); $query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname']) @@ -309,7 +309,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { case IRoomMetadata::CAPACITY: case IResourceMetadata::VEHICLE_SEATING_CAPACITY: - $results[] = $this->searchPrincipalsByCapacity($prop,$value); + $results[] = $this->searchPrincipalsByCapacity($prop, $value); break; default: @@ -470,7 +470,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { } [, $name] = \Sabre\Uri\split($path); - [$backendId, $resourceId] = explode('-', $name, 2); + [$backendId, $resourceId] = explode('-', $name, 2); $query = $this->db->getQueryBuilder(); $query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname', 'group_restrictions']) diff --git a/apps/dav/lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php index 20fdadbca0c..45795377e11 100644 --- a/apps/dav/lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php +++ b/apps/dav/lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php @@ -39,10 +39,10 @@ class ResourcePrincipalBackend extends AbstractPrincipalBackend { * ResourcePrincipalBackend constructor. */ public function __construct(IDBConnection $dbConnection, - IUserSession $userSession, - IGroupManager $groupManager, - LoggerInterface $logger, - ProxyMapper $proxyMapper) { + IUserSession $userSession, + IGroupManager $groupManager, + LoggerInterface $logger, + ProxyMapper $proxyMapper) { parent::__construct($dbConnection, $userSession, $groupManager, $logger, $proxyMapper, 'principals/calendar-resources', 'resource', 'RESOURCE'); } diff --git a/apps/dav/lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php index 931635d632f..829ca7d6033 100644 --- a/apps/dav/lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php +++ b/apps/dav/lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php @@ -39,10 +39,10 @@ class RoomPrincipalBackend extends AbstractPrincipalBackend { * RoomPrincipalBackend constructor. */ public function __construct(IDBConnection $dbConnection, - IUserSession $userSession, - IGroupManager $groupManager, - LoggerInterface $logger, - ProxyMapper $proxyMapper) { + IUserSession $userSession, + IGroupManager $groupManager, + LoggerInterface $logger, + ProxyMapper $proxyMapper) { parent::__construct($dbConnection, $userSession, $groupManager, $logger, $proxyMapper, 'principals/calendar-rooms', 'room', 'ROOM'); } diff --git a/apps/dav/lib/CalDAV/RetentionService.php b/apps/dav/lib/CalDAV/RetentionService.php index 1d92d847641..9a43d5bdc91 100644 --- a/apps/dav/lib/CalDAV/RetentionService.php +++ b/apps/dav/lib/CalDAV/RetentionService.php @@ -44,8 +44,8 @@ class RetentionService { private $calDavBackend; public function __construct(IConfig $config, - ITimeFactory $time, - CalDavBackend $calDavBackend) { + ITimeFactory $time, + CalDavBackend $calDavBackend) { $this->config = $config; $this->time = $time; $this->calDavBackend = $calDavBackend; diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php index 437a135e38c..fcc2ae1e166 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php @@ -86,14 +86,14 @@ class IMipPlugin extends SabreIMipPlugin { private EventComparisonService $eventComparisonService; public function __construct(IConfig $config, - IMailer $mailer, - LoggerInterface $logger, - ITimeFactory $timeFactory, - Defaults $defaults, - IUserManager $userManager, - $userId, - IMipService $imipService, - EventComparisonService $eventComparisonService) { + IMailer $mailer, + LoggerInterface $logger, + ITimeFactory $timeFactory, + Defaults $defaults, + IUserManager $userManager, + $userId, + IMipService $imipService, + EventComparisonService $eventComparisonService) { parent::__construct(''); $this->userId = $userId; $this->config = $config; @@ -305,9 +305,9 @@ class IMipPlugin extends SabreIMipPlugin { $itip_msg = $iTipMessage->message->serialize(); $message->attachInline( - $itip_msg, + $itip_msg, 'event.ics', - 'text/calendar; method=' . $iTipMessage->method, + 'text/calendar; method=' . $iTipMessage->method, ); try { diff --git a/apps/dav/lib/CalDAV/Schedule/IMipService.php b/apps/dav/lib/CalDAV/Schedule/IMipService.php index 1e7b0bc3b02..4cd859d79ac 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipService.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipService.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /* * DAV App @@ -57,10 +58,10 @@ class IMipService { ]; public function __construct(URLGenerator $urlGenerator, - IConfig $config, - IDBConnection $db, - ISecureRandom $random, - L10NFactory $l10nFactory) { + IConfig $config, + IDBConnection $db, + ISecureRandom $random, + L10NFactory $l10nFactory) { $this->urlGenerator = $urlGenerator; $this->config = $config; $this->db = $db; @@ -99,7 +100,7 @@ class IMipService { return $default; } $newstring = $vevent->$property->getValue(); - if(isset($oldVEvent->$property) && $oldVEvent->$property->getValue() !== $newstring ) { + if(isset($oldVEvent->$property) && $oldVEvent->$property->getValue() !== $newstring) { $oldstring = $oldVEvent->$property->getValue(); return sprintf($strikethrough, $oldstring, $newstring); } @@ -162,7 +163,7 @@ class IMipService { if(!empty($oldVEvent)) { $oldMeetingWhen = $this->generateWhenString($oldVEvent); - $data['meeting_title_html'] = $this->generateDiffString($vEvent, $oldVEvent, 'SUMMARY', $data['meeting_title']); + $data['meeting_title_html'] = $this->generateDiffString($vEvent, $oldVEvent, 'SUMMARY', $data['meeting_title']); $data['meeting_description_html'] = $this->generateDiffString($vEvent, $oldVEvent, 'DESCRIPTION', $data['meeting_description']); $data['meeting_location_html'] = $this->generateLinkifiedDiffString($vEvent, $oldVEvent, 'LOCATION', $data['meeting_location']); @@ -281,7 +282,8 @@ class IMipService { $strikethrough = "<span style='text-decoration: line-through'>%s</span>"; $newMeetingWhen = $this->generateWhenString($vEvent); - $newSummary = isset($vEvent->SUMMARY) && (string)$vEvent->SUMMARY !== '' ? (string)$vEvent->SUMMARY : $this->l10n->t('Untitled event');; + $newSummary = isset($vEvent->SUMMARY) && (string)$vEvent->SUMMARY !== '' ? (string)$vEvent->SUMMARY : $this->l10n->t('Untitled event'); + ; $newDescription = isset($vEvent->DESCRIPTION) && (string)$vEvent->DESCRIPTION !== '' ? (string)$vEvent->DESCRIPTION : $defaultVal; $newUrl = isset($vEvent->URL) && (string)$vEvent->URL !== '' ? sprintf('<a href="%1$s">%1$s</a>', $vEvent->URL) : $defaultVal; $newLocation = isset($vEvent->LOCATION) && (string)$vEvent->LOCATION !== '' ? (string)$vEvent->LOCATION : $defaultVal; @@ -483,7 +485,7 @@ class IMipService { htmlspecialchars($organizer->getNormalizedValue()), htmlspecialchars($organizerName ?: $organizerEmail)); $organizerText = sprintf('%s <%s>', $organizerName, $organizerEmail); - if(isset($organizer['PARTSTAT']) ) { + if(isset($organizer['PARTSTAT'])) { /** @var Parameter $partstat */ $partstat = $organizer['PARTSTAT']; if(strcasecmp($partstat->getValue(), 'ACCEPTED') === 0) { diff --git a/apps/dav/lib/CalDAV/Schedule/Plugin.php b/apps/dav/lib/CalDAV/Schedule/Plugin.php index 16acc72d988..2845ccdf6c2 100644 --- a/apps/dav/lib/CalDAV/Schedule/Plugin.php +++ b/apps/dav/lib/CalDAV/Schedule/Plugin.php @@ -36,7 +36,6 @@ use OCA\DAV\CalDAV\CalendarHome; use OCP\IConfig; use Psr\Log\LoggerInterface; use Sabre\CalDAV\ICalendar; -use Sabre\CalDAV\Schedule\IOutbox; use Sabre\DAV\INode; use Sabre\DAV\IProperties; use Sabre\DAV\PropFind; @@ -45,7 +44,6 @@ use Sabre\DAV\Xml\Property\LocalHref; use Sabre\DAVACL\IPrincipal; use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; -use Sabre\VObject; use Sabre\VObject\Component; use Sabre\VObject\Component\VCalendar; use Sabre\VObject\Component\VEvent; diff --git a/apps/dav/lib/CalDAV/Status/Status.php b/apps/dav/lib/CalDAV/Status/Status.php index 8857d0f14e7..d1c35002fcd 100644 --- a/apps/dav/lib/CalDAV/Status/Status.php +++ b/apps/dav/lib/CalDAV/Status/Status.php @@ -27,7 +27,8 @@ namespace OCA\DAV\CalDAV\Status; class Status { - public function __construct(private string $status = '', private ?string $message = null, private ?string $customMessage = null){} + public function __construct(private string $status = '', private ?string $message = null, private ?string $customMessage = null) { + } public function getStatus(): string { return $this->status; diff --git a/apps/dav/lib/CalDAV/Status/StatusService.php b/apps/dav/lib/CalDAV/Status/StatusService.php index 92554f800c3..1dce2c4c3a3 100644 --- a/apps/dav/lib/CalDAV/Status/StatusService.php +++ b/apps/dav/lib/CalDAV/Status/StatusService.php @@ -48,16 +48,13 @@ declare(strict_types=1); */ namespace OCA\DAV\CalDAV\Status; -use DateTimeZone; use OC\Calendar\CalendarQuery; use OCA\DAV\CalDAV\CalendarImpl; use OCA\DAV\CalDAV\FreeBusy\FreeBusyGenerator; use OCA\DAV\CalDAV\InvitationResponse\InvitationResponseServer; -use OCA\DAV\CalDAV\IUser; use OCA\DAV\CalDAV\Schedule\Plugin as SchedulePlugin; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Calendar\IManager; -use OCP\Calendar\ISchedulingInformation; use OCP\IL10N; use OCP\IUser as User; use OCP\UserStatus\IUserStatus; @@ -66,7 +63,6 @@ use Sabre\DAV\Exception\NotAuthenticated; use Sabre\DAVACL\Exception\NeedPrivileges; use Sabre\DAVACL\Plugin as AclPlugin; use Sabre\VObject\Component; -use Sabre\VObject\Component\VCalendar; use Sabre\VObject\Component\VEvent; use Sabre\VObject\Parameter; use Sabre\VObject\Property; @@ -74,10 +70,11 @@ use Sabre\VObject\Reader; class StatusService { public function __construct(private ITimeFactory $timeFactory, - private IManager $calendarManager, - private InvitationResponseServer $server, - private IL10N $l10n, - private FreeBusyGenerator $generator){} + private IManager $calendarManager, + private InvitationResponseServer $server, + private IL10N $l10n, + private FreeBusyGenerator $generator) { + } public function processCalendarAvailability(User $user, ?string $availability): ?Status { $userId = $user->getUID(); @@ -172,7 +169,7 @@ class StatusService { foreach ($calendarEvents as $calendarEvent) { $vEvent = new VEvent($calendar, 'VEVENT'); foreach($calendarEvent['objects'] as $component) { - foreach ($component as $key => $value) { + foreach ($component as $key => $value) { $vEvent->add($key, $value[0]); } } diff --git a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php index 5730b7a1002..b1a3fea21b7 100644 --- a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php +++ b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php @@ -48,9 +48,9 @@ class DeletedCalendarObject implements IACL, ICalendarObject, IRestorable { private $calDavBackend; public function __construct(string $name, - array $objectData, - string $principalUri, - CalDavBackend $calDavBackend) { + array $objectData, + string $principalUri, + CalDavBackend $calDavBackend) { $this->name = $name; $this->objectData = $objectData; $this->calDavBackend = $calDavBackend; diff --git a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php index 20d05c047b1..f7f0bd7b512 100644 --- a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php +++ b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php @@ -45,7 +45,7 @@ class DeletedCalendarObjectsCollection implements ICalendarObjectContainer { private $principalInfo; public function __construct(CalDavBackend $caldavBackend, - array $principalInfo) { + array $principalInfo) { $this->caldavBackend = $caldavBackend; $this->principalInfo = $principalInfo; } diff --git a/apps/dav/lib/CalDAV/Trashbin/Plugin.php b/apps/dav/lib/CalDAV/Trashbin/Plugin.php index 58ff76beca1..8a661732f19 100644 --- a/apps/dav/lib/CalDAV/Trashbin/Plugin.php +++ b/apps/dav/lib/CalDAV/Trashbin/Plugin.php @@ -56,7 +56,7 @@ class Plugin extends ServerPlugin { private $server; public function __construct(IRequest $request, - RetentionService $retentionService) { + RetentionService $retentionService) { $this->disableTrashbin = $request->getHeader('X-NC-CalDAV-No-Trashbin') === '1'; $this->retentionService = $retentionService; } diff --git a/apps/dav/lib/CalDAV/Trashbin/TrashbinHome.php b/apps/dav/lib/CalDAV/Trashbin/TrashbinHome.php index 34d11e51eb3..e9bf6da19e8 100644 --- a/apps/dav/lib/CalDAV/Trashbin/TrashbinHome.php +++ b/apps/dav/lib/CalDAV/Trashbin/TrashbinHome.php @@ -50,7 +50,7 @@ class TrashbinHome implements IACL, ICollection, IProperties { private $principalInfo; public function __construct(CalDavBackend $caldavBackend, - array $principalInfo) { + array $principalInfo) { $this->caldavBackend = $caldavBackend; $this->principalInfo = $principalInfo; } diff --git a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php index 8928d05b93c..4035f345876 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php @@ -46,9 +46,9 @@ use Sabre\DAV\Xml\Property\Href; use Sabre\VObject\Component; use Sabre\VObject\DateTimeParser; use Sabre\VObject\InvalidDataException; -use Sabre\VObject\Recur\NoInstancesException; use Sabre\VObject\ParseException; use Sabre\VObject\Reader; +use Sabre\VObject\Recur\NoInstancesException; use Sabre\VObject\Splitter\ICalendar; use Sabre\VObject\UUIDUtil; use function count; diff --git a/apps/dav/lib/CardDAV/Activity/Backend.php b/apps/dav/lib/CardDAV/Activity/Backend.php index 53639f84f84..f0a5ee05e82 100644 --- a/apps/dav/lib/CardDAV/Activity/Backend.php +++ b/apps/dav/lib/CardDAV/Activity/Backend.php @@ -55,10 +55,10 @@ class Backend { protected $userManager; public function __construct(IActivityManager $activityManager, - IGroupManager $groupManager, - IUserSession $userSession, - IAppManager $appManager, - IUserManager $userManager) { + IGroupManager $groupManager, + IUserSession $userSession, + IAppManager $appManager, + IUserManager $userManager) { $this->activityManager = $activityManager; $this->groupManager = $groupManager; $this->userSession = $userSession; diff --git a/apps/dav/lib/CardDAV/Activity/Provider/Addressbook.php b/apps/dav/lib/CardDAV/Activity/Provider/Addressbook.php index 0f4acaaa434..a9ed767ffc7 100644 --- a/apps/dav/lib/CardDAV/Activity/Provider/Addressbook.php +++ b/apps/dav/lib/CardDAV/Activity/Provider/Addressbook.php @@ -53,11 +53,11 @@ class Addressbook extends Base { protected $eventMerger; public function __construct(IFactory $languageFactory, - IURLGenerator $url, - IManager $activityManager, - IUserManager $userManager, - IGroupManager $groupManager, - IEventMerger $eventMerger) { + IURLGenerator $url, + IManager $activityManager, + IUserManager $userManager, + IGroupManager $groupManager, + IEventMerger $eventMerger) { parent::__construct($userManager, $groupManager, $url); $this->languageFactory = $languageFactory; $this->activityManager = $activityManager; diff --git a/apps/dav/lib/CardDAV/Activity/Provider/Base.php b/apps/dav/lib/CardDAV/Activity/Provider/Base.php index a59c3b57262..f475f9d76b7 100644 --- a/apps/dav/lib/CardDAV/Activity/Provider/Base.php +++ b/apps/dav/lib/CardDAV/Activity/Provider/Base.php @@ -51,8 +51,8 @@ abstract class Base implements IProvider { protected $url; public function __construct(IUserManager $userManager, - IGroupManager $groupManager, - IURLGenerator $urlGenerator) { + IGroupManager $groupManager, + IURLGenerator $urlGenerator) { $this->userManager = $userManager; $this->groupManager = $groupManager; $this->url = $urlGenerator; diff --git a/apps/dav/lib/CardDAV/Activity/Provider/Card.php b/apps/dav/lib/CardDAV/Activity/Provider/Card.php index e2abdda161a..8f205942d4b 100644 --- a/apps/dav/lib/CardDAV/Activity/Provider/Card.php +++ b/apps/dav/lib/CardDAV/Activity/Provider/Card.php @@ -53,12 +53,12 @@ class Card extends Base { protected $appManager; public function __construct(IFactory $languageFactory, - IURLGenerator $url, - IManager $activityManager, - IUserManager $userManager, - IGroupManager $groupManager, - IEventMerger $eventMerger, - IAppManager $appManager) { + IURLGenerator $url, + IManager $activityManager, + IUserManager $userManager, + IGroupManager $groupManager, + IEventMerger $eventMerger, + IAppManager $appManager) { parent::__construct($userManager, $groupManager, $url); $this->languageFactory = $languageFactory; $this->activityManager = $activityManager; diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php index c385d0e7b86..79720429479 100644 --- a/apps/dav/lib/CardDAV/AddressBookImpl.php +++ b/apps/dav/lib/CardDAV/AddressBookImpl.php @@ -63,10 +63,10 @@ class AddressBookImpl implements IAddressBook { * @param IUrlGenerator $urlGenerator */ public function __construct( - AddressBook $addressBook, - array $addressBookInfo, - CardDavBackend $backend, - IURLGenerator $urlGenerator) { + AddressBook $addressBook, + array $addressBookInfo, + CardDavBackend $backend, + IURLGenerator $urlGenerator) { $this->addressBook = $addressBook; $this->addressBookInfo = $addressBookInfo; $this->backend = $backend; diff --git a/apps/dav/lib/CardDAV/AddressBookRoot.php b/apps/dav/lib/CardDAV/AddressBookRoot.php index c82943d2879..f450dbe2ef9 100644 --- a/apps/dav/lib/CardDAV/AddressBookRoot.php +++ b/apps/dav/lib/CardDAV/AddressBookRoot.php @@ -41,11 +41,11 @@ class AddressBookRoot extends \Sabre\CardDAV\AddressBookRoot { * @param string $principalPrefix */ public function __construct(\Sabre\DAVACL\PrincipalBackend\BackendInterface $principalBackend, - \Sabre\CardDAV\Backend\BackendInterface $carddavBackend, - PluginManager $pluginManager, - ?IUser $user, - ?IGroupManager $groupManager, - string $principalPrefix = 'principals') { + \Sabre\CardDAV\Backend\BackendInterface $carddavBackend, + PluginManager $pluginManager, + ?IUser $user, + ?IGroupManager $groupManager, + string $principalPrefix = 'principals') { parent::__construct($principalBackend, $carddavBackend, $principalPrefix); $this->pluginManager = $pluginManager; $this->user = $user; diff --git a/apps/dav/lib/CardDAV/Card.php b/apps/dav/lib/CardDAV/Card.php index 72a9bd88c1e..093255392e0 100644 --- a/apps/dav/lib/CardDAV/Card.php +++ b/apps/dav/lib/CardDAV/Card.php @@ -24,8 +24,7 @@ declare(strict_types=1); */ namespace OCA\DAV\CardDAV; -class Card extends \Sabre\CardDAV\Card -{ +class Card extends \Sabre\CardDAV\Card { public function getId(): int { return (int) $this->cardData['id']; } diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 8be0bd8050c..c1f0fe0c93c 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -35,6 +35,7 @@ */ namespace OCA\DAV\CardDAV; +use OC\Search\Filter\DateTimeFilter; use OCA\DAV\Connector\Sabre\Principal; use OCA\DAV\DAV\Sharing\Backend; use OCA\DAV\DAV\Sharing\IShareable; @@ -53,7 +54,6 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\IDBConnection; use OCP\IGroupManager; use OCP\IUserManager; -use OC\Search\Filter\DateTimeFilter; use PDO; use Sabre\CardDAV\Backend\BackendInterface; use Sabre\CardDAV\Backend\SyncSupport; @@ -98,10 +98,10 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param IEventDispatcher $dispatcher */ public function __construct(IDBConnection $db, - Principal $principalBackend, - IUserManager $userManager, - IGroupManager $groupManager, - IEventDispatcher $dispatcher) { + Principal $principalBackend, + IUserManager $userManager, + IGroupManager $groupManager, + IEventDispatcher $dispatcher) { $this->db = $db; $this->principalBackend = $principalBackend; $this->userManager = $userManager; @@ -1093,9 +1093,9 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @return array */ public function searchPrincipalUri(string $principalUri, - string $pattern, - array $searchProperties, - array $options = []): array { + string $pattern, + array $searchProperties, + array $options = []): array { return $this->atomic(function () use ($principalUri, $pattern, $searchProperties, $options) { $addressBookIds = array_map(static function ($row):int { return (int) $row['id']; @@ -1123,9 +1123,9 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @return array */ private function searchByAddressBookIds(array $addressBookIds, - string $pattern, - array $searchProperties, - array $options = []): array { + string $pattern, + array $searchProperties, + array $options = []): array { if (empty($addressBookIds)) { return []; } diff --git a/apps/dav/lib/CardDAV/Converter.php b/apps/dav/lib/CardDAV/Converter.php index e19b52b4783..8ea75fbef74 100644 --- a/apps/dav/lib/CardDAV/Converter.php +++ b/apps/dav/lib/CardDAV/Converter.php @@ -29,8 +29,8 @@ namespace OCA\DAV\CardDAV; use Exception; use OCP\Accounts\IAccountManager; -use OCP\IURLGenerator; use OCP\IImage; +use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserManager; use Sabre\VObject\Component\VCard; diff --git a/apps/dav/lib/CardDAV/PhotoCache.php b/apps/dav/lib/CardDAV/PhotoCache.php index 0d31f1f5239..9f05ec2354a 100644 --- a/apps/dav/lib/CardDAV/PhotoCache.php +++ b/apps/dav/lib/CardDAV/PhotoCache.php @@ -34,12 +34,12 @@ use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; use OCP\Files\SimpleFS\ISimpleFile; use OCP\Files\SimpleFS\ISimpleFolder; +use Psr\Log\LoggerInterface; use Sabre\CardDAV\Card; use Sabre\VObject\Document; use Sabre\VObject\Parameter; use Sabre\VObject\Property\Binary; use Sabre\VObject\Reader; -use Psr\Log\LoggerInterface; class PhotoCache { diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php index 09c31683069..66927d35e04 100644 --- a/apps/dav/lib/CardDAV/SyncService.php +++ b/apps/dav/lib/CardDAV/SyncService.php @@ -30,7 +30,6 @@ */ namespace OCA\DAV\CardDAV; -use OC\Accounts\AccountManager; use OCP\AppFramework\Db\TTransactional; use OCP\AppFramework\Http; use OCP\IDBConnection; @@ -57,10 +56,10 @@ class SyncService { protected string $certPath; public function __construct(CardDavBackend $backend, - IUserManager $userManager, - IDBConnection $dbConnection, - LoggerInterface $logger, - Converter $converter) { + IUserManager $userManager, + IDBConnection $dbConnection, + LoggerInterface $logger, + Converter $converter) { $this->backend = $backend; $this->userManager = $userManager; $this->logger = $logger; @@ -97,7 +96,7 @@ class SyncService { $cardUri = basename($resource); if (isset($status[200])) { $vCard = $this->download($url, $userName, $sharedSecret, $resource); - $this->atomic(function() use ($addressBookId, $cardUri, $vCard) { + $this->atomic(function () use ($addressBookId, $cardUri, $vCard) { $existingCard = $this->backend->getCard($addressBookId, $cardUri); if ($existingCard === false) { $this->backend->createCard($addressBookId, $cardUri, $vCard['body']); @@ -117,7 +116,7 @@ class SyncService { * @throws \Sabre\DAV\Exception\BadRequest */ public function ensureSystemAddressBookExists(string $principal, string $uri, array $properties): ?array { - return $this->atomic(function() use ($principal, $uri, $properties) { + return $this->atomic(function () use ($principal, $uri, $properties) { $book = $this->backend->getAddressBooksByUri($principal, $uri); if (!is_null($book)) { return $book; @@ -226,7 +225,7 @@ class SyncService { $cardId = self::getCardUri($user); if ($user->isEnabled()) { - $this->atomic(function() use ($addressBookId, $cardId, $user) { + $this->atomic(function () use ($addressBookId, $cardId, $user) { $card = $this->backend->getCard($addressBookId, $cardId); if ($card === false) { $vCard = $this->converter->createCardFromUser($user); diff --git a/apps/dav/lib/CardDAV/SystemAddressbook.php b/apps/dav/lib/CardDAV/SystemAddressbook.php index 498c4e95be7..dc5ee0e1f21 100644 --- a/apps/dav/lib/CardDAV/SystemAddressbook.php +++ b/apps/dav/lib/CardDAV/SystemAddressbook.php @@ -36,8 +36,8 @@ use OCP\IGroupManager; use OCP\IL10N; use OCP\IRequest; use OCP\IUserSession; -use Sabre\CardDAV\Backend\SyncSupport; use Sabre\CardDAV\Backend\BackendInterface; +use Sabre\CardDAV\Backend\SyncSupport; use Sabre\CardDAV\Card; use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\Exception\NotFound; diff --git a/apps/dav/lib/CardDAV/UserAddressBooks.php b/apps/dav/lib/CardDAV/UserAddressBooks.php index 02e500acc86..2d129410067 100644 --- a/apps/dav/lib/CardDAV/UserAddressBooks.php +++ b/apps/dav/lib/CardDAV/UserAddressBooks.php @@ -29,8 +29,8 @@ declare(strict_types=1); namespace OCA\DAV\CardDAV; use OCA\DAV\AppInfo\PluginManager; -use OCA\DAV\CardDAV\Integration\IAddressBookProvider; use OCA\DAV\CardDAV\Integration\ExternalAddressBook; +use OCA\DAV\CardDAV\Integration\IAddressBookProvider; use OCA\Federation\TrustedServers; use OCP\AppFramework\QueryException; use OCP\IConfig; @@ -42,10 +42,10 @@ use OCP\IUserSession; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Sabre\CardDAV\Backend; -use Sabre\DAV\Exception\MethodNotAllowed; use Sabre\CardDAV\IAddressBook; -use function array_map; +use Sabre\DAV\Exception\MethodNotAllowed; use Sabre\DAV\MkCol; +use function array_map; class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome { /** @var IL10N */ @@ -60,10 +60,10 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome { private ?IGroupManager $groupManager; public function __construct(Backend\BackendInterface $carddavBackend, - string $principalUri, - PluginManager $pluginManager, - ?IUser $user, - ?IGroupManager $groupManager) { + string $principalUri, + PluginManager $pluginManager, + ?IUser $user, + ?IGroupManager $groupManager) { parent::__construct($carddavBackend, $principalUri); $this->pluginManager = $pluginManager; $this->user = $user; diff --git a/apps/dav/lib/Command/CreateAddressBook.php b/apps/dav/lib/Command/CreateAddressBook.php index 9dfc539a25d..27ecb5973e4 100644 --- a/apps/dav/lib/Command/CreateAddressBook.php +++ b/apps/dav/lib/Command/CreateAddressBook.php @@ -44,11 +44,11 @@ class CreateAddressBook extends Command { ->setName('dav:create-addressbook') ->setDescription('Create a dav addressbook') ->addArgument('user', - InputArgument::REQUIRED, - 'User for whom the addressbook will be created') + InputArgument::REQUIRED, + 'User for whom the addressbook will be created') ->addArgument('name', - InputArgument::REQUIRED, - 'Name of the addressbook'); + InputArgument::REQUIRED, + 'Name of the addressbook'); } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/apps/dav/lib/Comments/CommentsPlugin.php b/apps/dav/lib/Comments/CommentsPlugin.php index 58de3e36139..1cfaa8b4e16 100644 --- a/apps/dav/lib/Comments/CommentsPlugin.php +++ b/apps/dav/lib/Comments/CommentsPlugin.php @@ -247,7 +247,7 @@ class CommentsPlugin extends ServerPlugin { throw new BadRequest('Invalid input values', 0, $e); } catch (\OCP\Comments\MessageTooLongException $e) { $msg = 'Message exceeds allowed character limit of '; - throw new BadRequest($msg . \OCP\Comments\IComment::MAX_MESSAGE_LENGTH, 0, $e); + throw new BadRequest($msg . \OCP\Comments\IComment::MAX_MESSAGE_LENGTH, 0, $e); } } } diff --git a/apps/dav/lib/Connector/PublicAuth.php b/apps/dav/lib/Connector/PublicAuth.php index 6f58e89f1c0..d613a5a188f 100644 --- a/apps/dav/lib/Connector/PublicAuth.php +++ b/apps/dav/lib/Connector/PublicAuth.php @@ -51,9 +51,9 @@ class PublicAuth extends AbstractBasic { private IThrottler $throttler; public function __construct(IRequest $request, - IManager $shareManager, - ISession $session, - IThrottler $throttler) { + IManager $shareManager, + ISession $session, + IThrottler $throttler) { $this->request = $request; $this->shareManager = $shareManager; $this->session = $session; diff --git a/apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php b/apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php index 6c50f5682b7..db0f4e56b2e 100644 --- a/apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php +++ b/apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php @@ -50,40 +50,37 @@ class AppleQuirksPlugin extends ServerPlugin { private $isMacOSDavAgent = false; /** - * Sets up the plugin. - * - * This method is automatically called by the server class. + * Sets up the plugin. + * + * This method is automatically called by the server class. * * @return void - */ - public function initialize(Server $server) - { + */ + public function initialize(Server $server) { $server->on('beforeMethod:REPORT', [$this, 'beforeReport'], 0); $server->on('report', [$this, 'report'], 0); } /** - * Triggered before any method is handled. + * Triggered before any method is handled. * * @return void - */ - public function beforeReport(RequestInterface $request, ResponseInterface $response) - { + */ + public function beforeReport(RequestInterface $request, ResponseInterface $response) { $userAgent = $request->getRawServerValue('HTTP_USER_AGENT') ?? 'unknown'; $this->isMacOSDavAgent = $this->isMacOSUserAgent($userAgent); } /** - * This method handles HTTP REPORT requests. - * - * @param string $reportName - * @param mixed $report - * @param mixed $path + * This method handles HTTP REPORT requests. + * + * @param string $reportName + * @param mixed $report + * @param mixed $path * * @return bool - */ - public function report($reportName, $report, $path) - { + */ + public function report($reportName, $report, $path) { if ($reportName == '{DAV:}principal-property-search' && $this->isMacOSDavAgent) { /** @var \Sabre\DAVACL\Xml\Request\PrincipalPropertySearchReport $report */ $report->applyToPrincipalCollectionSet = true; @@ -98,8 +95,7 @@ class AppleQuirksPlugin extends ServerPlugin { * * @return bool */ - protected function isMacOSUserAgent(string $userAgent):bool - { + protected function isMacOSUserAgent(string $userAgent):bool { return str_starts_with(self::OSX_AGENT_PREFIX, $userAgent); } @@ -110,8 +106,7 @@ class AppleQuirksPlugin extends ServerPlugin { * * @return null|array */ - protected function decodeMacOSAgentString(string $userAgent):?array - { + protected function decodeMacOSAgentString(string $userAgent):?array { // OSX agent string is like: macOS/13.2.1 (22D68) dataaccessd/1.0 if (preg_match('|^' . self::OSX_AGENT_PREFIX . '/([0-9]+)\\.([0-9]+)\\.([0-9]+)\s+\((\w+)\)\s+([^/]+)/([0-9]+)(?:\\.([0-9]+))?(?:\\.([0-9]+))?$|i', $userAgent, $matches)) { return [ diff --git a/apps/dav/lib/Connector/Sabre/Auth.php b/apps/dav/lib/Connector/Sabre/Auth.php index 29e39349704..243b92e63f7 100644 --- a/apps/dav/lib/Connector/Sabre/Auth.php +++ b/apps/dav/lib/Connector/Sabre/Auth.php @@ -61,11 +61,11 @@ class Auth extends AbstractBasic { private IThrottler $throttler; public function __construct(ISession $session, - Session $userSession, - IRequest $request, - Manager $twoFactorManager, - IThrottler $throttler, - string $principalPrefix = 'principals/users/') { + Session $userSession, + IRequest $request, + Manager $twoFactorManager, + IThrottler $throttler, + string $principalPrefix = 'principals/users/') { $this->session = $session; $this->userSession = $userSession; $this->twoFactorManager = $twoFactorManager; @@ -223,7 +223,7 @@ class Auth extends AbstractBasic { if (!$this->userSession->isLoggedIn() && in_array('XMLHttpRequest', explode(',', $request->getHeader('X-Requested-With') ?? ''))) { // do not re-authenticate over ajax, use dummy auth name to prevent browser popup - $response->addHeader('WWW-Authenticate','DummyBasic realm="' . $this->realm . '"'); + $response->addHeader('WWW-Authenticate', 'DummyBasic realm="' . $this->realm . '"'); $response->setStatus(401); throw new \Sabre\DAV\Exception\NotAuthenticated('Cannot authenticate over ajax calls'); } diff --git a/apps/dav/lib/Connector/Sabre/BearerAuth.php b/apps/dav/lib/Connector/Sabre/BearerAuth.php index 5a69d07b002..4d9599b97a3 100644 --- a/apps/dav/lib/Connector/Sabre/BearerAuth.php +++ b/apps/dav/lib/Connector/Sabre/BearerAuth.php @@ -37,9 +37,9 @@ class BearerAuth extends AbstractBearer { private string $principalPrefix; public function __construct(IUserSession $userSession, - ISession $session, - IRequest $request, - $principalPrefix = 'principals/users/') { + ISession $session, + IRequest $request, + $principalPrefix = 'principals/users/') { $this->userSession = $userSession; $this->session = $session; $this->request = $request; diff --git a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php index 5d3f7104d6a..eda2399a780 100644 --- a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php +++ b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php @@ -27,9 +27,9 @@ namespace OCA\DAV\Connector\Sabre; use OCP\IConfig; use OCP\IRequest; +use Sabre\DAV\Server; use Sabre\DAV\ServerPlugin; use Sabre\HTTP\RequestInterface; -use Sabre\DAV\Server; /** * Class BlockLegacyClientPlugin is used to detect old legacy sync clients and diff --git a/apps/dav/lib/Connector/Sabre/ChecksumUpdatePlugin.php b/apps/dav/lib/Connector/Sabre/ChecksumUpdatePlugin.php index c222923bc8e..d68ced83616 100644 --- a/apps/dav/lib/Connector/Sabre/ChecksumUpdatePlugin.php +++ b/apps/dav/lib/Connector/Sabre/ChecksumUpdatePlugin.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace OCA\DAV\Connector\Sabre; +use Sabre\DAV\Server; use Sabre\DAV\ServerPlugin; use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; -use Sabre\DAV\Server; class ChecksumUpdatePlugin extends ServerPlugin { protected ?Server $server = null; diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php index eaa7f1bc2d2..94f9e167aae 100644 --- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. @@ -29,8 +30,8 @@ namespace OCA\DAV\Connector\Sabre; use OCP\Comments\ICommentsManager; use OCP\IUserSession; use Sabre\DAV\PropFind; -use Sabre\DAV\ServerPlugin; use Sabre\DAV\Server; +use Sabre\DAV\ServerPlugin; class CommentPropertiesPlugin extends ServerPlugin { public const PROPERTY_NAME_HREF = '{http://owncloud.org/ns}comments-href'; diff --git a/apps/dav/lib/Connector/Sabre/CopyEtagHeaderPlugin.php b/apps/dav/lib/Connector/Sabre/CopyEtagHeaderPlugin.php index f3ea94be3b6..0533dcab4d9 100644 --- a/apps/dav/lib/Connector/Sabre/CopyEtagHeaderPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CopyEtagHeaderPlugin.php @@ -25,9 +25,9 @@ namespace OCA\DAV\Connector\Sabre; use Sabre\DAV\Exception\NotFound; +use Sabre\DAV\Server; use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; -use Sabre\DAV\Server; /** * Copies the "Etag" header to "OC-Etag" after any request. diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php index ab321a363a2..441e6ea8f57 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -49,6 +49,7 @@ use OCP\IRequest; use OCP\L10N\IFactory; use OCP\Lock\ILockingProvider; use OCP\Lock\LockedException; +use OCP\Share\IManager as IShareManager; use Psr\Log\LoggerInterface; use Sabre\DAV\Exception\BadRequest; use Sabre\DAV\Exception\Locked; @@ -56,7 +57,6 @@ use Sabre\DAV\Exception\NotFound; use Sabre\DAV\Exception\ServiceUnavailable; use Sabre\DAV\IFile; use Sabre\DAV\INode; -use OCP\Share\IManager as IShareManager; class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICollection, \Sabre\DAV\IQuota, \Sabre\DAV\IMoveTarget, \Sabre\DAV\ICopyTarget { /** diff --git a/apps/dav/lib/Connector/Sabre/DummyGetResponsePlugin.php b/apps/dav/lib/Connector/Sabre/DummyGetResponsePlugin.php index 8e35afe2e7c..2019c77ad35 100644 --- a/apps/dav/lib/Connector/Sabre/DummyGetResponsePlugin.php +++ b/apps/dav/lib/Connector/Sabre/DummyGetResponsePlugin.php @@ -26,9 +26,9 @@ */ namespace OCA\DAV\Connector\Sabre; +use Sabre\DAV\Server; use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; -use Sabre\DAV\Server; /** * Class DummyGetResponsePlugin is a plugin used to not show a "Not implemented" @@ -63,7 +63,7 @@ class DummyGetResponsePlugin extends \Sabre\DAV\ServerPlugin { public function httpGet(RequestInterface $request, ResponseInterface $response) { $string = 'This is the WebDAV interface. It can only be accessed by ' . 'WebDAV clients such as the Nextcloud desktop sync client.'; - $stream = fopen('php://memory','r+'); + $stream = fopen('php://memory', 'r+'); fwrite($stream, $string); rewind($stream); diff --git a/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php b/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php index aabd5fda2fb..a5eed911701 100644 --- a/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php +++ b/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php @@ -48,17 +48,17 @@ class Forbidden extends \Sabre\DAV\Exception\Forbidden { * @param \DOMElement $errorNode * @return void */ - public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) { + public function serialize(\Sabre\DAV\Server $server, \DOMElement $errorNode) { // set ownCloud namespace $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD); // adding the retry node - $error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true)); + $error = $errorNode->ownerDocument->createElementNS('o:', 'o:retry', var_export($this->retry, true)); $errorNode->appendChild($error); // adding the message node - $error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage()); + $error = $errorNode->ownerDocument->createElementNS('o:', 'o:reason', $this->getMessage()); $errorNode->appendChild($error); } } diff --git a/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php b/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php index c504483d45a..9d1fda339a2 100644 --- a/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php +++ b/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php @@ -60,17 +60,17 @@ class InvalidPath extends Exception { * @param \DOMElement $errorNode * @return void */ - public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) { + public function serialize(\Sabre\DAV\Server $server, \DOMElement $errorNode) { // set ownCloud namespace $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD); // adding the retry node - $error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true)); + $error = $errorNode->ownerDocument->createElementNS('o:', 'o:retry', var_export($this->retry, true)); $errorNode->appendChild($error); // adding the message node - $error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage()); + $error = $errorNode->ownerDocument->createElementNS('o:', 'o:reason', $this->getMessage()); $errorNode->appendChild($error); } } diff --git a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php index ebf3e4021eb..a195b5722f5 100644 --- a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php +++ b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php @@ -42,7 +42,6 @@ use Sabre\DAV\Exception\NotFound; use Sabre\DAV\Exception\NotImplemented; use Sabre\DAV\Exception\PreconditionFailed; use Sabre\DAV\Exception\RequestedRangeNotSatisfiable; -use Sabre\DAV\Exception\ServiceUnavailable; class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin { protected $nonFatalExceptions = [ diff --git a/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php b/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php index 7209450745c..b61e9dc0c39 100644 --- a/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php @@ -125,7 +125,7 @@ class FakeLockerPlugin extends ServerPlugin { * @return bool */ public function fakeLockProvider(RequestInterface $request, - ResponseInterface $response) { + ResponseInterface $response) { $lockInfo = new LockInfo(); $lockInfo->token = md5($request->getPath()); $lockInfo->uri = $request->getPath(); @@ -151,7 +151,7 @@ class FakeLockerPlugin extends ServerPlugin { * @return bool */ public function fakeUnlockProvider(RequestInterface $request, - ResponseInterface $response) { + ResponseInterface $response) { $response->setStatus(204); $response->setHeader('Content-Length', '0'); return false; diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 8c467f11d0c..81cdfa464b5 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -105,12 +105,12 @@ class FilesPlugin extends ServerPlugin { private IPreview $previewManager; public function __construct(Tree $tree, - IConfig $config, - IRequest $request, - IPreview $previewManager, - IUserSession $userSession, - bool $isPublic = false, - bool $downloadAttachment = true) { + IConfig $config, + IRequest $request, + IPreview $previewManager, + IUserSession $userSession, + bool $isPublic = false, + bool $downloadAttachment = true) { $this->tree = $tree; $this->config = $config; $this->request = $request; diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php index 18998d9c5cb..e43fb740cac 100644 --- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php @@ -119,14 +119,14 @@ class FilesReportPlugin extends ServerPlugin { * @param IAppManager $appManager */ public function __construct(Tree $tree, - View $view, - ISystemTagManager $tagManager, - ISystemTagObjectMapper $tagMapper, - ITagManager $fileTagger, - IUserSession $userSession, - IGroupManager $groupManager, - Folder $userFolder, - IAppManager $appManager + View $view, + ISystemTagManager $tagManager, + ISystemTagObjectMapper $tagMapper, + ITagManager $fileTagger, + IUserSession $userSession, + IGroupManager $groupManager, + Folder $userFolder, + IAppManager $appManager ) { $this->tree = $tree; $this->fileView = $view; diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php index 823eafe8fdb..df1de17fe20 100644 --- a/apps/dav/lib/Connector/Sabre/Principal.php +++ b/apps/dav/lib/Connector/Sabre/Principal.php @@ -100,16 +100,16 @@ class Principal implements BackendInterface { private $languageFactory; public function __construct(IUserManager $userManager, - IGroupManager $groupManager, - IAccountManager $accountManager, - IShareManager $shareManager, - IUserSession $userSession, - IAppManager $appManager, - ProxyMapper $proxyMapper, - KnownUserService $knownUserService, - IConfig $config, - IFactory $languageFactory, - string $principalPrefix = 'principals/users/') { + IGroupManager $groupManager, + IAccountManager $accountManager, + IShareManager $shareManager, + IUserSession $userSession, + IAppManager $appManager, + ProxyMapper $proxyMapper, + KnownUserService $knownUserService, + IConfig $config, + IFactory $languageFactory, + string $principalPrefix = 'principals/users/') { $this->userManager = $userManager; $this->groupManager = $groupManager; $this->accountManager = $accountManager; diff --git a/apps/dav/lib/Connector/Sabre/RequestIdHeaderPlugin.php b/apps/dav/lib/Connector/Sabre/RequestIdHeaderPlugin.php index b281a1053b8..df82db59f1d 100644 --- a/apps/dav/lib/Connector/Sabre/RequestIdHeaderPlugin.php +++ b/apps/dav/lib/Connector/Sabre/RequestIdHeaderPlugin.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright Copyright (c) 2022 Robin Appelman <robin@icewind.nl> * diff --git a/apps/dav/lib/Connector/Sabre/ServerFactory.php b/apps/dav/lib/Connector/Sabre/ServerFactory.php index d0cc8aab5d0..828977fd812 100644 --- a/apps/dav/lib/Connector/Sabre/ServerFactory.php +++ b/apps/dav/lib/Connector/Sabre/ServerFactory.php @@ -31,11 +31,11 @@ */ namespace OCA\DAV\Connector\Sabre; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\Files\Folder; use OCA\DAV\AppInfo\PluginManager; use OCA\DAV\DAV\ViewOnlyPlugin; use OCA\DAV\Files\BrowserErrorPagePlugin; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\Files\Folder; use OCP\Files\Mount\IMountManager; use OCP\IConfig; use OCP\IDBConnection; @@ -88,9 +88,9 @@ class ServerFactory { * @param callable $viewCallBack callback that should return the view for the dav endpoint */ public function createServer(string $baseUri, - string $requestUri, - Plugin $authPlugin, - callable $viewCallBack): Server { + string $requestUri, + Plugin $authPlugin, + callable $viewCallBack): Server { // Fire up server $objectTree = new \OCA\DAV\Connector\Sabre\ObjectTree(); $server = new \OCA\DAV\Connector\Sabre\Server($objectTree); diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php index 3d52a44b6a6..4cda346af01 100644 --- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php @@ -33,11 +33,11 @@ use OCP\Files\Folder; use OCP\Files\Node; use OCP\Files\NotFoundException; use OCP\IUserSession; -use OCP\Share\IShare; use OCP\Share\IManager; +use OCP\Share\IShare; use Sabre\DAV\PropFind; -use Sabre\DAV\Tree; use Sabre\DAV\Server; +use Sabre\DAV\Tree; /** * Sabre Plugin to provide share-related properties diff --git a/apps/dav/lib/Connector/Sabre/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php index da5dd874905..dc2b6b0c339 100644 --- a/apps/dav/lib/Connector/Sabre/TagsPlugin.php +++ b/apps/dav/lib/Connector/Sabre/TagsPlugin.php @@ -222,7 +222,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin { && $propFind->getDepth() !== 0 && (!is_null($propFind->getStatus(self::TAGS_PROPERTYNAME)) || !is_null($propFind->getStatus(self::FAVORITE_PROPERTYNAME)) - )) { + )) { // note: pre-fetching only supported for depth <= 1 $folderContent = $node->getChildren(); $fileIds[] = (int)$node->getId(); diff --git a/apps/dav/lib/Controller/BirthdayCalendarController.php b/apps/dav/lib/Controller/BirthdayCalendarController.php index 4305d6daaef..5df13cefe97 100644 --- a/apps/dav/lib/Controller/BirthdayCalendarController.php +++ b/apps/dav/lib/Controller/BirthdayCalendarController.php @@ -74,10 +74,10 @@ class BirthdayCalendarController extends Controller { * @param CalDavBackend $calDavBackend */ public function __construct($appName, IRequest $request, - IDBConnection $db, IConfig $config, - IJobList $jobList, - IUserManager $userManager, - CalDavBackend $calDavBackend) { + IDBConnection $db, IConfig $config, + IJobList $jobList, + IUserManager $userManager, + CalDavBackend $calDavBackend) { parent::__construct($appName, $request); $this->db = $db; $this->config = $config; diff --git a/apps/dav/lib/Controller/DirectController.php b/apps/dav/lib/Controller/DirectController.php index 1a7b3b57626..0f618e46b22 100644 --- a/apps/dav/lib/Controller/DirectController.php +++ b/apps/dav/lib/Controller/DirectController.php @@ -32,11 +32,10 @@ use OCA\DAV\Db\DirectMapper; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCS\OCSBadRequestException; -use OCP\AppFramework\OCS\OCSNotFoundException; use OCP\AppFramework\OCS\OCSForbiddenException; +use OCP\AppFramework\OCS\OCSNotFoundException; use OCP\AppFramework\OCSController; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\EventDispatcher\GenericEvent; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Events\BeforeDirectFileDownloadEvent; use OCP\Files\File; @@ -69,14 +68,14 @@ class DirectController extends OCSController { private $eventDispatcher; public function __construct(string $appName, - IRequest $request, - IRootFolder $rootFolder, - string $userId, - DirectMapper $mapper, - ISecureRandom $random, - ITimeFactory $timeFactory, - IURLGenerator $urlGenerator, - IEventDispatcher $eventDispatcher) { + IRequest $request, + IRootFolder $rootFolder, + string $userId, + DirectMapper $mapper, + ISecureRandom $random, + ITimeFactory $timeFactory, + IURLGenerator $urlGenerator, + IEventDispatcher $eventDispatcher) { parent::__construct($appName, $request); $this->rootFolder = $rootFolder; diff --git a/apps/dav/lib/Controller/InvitationResponseController.php b/apps/dav/lib/Controller/InvitationResponseController.php index 0ec630883dc..69d6bea4e5b 100644 --- a/apps/dav/lib/Controller/InvitationResponseController.php +++ b/apps/dav/lib/Controller/InvitationResponseController.php @@ -60,8 +60,8 @@ class InvitationResponseController extends Controller { * @param InvitationResponseServer $responseServer */ public function __construct(string $appName, IRequest $request, - IDBConnection $db, ITimeFactory $timeFactory, - InvitationResponseServer $responseServer) { + IDBConnection $db, ITimeFactory $timeFactory, + InvitationResponseServer $responseServer) { parent::__construct($appName, $request); $this->db = $db; $this->timeFactory = $timeFactory; diff --git a/apps/dav/lib/DAV/GroupPrincipalBackend.php b/apps/dav/lib/DAV/GroupPrincipalBackend.php index 9acc7c4b05b..8c126e6b71c 100644 --- a/apps/dav/lib/DAV/GroupPrincipalBackend.php +++ b/apps/dav/lib/DAV/GroupPrincipalBackend.php @@ -104,7 +104,7 @@ class GroupPrincipalBackend implements BackendInterface { * @return array */ public function getPrincipalByPath($path) { - $elements = explode('/', $path, 3); + $elements = explode('/', $path, 3); if ($elements[0] !== 'principals') { return null; } diff --git a/apps/dav/lib/DAV/Sharing/Backend.php b/apps/dav/lib/DAV/Sharing/Backend.php index 74b34b81b22..b115ef61313 100644 --- a/apps/dav/lib/DAV/Sharing/Backend.php +++ b/apps/dav/lib/DAV/Sharing/Backend.php @@ -31,10 +31,10 @@ namespace OCA\DAV\DAV\Sharing; use OCA\DAV\Connector\Sabre\Principal; use OCP\AppFramework\Db\TTransactional; use OCP\Cache\CappedMemoryCache; +use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; use OCP\IGroupManager; use OCP\IUserManager; -use OCP\DB\QueryBuilder\IQueryBuilder; class Backend { use TTransactional; @@ -211,7 +211,7 @@ class Backend { } public function preloadShares(array $resourceIds): void { - $resourceIds = array_filter($resourceIds, function(int $resourceId) { + $resourceIds = array_filter($resourceIds, function (int $resourceId) { return !isset($this->shareCache[$resourceId]); }); if (count($resourceIds) === 0) { diff --git a/apps/dav/lib/DAV/Sharing/Plugin.php b/apps/dav/lib/DAV/Sharing/Plugin.php index c7d8691ab06..78e086bc907 100644 --- a/apps/dav/lib/DAV/Sharing/Plugin.php +++ b/apps/dav/lib/DAV/Sharing/Plugin.php @@ -113,7 +113,7 @@ class Plugin extends ServerPlugin { $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}invite'] = Invite::class; $this->server->on('method:POST', [$this, 'httpPost']); - $this->server->on('propFind', [$this, 'propFind']); + $this->server->on('propFind', [$this, 'propFind']); } /** diff --git a/apps/dav/lib/DAV/ViewOnlyPlugin.php b/apps/dav/lib/DAV/ViewOnlyPlugin.php index 51e3622142d..27e4a06f718 100644 --- a/apps/dav/lib/DAV/ViewOnlyPlugin.php +++ b/apps/dav/lib/DAV/ViewOnlyPlugin.php @@ -26,10 +26,10 @@ use OCA\DAV\Connector\Sabre\File as DavFile; use OCA\Files_Versions\Sabre\VersionFile; use OCP\Files\NotFoundException; use Psr\Log\LoggerInterface; +use Sabre\DAV\Exception\NotFound; use Sabre\DAV\Server; use Sabre\DAV\ServerPlugin; use Sabre\HTTP\RequestInterface; -use Sabre\DAV\Exception\NotFound; /** * Sabre plugin for restricting file share receiver download: @@ -74,7 +74,7 @@ class ViewOnlyPlugin extends ServerPlugin { if ($davNode instanceof DavFile) { // Restrict view-only to nodes which are shared $node = $davNode->getNode(); - } else if ($davNode instanceof VersionFile) { + } elseif ($davNode instanceof VersionFile) { $node = $davNode->getVersion()->getSourceFile(); } else { return true; diff --git a/apps/dav/lib/Direct/ServerFactory.php b/apps/dav/lib/Direct/ServerFactory.php index ce689b1e88e..f9914a5cb36 100644 --- a/apps/dav/lib/Direct/ServerFactory.php +++ b/apps/dav/lib/Direct/ServerFactory.php @@ -53,12 +53,12 @@ class ServerFactory { } public function createServer(string $baseURI, - string $requestURI, - IRootFolder $rootFolder, - DirectMapper $mapper, - ITimeFactory $timeFactory, - IThrottler $throttler, - IRequest $request): Server { + string $requestURI, + IRootFolder $rootFolder, + DirectMapper $mapper, + ITimeFactory $timeFactory, + IThrottler $throttler, + IRequest $request): Server { $home = new DirectHome($rootFolder, $mapper, $timeFactory, $throttler, $request, $this->eventDispatcher); $server = new Server($home); diff --git a/apps/dav/lib/Events/AddressBookCreatedEvent.php b/apps/dav/lib/Events/AddressBookCreatedEvent.php index 86c4cd23640..396c246289c 100644 --- a/apps/dav/lib/Events/AddressBookCreatedEvent.php +++ b/apps/dav/lib/Events/AddressBookCreatedEvent.php @@ -49,7 +49,7 @@ class AddressBookCreatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $addressBookId, - array $addressBookData) { + array $addressBookData) { parent::__construct(); $this->addressBookId = $addressBookId; $this->addressBookData = $addressBookData; diff --git a/apps/dav/lib/Events/AddressBookDeletedEvent.php b/apps/dav/lib/Events/AddressBookDeletedEvent.php index 3c8da6b7bf0..79785f5f0fa 100644 --- a/apps/dav/lib/Events/AddressBookDeletedEvent.php +++ b/apps/dav/lib/Events/AddressBookDeletedEvent.php @@ -53,8 +53,8 @@ class AddressBookDeletedEvent extends Event { * @since 20.0.0 */ public function __construct(int $addressBookId, - array $addressBookData, - array $shares) { + array $addressBookData, + array $shares) { parent::__construct(); $this->addressBookId = $addressBookId; $this->addressBookData = $addressBookData; diff --git a/apps/dav/lib/Events/AddressBookShareUpdatedEvent.php b/apps/dav/lib/Events/AddressBookShareUpdatedEvent.php index f9f8ff99d40..da3c2701abd 100644 --- a/apps/dav/lib/Events/AddressBookShareUpdatedEvent.php +++ b/apps/dav/lib/Events/AddressBookShareUpdatedEvent.php @@ -61,10 +61,10 @@ class AddressBookShareUpdatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $addressBookId, - array $addressBookData, - array $oldShares, - array $added, - array $removed) { + array $addressBookData, + array $oldShares, + array $added, + array $removed) { parent::__construct(); $this->addressBookId = $addressBookId; $this->addressBookData = $addressBookData; diff --git a/apps/dav/lib/Events/AddressBookUpdatedEvent.php b/apps/dav/lib/Events/AddressBookUpdatedEvent.php index c632f1817a8..d651e569467 100644 --- a/apps/dav/lib/Events/AddressBookUpdatedEvent.php +++ b/apps/dav/lib/Events/AddressBookUpdatedEvent.php @@ -57,9 +57,9 @@ class AddressBookUpdatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $addressBookId, - array $addressBookData, - array $shares, - array $mutations) { + array $addressBookData, + array $shares, + array $mutations) { parent::__construct(); $this->addressBookId = $addressBookId; $this->addressBookData = $addressBookData; diff --git a/apps/dav/lib/Events/CachedCalendarObjectCreatedEvent.php b/apps/dav/lib/Events/CachedCalendarObjectCreatedEvent.php index 29e11ddc146..64d9b6dd2c7 100644 --- a/apps/dav/lib/Events/CachedCalendarObjectCreatedEvent.php +++ b/apps/dav/lib/Events/CachedCalendarObjectCreatedEvent.php @@ -57,9 +57,9 @@ class CachedCalendarObjectCreatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $subscriptionId, - array $subscriptionData, - array $shares, - array $objectData) { + array $subscriptionData, + array $shares, + array $objectData) { parent::__construct(); $this->subscriptionId = $subscriptionId; $this->subscriptionData = $subscriptionData; diff --git a/apps/dav/lib/Events/CachedCalendarObjectDeletedEvent.php b/apps/dav/lib/Events/CachedCalendarObjectDeletedEvent.php index eaf98df60bf..183e8e8bcf9 100644 --- a/apps/dav/lib/Events/CachedCalendarObjectDeletedEvent.php +++ b/apps/dav/lib/Events/CachedCalendarObjectDeletedEvent.php @@ -57,9 +57,9 @@ class CachedCalendarObjectDeletedEvent extends Event { * @since 20.0.0 */ public function __construct(int $subscriptionId, - array $subscriptionData, - array $shares, - array $objectData) { + array $subscriptionData, + array $shares, + array $objectData) { parent::__construct(); $this->subscriptionId = $subscriptionId; $this->subscriptionData = $subscriptionData; diff --git a/apps/dav/lib/Events/CachedCalendarObjectUpdatedEvent.php b/apps/dav/lib/Events/CachedCalendarObjectUpdatedEvent.php index d47d75ec1d8..62781483def 100644 --- a/apps/dav/lib/Events/CachedCalendarObjectUpdatedEvent.php +++ b/apps/dav/lib/Events/CachedCalendarObjectUpdatedEvent.php @@ -57,9 +57,9 @@ class CachedCalendarObjectUpdatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $subscriptionId, - array $subscriptionData, - array $shares, - array $objectData) { + array $subscriptionData, + array $shares, + array $objectData) { parent::__construct(); $this->subscriptionId = $subscriptionId; $this->subscriptionData = $subscriptionData; diff --git a/apps/dav/lib/Events/CalendarCreatedEvent.php b/apps/dav/lib/Events/CalendarCreatedEvent.php index ba51002f829..649a242a1d2 100644 --- a/apps/dav/lib/Events/CalendarCreatedEvent.php +++ b/apps/dav/lib/Events/CalendarCreatedEvent.php @@ -49,7 +49,7 @@ class CalendarCreatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $calendarId, - array $calendarData) { + array $calendarData) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CalendarDeletedEvent.php b/apps/dav/lib/Events/CalendarDeletedEvent.php index d6207ac6ee2..97d522cde7c 100644 --- a/apps/dav/lib/Events/CalendarDeletedEvent.php +++ b/apps/dav/lib/Events/CalendarDeletedEvent.php @@ -53,8 +53,8 @@ class CalendarDeletedEvent extends Event { * @since 20.0.0 */ public function __construct(int $calendarId, - array $calendarData, - array $shares) { + array $calendarData, + array $shares) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CalendarMovedToTrashEvent.php b/apps/dav/lib/Events/CalendarMovedToTrashEvent.php index c04b383d5bf..5fb2f48a75c 100644 --- a/apps/dav/lib/Events/CalendarMovedToTrashEvent.php +++ b/apps/dav/lib/Events/CalendarMovedToTrashEvent.php @@ -48,8 +48,8 @@ class CalendarMovedToTrashEvent extends Event { * @since 22.0.0 */ public function __construct(int $calendarId, - array $calendarData, - array $shares) { + array $calendarData, + array $shares) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CalendarObjectCreatedEvent.php b/apps/dav/lib/Events/CalendarObjectCreatedEvent.php index 294c778335e..123f7fc229f 100644 --- a/apps/dav/lib/Events/CalendarObjectCreatedEvent.php +++ b/apps/dav/lib/Events/CalendarObjectCreatedEvent.php @@ -57,9 +57,9 @@ class CalendarObjectCreatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $calendarId, - array $calendarData, - array $shares, - array $objectData) { + array $calendarData, + array $shares, + array $objectData) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CalendarObjectDeletedEvent.php b/apps/dav/lib/Events/CalendarObjectDeletedEvent.php index 7a621994b80..8c5834ff050 100644 --- a/apps/dav/lib/Events/CalendarObjectDeletedEvent.php +++ b/apps/dav/lib/Events/CalendarObjectDeletedEvent.php @@ -57,9 +57,9 @@ class CalendarObjectDeletedEvent extends Event { * @since 20.0.0 */ public function __construct(int $calendarId, - array $calendarData, - array $shares, - array $objectData) { + array $calendarData, + array $shares, + array $objectData) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CalendarObjectMovedEvent.php b/apps/dav/lib/Events/CalendarObjectMovedEvent.php index 0143dad9a96..402a9adf979 100644 --- a/apps/dav/lib/Events/CalendarObjectMovedEvent.php +++ b/apps/dav/lib/Events/CalendarObjectMovedEvent.php @@ -46,12 +46,12 @@ class CalendarObjectMovedEvent extends Event { * @since 25.0.0 */ public function __construct(int $sourceCalendarId, - array $sourceCalendarData, - int $targetCalendarId, - array $targetCalendarData, - array $sourceShares, - array $targetShares, - array $objectData) { + array $sourceCalendarData, + int $targetCalendarId, + array $targetCalendarData, + array $sourceShares, + array $targetShares, + array $objectData) { parent::__construct(); $this->sourceCalendarId = $sourceCalendarId; $this->sourceCalendarData = $sourceCalendarData; diff --git a/apps/dav/lib/Events/CalendarObjectMovedToTrashEvent.php b/apps/dav/lib/Events/CalendarObjectMovedToTrashEvent.php index d7a3b99de82..b963d1321a4 100644 --- a/apps/dav/lib/Events/CalendarObjectMovedToTrashEvent.php +++ b/apps/dav/lib/Events/CalendarObjectMovedToTrashEvent.php @@ -52,9 +52,9 @@ class CalendarObjectMovedToTrashEvent extends Event { * @since 22.0.0 */ public function __construct(int $calendarId, - array $calendarData, - array $shares, - array $objectData) { + array $calendarData, + array $shares, + array $objectData) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CalendarObjectRestoredEvent.php b/apps/dav/lib/Events/CalendarObjectRestoredEvent.php index 42f296e64cc..76589725986 100644 --- a/apps/dav/lib/Events/CalendarObjectRestoredEvent.php +++ b/apps/dav/lib/Events/CalendarObjectRestoredEvent.php @@ -52,9 +52,9 @@ class CalendarObjectRestoredEvent extends Event { * @since 22.0.0 */ public function __construct(int $calendarId, - array $calendarData, - array $shares, - array $objectData) { + array $calendarData, + array $shares, + array $objectData) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CalendarObjectUpdatedEvent.php b/apps/dav/lib/Events/CalendarObjectUpdatedEvent.php index 84157afd20a..45d66370137 100644 --- a/apps/dav/lib/Events/CalendarObjectUpdatedEvent.php +++ b/apps/dav/lib/Events/CalendarObjectUpdatedEvent.php @@ -57,9 +57,9 @@ class CalendarObjectUpdatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $calendarId, - array $calendarData, - array $shares, - array $objectData) { + array $calendarData, + array $shares, + array $objectData) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CalendarPublishedEvent.php b/apps/dav/lib/Events/CalendarPublishedEvent.php index a95e9f294c1..b92d17901f7 100644 --- a/apps/dav/lib/Events/CalendarPublishedEvent.php +++ b/apps/dav/lib/Events/CalendarPublishedEvent.php @@ -48,8 +48,8 @@ class CalendarPublishedEvent extends Event { * @since 20.0.0 */ public function __construct(int $calendarId, - array $calendarData, - string $publicUri) { + array $calendarData, + string $publicUri) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CalendarRestoredEvent.php b/apps/dav/lib/Events/CalendarRestoredEvent.php index ef477ac1d48..b44b3607969 100644 --- a/apps/dav/lib/Events/CalendarRestoredEvent.php +++ b/apps/dav/lib/Events/CalendarRestoredEvent.php @@ -48,8 +48,8 @@ class CalendarRestoredEvent extends Event { * @since 22.0.0 */ public function __construct(int $calendarId, - array $calendarData, - array $shares) { + array $calendarData, + array $shares) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CalendarShareUpdatedEvent.php b/apps/dav/lib/Events/CalendarShareUpdatedEvent.php index dedd9f8a566..ebde62a8be2 100644 --- a/apps/dav/lib/Events/CalendarShareUpdatedEvent.php +++ b/apps/dav/lib/Events/CalendarShareUpdatedEvent.php @@ -61,10 +61,10 @@ class CalendarShareUpdatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $calendarId, - array $calendarData, - array $oldShares, - array $added, - array $removed) { + array $calendarData, + array $oldShares, + array $added, + array $removed) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CalendarUnpublishedEvent.php b/apps/dav/lib/Events/CalendarUnpublishedEvent.php index b2536fc7aef..ede60aeb904 100644 --- a/apps/dav/lib/Events/CalendarUnpublishedEvent.php +++ b/apps/dav/lib/Events/CalendarUnpublishedEvent.php @@ -46,7 +46,7 @@ class CalendarUnpublishedEvent extends Event { * @since 20.0.0 */ public function __construct(int $calendarId, - array $calendarData) { + array $calendarData) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CalendarUpdatedEvent.php b/apps/dav/lib/Events/CalendarUpdatedEvent.php index ec33412b478..c39d22b281c 100644 --- a/apps/dav/lib/Events/CalendarUpdatedEvent.php +++ b/apps/dav/lib/Events/CalendarUpdatedEvent.php @@ -57,9 +57,9 @@ class CalendarUpdatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $calendarId, - array $calendarData, - array $shares, - array $mutations) { + array $calendarData, + array $shares, + array $mutations) { parent::__construct(); $this->calendarId = $calendarId; $this->calendarData = $calendarData; diff --git a/apps/dav/lib/Events/CardCreatedEvent.php b/apps/dav/lib/Events/CardCreatedEvent.php index 4c6b1714721..138cccd6862 100644 --- a/apps/dav/lib/Events/CardCreatedEvent.php +++ b/apps/dav/lib/Events/CardCreatedEvent.php @@ -57,9 +57,9 @@ class CardCreatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $addressBookId, - array $addressBookData, - array $shares, - array $cardData) { + array $addressBookData, + array $shares, + array $cardData) { parent::__construct(); $this->addressBookId = $addressBookId; $this->addressBookData = $addressBookData; diff --git a/apps/dav/lib/Events/CardDeletedEvent.php b/apps/dav/lib/Events/CardDeletedEvent.php index f4d7e21fab1..e0a92a2076a 100644 --- a/apps/dav/lib/Events/CardDeletedEvent.php +++ b/apps/dav/lib/Events/CardDeletedEvent.php @@ -57,9 +57,9 @@ class CardDeletedEvent extends Event { * @since 20.0.0 */ public function __construct(int $addressBookId, - array $addressBookData, - array $shares, - array $cardData) { + array $addressBookData, + array $shares, + array $cardData) { parent::__construct(); $this->addressBookId = $addressBookId; $this->addressBookData = $addressBookData; diff --git a/apps/dav/lib/Events/CardMovedEvent.php b/apps/dav/lib/Events/CardMovedEvent.php index 07139cfdecf..38a66ed08b6 100644 --- a/apps/dav/lib/Events/CardMovedEvent.php +++ b/apps/dav/lib/Events/CardMovedEvent.php @@ -46,12 +46,12 @@ class CardMovedEvent extends Event { * @since 27.0.0 */ public function __construct(int $sourceAddressBookId, - array $sourceAddressBookData, - int $targetAddressBookId, - array $targetAddressBookData, - array $sourceShares, - array $targetShares, - array $objectData) { + array $sourceAddressBookData, + int $targetAddressBookId, + array $targetAddressBookData, + array $sourceShares, + array $targetShares, + array $objectData) { parent::__construct(); $this->sourceAddressBookId = $sourceAddressBookId; $this->sourceAddressBookData = $sourceAddressBookData; diff --git a/apps/dav/lib/Events/CardUpdatedEvent.php b/apps/dav/lib/Events/CardUpdatedEvent.php index 213419d51a3..40f28713ce6 100644 --- a/apps/dav/lib/Events/CardUpdatedEvent.php +++ b/apps/dav/lib/Events/CardUpdatedEvent.php @@ -57,9 +57,9 @@ class CardUpdatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $addressBookId, - array $addressBookData, - array $shares, - array $cardData) { + array $addressBookData, + array $shares, + array $cardData) { parent::__construct(); $this->addressBookId = $addressBookId; $this->addressBookData = $addressBookData; diff --git a/apps/dav/lib/Events/SubscriptionCreatedEvent.php b/apps/dav/lib/Events/SubscriptionCreatedEvent.php index f7fc2101221..9932e70c4c8 100644 --- a/apps/dav/lib/Events/SubscriptionCreatedEvent.php +++ b/apps/dav/lib/Events/SubscriptionCreatedEvent.php @@ -49,7 +49,7 @@ class SubscriptionCreatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $subscriptionId, - array $subscriptionData) { + array $subscriptionData) { parent::__construct(); $this->subscriptionId = $subscriptionId; $this->subscriptionData = $subscriptionData; diff --git a/apps/dav/lib/Events/SubscriptionDeletedEvent.php b/apps/dav/lib/Events/SubscriptionDeletedEvent.php index fc31005ac0f..8aa36f4584b 100644 --- a/apps/dav/lib/Events/SubscriptionDeletedEvent.php +++ b/apps/dav/lib/Events/SubscriptionDeletedEvent.php @@ -53,8 +53,8 @@ class SubscriptionDeletedEvent extends Event { * @since 20.0.0 */ public function __construct(int $subscriptionId, - array $subscriptionData, - array $shares) { + array $subscriptionData, + array $shares) { parent::__construct(); $this->subscriptionId = $subscriptionId; $this->subscriptionData = $subscriptionData; diff --git a/apps/dav/lib/Events/SubscriptionUpdatedEvent.php b/apps/dav/lib/Events/SubscriptionUpdatedEvent.php index 29231d13a7f..eb90177a00d 100644 --- a/apps/dav/lib/Events/SubscriptionUpdatedEvent.php +++ b/apps/dav/lib/Events/SubscriptionUpdatedEvent.php @@ -57,9 +57,9 @@ class SubscriptionUpdatedEvent extends Event { * @since 20.0.0 */ public function __construct(int $subscriptionId, - array $subscriptionData, - array $shares, - array $mutations) { + array $subscriptionData, + array $shares, + array $mutations) { parent::__construct(); $this->subscriptionId = $subscriptionId; $this->subscriptionData = $subscriptionData; diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php index 419a0c5ed3b..fd45491da7e 100644 --- a/apps/dav/lib/Files/FileSearchBackend.php +++ b/apps/dav/lib/Files/FileSearchBackend.php @@ -39,7 +39,6 @@ use OCP\Files\Cache\ICacheEntry; use OCP\Files\Folder; use OCP\Files\IRootFolder; use OCP\Files\Node; -use OCP\Files\Search\ISearchComparison; use OCP\Files\Search\ISearchOperator; use OCP\Files\Search\ISearchOrder; use OCP\Files\Search\ISearchQuery; @@ -372,6 +371,7 @@ class FileSearchBackend implements ISearchBackend { throw new \InvalidArgumentException('Invalid argument 2 for ' . $trimmedType . ' operation, expected literal'); } $value = $operator->arguments[1]->value; + // no break case Operator::OPERATION_IS_DEFINED: if (!($operator->arguments[0] instanceof SearchPropertyDefinition)) { throw new \InvalidArgumentException('Invalid argument 1 for ' . $trimmedType . ' operation, expected property'); @@ -429,7 +429,7 @@ class FileSearchBackend implements ISearchBackend { return ''; } - switch ($property->dataType) { + switch ($property->dataType) { case SearchPropertyDefinition::DATATYPE_BOOLEAN: return $value === 'yes'; case SearchPropertyDefinition::DATATYPE_DECIMAL: diff --git a/apps/dav/lib/Files/LazySearchBackend.php b/apps/dav/lib/Files/LazySearchBackend.php index c3b2f27d72a..ccd6fde14e1 100644 --- a/apps/dav/lib/Files/LazySearchBackend.php +++ b/apps/dav/lib/Files/LazySearchBackend.php @@ -22,7 +22,6 @@ */ namespace OCA\DAV\Files; -use Sabre\DAV\INode; use SearchDAV\Backend\ISearchBackend; use SearchDAV\Query\Query; diff --git a/apps/dav/lib/HookManager.php b/apps/dav/lib/HookManager.php index 9e923440e38..1e7990af32f 100644 --- a/apps/dav/lib/HookManager.php +++ b/apps/dav/lib/HookManager.php @@ -67,10 +67,10 @@ class HookManager { private $themingDefaults; public function __construct(IUserManager $userManager, - SyncService $syncService, - CalDavBackend $calDav, - CardDavBackend $cardDav, - Defaults $themingDefaults) { + SyncService $syncService, + CalDavBackend $calDav, + CardDavBackend $cardDav, + Defaults $themingDefaults) { $this->userManager = $userManager; $this->syncService = $syncService; $this->calDav = $calDav; diff --git a/apps/dav/lib/Listener/ActivityUpdaterListener.php b/apps/dav/lib/Listener/ActivityUpdaterListener.php index ea3ec49c14d..ba0d47f148f 100644 --- a/apps/dav/lib/Listener/ActivityUpdaterListener.php +++ b/apps/dav/lib/Listener/ActivityUpdaterListener.php @@ -53,7 +53,7 @@ class ActivityUpdaterListener implements IEventListener { private $logger; public function __construct(ActivityBackend $activityBackend, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->activityBackend = $activityBackend; $this->logger = $logger; } diff --git a/apps/dav/lib/Listener/AddressbookListener.php b/apps/dav/lib/Listener/AddressbookListener.php index 3c17d399d4e..489a814d158 100644 --- a/apps/dav/lib/Listener/AddressbookListener.php +++ b/apps/dav/lib/Listener/AddressbookListener.php @@ -44,7 +44,7 @@ class AddressbookListener implements IEventListener { private $logger; public function __construct(ActivityBackend $activityBackend, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->activityBackend = $activityBackend; $this->logger = $logger; } diff --git a/apps/dav/lib/Listener/CalendarContactInteractionListener.php b/apps/dav/lib/Listener/CalendarContactInteractionListener.php index b27aa53aa11..6787d9316e9 100644 --- a/apps/dav/lib/Listener/CalendarContactInteractionListener.php +++ b/apps/dav/lib/Listener/CalendarContactInteractionListener.php @@ -64,10 +64,10 @@ class CalendarContactInteractionListener implements IEventListener { private $logger; public function __construct(IEventDispatcher $dispatcher, - IUserSession $userSession, - Principal $principalConnector, - IMailer $mailer, - LoggerInterface $logger) { + IUserSession $userSession, + Principal $principalConnector, + IMailer $mailer, + LoggerInterface $logger) { $this->dispatcher = $dispatcher; $this->userSession = $userSession; $this->principalConnector = $principalConnector; diff --git a/apps/dav/lib/Listener/CalendarDeletionDefaultUpdaterListener.php b/apps/dav/lib/Listener/CalendarDeletionDefaultUpdaterListener.php index 42dd0dfc0a7..23835f1626e 100644 --- a/apps/dav/lib/Listener/CalendarDeletionDefaultUpdaterListener.php +++ b/apps/dav/lib/Listener/CalendarDeletionDefaultUpdaterListener.php @@ -44,7 +44,7 @@ class CalendarDeletionDefaultUpdaterListener implements IEventListener { private $logger; public function __construct(IConfig $config, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->config = $config; $this->logger = $logger; } diff --git a/apps/dav/lib/Listener/CalendarObjectReminderUpdaterListener.php b/apps/dav/lib/Listener/CalendarObjectReminderUpdaterListener.php index 3c168f6105c..8b723b95527 100644 --- a/apps/dav/lib/Listener/CalendarObjectReminderUpdaterListener.php +++ b/apps/dav/lib/Listener/CalendarObjectReminderUpdaterListener.php @@ -57,9 +57,9 @@ class CalendarObjectReminderUpdaterListener implements IEventListener { private $logger; public function __construct(ReminderBackend $reminderBackend, - ReminderService $reminderService, - CalDavBackend $calDavBackend, - LoggerInterface $logger) { + ReminderService $reminderService, + CalDavBackend $calDavBackend, + LoggerInterface $logger) { $this->reminderBackend = $reminderBackend; $this->reminderService = $reminderService; $this->calDavBackend = $calDavBackend; diff --git a/apps/dav/lib/Listener/CalendarPublicationListener.php b/apps/dav/lib/Listener/CalendarPublicationListener.php index 1453694d6fb..e86bfa73c55 100644 --- a/apps/dav/lib/Listener/CalendarPublicationListener.php +++ b/apps/dav/lib/Listener/CalendarPublicationListener.php @@ -37,7 +37,7 @@ class CalendarPublicationListener implements IEventListener { private LoggerInterface $logger; public function __construct(Backend $activityBackend, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->activityBackend = $activityBackend; $this->logger = $logger; } diff --git a/apps/dav/lib/Listener/CalendarShareUpdateListener.php b/apps/dav/lib/Listener/CalendarShareUpdateListener.php index dd046ddd66a..3f4f6f0a316 100644 --- a/apps/dav/lib/Listener/CalendarShareUpdateListener.php +++ b/apps/dav/lib/Listener/CalendarShareUpdateListener.php @@ -36,7 +36,7 @@ class CalendarShareUpdateListener implements IEventListener { private LoggerInterface $logger; public function __construct(Backend $activityBackend, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->activityBackend = $activityBackend; $this->logger = $logger; } diff --git a/apps/dav/lib/Listener/CardListener.php b/apps/dav/lib/Listener/CardListener.php index 0281127c858..69398435958 100644 --- a/apps/dav/lib/Listener/CardListener.php +++ b/apps/dav/lib/Listener/CardListener.php @@ -25,8 +25,8 @@ declare(strict_types=1); */ namespace OCA\DAV\Listener; -use OCA\DAV\CardDAV\Activity\Provider\Card; use OCA\DAV\CardDAV\Activity\Backend as ActivityBackend; +use OCA\DAV\CardDAV\Activity\Provider\Card; use OCA\DAV\Events\CardCreatedEvent; use OCA\DAV\Events\CardDeletedEvent; use OCA\DAV\Events\CardUpdatedEvent; @@ -44,7 +44,7 @@ class CardListener implements IEventListener { private $logger; public function __construct(ActivityBackend $activityBackend, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->activityBackend = $activityBackend; $this->logger = $logger; } diff --git a/apps/dav/lib/Listener/OutOfOfficeListener.php b/apps/dav/lib/Listener/OutOfOfficeListener.php index 645a01a35cf..609c32f5067 100644 --- a/apps/dav/lib/Listener/OutOfOfficeListener.php +++ b/apps/dav/lib/Listener/OutOfOfficeListener.php @@ -53,8 +53,8 @@ use function rewind; */ class OutOfOfficeListener implements IEventListener { public function __construct(private ServerFactory $serverFactory, - private IConfig $appConfig, - private LoggerInterface $logger) { + private IConfig $appConfig, + private LoggerInterface $logger) { } public function handle(Event $event): void { @@ -80,7 +80,7 @@ class OutOfOfficeListener implements IEventListener { } finally { fclose($stream); } - } else if ($event instanceof OutOfOfficeChangedEvent) { + } elseif ($event instanceof OutOfOfficeChangedEvent) { $userId = $event->getData()->getUser()->getUID(); $principal = "principals/users/$userId"; @@ -107,7 +107,7 @@ class OutOfOfficeListener implements IEventListener { fclose($stream); } } - } else if ($event instanceof OutOfOfficeClearedEvent) { + } elseif ($event instanceof OutOfOfficeClearedEvent) { $userId = $event->getData()->getUser()->getUID(); $principal = "principals/users/$userId"; diff --git a/apps/dav/lib/Listener/SubscriptionListener.php b/apps/dav/lib/Listener/SubscriptionListener.php index 36db234aa05..c7e1bbfecda 100644 --- a/apps/dav/lib/Listener/SubscriptionListener.php +++ b/apps/dav/lib/Listener/SubscriptionListener.php @@ -42,7 +42,7 @@ class SubscriptionListener implements IEventListener { private LoggerInterface $logger; public function __construct(IJobList $jobList, RefreshWebcalService $refreshWebcalService, ReminderBackend $reminderBackend, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->jobList = $jobList; $this->refreshWebcalService = $refreshWebcalService; $this->reminderBackend = $reminderBackend; diff --git a/apps/dav/lib/Migration/BuildCalendarSearchIndex.php b/apps/dav/lib/Migration/BuildCalendarSearchIndex.php index c8a649f3449..fc9a6d9a559 100644 --- a/apps/dav/lib/Migration/BuildCalendarSearchIndex.php +++ b/apps/dav/lib/Migration/BuildCalendarSearchIndex.php @@ -49,8 +49,8 @@ class BuildCalendarSearchIndex implements IRepairStep { * @param IConfig $config */ public function __construct(IDBConnection $db, - IJobList $jobList, - IConfig $config) { + IJobList $jobList, + IConfig $config) { $this->db = $db; $this->jobList = $jobList; $this->config = $config; diff --git a/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php index 6a315f2a150..a816e2619a3 100644 --- a/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php @@ -55,10 +55,10 @@ class BuildCalendarSearchIndexBackgroundJob extends QueuedJob { * @param ITimeFactory $timeFactory */ public function __construct(IDBConnection $db, - CalDavBackend $calDavBackend, - ILogger $logger, - IJobList $jobList, - ITimeFactory $timeFactory) { + CalDavBackend $calDavBackend, + ILogger $logger, + IJobList $jobList, + ITimeFactory $timeFactory) { $this->db = $db; $this->calDavBackend = $calDavBackend; $this->logger = $logger; diff --git a/apps/dav/lib/Migration/BuildSocialSearchIndex.php b/apps/dav/lib/Migration/BuildSocialSearchIndex.php index ae2eb084e2b..f3872acc3ab 100644 --- a/apps/dav/lib/Migration/BuildSocialSearchIndex.php +++ b/apps/dav/lib/Migration/BuildSocialSearchIndex.php @@ -46,8 +46,8 @@ class BuildSocialSearchIndex implements IRepairStep { * @param IConfig $config */ public function __construct(IDBConnection $db, - IJobList $jobList, - IConfig $config) { + IJobList $jobList, + IConfig $config) { $this->db = $db; $this->jobList = $jobList; $this->config = $config; diff --git a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php index 98afecc3b7d..231749521be 100644 --- a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php @@ -54,10 +54,10 @@ class BuildSocialSearchIndexBackgroundJob extends QueuedJob { * @param ITimeFactory $timeFactory */ public function __construct(IDBConnection $db, - CardDavBackend $davBackend, - ILogger $logger, - IJobList $jobList, - ITimeFactory $timeFactory) { + CardDavBackend $davBackend, + ILogger $logger, + IJobList $jobList, + ITimeFactory $timeFactory) { $this->db = $db; $this->davBackend = $davBackend; $this->logger = $logger; diff --git a/apps/dav/lib/Migration/ChunkCleanup.php b/apps/dav/lib/Migration/ChunkCleanup.php index 918023552da..8a4ad5664a4 100644 --- a/apps/dav/lib/Migration/ChunkCleanup.php +++ b/apps/dav/lib/Migration/ChunkCleanup.php @@ -48,9 +48,9 @@ class ChunkCleanup implements IRepairStep { private $jobList; public function __construct(IConfig $config, - IUserManager $userManager, - IRootFolder $rootFolder, - IJobList $jobList) { + IUserManager $userManager, + IRootFolder $rootFolder, + IJobList $jobList) { $this->config = $config; $this->userManager = $userManager; $this->rootFolder = $rootFolder; diff --git a/apps/dav/lib/Migration/RegenerateBirthdayCalendars.php b/apps/dav/lib/Migration/RegenerateBirthdayCalendars.php index 29547b09ff7..a8138d876e9 100644 --- a/apps/dav/lib/Migration/RegenerateBirthdayCalendars.php +++ b/apps/dav/lib/Migration/RegenerateBirthdayCalendars.php @@ -42,7 +42,7 @@ class RegenerateBirthdayCalendars implements IRepairStep { * @param IConfig $config */ public function __construct(IJobList $jobList, - IConfig $config) { + IConfig $config) { $this->jobList = $jobList; $this->config = $config; } diff --git a/apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php b/apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php index f488d85bde2..0b5062fcf3e 100644 --- a/apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php @@ -60,8 +60,8 @@ class RegisterBuildReminderIndexBackgroundJob implements IRepairStep { * @param IConfig $config */ public function __construct(IDBConnection $db, - IJobList $jobList, - IConfig $config) { + IJobList $jobList, + IConfig $config) { $this->db = $db; $this->jobList = $jobList; $this->config = $config; diff --git a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php b/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php index 4789a74d98a..a36d43d29df 100644 --- a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php +++ b/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php @@ -53,23 +53,23 @@ class RemoveOrphanEventsAndContacts implements IRepairStep { * @inheritdoc */ public function run(IOutput $output) { - $orphanItems = $this->removeOrphanChildren('calendarobjects', 'calendars', 'calendarid'); + $orphanItems = $this->removeOrphanChildren('calendarobjects', 'calendars', 'calendarid'); $output->info(sprintf('%d events without a calendar have been cleaned up', $orphanItems)); - $orphanItems = $this->removeOrphanChildren('calendarobjects_props', 'calendarobjects', 'objectid'); + $orphanItems = $this->removeOrphanChildren('calendarobjects_props', 'calendarobjects', 'objectid'); $output->info(sprintf('%d properties without an events have been cleaned up', $orphanItems)); - $orphanItems = $this->removeOrphanChildren('calendarchanges', 'calendars', 'calendarid'); + $orphanItems = $this->removeOrphanChildren('calendarchanges', 'calendars', 'calendarid'); $output->info(sprintf('%d changes without a calendar have been cleaned up', $orphanItems)); - $orphanItems = $this->removeOrphanChildren('calendarobjects', 'calendarsubscriptions', 'calendarid'); + $orphanItems = $this->removeOrphanChildren('calendarobjects', 'calendarsubscriptions', 'calendarid'); $output->info(sprintf('%d cached events without a calendar subscription have been cleaned up', $orphanItems)); - $orphanItems = $this->removeOrphanChildren('calendarchanges', 'calendarsubscriptions', 'calendarid'); + $orphanItems = $this->removeOrphanChildren('calendarchanges', 'calendarsubscriptions', 'calendarid'); $output->info(sprintf('%d changes without a calendar subscription have been cleaned up', $orphanItems)); - $orphanItems = $this->removeOrphanChildren('cards', 'addressbooks', 'addressbookid'); + $orphanItems = $this->removeOrphanChildren('cards', 'addressbooks', 'addressbookid'); $output->info(sprintf('%d contacts without an addressbook have been cleaned up', $orphanItems)); - $orphanItems = $this->removeOrphanChildren('cards_properties', 'cards', 'cardid'); + $orphanItems = $this->removeOrphanChildren('cards_properties', 'cards', 'cardid'); $output->info(sprintf('%d properties without a contact have been cleaned up', $orphanItems)); - $orphanItems = $this->removeOrphanChildren('addressbookchanges', 'addressbooks', 'addressbookid'); + $orphanItems = $this->removeOrphanChildren('addressbookchanges', 'addressbooks', 'addressbookid'); $output->info(sprintf('%d changes without an addressbook have been cleaned up', $orphanItems)); } diff --git a/apps/dav/lib/Migration/Version1005Date20180413093149.php b/apps/dav/lib/Migration/Version1005Date20180413093149.php index 1ee767ce547..6609b2396dd 100644 --- a/apps/dav/lib/Migration/Version1005Date20180413093149.php +++ b/apps/dav/lib/Migration/Version1005Date20180413093149.php @@ -27,8 +27,8 @@ declare(strict_types=1); */ namespace OCA\DAV\Migration; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -48,7 +48,7 @@ class Version1005Date20180413093149 extends SimpleMigrationStep { if (!$schema->hasTable('directlink')) { $table = $schema->createTable('directlink'); - $table->addColumn('id',Types::BIGINT, [ + $table->addColumn('id', Types::BIGINT, [ 'autoincrement' => true, 'notnull' => true, 'length' => 11, diff --git a/apps/dav/lib/Migration/Version1005Date20180530124431.php b/apps/dav/lib/Migration/Version1005Date20180530124431.php index ae057f74599..9b0868f9374 100644 --- a/apps/dav/lib/Migration/Version1005Date20180530124431.php +++ b/apps/dav/lib/Migration/Version1005Date20180530124431.php @@ -26,8 +26,8 @@ */ namespace OCA\DAV\Migration; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/apps/dav/lib/Migration/Version1006Date20180619154313.php b/apps/dav/lib/Migration/Version1006Date20180619154313.php index c607a14c2a9..36e35f615ac 100644 --- a/apps/dav/lib/Migration/Version1006Date20180619154313.php +++ b/apps/dav/lib/Migration/Version1006Date20180619154313.php @@ -26,8 +26,8 @@ */ namespace OCA\DAV\Migration; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/apps/dav/lib/Migration/Version1006Date20180628111625.php b/apps/dav/lib/Migration/Version1006Date20180628111625.php index 7ce2edccc28..8c3a8e4938c 100644 --- a/apps/dav/lib/Migration/Version1006Date20180628111625.php +++ b/apps/dav/lib/Migration/Version1006Date20180628111625.php @@ -29,8 +29,8 @@ declare(strict_types=1); */ namespace OCA\DAV\Migration; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/apps/dav/lib/Migration/Version1008Date20181030113700.php b/apps/dav/lib/Migration/Version1008Date20181030113700.php index 694f096ff3e..e9751159913 100644 --- a/apps/dav/lib/Migration/Version1008Date20181030113700.php +++ b/apps/dav/lib/Migration/Version1008Date20181030113700.php @@ -30,8 +30,8 @@ namespace OCA\DAV\Migration; use Closure; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/apps/dav/lib/Migration/Version1008Date20181105104826.php b/apps/dav/lib/Migration/Version1008Date20181105104826.php index 86ce4c33ce5..7b0c9861a98 100644 --- a/apps/dav/lib/Migration/Version1008Date20181105104826.php +++ b/apps/dav/lib/Migration/Version1008Date20181105104826.php @@ -29,8 +29,8 @@ declare(strict_types=1); namespace OCA\DAV\Migration; use Closure; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/apps/dav/lib/Migration/Version1008Date20181105110300.php b/apps/dav/lib/Migration/Version1008Date20181105110300.php index e275b2a8e1e..9a69d106412 100644 --- a/apps/dav/lib/Migration/Version1008Date20181105110300.php +++ b/apps/dav/lib/Migration/Version1008Date20181105110300.php @@ -29,8 +29,8 @@ declare(strict_types=1); namespace OCA\DAV\Migration; use Closure; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/apps/dav/lib/Migration/Version1011Date20190725113607.php b/apps/dav/lib/Migration/Version1011Date20190725113607.php index 1191f0e8878..a6673378259 100644 --- a/apps/dav/lib/Migration/Version1011Date20190725113607.php +++ b/apps/dav/lib/Migration/Version1011Date20190725113607.php @@ -28,8 +28,8 @@ declare(strict_types=1); */ namespace OCA\DAV\Migration; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/apps/dav/lib/Migration/Version1011Date20190806104428.php b/apps/dav/lib/Migration/Version1011Date20190806104428.php index a6f8772ec08..7c41bce87f5 100644 --- a/apps/dav/lib/Migration/Version1011Date20190806104428.php +++ b/apps/dav/lib/Migration/Version1011Date20190806104428.php @@ -29,8 +29,8 @@ declare(strict_types=1); namespace OCA\DAV\Migration; use Closure; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/apps/dav/lib/Migration/Version1012Date20190808122342.php b/apps/dav/lib/Migration/Version1012Date20190808122342.php index 7bb39db6bf1..e72b552cac1 100644 --- a/apps/dav/lib/Migration/Version1012Date20190808122342.php +++ b/apps/dav/lib/Migration/Version1012Date20190808122342.php @@ -29,8 +29,8 @@ declare(strict_types=1); */ namespace OCA\DAV\Migration; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -47,8 +47,8 @@ class Version1012Date20190808122342 extends SimpleMigrationStep { * @since 17.0.0 */ public function changeSchema(IOutput $output, - \Closure $schemaClosure, - array $options):?ISchemaWrapper { + \Closure $schemaClosure, + array $options):?ISchemaWrapper { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); diff --git a/apps/dav/lib/Migration/Version1027Date20230504122946.php b/apps/dav/lib/Migration/Version1027Date20230504122946.php index b1aaec0559b..28361011436 100644 --- a/apps/dav/lib/Migration/Version1027Date20230504122946.php +++ b/apps/dav/lib/Migration/Version1027Date20230504122946.php @@ -33,16 +33,15 @@ use OCP\IConfig; use OCP\IUserManager; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; use Psr\Log\LoggerInterface; use Throwable; class Version1027Date20230504122946 extends SimpleMigrationStep { public function __construct(private SyncService $syncService, - private LoggerInterface $logger, - private IUserManager $userManager, - private IConfig $config) {} + private LoggerInterface $logger, + private IUserManager $userManager, + private IConfig $config) { + } /** * @param IOutput $output * @param Closure(): ISchemaWrapper $schemaClosure diff --git a/apps/dav/lib/Profiler/ProfilerPlugin.php b/apps/dav/lib/Profiler/ProfilerPlugin.php index 672ca4010b7..cc65c2b75e1 100644 --- a/apps/dav/lib/Profiler/ProfilerPlugin.php +++ b/apps/dav/lib/Profiler/ProfilerPlugin.php @@ -1,4 +1,6 @@ -<?php declare(strict_types = 1); +<?php + +declare(strict_types = 1); /** * @copyright 2021 Carl Schwan <carl@carlschwan.eu> * diff --git a/apps/dav/lib/RootCollection.php b/apps/dav/lib/RootCollection.php index 90be581a2a9..c751a4babf5 100644 --- a/apps/dav/lib/RootCollection.php +++ b/apps/dav/lib/RootCollection.php @@ -50,7 +50,6 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\IRootFolder; use OCP\IConfig; -use OCP\IGroupManager; use Psr\Log\LoggerInterface; use Sabre\DAV\SimpleCollection; diff --git a/apps/dav/lib/Search/ACalendarSearchProvider.php b/apps/dav/lib/Search/ACalendarSearchProvider.php index 91904d5e8d6..82c15efec64 100644 --- a/apps/dav/lib/Search/ACalendarSearchProvider.php +++ b/apps/dav/lib/Search/ACalendarSearchProvider.php @@ -61,9 +61,9 @@ abstract class ACalendarSearchProvider implements IProvider { * @param CalDavBackend $backend */ public function __construct(IAppManager $appManager, - IL10N $l10n, - IURLGenerator $urlGenerator, - CalDavBackend $backend) { + IL10N $l10n, + IURLGenerator $urlGenerator, + CalDavBackend $backend) { $this->appManager = $appManager; $this->l10n = $l10n; $this->urlGenerator = $urlGenerator; diff --git a/apps/dav/lib/Search/EventsSearchProvider.php b/apps/dav/lib/Search/EventsSearchProvider.php index 4a2447c25f9..0cf01742672 100644 --- a/apps/dav/lib/Search/EventsSearchProvider.php +++ b/apps/dav/lib/Search/EventsSearchProvider.php @@ -153,7 +153,7 @@ class EventsSearchProvider extends ACalendarSearchProvider implements IFiltering ); $searchResultIndex = array_combine( - array_map(fn($event) => $event['calendarid'] . '-' . $event['uri'], $searchResults), + array_map(fn ($event) => $event['calendarid'] . '-' . $event['uri'], $searchResults), array_fill(0, count($searchResults), null), ); foreach ($attendeeSearchResults as $attendeeResult) { diff --git a/apps/dav/lib/Service/AbsenceService.php b/apps/dav/lib/Service/AbsenceService.php index b31a910c4d2..b50dd32e925 100644 --- a/apps/dav/lib/Service/AbsenceService.php +++ b/apps/dav/lib/Service/AbsenceService.php @@ -110,4 +110,3 @@ class AbsenceService { $this->eventDispatcher->dispatchTyped(new OutOfOfficeClearedEvent($eventData)); } } - diff --git a/apps/dav/lib/Settings/AvailabilitySettings.php b/apps/dav/lib/Settings/AvailabilitySettings.php index c48ebe0255e..f8986ffe5d1 100644 --- a/apps/dav/lib/Settings/AvailabilitySettings.php +++ b/apps/dav/lib/Settings/AvailabilitySettings.php @@ -42,11 +42,11 @@ class AvailabilitySettings implements ISettings { protected ?string $userId; public function __construct(IConfig $config, - IInitialState $initialState, - ?string $userId, - private LoggerInterface $logger, - private IAvailabilityCoordinator $coordinator, - private AbsenceMapper $absenceMapper) { + IInitialState $initialState, + ?string $userId, + private LoggerInterface $logger, + private IAvailabilityCoordinator $coordinator, + private AbsenceMapper $absenceMapper) { $this->config = $config; $this->initialState = $initialState; $this->userId = $userId; diff --git a/apps/dav/lib/Settings/CalDAVSettings.php b/apps/dav/lib/Settings/CalDAVSettings.php index 1938d20c9f5..2985c9fc888 100644 --- a/apps/dav/lib/Settings/CalDAVSettings.php +++ b/apps/dav/lib/Settings/CalDAVSettings.php @@ -27,8 +27,8 @@ namespace OCA\DAV\Settings; use OCA\DAV\AppInfo\Application; use OCP\AppFramework\Http\TemplateResponse; -use OCP\IConfig; use OCP\AppFramework\Services\IInitialState; +use OCP\IConfig; use OCP\IURLGenerator; use OCP\Settings\IDelegatedSettings; diff --git a/apps/dav/lib/SystemTag/SystemTagPlugin.php b/apps/dav/lib/SystemTag/SystemTagPlugin.php index 58f61c13232..34b71ae40f2 100644 --- a/apps/dav/lib/SystemTag/SystemTagPlugin.php +++ b/apps/dav/lib/SystemTag/SystemTagPlugin.php @@ -353,11 +353,11 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { } } - $tags = array_filter(array_map(function(string $tagId) { + $tags = array_filter(array_map(function (string $tagId) { return $this->cachedTags[$tagId] ?? null; }, $tagIds)); - $uncachedTagIds = array_filter($tagIds, function(string $tagId): bool { + $uncachedTagIds = array_filter($tagIds, function (string $tagId): bool { return !isset($this->cachedTags[$tagId]); }); @@ -369,7 +369,7 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { $tags += $retrievedTags; } - return array_filter($tags, function(ISystemTag $tag) use ($user) { + return array_filter($tags, function (ISystemTag $tag) use ($user) { return $this->tagManager->canUserSeeTag($tag, $user); }); } diff --git a/apps/dav/lib/Upload/RootCollection.php b/apps/dav/lib/Upload/RootCollection.php index e3ae22af5e9..e05c154c8ea 100644 --- a/apps/dav/lib/Upload/RootCollection.php +++ b/apps/dav/lib/Upload/RootCollection.php @@ -35,8 +35,8 @@ class RootCollection extends AbstractPrincipalCollection { private $cleanupService; public function __construct(PrincipalBackend\BackendInterface $principalBackend, - string $principalPrefix, - CleanupService $cleanupService) { + string $principalPrefix, + CleanupService $cleanupService) { parent::__construct($principalBackend, $principalPrefix); $this->cleanupService = $cleanupService; } diff --git a/apps/dav/lib/UserMigration/CalendarMigrator.php b/apps/dav/lib/UserMigration/CalendarMigrator.php index 7666dc99eea..14ea4459435 100644 --- a/apps/dav/lib/UserMigration/CalendarMigrator.php +++ b/apps/dav/lib/UserMigration/CalendarMigrator.php @@ -26,7 +26,6 @@ declare(strict_types=1); namespace OCA\DAV\UserMigration; -use function substr; use OCA\DAV\AppInfo\Application; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\CalDAV\ICSExportPlugin\ICSExportPlugin; @@ -53,6 +52,7 @@ use Sabre\VObject\UUIDUtil; use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Console\Output\OutputInterface; use Throwable; +use function substr; class CalendarMigrator implements IMigrator, ISizeEstimationMigrator { diff --git a/apps/dav/lib/UserMigration/ContactsMigrator.php b/apps/dav/lib/UserMigration/ContactsMigrator.php index 53aac0a4cfa..879642b9dc1 100644 --- a/apps/dav/lib/UserMigration/ContactsMigrator.php +++ b/apps/dav/lib/UserMigration/ContactsMigrator.php @@ -26,8 +26,6 @@ declare(strict_types=1); namespace OCA\DAV\UserMigration; -use function sort; -use function substr; use OCA\DAV\AppInfo\Application; use OCA\DAV\CardDAV\CardDavBackend; use OCA\DAV\CardDAV\Plugin as CardDAVPlugin; @@ -49,6 +47,8 @@ use Sabre\VObject\UUIDUtil; use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Console\Output\OutputInterface; use Throwable; +use function sort; +use function substr; class ContactsMigrator implements IMigrator, ISizeEstimationMigrator { |