aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/UserMigration
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/UserMigration')
-rw-r--r--apps/dav/lib/UserMigration/CalendarMigrator.php48
-rw-r--r--apps/dav/lib/UserMigration/CalendarMigratorException.php21
-rw-r--r--apps/dav/lib/UserMigration/ContactsMigrator.php34
-rw-r--r--apps/dav/lib/UserMigration/ContactsMigratorException.php21
-rw-r--r--apps/dav/lib/UserMigration/InvalidAddressBookException.php21
-rw-r--r--apps/dav/lib/UserMigration/InvalidCalendarException.php21
6 files changed, 20 insertions, 146 deletions
diff --git a/apps/dav/lib/UserMigration/CalendarMigrator.php b/apps/dav/lib/UserMigration/CalendarMigrator.php
index 22a20703024..73e9c375490 100644
--- a/apps/dav/lib/UserMigration/CalendarMigrator.php
+++ b/apps/dav/lib/UserMigration/CalendarMigrator.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2022 Christopher Ng <chrng8@gmail.com>
- *
- * @author Christopher Ng <chrng8@gmail.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\UserMigration;
@@ -58,17 +41,6 @@ class CalendarMigrator implements IMigrator, ISizeEstimationMigrator {
use TMigratorBasicVersionHandling;
- private CalDavBackend $calDavBackend;
-
- private ICalendarManager $calendarManager;
-
- // ICSExportPlugin is injected as the mergeObjects() method is required and is not to be used as a SabreDAV server plugin
- private ICSExportPlugin $icsExportPlugin;
-
- private Defaults $defaults;
-
- private IL10N $l10n;
-
private SabreDavServer $sabreDavServer;
private const USERS_URI_ROOT = 'principals/users/';
@@ -80,18 +52,12 @@ class CalendarMigrator implements IMigrator, ISizeEstimationMigrator {
private const EXPORT_ROOT = Application::APP_ID . '/calendars/';
public function __construct(
- CalDavBackend $calDavBackend,
- ICalendarManager $calendarManager,
- ICSExportPlugin $icsExportPlugin,
- Defaults $defaults,
- IL10N $l10n
+ private CalDavBackend $calDavBackend,
+ private ICalendarManager $calendarManager,
+ private ICSExportPlugin $icsExportPlugin,
+ private Defaults $defaults,
+ private IL10N $l10n,
) {
- $this->calDavBackend = $calDavBackend;
- $this->calendarManager = $calendarManager;
- $this->icsExportPlugin = $icsExportPlugin;
- $this->defaults = $defaults;
- $this->l10n = $l10n;
-
$root = new RootCollection();
$this->sabreDavServer = new SabreDavServer(new CachingTree($root));
$this->sabreDavServer->addPlugin(new CalDAVPlugin());
diff --git a/apps/dav/lib/UserMigration/CalendarMigratorException.php b/apps/dav/lib/UserMigration/CalendarMigratorException.php
index 3b4f8f89232..f3754809b44 100644
--- a/apps/dav/lib/UserMigration/CalendarMigratorException.php
+++ b/apps/dav/lib/UserMigration/CalendarMigratorException.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2022 Christopher Ng <chrng8@gmail.com>
- *
- * @author Christopher Ng <chrng8@gmail.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\UserMigration;
diff --git a/apps/dav/lib/UserMigration/ContactsMigrator.php b/apps/dav/lib/UserMigration/ContactsMigrator.php
index 38c53a1f76e..96d623938a3 100644
--- a/apps/dav/lib/UserMigration/ContactsMigrator.php
+++ b/apps/dav/lib/UserMigration/ContactsMigrator.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2022 Christopher Ng <chrng8@gmail.com>
- *
- * @author Christopher Ng <chrng8@gmail.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\UserMigration;
@@ -54,10 +37,6 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator {
use TMigratorBasicVersionHandling;
- private CardDavBackend $cardDavBackend;
-
- private IL10N $l10n;
-
private SabreDavServer $sabreDavServer;
private const USERS_URI_ROOT = 'principals/users/';
@@ -71,12 +50,9 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator {
private const PATH_ROOT = Application::APP_ID . '/address_books/';
public function __construct(
- CardDavBackend $cardDavBackend,
- IL10N $l10n
+ private CardDavBackend $cardDavBackend,
+ private IL10N $l10n,
) {
- $this->cardDavBackend = $cardDavBackend;
- $this->l10n = $l10n;
-
$root = new RootCollection();
$this->sabreDavServer = new SabreDavServer(new CachingTree($root));
$this->sabreDavServer->addPlugin(new CardDAVPlugin());
@@ -268,7 +244,7 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator {
$vCard->serialize(),
);
} catch (Throwable $e) {
- $output->writeln("Error creating contact \"" . ($vCard->FN ?? 'null') . "\" from \"$filename\", skipping…");
+ $output->writeln('Error creating contact "' . ($vCard->FN ?? 'null') . "\" from \"$filename\", skipping…");
}
}
diff --git a/apps/dav/lib/UserMigration/ContactsMigratorException.php b/apps/dav/lib/UserMigration/ContactsMigratorException.php
index 63dedebf73d..8d64d3d4428 100644
--- a/apps/dav/lib/UserMigration/ContactsMigratorException.php
+++ b/apps/dav/lib/UserMigration/ContactsMigratorException.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2022 Christopher Ng <chrng8@gmail.com>
- *
- * @author Christopher Ng <chrng8@gmail.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\UserMigration;
diff --git a/apps/dav/lib/UserMigration/InvalidAddressBookException.php b/apps/dav/lib/UserMigration/InvalidAddressBookException.php
index fd99eac1a73..d904dd9d4dd 100644
--- a/apps/dav/lib/UserMigration/InvalidAddressBookException.php
+++ b/apps/dav/lib/UserMigration/InvalidAddressBookException.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2022 Christopher Ng <chrng8@gmail.com>
- *
- * @author Christopher Ng <chrng8@gmail.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\UserMigration;
diff --git a/apps/dav/lib/UserMigration/InvalidCalendarException.php b/apps/dav/lib/UserMigration/InvalidCalendarException.php
index 0e42ef1bc20..664989de8b1 100644
--- a/apps/dav/lib/UserMigration/InvalidCalendarException.php
+++ b/apps/dav/lib/UserMigration/InvalidCalendarException.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2022 Christopher Ng <chrng8@gmail.com>
- *
- * @author Christopher Ng <chrng8@gmail.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\UserMigration;