diff --git a/apps/contactsinteraction/lib/Migration/FixVcardCategory.php b/apps/contactsinteraction/lib/Migration/FixVcardCategory.php index 4d49600f76626..f3c20192447e7 100644 --- a/apps/contactsinteraction/lib/Migration/FixVcardCategory.php +++ b/apps/contactsinteraction/lib/Migration/FixVcardCategory.php @@ -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, diff --git a/apps/dav/lib/BackgroundJob/CleanupOrphanedChildrenJob.php b/apps/dav/lib/BackgroundJob/CleanupOrphanedChildrenJob.php index fc6521baf82a5..893fe8a93d0bc 100644 --- a/apps/dav/lib/BackgroundJob/CleanupOrphanedChildrenJob.php +++ b/apps/dav/lib/BackgroundJob/CleanupOrphanedChildrenJob.php @@ -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, diff --git a/apps/dav/lib/BackgroundJob/FederatedCalendarPeriodicSyncJob.php b/apps/dav/lib/BackgroundJob/FederatedCalendarPeriodicSyncJob.php index df14a1b85a958..96d8a00950d0f 100644 --- a/apps/dav/lib/BackgroundJob/FederatedCalendarPeriodicSyncJob.php +++ b/apps/dav/lib/BackgroundJob/FederatedCalendarPeriodicSyncJob.php @@ -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, diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 59931eb6b0b53..86ed21795f4c1 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -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', @@ -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'], ]; diff --git a/apps/dav/lib/CalDAV/CalendarImpl.php b/apps/dav/lib/CalDAV/CalendarImpl.php index 63abfc4cdad17..b1028297ec753 100644 --- a/apps/dav/lib/CalDAV/CalendarImpl.php +++ b/apps/dav/lib/CalDAV/CalendarImpl.php @@ -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 diff --git a/apps/dav/lib/CalDAV/EventComparisonService.php b/apps/dav/lib/CalDAV/EventComparisonService.php index 96264dd564bef..345d1785ee8e4 100644 --- a/apps/dav/lib/CalDAV/EventComparisonService.php +++ b/apps/dav/lib/CalDAV/EventComparisonService.php @@ -16,7 +16,7 @@ class EventComparisonService { /** @var string[] */ - private const EVENT_DIFF = [ + private const array EVENT_DIFF = [ 'RECURRENCE-ID', 'RRULE', 'SEQUENCE', diff --git a/apps/dav/lib/CalDAV/Federation/FederatedCalendar.php b/apps/dav/lib/CalDAV/Federation/FederatedCalendar.php index 6e21f7cc805b6..00bf8fbdd66a8 100644 --- a/apps/dav/lib/CalDAV/Federation/FederatedCalendar.php +++ b/apps/dav/lib/CalDAV/Federation/FederatedCalendar.php @@ -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; diff --git a/apps/dav/lib/CalDAV/Federation/FederatedCalendarSyncService.php b/apps/dav/lib/CalDAV/Federation/FederatedCalendarSyncService.php index 7d2346b6e1f09..45ea9be17be7f 100644 --- a/apps/dav/lib/CalDAV/Federation/FederatedCalendarSyncService.php +++ b/apps/dav/lib/CalDAV/Federation/FederatedCalendarSyncService.php @@ -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, diff --git a/apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php b/apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php index 3f5babd4459da..67a4314270b19 100644 --- a/apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php +++ b/apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php @@ -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. diff --git a/apps/dav/lib/CalDAV/Import/TextImporter.php b/apps/dav/lib/CalDAV/Import/TextImporter.php index 6ffcc02b831f3..beac3bc7e10bf 100644 --- a/apps/dav/lib/CalDAV/Import/TextImporter.php +++ b/apps/dav/lib/CalDAV/Import/TextImporter.php @@ -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' => []]; diff --git a/apps/dav/lib/CalDAV/Import/XmlImporter.php b/apps/dav/lib/CalDAV/Import/XmlImporter.php index 1c9032d0f9e6f..521d178cc530d 100644 --- a/apps/dav/lib/CalDAV/Import/XmlImporter.php +++ b/apps/dav/lib/CalDAV/Import/XmlImporter.php @@ -13,9 +13,9 @@ class XmlImporter { - public const OBJECT_PREFIX = ''; - public const OBJECT_SUFFIX = ''; - private const COMPONENT_TYPES = ['VEVENT', 'VTODO', 'VJOURNAL', 'VTIMEZONE']; + public const string OBJECT_PREFIX = ''; + public const string OBJECT_SUFFIX = ''; + private const array COMPONENT_TYPES = ['VEVENT', 'VTODO', 'VJOURNAL', 'VTIMEZONE']; private bool $analyzed = false; private array $structure = ['VCALENDAR' => [], 'VEVENT' => [], 'VTODO' => [], 'VJOURNAL' => [], 'VTIMEZONE' => []]; diff --git a/apps/dav/lib/CalDAV/Integration/ExternalCalendar.php b/apps/dav/lib/CalDAV/Integration/ExternalCalendar.php index 6f993bd3061ec..dbb49fc928ec0 100644 --- a/apps/dav/lib/CalDAV/Integration/ExternalCalendar.php +++ b/apps/dav/lib/CalDAV/Integration/ExternalCalendar.php @@ -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 @@ -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. diff --git a/apps/dav/lib/CalDAV/RetentionService.php b/apps/dav/lib/CalDAV/RetentionService.php index 56bfbcd7eaa9b..de433308faa5c 100644 --- a/apps/dav/lib/CalDAV/RetentionService.php +++ b/apps/dav/lib/CalDAV/RetentionService.php @@ -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, diff --git a/apps/dav/lib/CalDAV/Schedule/IMipService.php b/apps/dav/lib/CalDAV/Schedule/IMipService.php index 156d5967fcf8e..bd1240fb5ed76 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipService.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipService.php @@ -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', diff --git a/apps/dav/lib/CalDAV/TimeZoneFactory.php b/apps/dav/lib/CalDAV/TimeZoneFactory.php index 36a2c97be8229..af49ce6394c76 100644 --- a/apps/dav/lib/CalDAV/TimeZoneFactory.php +++ b/apps/dav/lib/CalDAV/TimeZoneFactory.php @@ -23,7 +23,7 @@ class TimeZoneFactory { * * @var array 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', diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 978646e43337f..3d26ef9507efd 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -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']; diff --git a/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php b/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php index 3db90a6bb0836..72abf46fed65c 100644 --- a/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php +++ b/apps/dav/lib/CardDAV/Integration/ExternalAddressBook.php @@ -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 @@ -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, diff --git a/apps/dav/lib/Connector/LegacyPublicAuth.php b/apps/dav/lib/Connector/LegacyPublicAuth.php index 0aa77993a7785..aad2313bdf795 100644 --- a/apps/dav/lib/Connector/LegacyPublicAuth.php +++ b/apps/dav/lib/Connector/LegacyPublicAuth.php @@ -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; diff --git a/apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php b/apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php index 675c19da0e167..39bce6aaf310a 100644 --- a/apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php +++ b/apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php @@ -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; diff --git a/apps/dav/lib/Connector/Sabre/PublicAuth.php b/apps/dav/lib/Connector/Sabre/PublicAuth.php index 9548050374f5d..59a7bc178176b 100644 --- a/apps/dav/lib/Connector/Sabre/PublicAuth.php +++ b/apps/dav/lib/Connector/Sabre/PublicAuth.php @@ -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; diff --git a/apps/dav/lib/DAV/CustomPropertiesBackend.php b/apps/dav/lib/DAV/CustomPropertiesBackend.php index 8be2af9da8062..3a95fe07606ca 100644 --- a/apps/dav/lib/DAV/CustomPropertiesBackend.php +++ b/apps/dav/lib/DAV/CustomPropertiesBackend.php @@ -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. @@ -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', @@ -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', ]; @@ -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', ]; @@ -104,7 +104,7 @@ class CustomPropertiesBackend implements BackendInterface { * \Sabre\DAV\Xml\Property\Complex to find a more specialized PROPERTY_TYPE_* * @var array */ - 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, ]; @@ -112,7 +112,7 @@ class CustomPropertiesBackend implements BackendInterface { * Map of well-known property names to default values * @var array */ - private const PROPERTY_DEFAULT_VALUES = [ + private const array PROPERTY_DEFAULT_VALUES = [ '{http://owncloud.org/ns}calendar-enabled' => '1', ]; @@ -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, diff --git a/apps/dav/lib/Db/PropertyMapper.php b/apps/dav/lib/Db/PropertyMapper.php index bf0aa5c2a40ca..3f16151d61bbe 100644 --- a/apps/dav/lib/Db/PropertyMapper.php +++ b/apps/dav/lib/Db/PropertyMapper.php @@ -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); diff --git a/apps/dav/lib/Listener/CalendarContactInteractionListener.php b/apps/dav/lib/Listener/CalendarContactInteractionListener.php index 5e3dac1e8358b..43e65751312f6 100644 --- a/apps/dav/lib/Listener/CalendarContactInteractionListener.php +++ b/apps/dav/lib/Listener/CalendarContactInteractionListener.php @@ -31,7 +31,7 @@ /** @template-implements IEventListener */ class CalendarContactInteractionListener implements IEventListener { - private const URI_USERS = 'principals/users/'; + private const string URI_USERS = 'principals/users/'; public function __construct( private IEventDispatcher $dispatcher, diff --git a/apps/dav/lib/Listener/CalendarDelegateActionListener.php b/apps/dav/lib/Listener/CalendarDelegateActionListener.php index eaa4d2861633e..14f619195a9c7 100644 --- a/apps/dav/lib/Listener/CalendarDelegateActionListener.php +++ b/apps/dav/lib/Listener/CalendarDelegateActionListener.php @@ -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, diff --git a/apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php b/apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php index 6db597b72138b..1592a2dbeaa65 100644 --- a/apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php @@ -24,7 +24,7 @@ class RegisterBuildReminderIndexBackgroundJob implements IRepairStep { /** @var string */ - private const CONFIG_KEY = 'buildCalendarReminderIndex'; + private const string CONFIG_KEY = 'buildCalendarReminderIndex'; /** * @param IDBConnection $db diff --git a/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php b/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php index 76c678d061507..d6931164e30bf 100644 --- a/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php +++ b/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php @@ -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, diff --git a/apps/dav/lib/Migration/RemoveObjectProperties.php b/apps/dav/lib/Migration/RemoveObjectProperties.php index e976ee4f0f89a..2f6aa8e62df17 100644 --- a/apps/dav/lib/Migration/RemoveObjectProperties.php +++ b/apps/dav/lib/Migration/RemoveObjectProperties.php @@ -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, diff --git a/apps/dav/lib/Paginate/PaginateCache.php b/apps/dav/lib/Paginate/PaginateCache.php index 58219b03621e3..6165ead4690ef 100644 --- a/apps/dav/lib/Paginate/PaginateCache.php +++ b/apps/dav/lib/Paginate/PaginateCache.php @@ -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; diff --git a/apps/dav/lib/Search/ContactsSearchProvider.php b/apps/dav/lib/Search/ContactsSearchProvider.php index f179d83ea89b4..183674dd4c604 100644 --- a/apps/dav/lib/Search/ContactsSearchProvider.php +++ b/apps/dav/lib/Search/ContactsSearchProvider.php @@ -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', diff --git a/apps/dav/lib/Search/EventsSearchProvider.php b/apps/dav/lib/Search/EventsSearchProvider.php index c49a9f18e1149..55f0fa44ba943 100644 --- a/apps/dav/lib/Search/EventsSearchProvider.php +++ b/apps/dav/lib/Search/EventsSearchProvider.php @@ -37,7 +37,7 @@ class EventsSearchProvider extends ACalendarSearchProvider implements IFiltering /** * @var string[] */ - private const SEARCH_PROPERTIES = [ + private const array SEARCH_PROPERTIES = [ 'SUMMARY', 'LOCATION', 'DESCRIPTION', @@ -49,7 +49,7 @@ class EventsSearchProvider extends ACalendarSearchProvider implements IFiltering /** * @var array */ - private const SEARCH_PARAMETERS = [ + private const array SEARCH_PARAMETERS = [ 'ATTENDEE' => ['CN'], 'ORGANIZER' => ['CN'], ]; @@ -57,7 +57,7 @@ class EventsSearchProvider extends ACalendarSearchProvider implements IFiltering /** * @var string */ - private const COMPONENT_TYPE = 'VEVENT'; + private const string COMPONENT_TYPE = 'VEVENT'; /** * @inheritDoc diff --git a/apps/dav/lib/Search/TasksSearchProvider.php b/apps/dav/lib/Search/TasksSearchProvider.php index 320cb82104db9..471dbff1df325 100644 --- a/apps/dav/lib/Search/TasksSearchProvider.php +++ b/apps/dav/lib/Search/TasksSearchProvider.php @@ -29,7 +29,7 @@ class TasksSearchProvider extends ACalendarSearchProvider { /** * @var string[] */ - private const SEARCH_PROPERTIES = [ + private const array SEARCH_PROPERTIES = [ 'SUMMARY', 'DESCRIPTION', 'CATEGORIES', @@ -38,12 +38,12 @@ class TasksSearchProvider extends ACalendarSearchProvider { /** * @var string[] */ - private const SEARCH_PARAMETERS = []; + private const array SEARCH_PARAMETERS = []; /** * @var string */ - private const COMPONENT_TYPE = 'VTODO'; + private const string COMPONENT_TYPE = 'VTODO'; /** * @inheritDoc diff --git a/apps/dav/lib/Service/ExampleEventService.php b/apps/dav/lib/Service/ExampleEventService.php index 12765d202684f..87e11ed77cfcb 100644 --- a/apps/dav/lib/Service/ExampleEventService.php +++ b/apps/dav/lib/Service/ExampleEventService.php @@ -25,9 +25,9 @@ use Sabre\VObject\Component\VEvent; class ExampleEventService { - private const FOLDER_NAME = 'example_event'; - private const FILE_NAME = 'example_event.ics'; - private const ENABLE_CONFIG_KEY = 'create_example_event'; + private const string FOLDER_NAME = 'example_event'; + private const string FILE_NAME = 'example_event.ics'; + private const string ENABLE_CONFIG_KEY = 'create_example_event'; public function __construct( private readonly CalDavBackend $calDavBackend, diff --git a/apps/dav/lib/Settings/CalDAVSettings.php b/apps/dav/lib/Settings/CalDAVSettings.php index a8d8c2f830fce..41129665004a1 100644 --- a/apps/dav/lib/Settings/CalDAVSettings.php +++ b/apps/dav/lib/Settings/CalDAVSettings.php @@ -20,7 +20,7 @@ class CalDAVSettings implements IDelegatedSettings { - private const defaults = [ + private const array defaults = [ 'sendInvitations' => 'yes', 'generateBirthdayCalendar' => 'yes', 'sendEventReminders' => 'yes', diff --git a/apps/dav/lib/Upload/ChunkingV2Plugin.php b/apps/dav/lib/Upload/ChunkingV2Plugin.php index 83ced7b8933ab..4a49087981380 100644 --- a/apps/dav/lib/Upload/ChunkingV2Plugin.php +++ b/apps/dav/lib/Upload/ChunkingV2Plugin.php @@ -52,14 +52,14 @@ class ChunkingV2Plugin extends ServerPlugin { private ?string $uploadId = null; private ?string $uploadPath = null; - private const TEMP_TARGET = '.target'; + private const string TEMP_TARGET = '.target'; public const CACHE_KEY = 'chunking-v2'; public const UPLOAD_TARGET_PATH = 'upload-target-path'; public const UPLOAD_TARGET_ID = 'upload-target-id'; public const UPLOAD_ID = 'upload-id'; - private const DESTINATION_HEADER = 'Destination'; + private const string DESTINATION_HEADER = 'Destination'; public function __construct(ICacheFactory $cacheFactory) { $this->cache = $cacheFactory->createDistributed(self::CACHE_KEY); diff --git a/apps/dav/lib/UserMigration/CalendarMigrator.php b/apps/dav/lib/UserMigration/CalendarMigrator.php index 8dd94d6d4cf25..c9ec5f4ebbe4b 100644 --- a/apps/dav/lib/UserMigration/CalendarMigrator.php +++ b/apps/dav/lib/UserMigration/CalendarMigrator.php @@ -35,21 +35,21 @@ class CalendarMigrator implements IMigrator, ISizeEstimationMigrator { use TMigratorBasicVersionHandling; - private const PATH_ROOT = Application::APP_ID . '/calendars/'; - private const PATH_VERSION = self::PATH_ROOT . 'version.json'; - private const PATH_CALENDARS = self::PATH_ROOT . 'calendars.json'; - private const PATH_SUBSCRIPTIONS = self::PATH_ROOT . 'subscriptions.json'; - private const USERS_URI_ROOT = 'principals/users/'; - private const MIGRATED_URI_PREFIX = 'migrated-'; - - private const DAV_PROPERTY_URI = 'uri'; - private const DAV_PROPERTY_DISPLAYNAME = '{DAV:}displayname'; - private const DAV_PROPERTY_CALENDAR_COLOR = '{http://apple.com/ns/ical/}calendar-color'; - private const DAV_PROPERTY_CALENDAR_TIMEZONE = '{urn:ietf:params:xml:ns:caldav}calendar-timezone'; - private const DAV_PROPERTY_SUBSCRIBED_SOURCE = 'source'; - private const DAV_PROPERTY_SUBSCRIBED_STRIP_TODOS = '{http://calendarserver.org/ns/}subscribed-strip-todos'; - private const DAV_PROPERTY_SUBSCRIBED_STRIP_ALARMS = '{http://calendarserver.org/ns/}subscribed-strip-alarms'; - private const DAV_PROPERTY_SUBSCRIBED_STRIP_ATTACHMENTS = '{http://calendarserver.org/ns/}subscribed-strip-attachments'; + private const string PATH_ROOT = Application::APP_ID . '/calendars/'; + private const string PATH_VERSION = self::PATH_ROOT . 'version.json'; + private const string PATH_CALENDARS = self::PATH_ROOT . 'calendars.json'; + private const string PATH_SUBSCRIPTIONS = self::PATH_ROOT . 'subscriptions.json'; + private const string USERS_URI_ROOT = 'principals/users/'; + private const string MIGRATED_URI_PREFIX = 'migrated-'; + + private const string DAV_PROPERTY_URI = 'uri'; + private const string DAV_PROPERTY_DISPLAYNAME = '{DAV:}displayname'; + private const string DAV_PROPERTY_CALENDAR_COLOR = '{http://apple.com/ns/ical/}calendar-color'; + private const string DAV_PROPERTY_CALENDAR_TIMEZONE = '{urn:ietf:params:xml:ns:caldav}calendar-timezone'; + private const string DAV_PROPERTY_SUBSCRIBED_SOURCE = 'source'; + private const string DAV_PROPERTY_SUBSCRIBED_STRIP_TODOS = '{http://calendarserver.org/ns/}subscribed-strip-todos'; + private const string DAV_PROPERTY_SUBSCRIBED_STRIP_ALARMS = '{http://calendarserver.org/ns/}subscribed-strip-alarms'; + private const string DAV_PROPERTY_SUBSCRIBED_STRIP_ATTACHMENTS = '{http://calendarserver.org/ns/}subscribed-strip-attachments'; public function __construct( private readonly IAppManager $appManager, diff --git a/apps/dav/lib/UserMigration/ContactsMigrator.php b/apps/dav/lib/UserMigration/ContactsMigrator.php index 826d40f732990..1dd9797db99d6 100644 --- a/apps/dav/lib/UserMigration/ContactsMigrator.php +++ b/apps/dav/lib/UserMigration/ContactsMigrator.php @@ -39,15 +39,15 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator { private SabreDavServer $sabreDavServer; - private const USERS_URI_ROOT = 'principals/users/'; + private const string USERS_URI_ROOT = 'principals/users/'; - private const FILENAME_EXT = 'vcf'; + private const string FILENAME_EXT = 'vcf'; - private const METADATA_EXT = 'json'; + private const string METADATA_EXT = 'json'; - private const MIGRATED_URI_PREFIX = 'migrated-'; + private const string MIGRATED_URI_PREFIX = 'migrated-'; - private const PATH_ROOT = Application::APP_ID . '/address_books/'; + private const string PATH_ROOT = Application::APP_ID . '/address_books/'; public function __construct( private CardDavBackend $cardDavBackend, diff --git a/apps/dav/tests/integration/UserMigration/CalendarMigratorTest.php b/apps/dav/tests/integration/UserMigration/CalendarMigratorTest.php index 6fe00aae72284..18c6ca6ee4ec5 100644 --- a/apps/dav/tests/integration/UserMigration/CalendarMigratorTest.php +++ b/apps/dav/tests/integration/UserMigration/CalendarMigratorTest.php @@ -32,8 +32,8 @@ class CalendarMigratorTest extends TestCase { private CalendarMigrator $migrator; private OutputInterface $output; - private const ASSETS_DIR = __DIR__ . '/assets/calendars/'; - private const USERS_URI_ROOT = 'principals/users/'; + private const string ASSETS_DIR = __DIR__ . '/assets/calendars/'; + private const string USERS_URI_ROOT = 'principals/users/'; protected function setUp(): void { parent::setUp(); diff --git a/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php b/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php index 6c19d1b5468e8..8254e15f73871 100644 --- a/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php +++ b/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php @@ -31,7 +31,7 @@ class ContactsMigratorTest extends TestCase { private OutputInterface $output; - private const ASSETS_DIR = __DIR__ . '/assets/address_books/'; + private const string ASSETS_DIR = __DIR__ . '/assets/address_books/'; protected function setUp(): void { $app = new App(Application::APP_ID); diff --git a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php index a10b6d18b3dc7..256ddd194b969 100644 --- a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php +++ b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php @@ -39,7 +39,7 @@ #[\PHPUnit\Framework\Attributes\Group(name: 'DB')] class PublicCalendarRootTest extends TestCase { public const UNIT_TEST_USER = ''; - private const DISABLED_USER_PRINCIPAL = 'principals/users/disabled-caldav-unit-test'; + private const string DISABLED_USER_PRINCIPAL = 'principals/users/disabled-caldav-unit-test'; private CalDavBackend $backend; private PublicCalendarRoot $publicCalendarRoot; private IL10N&MockObject $l10n; diff --git a/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php b/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php index bb5fa5ec538be..f07d508e61978 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php @@ -157,7 +157,7 @@ class ReminderServiceTest extends TestCase { END:VCALENDAR EOD; - private const CALENDAR_DATA_ONE_TIME = <<getSystemValueInt(self::KEY_MAX_SIZE, 100 * 1024 * 1024); diff --git a/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php index 104812736d6c9..404e9551cf55a 100644 --- a/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php +++ b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php @@ -21,7 +21,7 @@ */ class GlobalAuth extends AuthMechanism { public const CREDENTIALS_IDENTIFIER = 'password::global'; - private const PWD_PLACEHOLDER = '************************'; + private const string PWD_PLACEHOLDER = '************************'; public function __construct( IL10N $l, diff --git a/apps/files_external/lib/Lib/Auth/Password/UserGlobalAuth.php b/apps/files_external/lib/Lib/Auth/Password/UserGlobalAuth.php index df61187fe904a..4b7136c6c3c4e 100644 --- a/apps/files_external/lib/Lib/Auth/Password/UserGlobalAuth.php +++ b/apps/files_external/lib/Lib/Auth/Password/UserGlobalAuth.php @@ -22,7 +22,7 @@ * User provided Global Username and Password */ class UserGlobalAuth extends AuthMechanism { - private const CREDENTIALS_IDENTIFIER = 'password::global'; + private const string CREDENTIALS_IDENTIFIER = 'password::global'; public function __construct( IL10N $l, diff --git a/apps/files_sharing/lib/Command/ListShares.php b/apps/files_sharing/lib/Command/ListShares.php index 4a13aa92fa536..307bd68c16424 100644 --- a/apps/files_sharing/lib/Command/ListShares.php +++ b/apps/files_sharing/lib/Command/ListShares.php @@ -23,7 +23,7 @@ class ListShares extends Base { /** @var array */ private array $fileCache = []; - private const SHARE_TYPE_NAMES = [ + private const array SHARE_TYPE_NAMES = [ IShare::TYPE_USER => 'user', IShare::TYPE_GROUP => 'group', IShare::TYPE_LINK => 'link', diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 65fac15646080..ff98c0d08af88 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -77,7 +77,7 @@ class ShareAPIController extends OCSController { /** Maximum length of a custom share token, matching the oc_share.token database column. */ - private const TOKEN_MAX_LENGTH = 32; + private const int TOKEN_MAX_LENGTH = 32; private ?Node $lockedNode = null; /** @var array $trustedServerCache */ diff --git a/apps/files_sharing/lib/DeleteOrphanedSharesJob.php b/apps/files_sharing/lib/DeleteOrphanedSharesJob.php index c0828caca1675..ee06ea0a1a54f 100644 --- a/apps/files_sharing/lib/DeleteOrphanedSharesJob.php +++ b/apps/files_sharing/lib/DeleteOrphanedSharesJob.php @@ -24,9 +24,9 @@ class DeleteOrphanedSharesJob extends TimedJob { use TTransactional; - private const CHUNK_SIZE = 1000; + private const int CHUNK_SIZE = 1000; - private const INTERVAL = 24 * 60 * 60; + private const int INTERVAL = 24 * 60 * 60; /** * sets the correct interval for this timed job diff --git a/apps/files_sharing/lib/External/ExternalShareMapper.php b/apps/files_sharing/lib/External/ExternalShareMapper.php index 9db5b2d95b4b5..060b7c97fadfa 100644 --- a/apps/files_sharing/lib/External/ExternalShareMapper.php +++ b/apps/files_sharing/lib/External/ExternalShareMapper.php @@ -25,7 +25,7 @@ * @template-extends QBMapper */ class ExternalShareMapper extends QBMapper { - private const TABLE_NAME = 'share_external'; + private const string TABLE_NAME = 'share_external'; public function __construct( IDBConnection $db, diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php index 04ab974425dc3..1622f1ea8f032 100644 --- a/apps/files_sharing/lib/External/Storage.php +++ b/apps/files_sharing/lib/External/Storage.php @@ -61,8 +61,8 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage, /** Unix timestamp before which the next exchange attempt must not be made (0 = no wait) */ private int $refreshBackoffUntil = 0; - private const REFRESH_MAX_ATTEMPTS = 3; - private const REFRESH_BACKOFF_SECONDS = 5; + private const int REFRESH_MAX_ATTEMPTS = 3; + private const int REFRESH_BACKOFF_SECONDS = 5; /** * @param array{HttpClientService: IClientService, manager: ExternalShareManager, cloudId: ICloudId, mountpoint: string, token: string, access_token: ?string, access_token_expires: ?int}|array $options diff --git a/apps/files_sharing/lib/Listener/ShareInteractionListener.php b/apps/files_sharing/lib/Listener/ShareInteractionListener.php index b7270536e16df..16ea49c3cb161 100644 --- a/apps/files_sharing/lib/Listener/ShareInteractionListener.php +++ b/apps/files_sharing/lib/Listener/ShareInteractionListener.php @@ -21,7 +21,7 @@ /** @template-implements IEventListener */ class ShareInteractionListener implements IEventListener { - private const SUPPORTED_SHARE_TYPES = [ + private const array SUPPORTED_SHARE_TYPES = [ IShare::TYPE_USER, IShare::TYPE_EMAIL, IShare::TYPE_REMOTE, diff --git a/apps/files_sharing/lib/Repair/CleanupShareTarget.php b/apps/files_sharing/lib/Repair/CleanupShareTarget.php index 7a82869b773bc..340cc8840f04a 100644 --- a/apps/files_sharing/lib/Repair/CleanupShareTarget.php +++ b/apps/files_sharing/lib/Repair/CleanupShareTarget.php @@ -32,7 +32,7 @@ class CleanupShareTarget implements IRepairStepExpensive { /** we only care about shares with a user target, * since the underling group/deck/talk share doesn't get moved */ - private const USER_SHARE_TYPES = [ + private const array USER_SHARE_TYPES = [ IShare::TYPE_USER, IShare::TYPE_USERGROUP, IShare::TYPE_DECK_USER, diff --git a/apps/files_sharing/lib/SharesReminderJob.php b/apps/files_sharing/lib/SharesReminderJob.php index 4ec9aabe716ea..255d2204a1483 100644 --- a/apps/files_sharing/lib/SharesReminderJob.php +++ b/apps/files_sharing/lib/SharesReminderJob.php @@ -34,7 +34,7 @@ * Send a reminder via email to the sharee(s) if the folder is still empty a predefined time before the expiration date */ class SharesReminderJob extends TimedJob { - private const SECONDS_BEFORE_REMINDER = 24 * 60 * 60; + private const int SECONDS_BEFORE_REMINDER = 24 * 60 * 60; private int $folderMimeTypeId; public function __construct( diff --git a/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php b/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php index 5df0061145e33..06e01137e99a5 100644 --- a/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php +++ b/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php @@ -27,8 +27,8 @@ class ExpireTrash extends TimedJob { public const TOGGLE_CONFIG_KEY_NAME = 'background_job_expire_trash'; public const OFFSET_CONFIG_KEY_NAME = 'background_job_expire_trash_offset'; - private const THIRTY_MINUTES = 30 * 60; - private const USER_BATCH_SIZE = 10; + private const int THIRTY_MINUTES = 30 * 60; + private const int USER_BATCH_SIZE = 10; public function __construct( private readonly IAppConfig $appConfig, diff --git a/apps/files_trashbin/lib/Command/RestoreAllFiles.php b/apps/files_trashbin/lib/Command/RestoreAllFiles.php index adf2bcacd8a01..d2dabe2beae75 100644 --- a/apps/files_trashbin/lib/Command/RestoreAllFiles.php +++ b/apps/files_trashbin/lib/Command/RestoreAllFiles.php @@ -26,11 +26,11 @@ class RestoreAllFiles extends Base { - private const SCOPE_ALL = 0; - private const SCOPE_USER = 1; - private const SCOPE_GROUPFOLDERS = 2; + private const int SCOPE_ALL = 0; + private const int SCOPE_USER = 1; + private const int SCOPE_GROUPFOLDERS = 2; - private const SCOPE_MAP = [ + private const array SCOPE_MAP = [ 'user' => self::SCOPE_USER, 'groupfolders' => self::SCOPE_GROUPFOLDERS, 'all' => self::SCOPE_ALL diff --git a/apps/files_trashbin/tests/StorageTest.php b/apps/files_trashbin/tests/StorageTest.php index ac5698c51afa5..cc010d10d3344 100644 --- a/apps/files_trashbin/tests/StorageTest.php +++ b/apps/files_trashbin/tests/StorageTest.php @@ -63,9 +63,9 @@ class StorageTest extends \Test\TestCase { private View $userView; // 239 chars so appended timestamp of 12 chars will exceed max length of 250 chars - private const LONG_FILENAME = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt'; + private const string LONG_FILENAME = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt'; // 250 chars - private const MAX_FILENAME = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt'; + private const string MAX_FILENAME = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt'; protected function setUp(): void { parent::setUp(); diff --git a/apps/files_versions/lib/Sabre/Plugin.php b/apps/files_versions/lib/Sabre/Plugin.php index a26a9c874558b..173efd2b129c2 100644 --- a/apps/files_versions/lib/Sabre/Plugin.php +++ b/apps/files_versions/lib/Sabre/Plugin.php @@ -33,7 +33,7 @@ class Plugin extends ServerPlugin { public const AUTHOR = 'author'; public const VERSION_LABEL = '{http://nextcloud.org/ns}version-label'; public const VERSION_AUTHOR = '{http://nextcloud.org/ns}version-author'; - private const LEGACY_FILENAME_HEADER_USER_AGENTS = [ // Quirky clients + private const array LEGACY_FILENAME_HEADER_USER_AGENTS = [ // Quirky clients Request::USER_AGENT_IE, Request::USER_AGENT_ANDROID_MOBILE_CHROME, Request::USER_AGENT_FREEBOX, diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index a78929a4c3b6c..63831db04fbd0 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -67,7 +67,7 @@ class Storage { */ private static array $sourcePathAndUser = []; - private const MAX_VERSIONS_PER_INTERVAL = [ + private const array MAX_VERSIONS_PER_INTERVAL = [ //first 10sec, one version every 2sec 1 => ['intervalEndsAfter' => 10, 'step' => 2], //next minute, one version every 10sec diff --git a/apps/files_versions/tests/GetAutoExpireListTest.php b/apps/files_versions/tests/GetAutoExpireListTest.php index efe3f8ce7e2ad..cd74e2c4f3af0 100644 --- a/apps/files_versions/tests/GetAutoExpireListTest.php +++ b/apps/files_versions/tests/GetAutoExpireListTest.php @@ -16,7 +16,7 @@ class GetAutoExpireListTest extends TestCase { /** * Frozen reference time for all tests */ - private const NOW = 1600000000; + private const int NOW = 1600000000; /** * Helper to call the private retention logic diff --git a/apps/oauth2/lib/Command/AddClient.php b/apps/oauth2/lib/Command/AddClient.php index 5fdff923835d9..edf384b45372e 100644 --- a/apps/oauth2/lib/Command/AddClient.php +++ b/apps/oauth2/lib/Command/AddClient.php @@ -18,8 +18,8 @@ use Symfony\Component\Console\Output\OutputInterface; class AddClient extends Base { - private const ARGUMENT_CLIENT_NAME = 'client-name'; - private const ARGUMENT_CLIENT_REDIRECT_URI = 'client-redirect-uri'; + private const string ARGUMENT_CLIENT_NAME = 'client-name'; + private const string ARGUMENT_CLIENT_REDIRECT_URI = 'client-redirect-uri'; public function __construct( private readonly ClientService $clientService, diff --git a/apps/oauth2/lib/Command/DeleteClient.php b/apps/oauth2/lib/Command/DeleteClient.php index 8369bddbf323c..6eb15421c88df 100644 --- a/apps/oauth2/lib/Command/DeleteClient.php +++ b/apps/oauth2/lib/Command/DeleteClient.php @@ -18,7 +18,7 @@ use Symfony\Component\Console\Output\OutputInterface; class DeleteClient extends Base { - private const ARGUMENT_CLIENT_ID = 'client-id'; + private const string ARGUMENT_CLIENT_ID = 'client-id'; public function __construct( private readonly ClientService $clientService, diff --git a/apps/oauth2/lib/Command/ImportLegacyOcClient.php b/apps/oauth2/lib/Command/ImportLegacyOcClient.php index 6a2303ac545ad..93649fd4b1f62 100644 --- a/apps/oauth2/lib/Command/ImportLegacyOcClient.php +++ b/apps/oauth2/lib/Command/ImportLegacyOcClient.php @@ -19,8 +19,8 @@ use Symfony\Component\Console\Output\OutputInterface; class ImportLegacyOcClient extends Command { - private const ARGUMENT_CLIENT_ID = 'client-id'; - private const ARGUMENT_CLIENT_SECRET = 'client-secret'; + private const string ARGUMENT_CLIENT_ID = 'client-id'; + private const string ARGUMENT_CLIENT_SECRET = 'client-secret'; public function __construct( private readonly IConfig $config, diff --git a/apps/settings/lib/Controller/UsersController.php b/apps/settings/lib/Controller/UsersController.php index 82e501262d0d3..88656772b825c 100644 --- a/apps/settings/lib/Controller/UsersController.php +++ b/apps/settings/lib/Controller/UsersController.php @@ -61,7 +61,7 @@ #[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)] class UsersController extends Controller { /** Limit for counting users for subadmins, to avoid spending too much time */ - private const COUNT_LIMIT_FOR_SUBADMINS = 999; + private const int COUNT_LIMIT_FOR_SUBADMINS = 999; public const ALLOWED_USER_PREFERENCES = [ ConfigLexicon::USER_LIST_SHOW_STORAGE_PATH, diff --git a/apps/settings/lib/Controller/WebAuthnController.php b/apps/settings/lib/Controller/WebAuthnController.php index d61a2a8904328..9efd386c02222 100644 --- a/apps/settings/lib/Controller/WebAuthnController.php +++ b/apps/settings/lib/Controller/WebAuthnController.php @@ -28,7 +28,7 @@ #[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)] class WebAuthnController extends Controller { - private const WEBAUTHN_REGISTRATION = 'webauthn_registration'; + private const string WEBAUTHN_REGISTRATION = 'webauthn_registration'; public function __construct( IRequest $request, diff --git a/apps/settings/lib/SetupChecks/SupportedDatabase.php b/apps/settings/lib/SetupChecks/SupportedDatabase.php index 6592d998397c5..c2fcd5d4cc190 100644 --- a/apps/settings/lib/SetupChecks/SupportedDatabase.php +++ b/apps/settings/lib/SetupChecks/SupportedDatabase.php @@ -17,14 +17,14 @@ class SupportedDatabase implements ISetupCheck { - private const MIN_MARIADB = '10.11'; - private const MAX_MARIADB = '12.3'; - private const MIN_MYSQL = '8.4'; - private const MAX_MYSQL = '9.7'; - private const MIN_POSTGRES = '14'; - private const MAX_POSTGRES = '18'; - private const MIN_ORACLE = '12.2'; - private const MAX_ORACLE = '26'; + private const string MIN_MARIADB = '10.11'; + private const string MAX_MARIADB = '12.3'; + private const string MIN_MYSQL = '8.4'; + private const string MAX_MYSQL = '9.7'; + private const string MIN_POSTGRES = '14'; + private const string MAX_POSTGRES = '18'; + private const string MIN_ORACLE = '12.2'; + private const string MAX_ORACLE = '26'; public function __construct( private IL10N $l10n, diff --git a/apps/settings/lib/UserMigration/AccountMigrator.php b/apps/settings/lib/UserMigration/AccountMigrator.php index 842ea7b6992ad..dd1ca7a2cca31 100644 --- a/apps/settings/lib/UserMigration/AccountMigrator.php +++ b/apps/settings/lib/UserMigration/AccountMigrator.php @@ -32,13 +32,13 @@ class AccountMigrator implements IMigrator, ISizeEstimationMigrator { use TMigratorBasicVersionHandling; use TAccountsHelper; - private const PATH_ROOT = Application::APP_ID . '/'; + private const string PATH_ROOT = Application::APP_ID . '/'; - private const PATH_ACCOUNT_FILE = AccountMigrator::PATH_ROOT . 'account.json'; + private const string PATH_ACCOUNT_FILE = AccountMigrator::PATH_ROOT . 'account.json'; - private const AVATAR_BASENAME = 'avatar'; + private const string AVATAR_BASENAME = 'avatar'; - private const PATH_CONFIG_FILE = AccountMigrator::PATH_ROOT . 'config.json'; + private const string PATH_CONFIG_FILE = AccountMigrator::PATH_ROOT . 'config.json'; public function __construct( private IAccountManager $accountManager, diff --git a/apps/settings/tests/UserMigration/AccountMigratorTest.php b/apps/settings/tests/UserMigration/AccountMigratorTest.php index b053dae82cca3..f1df03343f0af 100644 --- a/apps/settings/tests/UserMigration/AccountMigratorTest.php +++ b/apps/settings/tests/UserMigration/AccountMigratorTest.php @@ -33,13 +33,13 @@ class AccountMigratorTest extends TestCase { private IExportDestination&MockObject $exportDestination; private OutputInterface&MockObject $output; - private const ASSETS_DIR = __DIR__ . '/assets/'; + private const string ASSETS_DIR = __DIR__ . '/assets/'; - private const REGEX_ACCOUNT_FILE = '/^' . Application::APP_ID . '\/' . '[a-z]+\.json' . '$/'; + private const string REGEX_ACCOUNT_FILE = '/^' . Application::APP_ID . '\/' . '[a-z]+\.json' . '$/'; - private const REGEX_AVATAR_FILE = '/^' . Application::APP_ID . '\/' . 'avatar\.(jpg|png)' . '$/'; + private const string REGEX_AVATAR_FILE = '/^' . Application::APP_ID . '\/' . 'avatar\.(jpg|png)' . '$/'; - private const REGEX_CONFIG_FILE = '/^' . Application::APP_ID . '\/' . '[a-z]+\.json' . '$/'; + private const string REGEX_CONFIG_FILE = '/^' . Application::APP_ID . '\/' . '[a-z]+\.json' . '$/'; protected function setUp(): void { parent::setUp(); diff --git a/apps/testing/lib/Command/StaticHunt.php b/apps/testing/lib/Command/StaticHunt.php index 44e332d788cc6..148e8bc7735fb 100644 --- a/apps/testing/lib/Command/StaticHunt.php +++ b/apps/testing/lib/Command/StaticHunt.php @@ -15,7 +15,7 @@ use Symfony\Component\Console\Output\OutputInterface; class StaticHunt extends Command { - private const SKIP_REGEX = [ + private const array SKIP_REGEX = [ '@/templates/.+.php$@', '@/ajax/.+.php$@', '@/register_command.php$@', diff --git a/apps/theming/lib/Listener/BeforePreferenceListener.php b/apps/theming/lib/Listener/BeforePreferenceListener.php index d823df1ab33c2..1dac365b7f61e 100644 --- a/apps/theming/lib/Listener/BeforePreferenceListener.php +++ b/apps/theming/lib/Listener/BeforePreferenceListener.php @@ -22,7 +22,7 @@ class BeforePreferenceListener implements IEventListener { /** * @var string[] */ - private const ALLOWED_KEYS = ['force_enable_blur_filter', 'shortcuts_disabled', 'primary_color']; + private const array ALLOWED_KEYS = ['force_enable_blur_filter', 'shortcuts_disabled', 'primary_color']; public function __construct( private IAppManager $appManager, diff --git a/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php b/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php index 9251858b1d203..4ac487ecea1df 100644 --- a/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php +++ b/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php @@ -18,7 +18,7 @@ use OCP\Security\ISecureRandom; class BackupCodeStorage { - private const CODE_LENGTH = 16; + private const int CODE_LENGTH = 16; public function __construct( private BackupCodeMapper $mapper, diff --git a/apps/user_status/lib/Service/PredefinedStatusService.php b/apps/user_status/lib/Service/PredefinedStatusService.php index 3e9c196dbe2d4..c495ea1383101 100644 --- a/apps/user_status/lib/Service/PredefinedStatusService.php +++ b/apps/user_status/lib/Service/PredefinedStatusService.php @@ -21,12 +21,12 @@ * @package OCA\UserStatus\Service */ class PredefinedStatusService { - private const BE_RIGHT_BACK = 'be-right-back'; - private const MEETING = 'meeting'; - private const COMMUTING = 'commuting'; - private const SICK_LEAVE = 'sick-leave'; - private const VACATIONING = 'vacationing'; - private const REMOTE_WORK = 'remote-work'; + private const string BE_RIGHT_BACK = 'be-right-back'; + private const string MEETING = 'meeting'; + private const string COMMUTING = 'commuting'; + private const string SICK_LEAVE = 'sick-leave'; + private const string VACATIONING = 'vacationing'; + private const string REMOTE_WORK = 'remote-work'; /** * @deprecated See \OCP\UserStatus\IUserStatus::MESSAGE_CALL */ diff --git a/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php b/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php index d77f5298dc503..e485ece59d0b6 100644 --- a/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php +++ b/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php @@ -25,7 +25,7 @@ class WebhookListenerMapper extends QBMapper { public const TABLE_NAME = 'webhook_listeners'; - private const EVENTS_CACHE_KEY_PREFIX = 'eventsUsedInWebhooks'; + private const string EVENTS_CACHE_KEY_PREFIX = 'eventsUsedInWebhooks'; private ?ICache $cache = null; diff --git a/apps/workflowengine/lib/Entity/File.php b/apps/workflowengine/lib/Entity/File.php index 2eb000c44f52b..89edacdcc2a38 100644 --- a/apps/workflowengine/lib/Entity/File.php +++ b/apps/workflowengine/lib/Entity/File.php @@ -33,7 +33,7 @@ use OCP\WorkflowEngine\IRuleMatcher; class File implements IEntity, IDisplayText, IUrl, IIcon, IContextPortation { - private const EVENT_NAMESPACE = '\OCP\Files::'; + private const string EVENT_NAMESPACE = '\OCP\Files::'; protected ?string $eventName = null; protected ?Event $event = null; private ?Node $node = null; diff --git a/core/Command/Db/Migrations/GenerateCommand.php b/core/Command/Db/Migrations/GenerateCommand.php index 14adc62fa6fed..dd83b93aa33ec 100644 --- a/core/Command/Db/Migrations/GenerateCommand.php +++ b/core/Command/Db/Migrations/GenerateCommand.php @@ -24,7 +24,7 @@ use Symfony\Component\Console\Question\ConfirmationQuestion; class GenerateCommand extends Command implements CompletionAwareInterface { - private const TEMPLATE + private const string TEMPLATE = ' */ class LoginFlowV2Mapper extends QBMapper { - private const lifetime = 1200; + private const int lifetime = 1200; public function __construct( IDBConnection $db, diff --git a/core/Migrations/Version23000Date20210930122352.php b/core/Migrations/Version23000Date20210930122352.php index 9f64a5c5162f3..e1d1f85bfada2 100644 --- a/core/Migrations/Version23000Date20210930122352.php +++ b/core/Migrations/Version23000Date20210930122352.php @@ -16,7 +16,7 @@ use OCP\Migration\SimpleMigrationStep; class Version23000Date20210930122352 extends SimpleMigrationStep { - private const TABLE_NAME = 'profile_config'; + private const string TABLE_NAME = 'profile_config'; /** * @param IOutput $output diff --git a/core/Migrations/Version23000Date20211203110726.php b/core/Migrations/Version23000Date20211203110726.php index e98cb6818fccd..1453f7d58dd42 100644 --- a/core/Migrations/Version23000Date20211203110726.php +++ b/core/Migrations/Version23000Date20211203110726.php @@ -15,7 +15,7 @@ use OCP\Migration\SimpleMigrationStep; class Version23000Date20211203110726 extends SimpleMigrationStep { - private const TABLE_NAME = 'profile_config'; + private const string TABLE_NAME = 'profile_config'; /** * @param IOutput $output diff --git a/core/Migrations/Version24000Date20211222112246.php b/core/Migrations/Version24000Date20211222112246.php index debf0968ec822..98dbf33df1385 100644 --- a/core/Migrations/Version24000Date20211222112246.php +++ b/core/Migrations/Version24000Date20211222112246.php @@ -16,7 +16,7 @@ use OCP\Migration\SimpleMigrationStep; class Version24000Date20211222112246 extends SimpleMigrationStep { - private const TABLE_NAME = 'reactions'; + private const string TABLE_NAME = 'reactions'; /** * @param IOutput $output diff --git a/lib/private/App/CompareVersion.php b/lib/private/App/CompareVersion.php index 4b5bae9d75c2f..4a113a36848bb 100644 --- a/lib/private/App/CompareVersion.php +++ b/lib/private/App/CompareVersion.php @@ -13,10 +13,10 @@ use function explode; class CompareVersion { - private const REGEX_MAJOR = '/^\d+$/'; - private const REGEX_MAJOR_MINOR = '/^\d+\.\d+$/'; - private const REGEX_MAJOR_MINOR_PATCH = '/^\d+\.\d+\.\d+(?!\.\d+)/'; - private const REGEX_ACTUAL = '/^\d+(\.\d+){1,2}/'; + private const string REGEX_MAJOR = '/^\d+$/'; + private const string REGEX_MAJOR_MINOR = '/^\d+\.\d+$/'; + private const string REGEX_MAJOR_MINOR_PATCH = '/^\d+\.\d+\.\d+(?!\.\d+)/'; + private const string REGEX_ACTUAL = '/^\d+(\.\d+){1,2}/'; /** * Checks if the given server version fulfills the given (app) version requirements. diff --git a/lib/private/App/PlatformRepository.php b/lib/private/App/PlatformRepository.php index 47dc227bab727..c1cbb5831e01e 100644 --- a/lib/private/App/PlatformRepository.php +++ b/lib/private/App/PlatformRepository.php @@ -128,7 +128,7 @@ public function findLibrary(string $name): ?string { return null; } - private const MODIFIER_REGEX = '[._-]?(?:(stable|beta|b|RC|alpha|a|patch|pl|p)(?:[.-]?(\d+))?)?([.-]?dev)?'; + private const string MODIFIER_REGEX = '[._-]?(?:(stable|beta|b|RC|alpha|a|patch|pl|p)(?:[.-]?(\d+))?)?([.-]?dev)?'; /** * Normalizes a version string to be able to perform comparisons on it diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index f52971bd6d948..27a6b7563eadc 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -52,12 +52,12 @@ * @since 29.0.0 - Supporting types and lazy loading */ class AppConfig implements IAppConfig { - private const APP_MAX_LENGTH = 32; - private const KEY_MAX_LENGTH = 64; - private const ENCRYPTION_PREFIX = '$AppConfigEncryption$'; - private const ENCRYPTION_PREFIX_LENGTH = 21; // strlen(self::ENCRYPTION_PREFIX) - private const LOCAL_CACHE_KEY = 'OC\\AppConfig'; - private const LOCAL_CACHE_TTL = 3; + private const int APP_MAX_LENGTH = 32; + private const int KEY_MAX_LENGTH = 64; + private const string ENCRYPTION_PREFIX = '$AppConfigEncryption$'; + private const int ENCRYPTION_PREFIX_LENGTH = 21; // strlen(self::ENCRYPTION_PREFIX) + private const string LOCAL_CACHE_KEY = 'OC\\AppConfig'; + private const int LOCAL_CACHE_TTL = 3; /** @var array> ['app_id' => ['config_key' => 'config_value']] */ private array $fastCache = []; // cache for normal config keys diff --git a/lib/private/AppFramework/Routing/RouteParser.php b/lib/private/AppFramework/Routing/RouteParser.php index 483e0c16d28ce..dc794a1b39669 100644 --- a/lib/private/AppFramework/Routing/RouteParser.php +++ b/lib/private/AppFramework/Routing/RouteParser.php @@ -16,7 +16,7 @@ class RouteParser { /** @var string[] */ private $controllerNameCache = []; - private const rootUrlApps = [ + private const array rootUrlApps = [ 'appstore', 'cloud_federation_api', 'core', diff --git a/lib/private/Authentication/Login/CreateSessionTokenCommand.php b/lib/private/Authentication/Login/CreateSessionTokenCommand.php index 03d6014bfbb08..04c08967a2d16 100644 --- a/lib/private/Authentication/Login/CreateSessionTokenCommand.php +++ b/lib/private/Authentication/Login/CreateSessionTokenCommand.php @@ -16,7 +16,7 @@ use OCP\IURLGenerator; class CreateSessionTokenCommand extends ALoginCommand { - private const EPHEMERAL_SESSION_TTL = 5 * 60; // 5 minutes + private const int EPHEMERAL_SESSION_TTL = 5 * 60; // 5 minutes public function __construct( private IConfig $config, diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php index f3328a388dbe7..597bae331126d 100644 --- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php +++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php @@ -31,7 +31,7 @@ class PublicKeyTokenProvider implements IProvider { public const TOKEN_MIN_LENGTH = 22; /** Token cache TTL in seconds */ - private const TOKEN_CACHE_TTL = 10; + private const int TOKEN_CACHE_TTL = 10; use TTransactional; diff --git a/lib/private/Avatar/RemoteAvatar.php b/lib/private/Avatar/RemoteAvatar.php index 6295d54ed9567..50eb5cf8f6747 100644 --- a/lib/private/Avatar/RemoteAvatar.php +++ b/lib/private/Avatar/RemoteAvatar.php @@ -19,7 +19,7 @@ use Psr\Log\LoggerInterface; class RemoteAvatar extends Avatar { - private const IMAGE_CACHE_AGE = 60 * 60 * 24; // One day + private const int IMAGE_CACHE_AGE = 60 * 60 * 24; // One day private ICloudId $cloudId; diff --git a/lib/private/BackgroundJob/JobClassesRegistry.php b/lib/private/BackgroundJob/JobClassesRegistry.php index 283ceedc1fd3a..0649e4ed31a9e 100644 --- a/lib/private/BackgroundJob/JobClassesRegistry.php +++ b/lib/private/BackgroundJob/JobClassesRegistry.php @@ -24,7 +24,7 @@ final class JobClassesRegistry { */ private array $registry = []; - private const TABLE = 'job_classes_registry'; + private const string TABLE = 'job_classes_registry'; public function __construct( private readonly IDBConnection $connection, diff --git a/lib/private/BackgroundJob/JobRuns.php b/lib/private/BackgroundJob/JobRuns.php index 95f47c666a49f..af8570b9f6010 100644 --- a/lib/private/BackgroundJob/JobRuns.php +++ b/lib/private/BackgroundJob/JobRuns.php @@ -22,7 +22,7 @@ use RuntimeException; final readonly class JobRuns implements IJobRuns { - private const TABLE = 'job_runs'; + private const string TABLE = 'job_runs'; public function __construct( private IDBConnection $connection, diff --git a/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php b/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php index aa95087453425..0a5154c0cf0c7 100644 --- a/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php +++ b/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php @@ -28,8 +28,8 @@ * @template-implements IEventListener */ class GenerateBlurhashMetadata implements IEventListener { - private const COMPONENTS_X = 4; - private const COMPONENTS_Y = 3; + private const int COMPONENTS_X = 4; + private const int COMPONENTS_Y = 3; public function __construct( private IPreview $preview, diff --git a/lib/private/Config/PresetManager.php b/lib/private/Config/PresetManager.php index 462273335e01c..c78e67b7553f5 100644 --- a/lib/private/Config/PresetManager.php +++ b/lib/private/Config/PresetManager.php @@ -25,7 +25,7 @@ * tools to manage the Preset feature */ class PresetManager { - private const PRESET_CONFIGKEY = 'config_preset'; + private const string PRESET_CONFIGKEY = 'config_preset'; private ?AppManager $appManager = null; private ?Installer $installer = null; diff --git a/lib/private/Config/UserConfig.php b/lib/private/Config/UserConfig.php index e786d13f10d58..2869b590f5e0a 100644 --- a/lib/private/Config/UserConfig.php +++ b/lib/private/Config/UserConfig.php @@ -51,10 +51,10 @@ * @since 31.0.0 */ class UserConfig implements IUserConfig { - private const USER_MAX_LENGTH = 64; - private const APP_MAX_LENGTH = 32; - private const KEY_MAX_LENGTH = 64; - private const INDEX_MAX_LENGTH = 64; + private const int USER_MAX_LENGTH = 64; + private const int APP_MAX_LENGTH = 32; + private const int KEY_MAX_LENGTH = 64; + private const int INDEX_MAX_LENGTH = 64; /** @var CappedMemoryCache>> cache for normal config keys */ private CappedMemoryCache $fastCache; diff --git a/lib/private/Config/UserConfigEntry.php b/lib/private/Config/UserConfigEntry.php index f0a77567b30dd..615438a07b986 100644 --- a/lib/private/Config/UserConfigEntry.php +++ b/lib/private/Config/UserConfigEntry.php @@ -14,8 +14,8 @@ use OCP\Security\ICrypto; class UserConfigEntry { - private const ENCRYPTION_PREFIX = '$UserConfigEncryption$'; - private const ENCRYPTION_PREFIX_LENGTH = 22; // strlen(self::ENCRYPTION_PREFIX) + private const string ENCRYPTION_PREFIX = '$UserConfigEncryption$'; + private const int ENCRYPTION_PREFIX_LENGTH = 22; // strlen(self::ENCRYPTION_PREFIX) /** @var string $decryptedValue Cached decrypted value, if any */ private ?string $decryptedValue = null; diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 6674b84c599fc..3b70d011980e8 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -65,7 +65,7 @@ class Connection extends PrimaryReadReplicaConnection { protected int $queriesExecuted = 0; protected ?DbDataCollector $dbDataCollector = null; /** Seconds the connection may sit idle before the next use re-verifies connectivity */ - private const CONNECTION_CHECK_INTERVAL = 30; + private const int CONNECTION_CHECK_INTERVAL = 30; private array $lastConnectionCheck = []; protected ?float $transactionActiveSince = null; diff --git a/lib/private/DirectEditing/Manager.php b/lib/private/DirectEditing/Manager.php index d3c73c9bb725e..bfa5edc6d4344 100644 --- a/lib/private/DirectEditing/Manager.php +++ b/lib/private/DirectEditing/Manager.php @@ -35,7 +35,7 @@ use function in_array; class Manager implements IManager { - private const TOKEN_CLEANUP_TIME = 12 * 60 * 60 ; + private const int TOKEN_CLEANUP_TIME = 12 * 60 * 60 ; public const TABLE_TOKENS = 'direct_edit'; diff --git a/lib/private/Files/Cache/SearchBuilder.php b/lib/private/Files/Cache/SearchBuilder.php index 79fc7db1a4bf0..66cb614043ecc 100644 --- a/lib/private/Files/Cache/SearchBuilder.php +++ b/lib/private/Files/Cache/SearchBuilder.php @@ -24,7 +24,7 @@ */ class SearchBuilder { /** @var array */ - private const SEARCH_OPERATOR_MAP = [ + private const array SEARCH_OPERATOR_MAP = [ ISearchComparison::COMPARE_LIKE => 'iLike', ISearchComparison::COMPARE_LIKE_CASE_SENSITIVE => 'like', ISearchComparison::COMPARE_EQUAL => 'eq', @@ -37,7 +37,7 @@ class SearchBuilder { ]; /** @var array */ - private const SEARCH_OPERATOR_NEGATIVE_MAP = [ + private const array SEARCH_OPERATOR_NEGATIVE_MAP = [ ISearchComparison::COMPARE_LIKE => 'notLike', ISearchComparison::COMPARE_LIKE_CASE_SENSITIVE => 'notLike', ISearchComparison::COMPARE_EQUAL => 'neq', @@ -50,7 +50,7 @@ class SearchBuilder { ]; /** @var array */ - private const FIELD_TYPES = [ + private const array FIELD_TYPES = [ 'mimetype' => 'string', 'mtime' => 'integer', 'name' => 'string', @@ -69,14 +69,14 @@ class SearchBuilder { ]; /** @var array */ - private const PARAM_TYPE_MAP = [ + private const array PARAM_TYPE_MAP = [ 'string' => IQueryBuilder::PARAM_STR, 'integer' => IQueryBuilder::PARAM_INT, 'boolean' => IQueryBuilder::PARAM_BOOL, ]; /** @var array */ - private const PARAM_ARRAY_TYPE_MAP = [ + private const array PARAM_ARRAY_TYPE_MAP = [ 'string' => IQueryBuilder::PARAM_STR_ARRAY, 'integer' => IQueryBuilder::PARAM_INT_ARRAY, 'boolean' => IQueryBuilder::PARAM_INT_ARRAY, diff --git a/lib/private/Files/Config/LazyPathCachedMountInfo.php b/lib/private/Files/Config/LazyPathCachedMountInfo.php index c0f5c28fcefac..556610cc56319 100644 --- a/lib/private/Files/Config/LazyPathCachedMountInfo.php +++ b/lib/private/Files/Config/LazyPathCachedMountInfo.php @@ -12,7 +12,7 @@ class LazyPathCachedMountInfo extends CachedMountInfo { // we don't allow \ in paths so it makes a great placeholder - private const PATH_PLACEHOLDER = '\\PLACEHOLDER\\'; + private const string PATH_PLACEHOLDER = '\\PLACEHOLDER\\'; /** @var callable(CachedMountInfo): string */ protected $rootInternalPathCallback; diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php index 304de7f788f6c..76959f6f01ea3 100644 --- a/lib/private/Files/SetupManager.php +++ b/lib/private/Files/SetupManager.php @@ -95,8 +95,8 @@ class SetupManager implements ISetupManager { private bool $setupBuiltinWrappersDone = false; private bool $forceFullSetup; private bool $optimizeAuthoritativeProviders; - private const SETUP_WITH_CHILDREN = 1; - private const SETUP_WITHOUT_CHILDREN = 0; + private const int SETUP_WITH_CHILDREN = 1; + private const int SETUP_WITHOUT_CHILDREN = 0; private bool $updatingProviders = false; diff --git a/lib/private/Files/Stream/SeekableHttpStream.php b/lib/private/Files/Stream/SeekableHttpStream.php index 996a8fa8234fe..6b6ab08cbbc1c 100644 --- a/lib/private/Files/Stream/SeekableHttpStream.php +++ b/lib/private/Files/Stream/SeekableHttpStream.php @@ -14,7 +14,7 @@ * A stream wrapper that uses http range requests to provide a seekable stream for http reading */ class SeekableHttpStream implements File { - private const PROTOCOL = 'httpseek'; + private const string PROTOCOL = 'httpseek'; /** * Registers the stream wrapper using the `httpseek://` url scheme diff --git a/lib/private/Files/Type/Detection.php b/lib/private/Files/Type/Detection.php index 5cb69eb674a00..35fec9c230f16 100644 --- a/lib/private/Files/Type/Detection.php +++ b/lib/private/Files/Type/Detection.php @@ -24,9 +24,9 @@ * @package OC\Files\Type */ class Detection implements IMimeTypeDetector { - private const CUSTOM_MIMETYPEMAPPING = 'mimetypemapping.json'; - private const CUSTOM_MIMETYPEALIASES = 'mimetypealiases.json'; - private const CUSTOM_MIMETYPENAMES = 'mimetypenames.json'; + private const string CUSTOM_MIMETYPEMAPPING = 'mimetypemapping.json'; + private const string CUSTOM_MIMETYPEALIASES = 'mimetypealiases.json'; + private const string CUSTOM_MIMETYPENAMES = 'mimetypenames.json'; /** @var array */ protected array $mimeTypes = []; diff --git a/lib/private/FilesMetadata/FilesMetadataManager.php b/lib/private/FilesMetadata/FilesMetadataManager.php index 8f7d0c369280f..223e91f0ac459 100644 --- a/lib/private/FilesMetadata/FilesMetadataManager.php +++ b/lib/private/FilesMetadata/FilesMetadataManager.php @@ -43,7 +43,7 @@ class FilesMetadataManager implements IFilesMetadataManager { public const CONFIG_KEY = 'files_metadata'; public const MIGRATION_DONE = 'files_metadata_installed'; - private const JSON_MAXSIZE = 100000; + private const int JSON_MAXSIZE = 100000; private ?IFilesMetadata $all = null; diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index 43f08333b2d8f..1f9749746aff9 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -53,7 +53,7 @@ class Manager extends PublicEmitter implements IGroupManager { private array $cachedUserGroups = []; private ?SubAdmin $subAdmin = null; private DisplayNameCache $displayNameCache; - private const MAX_GROUP_LENGTH = 255; + private const int MAX_GROUP_LENGTH = 255; public function __construct( private \OC\User\Manager $userManager, diff --git a/lib/private/Memcache/Redis.php b/lib/private/Memcache/Redis.php index d0304db50e6a9..b6d4efa4ede10 100644 --- a/lib/private/Memcache/Redis.php +++ b/lib/private/Memcache/Redis.php @@ -37,10 +37,10 @@ class Redis extends Cache implements IMemcacheTTL { ], ]; - private const MAX_TTL = 30 * 24 * 60 * 60; // 1 month + private const int MAX_TTL = 30 * 24 * 60 * 60; // 1 month /** Number of keys to request per SCAN iteration in {@see self::clear()} (only a hint to Redis) */ - private const SCAN_COUNT = 1000; + private const int SCAN_COUNT = 1000; private \Redis|\RedisCluster|null $cache = null; diff --git a/lib/private/Net/HostnameClassifier.php b/lib/private/Net/HostnameClassifier.php index 13acca326ddfc..3384d3d936ebf 100644 --- a/lib/private/Net/HostnameClassifier.php +++ b/lib/private/Net/HostnameClassifier.php @@ -21,7 +21,7 @@ * @internal */ class HostnameClassifier { - private const LOCAL_TOPLEVEL_DOMAINS = [ + private const array LOCAL_TOPLEVEL_DOMAINS = [ 'local', 'localhost', 'intranet', diff --git a/lib/private/Net/IpAddressClassifier.php b/lib/private/Net/IpAddressClassifier.php index d7563f3529961..5300d47be1d82 100644 --- a/lib/private/Net/IpAddressClassifier.php +++ b/lib/private/Net/IpAddressClassifier.php @@ -24,7 +24,7 @@ * @internal */ class IpAddressClassifier { - private const LOCAL_ADDRESS_RANGES = [ + private const array LOCAL_ADDRESS_RANGES = [ '100.64.0.0/10', // See RFC 6598 '192.0.0.0/24', // See RFC 6890 ]; diff --git a/lib/private/OCM/OCMDiscoveryService.php b/lib/private/OCM/OCMDiscoveryService.php index 58db2a1d0ed53..f2c914dd0394a 100644 --- a/lib/private/OCM/OCMDiscoveryService.php +++ b/lib/private/OCM/OCMDiscoveryService.php @@ -50,7 +50,7 @@ #[Consumable(since: '28.0.0')] final class OCMDiscoveryService implements IOCMDiscoveryService { private ICache $cache; - public const API_VERSION = '1.1.2'; + public const string API_VERSION = '1.1.2'; private ?IOCMProvider $localProvider = null; /** @var array */ private array $remoteProviders = []; diff --git a/lib/private/OCM/OCMSignatoryManager.php b/lib/private/OCM/OCMSignatoryManager.php index 250d5b8df0341..01c829fd901b7 100644 --- a/lib/private/OCM/OCMSignatoryManager.php +++ b/lib/private/OCM/OCMSignatoryManager.php @@ -50,22 +50,22 @@ class OCMSignatoryManager implements IJwkResolvingSignatoryManager { public const APPCONFIG_SIGN_IDENTITY_EXTERNAL = 'ocm_signed_request_identity_external'; public const APPCONFIG_SIGN_DISABLED = 'ocm_signed_request_disabled'; public const APPCONFIG_SIGN_ENFORCED = 'ocm_signed_request_enforced'; - private const APPKEY_CAVAGE = 'ocm_external'; - private const KEYID_FRAGMENT_CAVAGE = 'signature'; - private const KEYID_FRAGMENT_JWKS = 'ecdsa-p256-sha256'; + private const string APPKEY_CAVAGE = 'ocm_external'; + private const string KEYID_FRAGMENT_CAVAGE = 'signature'; + private const string KEYID_FRAGMENT_JWKS = 'ecdsa-p256-sha256'; /** JWKS-published keypairs live in numbered pool appkeys; slots point to them by id. */ - private const APPKEY_JWKS_POOL_PREFIX = 'ocm_jwks_pool_'; - private const APPCONFIG_JWKS_POOL_COUNTER = 'ocm_jwks_pool_counter'; - private const APPCONFIG_JWKS_POOL_KID_PREFIX = 'ocm_jwks_pool_kid_'; + private const string APPKEY_JWKS_POOL_PREFIX = 'ocm_jwks_pool_'; + private const string APPCONFIG_JWKS_POOL_COUNTER = 'ocm_jwks_pool_counter'; + private const string APPCONFIG_JWKS_POOL_KID_PREFIX = 'ocm_jwks_pool_kid_'; /** Stable kid identity portion, reused across rotations so kids stay on one hostname. */ - private const APPCONFIG_JWKS_KID_BASE = 'ocm_jwks_kid_base'; + private const string APPCONFIG_JWKS_KID_BASE = 'ocm_jwks_kid_base'; public const SLOT_ACTIVE = 'active'; public const SLOT_PENDING = 'pending'; public const SLOT_RETIRING = 'retiring'; /** All slots in advertise order. */ public const JWKS_SLOTS = [self::SLOT_ACTIVE, self::SLOT_PENDING, self::SLOT_RETIRING]; /** Remote JWKS cache TTL (seconds). */ - private const JWKS_CACHE_TTL = 3600; + private const int JWKS_CACHE_TTL = 3600; private readonly ICache $jwksCache; diff --git a/lib/private/OpenMetrics/ExporterManager.php b/lib/private/OpenMetrics/ExporterManager.php index 38984a173a4e6..8f82aa3040c96 100644 --- a/lib/private/OpenMetrics/ExporterManager.php +++ b/lib/private/OpenMetrics/ExporterManager.php @@ -27,7 +27,7 @@ class ExporterManager { private array $skippedClasses; - private const XML_ENTRY = 'openmetrics'; + private const string XML_ENTRY = 'openmetrics'; public function __construct( private IAppManager $appManager, diff --git a/lib/private/Preview/Db/PreviewMapper.php b/lib/private/Preview/Db/PreviewMapper.php index d747840d033df..8aac5f3488ec0 100644 --- a/lib/private/Preview/Db/PreviewMapper.php +++ b/lib/private/Preview/Db/PreviewMapper.php @@ -26,9 +26,9 @@ */ class PreviewMapper extends QBMapper { - private const TABLE_NAME = 'previews'; - private const LOCATION_TABLE_NAME = 'preview_locations'; - private const VERSION_TABLE_NAME = 'preview_versions'; + private const string TABLE_NAME = 'previews'; + private const string LOCATION_TABLE_NAME = 'preview_locations'; + private const string VERSION_TABLE_NAME = 'preview_versions'; public const MAX_CHUNK_SIZE = 1000; public function __construct( diff --git a/lib/private/Preview/Storage/LocalPreviewStorage.php b/lib/private/Preview/Storage/LocalPreviewStorage.php index 4d9d594089e40..e66ebae192d10 100644 --- a/lib/private/Preview/Storage/LocalPreviewStorage.php +++ b/lib/private/Preview/Storage/LocalPreviewStorage.php @@ -30,7 +30,7 @@ use RecursiveIteratorIterator; class LocalPreviewStorage implements IPreviewStorage { - private const SCAN_BATCH_SIZE = 1000; + private const int SCAN_BATCH_SIZE = 1000; public function __construct( private readonly IConfig $config, diff --git a/lib/private/Profile/ProfileManager.php b/lib/private/Profile/ProfileManager.php index df046aacc283d..91632073fb2e3 100644 --- a/lib/private/Profile/ProfileManager.php +++ b/lib/private/Profile/ProfileManager.php @@ -49,12 +49,12 @@ class ProfileManager implements IProfileManager { /** @var CappedMemoryCache */ private CappedMemoryCache $configCache; - private const CORE_APP_ID = 'core'; + private const string CORE_APP_ID = 'core'; /** * Array of account property actions */ - private const ACCOUNT_PROPERTY_ACTIONS = [ + private const array ACCOUNT_PROPERTY_ACTIONS = [ EmailAction::class, PhoneAction::class, WebsiteAction::class, @@ -66,7 +66,7 @@ class ProfileManager implements IProfileManager { /** * Array of account properties displayed on the profile */ - private const PROFILE_PROPERTIES = [ + private const array PROFILE_PROPERTIES = [ IAccountManager::PROPERTY_ADDRESS, IAccountManager::PROPERTY_AVATAR, IAccountManager::PROPERTY_BIOGRAPHY, diff --git a/lib/private/Repair/NC29/SanitizeAccountPropertiesJob.php b/lib/private/Repair/NC29/SanitizeAccountPropertiesJob.php index ee18cec81f0fb..73d589050cacc 100644 --- a/lib/private/Repair/NC29/SanitizeAccountPropertiesJob.php +++ b/lib/private/Repair/NC29/SanitizeAccountPropertiesJob.php @@ -19,7 +19,7 @@ class SanitizeAccountPropertiesJob extends QueuedJob { - private const PROPERTIES_TO_CHECK = [ + private const array PROPERTIES_TO_CHECK = [ IAccountManager::PROPERTY_PHONE, IAccountManager::PROPERTY_WEBSITE, IAccountManager::PROPERTY_TWITTER, diff --git a/lib/private/Search/FilterFactory.php b/lib/private/Search/FilterFactory.php index 791f54c7ebd32..b87fd8dc81e72 100644 --- a/lib/private/Search/FilterFactory.php +++ b/lib/private/Search/FilterFactory.php @@ -25,7 +25,7 @@ use RuntimeException; final class FilterFactory { - private const PERSON_TYPE_SEPARATOR = '/'; + private const string PERSON_TYPE_SEPARATOR = '/'; public static function get(string $type, string|array $filter): IFilter { return match ($type) { diff --git a/lib/private/Security/Bruteforce/Backend/DatabaseBackend.php b/lib/private/Security/Bruteforce/Backend/DatabaseBackend.php index fc3ed01c8a3b9..414db2aa3f227 100644 --- a/lib/private/Security/Bruteforce/Backend/DatabaseBackend.php +++ b/lib/private/Security/Bruteforce/Backend/DatabaseBackend.php @@ -12,7 +12,7 @@ use OCP\IDBConnection; class DatabaseBackend implements IBackend { - private const TABLE_NAME = 'bruteforce_attempts'; + private const string TABLE_NAME = 'bruteforce_attempts'; public function __construct( private IDBConnection $db, diff --git a/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php b/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php index 385ea2030fd40..3ff57e9454828 100644 --- a/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php +++ b/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php @@ -16,7 +16,7 @@ use OCP\IDBConnection; class DatabaseBackend implements IBackend { - private const TABLE_NAME = 'ratelimit_entries'; + private const string TABLE_NAME = 'ratelimit_entries'; public function __construct( private IConfig $config, diff --git a/lib/private/Security/Signature/Model/Rfc9421IncomingSignedRequest.php b/lib/private/Security/Signature/Model/Rfc9421IncomingSignedRequest.php index 89649d3bbe3a1..bc41bf4b1979d 100644 --- a/lib/private/Security/Signature/Model/Rfc9421IncomingSignedRequest.php +++ b/lib/private/Security/Signature/Model/Rfc9421IncomingSignedRequest.php @@ -55,7 +55,7 @@ class Rfc9421IncomingSignedRequest extends SignedRequest implements ]; /** Max clock skew (seconds) for `created`. Override via `rfc9421.maxClockSkew`. */ - private const DEFAULT_MAX_FUTURE_SKEW = 60; + private const int DEFAULT_MAX_FUTURE_SKEW = 60; private string $origin = ''; private string $label; diff --git a/lib/private/Security/Signature/Rfc9421/Algorithm.php b/lib/private/Security/Signature/Rfc9421/Algorithm.php index 3c79cd6721d75..b1da4776a16f9 100644 --- a/lib/private/Security/Signature/Rfc9421/Algorithm.php +++ b/lib/private/Security/Signature/Rfc9421/Algorithm.php @@ -34,7 +34,7 @@ * `alg` and the Signature-Input `alg` parameter (RFC 9421 §3.2 step 6). */ final class Algorithm { - public const NATIVE = [ + public const array NATIVE = [ 'rsa-v1_5-sha256', 'rsa-v1_5-sha384', 'rsa-v1_5-sha512', diff --git a/lib/private/Security/Signature/Rfc9421/ContentDigest.php b/lib/private/Security/Signature/Rfc9421/ContentDigest.php index 7df49f624d22f..3cee946c8e990 100644 --- a/lib/private/Security/Signature/Rfc9421/ContentDigest.php +++ b/lib/private/Security/Signature/Rfc9421/ContentDigest.php @@ -13,8 +13,8 @@ /** RFC 9530 `Content-Digest` helpers; covered by RFC 9421 §7.2.5 in OCM signatures. */ final class ContentDigest { - public const ALGO_SHA256 = 'sha-256'; - public const ALGO_SHA512 = 'sha-512'; + public const string ALGO_SHA256 = 'sha-256'; + public const string ALGO_SHA512 = 'sha-512'; public static function compute(string $body, string $algorithm = self::ALGO_SHA256): string { $hashAlgorithm = self::hashAlgorithmFor($algorithm); diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 7f598f7abc843..8033bd520998b 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -75,7 +75,7 @@ public function __construct( $this->l10n = $l10nFactory->get('lib'); } - private const DB_SETUP_CLASSES = [ + private const array DB_SETUP_CLASSES = [ 'mysql' => MySQL::class, 'pgsql' => PostgreSQL::class, 'oci' => OCI::class, diff --git a/lib/private/Snowflake/FileSequence.php b/lib/private/Snowflake/FileSequence.php index 55319932994d1..463dfd762e195 100644 --- a/lib/private/Snowflake/FileSequence.php +++ b/lib/private/Snowflake/FileSequence.php @@ -15,13 +15,13 @@ class FileSequence implements ISequence { /** Number of files to use */ - private const NB_FILES = 20; + private const int NB_FILES = 20; /** Lock file directory **/ public const LOCK_FILE_DIRECTORY = 'sfi_file_sequence'; /** Lock filename format **/ - private const LOCK_FILE_FORMAT = 'seq-%03d.lock'; + private const string LOCK_FILE_FORMAT = 'seq-%03d.lock'; /** Delete sequences after SEQUENCE_TTL seconds **/ - private const SEQUENCE_TTL = 30; + private const int SEQUENCE_TTL = 30; private string $workDir; diff --git a/lib/private/Streamer.php b/lib/private/Streamer.php index 887b082a621cc..c1ff73932c09f 100644 --- a/lib/private/Streamer.php +++ b/lib/private/Streamer.php @@ -24,7 +24,7 @@ class Streamer { // array of regexp. Matching user agents will get tar instead of zip - private const UA_PREFERS_TAR = [ '/macintosh|mac os x/i' ]; + private const array UA_PREFERS_TAR = [ '/macintosh|mac os x/i' ]; // streamer instance private $streamerInstance; diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index 27c5bac611416..a4c3688f04682 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -124,8 +124,8 @@ class Manager implements IManager { public const MAX_TASK_AGE_SECONDS = 60 * 60 * 24 * 31 * 6; // 6 months - private const TASK_TYPES_CACHE_KEY = 'available_task_types_v3'; - private const TASK_TYPE_IDS_CACHE_KEY = 'available_task_type_ids'; + private const string TASK_TYPES_CACHE_KEY = 'available_task_types_v3'; + private const string TASK_TYPE_IDS_CACHE_KEY = 'available_task_type_ids'; /** @var list|null */ private ?array $providers = null; diff --git a/lib/private/TextProcessing/Manager.php b/lib/private/TextProcessing/Manager.php index 0d11361d6e5dc..113ece98b7415 100644 --- a/lib/private/TextProcessing/Manager.php +++ b/lib/private/TextProcessing/Manager.php @@ -47,7 +47,7 @@ class Manager implements IManager { /** * @var array */ - private const COMPATIBLE_TASK_TYPES = [ + private const array COMPATIBLE_TASK_TYPES = [ FreePromptTaskType::class => TextToText::ID, HeadlineTaskType::class => TextToTextHeadline::ID, SummaryTaskType::class => TextToTextSummary::ID, diff --git a/lib/private/User/DisplayNameCache.php b/lib/private/User/DisplayNameCache.php index 374e8faf5758d..6ff50feaae636 100644 --- a/lib/private/User/DisplayNameCache.php +++ b/lib/private/User/DisplayNameCache.php @@ -26,7 +26,7 @@ * @template-implements IEventListener */ class DisplayNameCache implements IEventListener { - private const CACHE_TTL = 24 * 60 * 60; // 1 day + private const int CACHE_TTL = 24 * 60 * 60; // 1 day private array $cache = []; private ICache $memCache; diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 7c8e5377e2bf4..e3424211e0ced 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -48,7 +48,7 @@ use Psr\Log\LoggerInterface; class User implements IUser { - private const CONFIG_KEY_MANAGERS = 'manager'; + private const string CONFIG_KEY_MANAGERS = 'manager'; private IConfig $config; private IUserConfig $userConfig; diff --git a/tests/lib/AppFramework/Services/AppConfigTest.php b/tests/lib/AppFramework/Services/AppConfigTest.php index e75b9acaec423..95313322fc2d4 100644 --- a/tests/lib/AppFramework/Services/AppConfigTest.php +++ b/tests/lib/AppFramework/Services/AppConfigTest.php @@ -22,7 +22,7 @@ class AppConfigTest extends TestCase { private IAppConfigCore|MockObject $appConfigCore; private AppConfig $appConfig; - private const TEST_APPID = 'appconfig-test'; + private const string TEST_APPID = 'appconfig-test'; #[\Override] protected function setUp(): void { diff --git a/tests/lib/Avatar/RemoteAvatarTest.php b/tests/lib/Avatar/RemoteAvatarTest.php index 788ef035753eb..fb008746fb183 100644 --- a/tests/lib/Avatar/RemoteAvatarTest.php +++ b/tests/lib/Avatar/RemoteAvatarTest.php @@ -23,7 +23,7 @@ use Test\TestCase; class RemoteAvatarTest extends TestCase { - private const CLOUD_ID = 'user@https://remote.example.com'; + private const string CLOUD_ID = 'user@https://remote.example.com'; private ISimpleFolder&MockObject $folder; private IConfig&MockObject $config; diff --git a/tests/lib/OCM/OCMSignatoryManagerJwksTest.php b/tests/lib/OCM/OCMSignatoryManagerJwksTest.php index 8b0b1aa32cae7..2f8e27bf8f410 100644 --- a/tests/lib/OCM/OCMSignatoryManagerJwksTest.php +++ b/tests/lib/OCM/OCMSignatoryManagerJwksTest.php @@ -29,12 +29,12 @@ class OCMSignatoryManagerJwksTest extends TestCase { /** RFC 7517 §A.1 test vector for an EC P-256 public key. */ - private const TEST_X = 'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU'; - private const TEST_Y = 'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0'; + private const string TEST_X = 'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU'; + private const string TEST_Y = 'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0'; /** RFC 8037 §A.2 test vector for an Ed25519 public key. */ - private const TEST_OKP_X = '11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo'; + private const string TEST_OKP_X = '11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo'; - private const JWKS_URI = 'https://sender.example.org/ocm/jwks'; + private const string JWKS_URI = 'https://sender.example.org/ocm/jwks'; private IAppConfig&MockObject $appConfig; private ISignatureManager&MockObject $signatureManager; diff --git a/tests/lib/Preview/Storage/LocalPreviewStorageTest.php b/tests/lib/Preview/Storage/LocalPreviewStorageTest.php index 14e6419a9d538..c532a1575e86d 100644 --- a/tests/lib/Preview/Storage/LocalPreviewStorageTest.php +++ b/tests/lib/Preview/Storage/LocalPreviewStorageTest.php @@ -39,7 +39,7 @@ class LocalPreviewStorageTest extends TestCase { private LocalPreviewStorage $storage; /** File ID used across the single-file tests. */ - private const FILE_ID = 1; + private const int FILE_ID = 1; #[\Override] protected function setUp(): void {