aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php')
-rw-r--r--apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php43
1 files changed, 8 insertions, 35 deletions
diff --git a/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php b/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php
index b1deb638f3d..372906a6ae8 100644
--- a/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php
+++ b/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php
@@ -3,26 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Georg Ehrke <oc.list@georgehrke.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: 2016 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\CardDAV\Integration;
@@ -50,19 +32,10 @@ abstract class ExternalAddressBook implements IAddressBook, DAV\IProperties {
*/
private const DELIMITER = '--';
- /** @var string */
- private $appId;
-
- /** @var string */
- private $uri;
-
- /**
- * @param string $appId
- * @param string $uri
- */
- public function __construct(string $appId, string $uri) {
- $this->appId = $appId;
- $this->uri = $uri;
+ public function __construct(
+ private string $appId,
+ private string $uri,
+ ) {
}
/**
@@ -98,7 +71,7 @@ abstract class ExternalAddressBook implements IAddressBook, DAV\IProperties {
* @return bool
*/
public static function isAppGeneratedAddressBook(string $uri): bool {
- return strpos($uri, self::PREFIX) === 0 && substr_count($uri, self::DELIMITER) >= 2;
+ return str_starts_with($uri, self::PREFIX) && substr_count($uri, self::DELIMITER) >= 2;
}
/**
@@ -128,6 +101,6 @@ abstract class ExternalAddressBook implements IAddressBook, DAV\IProperties {
* @return bool
*/
public static function doesViolateReservedName(string $uri): bool {
- return strpos($uri, self::PREFIX) === 0;
+ return str_starts_with($uri, self::PREFIX);
}
}