aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2022-05-12 17:32:30 +0200
committerThomas Citharel <tcit@tcit.fr>2022-05-17 15:09:49 +0200
commit060c8d7c4b053094a39e1db834eea56c1e3c1e36 (patch)
tree2c8b39c44269b36df96b5406a0e65715d04c2e7d
parent4bb31c021e02d1076b5edc13d352e9c058e7c253 (diff)
downloadnextcloud-server-060c8d7c4b053094a39e1db834eea56c1e3c1e36.tar.gz
nextcloud-server-060c8d7c4b053094a39e1db834eea56c1e3c1e36.zip
Add some typed properties
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php50
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php37
-rw-r--r--apps/dav/lib/Events/CalendarPublishedEvent.php13
-rw-r--r--apps/dav/lib/Events/CalendarUnpublishedEvent.php9
4 files changed, 30 insertions, 79 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index d1c116eed4c..a9c829a2ca2 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -148,7 +148,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @var array
* @psalm-var array<string, string[]>
*/
- public $propertyMap = [
+ public array $propertyMap = [
'{DAV:}displayname' => ['displayname', 'string'],
'{urn:ietf:params:xml:ns:caldav}calendar-description' => ['description', 'string'],
'{urn:ietf:params:xml:ns:caldav}calendar-timezone' => ['timezone', 'string'],
@@ -162,7 +162,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
*
* @var array
*/
- public $subscriptionPropertyMap = [
+ public array $subscriptionPropertyMap = [
'{DAV:}displayname' => ['displayname', 'string'],
'{http://apple.com/ns/ical/}refreshrate' => ['refreshrate', 'string'],
'{http://apple.com/ns/ical/}calendar-order' => ['calendarorder', 'int'],
@@ -193,7 +193,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
];
/** @var array parameters to index */
- public static $indexParameters = [
+ public static array $indexParameters = [
'ATTENDEE' => ['CN'],
'ORGANIZER' => ['CN'],
];
@@ -201,43 +201,19 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
/**
* @var string[] Map of uid => display name
*/
- protected $userDisplayNames;
-
- /** @var IDBConnection */
- private $db;
-
- /** @var Backend */
- private $calendarSharingBackend;
-
- /** @var Principal */
- private $principalBackend;
-
- /** @var IUserManager */
- private $userManager;
-
- /** @var ISecureRandom */
- private $random;
+ protected array $userDisplayNames;
+ private IDBConnection $db;
+ private Backend $calendarSharingBackend;
+ private Principal $principalBackend;
+ private IUserManager $userManager;
+ private ISecureRandom $random;
private LoggerInterface $logger;
+ private IEventDispatcher $dispatcher;
+ private IConfig $config;
+ private bool $legacyEndpoint;
+ private string $dbObjectPropertiesTable = 'calendarobjects_props';
- /** @var IEventDispatcher */
- private $dispatcher;
-
- /** @var EventDispatcherInterface */
- private $legacyDispatcher;
-
- /** @var IConfig */
- private $config;
-
- /** @var bool */
- private $legacyEndpoint;
-
- /** @var string */
- private $dbObjectPropertiesTable = 'calendarobjects_props';
-
- /**
- * CalDavBackend constructor.
- */
public function __construct(IDBConnection $db,
Principal $principalBackend,
IUserManager $userManager,
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index 50e068e135f..745ca7801b7 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -63,23 +63,14 @@ class CardDavBackend implements BackendInterface, SyncSupport {
public const PERSONAL_ADDRESSBOOK_URI = 'contacts';
public const PERSONAL_ADDRESSBOOK_NAME = 'Contacts';
- /** @var Principal */
- private $principalBackend;
-
- /** @var string */
- private $dbCardsTable = 'cards';
-
- /** @var string */
- private $dbCardsPropertiesTable = 'cards_properties';
-
- /** @var IDBConnection */
- private $db;
-
- /** @var Backend */
- private $sharingBackend;
+ private Principal $principalBackend;
+ private string $dbCardsTable = 'cards';
+ private string $dbCardsPropertiesTable = 'cards_properties';
+ private IDBConnection $db;
+ private Backend $sharingBackend;
/** @var array properties to index */
- public static $indexProperties = [
+ public static array $indexProperties = [
'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME',
'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO',
'CLOUD', 'X-SOCIALPROFILE'];
@@ -87,18 +78,10 @@ class CardDavBackend implements BackendInterface, SyncSupport {
/**
* @var string[] Map of uid => display name
*/
- protected $userDisplayNames;
-
- /** @var IUserManager */
- private $userManager;
-
- /** @var IEventDispatcher */
- private $dispatcher;
-
- /** @var EventDispatcherInterface */
- private $legacyDispatcher;
-
- private $etagCache = [];
+ protected array $userDisplayNames;
+ private IUserManager $userManager;
+ private IEventDispatcher $dispatcher;
+ private array $etagCache = [];
/**
* CardDavBackend constructor.
diff --git a/apps/dav/lib/Events/CalendarPublishedEvent.php b/apps/dav/lib/Events/CalendarPublishedEvent.php
index 7b3b95f2f77..a95e9f294c1 100644
--- a/apps/dav/lib/Events/CalendarPublishedEvent.php
+++ b/apps/dav/lib/Events/CalendarPublishedEvent.php
@@ -6,6 +6,7 @@ declare(strict_types=1);
* @copyright Copyright (c) 2020, Georg Ehrke
*
* @author Georg Ehrke <oc.list@georgehrke.com>
+ * @author Thomas Citharel <nextcloud@tcit.fr>
*
* @license GNU AGPL version 3 or any later version
*
@@ -34,15 +35,9 @@ use OCP\EventDispatcher\Event;
* @since 20.0.0
*/
class CalendarPublishedEvent extends Event {
-
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
- /** @var string */
- private $publicUri;
+ private int $calendarId;
+ private array $calendarData;
+ private string $publicUri;
/**
* CalendarPublishedEvent constructor.
diff --git a/apps/dav/lib/Events/CalendarUnpublishedEvent.php b/apps/dav/lib/Events/CalendarUnpublishedEvent.php
index 0cea53c6f0d..b2536fc7aef 100644
--- a/apps/dav/lib/Events/CalendarUnpublishedEvent.php
+++ b/apps/dav/lib/Events/CalendarUnpublishedEvent.php
@@ -6,6 +6,7 @@ declare(strict_types=1);
* @copyright Copyright (c) 2020, Georg Ehrke
*
* @author Georg Ehrke <oc.list@georgehrke.com>
+ * @author Thomas Citharel <nextcloud@tcit.fr>
*
* @license GNU AGPL version 3 or any later version
*
@@ -34,12 +35,8 @@ use OCP\EventDispatcher\Event;
* @since 20.0.0
*/
class CalendarUnpublishedEvent extends Event {
-
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
+ private int $calendarId;
+ private array $calendarData;
/**
* CalendarUnpublishedEvent constructor.