Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class FixVcardCategory implements IRepairStep {

private const CARDS_PER_BATCH = 5000;
private const int CARDS_PER_BATCH = 5000;

public function __construct(
private readonly IDBConnection $connection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CleanupOrphanedChildrenJob extends QueuedJob {
public const ARGUMENT_PARENT_ID = 'parentId';
public const ARGUMENT_LOG_MESSAGE = 'logMessage';

private const BATCH_SIZE = 1000;
private const int BATCH_SIZE = 1000;

public function __construct(
ITimeFactory $time,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Psr\Log\LoggerInterface;

class FederatedCalendarPeriodicSyncJob extends TimedJob {
private const DOWNLOAD_LIMIT = 500;
private const int DOWNLOAD_LIMIT = 500;

public function __construct(
ITimeFactory $time,
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/CalDAV/CalDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
*
* @see \OCP\Calendar\ICalendarQuery
*/
private const INDEXED_PROPERTIES = [
private const array INDEXED_PROPERTIES = [
'CATEGORIES',
'COMMENT',
'DESCRIPTION',
Expand All @@ -191,7 +191,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
];

/** @var array parameters to index */
private const INDEXED_PARAMETERS = [
private const array INDEXED_PARAMETERS = [
'ATTENDEE' => ['CN'],
'ORGANIZER' => ['CN'],
];
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/CalDAV/CalendarImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public function __construct(
) {
}

private const DAV_PROPERTY_USER_ADDRESS = '{http://sabredav.org/ns}email-address';
private const DAV_PROPERTY_USER_ADDRESSES = '{urn:ietf:params:xml:ns:caldav}calendar-user-address-set';
private const string DAV_PROPERTY_USER_ADDRESS = '{http://sabredav.org/ns}email-address';
private const string DAV_PROPERTY_USER_ADDRESSES = '{urn:ietf:params:xml:ns:caldav}calendar-user-address-set';

/**
* @return string defining the technical unique key
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/EventComparisonService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class EventComparisonService {

/** @var string[] */
private const EVENT_DIFF = [
private const array EVENT_DIFF = [
'RECURRENCE-ID',
'RRULE',
'SEQUENCE',
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/lib/CalDAV/Federation/FederatedCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

class FederatedCalendar implements ICalendar, IProperties, IMultiGet {

private const CALENDAR_TYPE = CalDavBackend::CALENDAR_TYPE_FEDERATED;
private const DAV_PROPERTY_CALENDAR_LABEL = '{DAV:}displayname';
private const DAV_PROPERTY_CALENDAR_COLOR = '{http://apple.com/ns/ical/}calendar-color';
private const int CALENDAR_TYPE = CalDavBackend::CALENDAR_TYPE_FEDERATED;
private const string DAV_PROPERTY_CALENDAR_LABEL = '{DAV:}displayname';
private const string DAV_PROPERTY_CALENDAR_COLOR = '{http://apple.com/ns/ical/}calendar-color';

private string $principalUri;
private string $calendarUri;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class FederatedCalendarSyncService extends ASyncService {
use TTransactional;

private const SYNC_TOKEN_PREFIX = 'http://sabre.io/ns/sync/';
private const string SYNC_TOKEN_PREFIX = 'http://sabre.io/ns/sync/';

public function __construct(
IClientService $clientService,
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
class ICSExportPlugin extends \Sabre\CalDAV\ICSExportPlugin {
/** @var string */
private const DEFAULT_REFRESH_INTERVAL = 'PT4H';
private const string DEFAULT_REFRESH_INTERVAL = 'PT4H';

/**
* ICSExportPlugin constructor.
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/lib/CalDAV/Import/TextImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

class TextImporter {

public const OBJECT_PREFIX = 'BEGIN:VCALENDAR' . PHP_EOL;
public const OBJECT_SUFFIX = PHP_EOL . 'END:VCALENDAR';
private const COMPONENT_TYPES = ['VEVENT', 'VTODO', 'VJOURNAL', 'VTIMEZONE'];
public const string OBJECT_PREFIX = 'BEGIN:VCALENDAR' . PHP_EOL;
public const string OBJECT_SUFFIX = PHP_EOL . 'END:VCALENDAR';
private const array COMPONENT_TYPES = ['VEVENT', 'VTODO', 'VJOURNAL', 'VTIMEZONE'];

private bool $analyzed = false;
private array $structure = ['VCALENDAR' => [], 'VEVENT' => [], 'VTODO' => [], 'VJOURNAL' => [], 'VTIMEZONE' => []];
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/lib/CalDAV/Import/XmlImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

class XmlImporter {

public const OBJECT_PREFIX = '<?xml version="1.0" encoding="UTF-8"?><icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0"><vcalendar><components>';
public const OBJECT_SUFFIX = '</components></vcalendar></icalendar>';
private const COMPONENT_TYPES = ['VEVENT', 'VTODO', 'VJOURNAL', 'VTIMEZONE'];
public const string OBJECT_PREFIX = '<?xml version="1.0" encoding="UTF-8"?><icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0"><vcalendar><components>';
public const string OBJECT_SUFFIX = '</components></vcalendar></icalendar>';
private const array COMPONENT_TYPES = ['VEVENT', 'VTODO', 'VJOURNAL', 'VTIMEZONE'];

private bool $analyzed = false;
private array $structure = ['VCALENDAR' => [], 'VEVENT' => [], 'VTODO' => [], 'VJOURNAL' => [], 'VTIMEZONE' => []];
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/CalDAV/Integration/ExternalCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
abstract class ExternalCalendar implements CalDAV\ICalendar, DAV\IProperties {

/** @var string */
private const PREFIX = 'app-generated';
private const string PREFIX = 'app-generated';

/**
* @var string
Expand All @@ -34,7 +34,7 @@ abstract class ExternalCalendar implements CalDAV\ICalendar, DAV\IProperties {
* - explode has a limit of three, so even if the app-generated
* calendar uri has double dashes, it won't be split
*/
private const DELIMITER = '--';
private const string DELIMITER = '--';

/**
* ExternalCalendar constructor.
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/RetentionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class RetentionService {
public const RETENTION_CONFIG_KEY = 'calendarRetentionObligation';
private const DEFAULT_RETENTION_SECONDS = 30 * 24 * 60 * 60;
private const int DEFAULT_RETENTION_SECONDS = 30 * 24 * 60 * 60;

public function __construct(
private IConfig $config,
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Schedule/IMipService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class IMipService {
private IL10N $l10n;

/** @var string[] */
private const STRING_DIFF = [
private const array STRING_DIFF = [
'meeting_title' => 'SUMMARY',
'meeting_description' => 'DESCRIPTION',
'meeting_url' => 'URL',
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/TimeZoneFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TimeZoneFactory {
*
* @var array<string,string> MS2IANA
*/
private const MS2IANA = [
private const array MS2IANA = [
'AUS Central Standard Time' => 'Australia/Darwin',
'Aus Central W. Standard Time' => 'Australia/Eucla',
'AUS Eastern Standard Time' => 'Australia/Sydney',
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/CardDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
private string $dbCardsPropertiesTable = 'cards_properties';

/** @var array properties to index */
private const INDEXED_PROPERTIES = [
private const array INDEXED_PROPERTIES = [
'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME',
'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO',
'CLOUD', 'X-SOCIALPROFILE'];
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
abstract class ExternalAddressBook implements IAddressBook, DAV\IProperties {

/** @var string */
private const PREFIX = 'z-app-generated';
private const string PREFIX = 'z-app-generated';

/**
* @var string
Expand All @@ -31,7 +31,7 @@ abstract class ExternalAddressBook implements IAddressBook, DAV\IProperties {
* - explode has a limit of three, so even if the app-generated
* URI has double dashes, it won't be split
*/
private const DELIMITER = '--';
private const string DELIMITER = '--';

public function __construct(
private string $appId,
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/LegacyPublicAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @package OCA\DAV\Connector
*/
class LegacyPublicAuth extends AbstractBasic {
private const BRUTEFORCE_ACTION = 'legacy_public_webdav_auth';
private const string BRUTEFORCE_ACTION = 'legacy_public_webdav_auth';

private ?IShare $share = null;

Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AppleQuirksPlugin extends ServerPlugin {
private const OSX_CONTACTS_AGENT = 'AddressBookCore';
*/

private const OSX_AGENT_PREFIX = 'macOS';
private const string OSX_AGENT_PREFIX = 'macOS';

/** @var bool */
private $isMacOSDavAgent = false;
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/PublicAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @package OCA\DAV\Connector
*/
class PublicAuth extends AbstractBasic {
private const BRUTEFORCE_ACTION = 'public_dav_auth';
private const string BRUTEFORCE_ACTION = 'public_dav_auth';
public const DAV_AUTHENTICATED = 'public_link_authenticated';

private ?IShare $share = null;
Expand Down
14 changes: 7 additions & 7 deletions apps/dav/lib/DAV/CustomPropertiesBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
class CustomPropertiesBackend implements BackendInterface {

/** @var string */
private const TABLE_NAME = 'properties';
private const string TABLE_NAME = 'properties';

/**
* Value is stored as string.
Expand All @@ -67,7 +67,7 @@ class CustomPropertiesBackend implements BackendInterface {
*
* @var string[]
*/
private const IGNORED_PROPERTIES = [
private const array IGNORED_PROPERTIES = [
'{DAV:}getcontentlength',
'{DAV:}getcontenttype',
'{DAV:}getetag',
Expand All @@ -84,7 +84,7 @@ class CustomPropertiesBackend implements BackendInterface {
*
* @var string[]
*/
private const ALLOWED_NC_PROPERTIES = [
private const array ALLOWED_NC_PROPERTIES = [
'{http://owncloud.org/ns}calendar-enabled',
'{http://owncloud.org/ns}enabled',
];
Expand All @@ -94,7 +94,7 @@ class CustomPropertiesBackend implements BackendInterface {
*
* @var string[]
*/
private const PUBLISHED_READ_ONLY_PROPERTIES = [
private const array PUBLISHED_READ_ONLY_PROPERTIES = [
'{urn:ietf:params:xml:ns:caldav}calendar-availability',
'{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL',
];
Expand All @@ -104,15 +104,15 @@ class CustomPropertiesBackend implements BackendInterface {
* \Sabre\DAV\Xml\Property\Complex to find a more specialized PROPERTY_TYPE_*
* @var array<string, class-string>
*/
private const COMPLEX_XML_ELEMENT_MAP = [
private const array COMPLEX_XML_ELEMENT_MAP = [
'{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL' => Href::class,
];

/**
* Map of well-known property names to default values
* @var array<string, string>
*/
private const PROPERTY_DEFAULT_VALUES = [
private const array PROPERTY_DEFAULT_VALUES = [
'{http://owncloud.org/ns}calendar-enabled' => '1',
];

Expand All @@ -121,7 +121,7 @@ class CustomPropertiesBackend implements BackendInterface {
*
* @var class-string[]
*/
private const ALLOWED_SERIALIZED_CLASSES = [
private const array ALLOWED_SERIALIZED_CLASSES = [
\Sabre\CalDAV\Xml\Property\AllowedSharingModes::class,
\Sabre\CalDAV\Xml\Property\EmailAddressSet::class,
\Sabre\CalDAV\Xml\Property\Invite::class,
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Db/PropertyMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
class PropertyMapper extends QBMapper {

private const TABLE_NAME = 'properties';
private const string TABLE_NAME = 'properties';

public function __construct(IDBConnection $db) {
parent::__construct($db, self::TABLE_NAME, Property::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

/** @template-implements IEventListener<CalendarObjectCreatedEvent|CalendarObjectUpdatedEvent|CalendarShareUpdatedEvent> */
class CalendarContactInteractionListener implements IEventListener {
private const URI_USERS = 'principals/users/';
private const string URI_USERS = 'principals/users/';

public function __construct(
private IEventDispatcher $dispatcher,
Expand Down
10 changes: 5 additions & 5 deletions apps/dav/lib/Listener/CalendarDelegateActionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
*/
class CalendarDelegateActionListener implements IEventListener {

private const ACTION_CREATE = 'create';
private const ACTION_UPDATE = 'update';
private const ACTION_DELETE = 'delete';
private const ACTION_TRASH = 'trash';
private const ACTION_RESTORE = 'restore';
private const string ACTION_CREATE = 'create';
private const string ACTION_UPDATE = 'update';
private const string ACTION_DELETE = 'delete';
private const string ACTION_TRASH = 'trash';
private const string ACTION_RESTORE = 'restore';

public function __construct(
private readonly IUserSession $userSession,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class RegisterBuildReminderIndexBackgroundJob implements IRepairStep {

/** @var string */
private const CONFIG_KEY = 'buildCalendarReminderIndex';
private const string CONFIG_KEY = 'buildCalendarReminderIndex';

/**
* @param IDBConnection $db
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep {
/** @var int[] */
private $orphanSubscriptionIds = [];

private const SUBSCRIPTIONS_CHUNK_SIZE = 1000;
private const int SUBSCRIPTIONS_CHUNK_SIZE = 1000;

public function __construct(
private IDBConnection $connection,
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/lib/Migration/RemoveObjectProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
use OCP\Migration\IRepairStepExpensive;

class RemoveObjectProperties implements IRepairStepExpensive {
private const RESOURCE_TYPE_PROPERTY = '{DAV:}resourcetype';
private const ME_CARD_PROPERTY = '{http://calendarserver.org/ns/}me-card';
private const CALENDAR_TRANSP_PROPERTY = '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp';
private const string RESOURCE_TYPE_PROPERTY = '{DAV:}resourcetype';
private const string ME_CARD_PROPERTY = '{http://calendarserver.org/ns/}me-card';
private const string CALENDAR_TRANSP_PROPERTY = '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp';

public function __construct(
private readonly IDBConnection $connection,
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Paginate/PaginateCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class PaginateCache {
public const TTL = 60 * 60;
private const CACHE_COUNT_SUFFIX = 'count';
private const string CACHE_COUNT_SUFFIX = 'count';

private ICache $cache;

Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/Search/ContactsSearchProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
use Sabre\VObject\Reader;

class ContactsSearchProvider implements IFilteringProvider {
private const SEARCH_PROPERTIES_RESTRICTED = [
private const array SEARCH_PROPERTIES_RESTRICTED = [
'N',
'FN',
'NICKNAME',
'EMAIL',
];

private const SEARCH_PROPERTIES = [
private const array SEARCH_PROPERTIES = [
'N',
'FN',
'NICKNAME',
Expand Down
Loading
Loading