From 832f79ac9388addeb2b22479c6da1ac46eea205c Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 27 Apr 2025 14:38:18 +0200 Subject: [PATCH] chore: apply code style Signed-off-by: Ferdinand Thiessen --- apps/admin_audit/lib/Actions/Files.php | 16 +- .../cloud_federation_api/lib/Capabilities.php | 4 +- apps/cloud_federation_api/lib/Config.php | 1 + .../Controller/RequestHandlerController.php | 15 +- apps/comments/lib/Activity/Filter.php | 1 + apps/comments/lib/Activity/Listener.php | 6 +- apps/comments/lib/Activity/Provider.php | 1 + apps/comments/lib/Activity/Setting.php | 1 + apps/comments/lib/AppInfo/Application.php | 1 + .../lib/Collaboration/CommentersSorter.php | 1 + .../Controller/NotificationsController.php | 3 +- .../Listener/CommentsEntityEventListener.php | 2 +- .../MaxAutoCompleteResultsInitialState.php | 2 +- apps/comments/lib/Notification/Notifier.php | 2 +- apps/comments/lib/Search/Result.php | 1 + .../tests/Unit/Activity/ListenerTest.php | 1 + .../Collaboration/CommentersSorterTest.php | 5 +- apps/comments/tests/Unit/EventHandlerTest.php | 3 +- .../tests/Unit/Notification/ListenerTest.php | 2 +- .../tests/Unit/Notification/NotifierTest.php | 1 + apps/contactsinteraction/lib/AddressBook.php | 12 +- .../lib/Db/CardSearchDao.php | 2 +- .../lib/Db/RecentContactMapper.php | 2 +- .../Listeners/ContactInteractionListener.php | 4 +- apps/dav/appinfo/routes.php | 1 + apps/dav/lib/Avatars/AvatarHome.php | 2 +- apps/dav/lib/Avatars/AvatarNode.php | 2 +- apps/dav/lib/Avatars/RootCollection.php | 1 + .../CleanupInvitationTokenJob.php | 2 +- .../DeleteOutdatedSchedulingObjects.php | 2 +- .../OutOfOfficeEventDispatcherJob.php | 2 +- apps/dav/lib/BackgroundJob/UploadCleanup.php | 4 +- .../BackgroundJob/UserStatusAutomation.php | 14 +- apps/dav/lib/BulkUpload/BulkUploadPlugin.php | 15 +- .../lib/BulkUpload/MultipartRequestParser.php | 27 +- apps/dav/lib/CalDAV/Activity/Backend.php | 1 + .../lib/CalDAV/Activity/Filter/Calendar.php | 5 +- apps/dav/lib/CalDAV/Activity/Filter/Todo.php | 5 +- .../dav/lib/CalDAV/Activity/Provider/Base.php | 7 +- .../lib/CalDAV/Activity/Provider/Calendar.php | 1 + .../lib/CalDAV/Activity/Provider/Event.php | 1 + .../dav/lib/CalDAV/Activity/Provider/Todo.php | 1 + .../lib/CalDAV/Activity/Setting/Calendar.php | 5 +- .../dav/lib/CalDAV/Activity/Setting/Event.php | 5 +- apps/dav/lib/CalDAV/Activity/Setting/Todo.php | 5 +- .../lib/CalDAV/AppCalendar/AppCalendar.php | 2 +- .../lib/CalDAV/AppCalendar/CalendarObject.php | 6 +- .../CalDAV/BirthdayCalendar/EnablePlugin.php | 3 +- apps/dav/lib/CalDAV/BirthdayService.php | 10 +- .../dav/lib/CalDAV/CachedSubscriptionImpl.php | 2 +- apps/dav/lib/CalDAV/CalDavBackend.php | 113 +- apps/dav/lib/CalDAV/CalendarHome.php | 4 +- apps/dav/lib/CalDAV/CalendarImpl.php | 6 +- apps/dav/lib/CalDAV/CalendarManager.php | 1 + apps/dav/lib/CalDAV/CalendarObject.php | 3 +- .../dav/lib/CalDAV/EventComparisonService.php | 14 +- apps/dav/lib/CalDAV/EventReader.php | 22 +- apps/dav/lib/CalDAV/EventReaderRDate.php | 6 +- apps/dav/lib/CalDAV/EventReaderRRule.php | 6 +- .../ICSExportPlugin/ICSExportPlugin.php | 1 + .../CalDAV/Integration/ExternalCalendar.php | 1 + .../CalDAV/Integration/ICalendarProvider.php | 1 + .../InvitationResponseServer.php | 1 + apps/dav/lib/CalDAV/Outbox.php | 1 + apps/dav/lib/CalDAV/Principal/Collection.php | 1 + apps/dav/lib/CalDAV/Principal/User.php | 1 + apps/dav/lib/CalDAV/PublicCalendar.php | 1 + apps/dav/lib/CalDAV/PublicCalendarObject.php | 1 + .../lib/CalDAV/Publishing/PublishPlugin.php | 1 + .../lib/CalDAV/Publishing/Xml/Publisher.php | 1 + .../NotificationProvider/EmailProvider.php | 10 +- apps/dav/lib/CalDAV/Reminder/Notifier.php | 8 +- .../lib/CalDAV/Reminder/ReminderService.php | 2 +- .../AbstractPrincipalBackend.php | 3 +- .../ResourcePrincipalBackend.php | 1 + .../ResourceBooking/RoomPrincipalBackend.php | 1 + apps/dav/lib/CalDAV/Schedule/IMipPlugin.php | 10 +- apps/dav/lib/CalDAV/Schedule/IMipService.php | 42 +- apps/dav/lib/CalDAV/Search/SearchPlugin.php | 1 + .../CalDAV/Search/Xml/Filter/CompFilter.php | 1 + .../CalDAV/Search/Xml/Filter/LimitFilter.php | 3 +- .../CalDAV/Search/Xml/Filter/OffsetFilter.php | 3 +- .../CalDAV/Search/Xml/Filter/ParamFilter.php | 1 + .../CalDAV/Search/Xml/Filter/PropFilter.php | 1 + .../Search/Xml/Filter/SearchTermFilter.php | 1 + .../Xml/Request/CalendarSearchReport.php | 1 + apps/dav/lib/CalDAV/Status/StatusService.php | 20 +- apps/dav/lib/CalDAV/WebcalCaching/Plugin.php | 6 +- .../WebcalCaching/RefreshWebcalService.php | 10 +- apps/dav/lib/Capabilities.php | 1 + apps/dav/lib/CardDAV/Activity/Filter.php | 5 +- .../lib/CardDAV/Activity/Provider/Base.php | 6 +- apps/dav/lib/CardDAV/Activity/Setting.php | 4 +- apps/dav/lib/CardDAV/AddressBook.php | 2 +- apps/dav/lib/CardDAV/AddressBookImpl.php | 36 +- apps/dav/lib/CardDAV/Card.php | 2 +- apps/dav/lib/CardDAV/CardDavBackend.php | 32 +- apps/dav/lib/CardDAV/ContactsManager.php | 8 +- apps/dav/lib/CardDAV/ImageExportPlugin.php | 2 +- apps/dav/lib/CardDAV/PhotoCache.php | 3 +- apps/dav/lib/CardDAV/SyncService.php | 4 +- apps/dav/lib/CardDAV/SystemAddressbook.php | 4 +- apps/dav/lib/CardDAV/UserAddressBooks.php | 2 +- apps/dav/lib/Command/CreateAddressBook.php | 16 +- apps/dav/lib/Command/DeleteCalendar.php | 4 +- .../lib/Command/FixCalendarSyncCommand.php | 2 +- apps/dav/lib/Command/ListCalendars.php | 1 + apps/dav/lib/Command/MoveCalendar.php | 11 +- apps/dav/lib/Command/SendEventReminders.php | 1 + apps/dav/lib/Command/SyncBirthdayCalendar.php | 2 +- apps/dav/lib/Comments/CommentNode.php | 2 +- apps/dav/lib/Comments/CommentsPlugin.php | 6 +- apps/dav/lib/Comments/EntityCollection.php | 2 +- .../Sabre/AnonymousOptionsPlugin.php | 1 + .../lib/Connector/Sabre/AppleQuirksPlugin.php | 5 +- apps/dav/lib/Connector/Sabre/BearerAuth.php | 1 + apps/dav/lib/Connector/Sabre/CachingTree.php | 1 + .../Connector/Sabre/ChecksumUpdatePlugin.php | 2 +- .../Sabre/CommentPropertiesPlugin.php | 12 +- apps/dav/lib/Connector/Sabre/DavAclPlugin.php | 2 +- apps/dav/lib/Connector/Sabre/Directory.php | 8 +- .../Connector/Sabre/Exception/BadGateway.php | 1 + .../Connector/Sabre/Exception/FileLocked.php | 2 +- apps/dav/lib/Connector/Sabre/File.php | 2 +- apps/dav/lib/Connector/Sabre/FilesPlugin.php | 2 +- .../lib/Connector/Sabre/FilesReportPlugin.php | 8 +- .../lib/Connector/Sabre/MtimeSanitizer.php | 5 +- apps/dav/lib/Connector/Sabre/Node.php | 4 +- apps/dav/lib/Connector/Sabre/ObjectTree.php | 4 +- apps/dav/lib/Connector/Sabre/Principal.php | 3 +- apps/dav/lib/Connector/Sabre/QuotaPlugin.php | 2 +- apps/dav/lib/Connector/Sabre/Server.php | 2 +- .../dav/lib/Connector/Sabre/ShareTypeList.php | 2 +- apps/dav/lib/Connector/Sabre/TagsPlugin.php | 8 +- .../Controller/BirthdayCalendarController.php | 1 + apps/dav/lib/DAV/CustomPropertiesBackend.php | 1 + apps/dav/lib/DAV/GroupPrincipalBackend.php | 1 + apps/dav/lib/DAV/PublicAuth.php | 4 +- apps/dav/lib/DAV/Sharing/Backend.php | 28 +- apps/dav/lib/DAV/ViewOnlyPlugin.php | 2 +- apps/dav/lib/Db/Absence.php | 4 +- apps/dav/lib/Direct/DirectFile.php | 2 +- apps/dav/lib/Events/CalendarDeletedEvent.php | 2 +- .../lib/Events/CalendarMovedToTrashEvent.php | 2 +- apps/dav/lib/Events/CalendarRestoredEvent.php | 2 +- ...UnsupportedLimitOnInitialSyncException.php | 1 + apps/dav/lib/Files/BrowserErrorPagePlugin.php | 2 +- apps/dav/lib/Files/FileSearchBackend.php | 5 +- apps/dav/lib/Files/LazySearchBackend.php | 1 + .../dav/lib/Files/Sharing/FilesDropPlugin.php | 1 + .../Listener/CalendarShareUpdateListener.php | 2 +- .../dav/lib/Listener/SubscriptionListener.php | 4 +- .../Migration/BuildCalendarSearchIndex.php | 1 + .../lib/Migration/BuildSocialSearchIndex.php | 3 +- .../BuildSocialSearchIndexBackgroundJob.php | 2 +- .../lib/Migration/CalDAVRemoveEmptyValue.php | 7 +- .../FixBirthdayCalendarComponent.php | 1 + .../Migration/RegenerateBirthdayCalendars.php | 1 + ...emoveDeletedUsersCalendarSubscriptions.php | 2 +- .../lib/Migration/RemoveObjectProperties.php | 1 + .../Version1004Date20170825134824.php | 1 + .../Version1004Date20170919104507.php | 1 + .../Version1004Date20170924124212.php | 1 + .../Version1004Date20170926103422.php | 3 +- .../Version1005Date20180530124431.php | 1 + .../Version1006Date20180619154313.php | 1 + .../Version1027Date20230504122946.php | 2 +- .../Version1029Date20221114151721.php | 2 +- .../Apple/AppleProvisioningNode.php | 1 + .../Apple/AppleProvisioningPlugin.php | 1 + .../dav/lib/Search/ContactsSearchProvider.php | 10 +- apps/dav/lib/Search/EventsSearchProvider.php | 4 +- apps/dav/lib/Search/TasksSearchProvider.php | 2 +- apps/dav/lib/Server.php | 1 + apps/dav/lib/Settings/CalDAVSettings.php | 1 + apps/dav/lib/SystemTag/SystemTagList.php | 1 + apps/dav/lib/SystemTag/SystemTagPlugin.php | 4 +- .../SystemTag/SystemTagsInUseCollection.php | 2 +- .../SystemTagsRelationsCollection.php | 4 +- apps/dav/lib/Traits/PrincipalProxyTrait.php | 1 + apps/dav/lib/Upload/ChunkingPlugin.php | 2 +- apps/dav/lib/Upload/ChunkingV2Plugin.php | 8 +- apps/dav/lib/Upload/UploadFile.php | 2 +- .../lib/UserMigration/ContactsMigrator.php | 2 +- .../tests/unit/AppInfo/PluginManagerTest.php | 1 + .../PruneOutdatedSyncTokensJobTest.php | 2 +- .../unit/CalDAV/Activity/BackendTest.php | 1 + .../CalDAV/Activity/Filter/CalendarTest.php | 1 + .../CalDAV/Activity/Filter/GenericTest.php | 1 + .../unit/CalDAV/Activity/Filter/TodoTest.php | 1 + .../CalDAV/Activity/Provider/BaseTest.php | 1 + .../CalDAV/Activity/Provider/EventTest.php | 1 + .../CalDAV/Activity/Setting/GenericTest.php | 1 + .../CalDAV/AppCalendar/CalendarObjectTest.php | 4 +- .../BirthdayCalendar/EnablePluginTest.php | 3 +- .../CalDAV/CachedSubscriptionObjectTest.php | 1 + .../unit/CalDAV/CachedSubscriptionTest.php | 1 + .../tests/unit/CalDAV/CalDavBackendTest.php | 3 +- .../tests/unit/CalDAV/CalendarHomeTest.php | 1 + .../tests/unit/CalDAV/CalendarImplTest.php | 7 +- .../tests/unit/CalDAV/CalendarManagerTest.php | 1 + apps/dav/tests/unit/CalDAV/CalendarTest.php | 5 +- .../dav/tests/unit/CalDAV/EventReaderTest.php | 14 +- .../Integration/ExternalCalendarTest.php | 1 + .../CalendarPublicationListenerTest.php | 1 + .../CalendarShareUpdateListenerTest.php | 1 + .../Listener/SubscriptionListenerTest.php | 1 + apps/dav/tests/unit/CalDAV/OutboxTest.php | 1 + apps/dav/tests/unit/CalDAV/PluginTest.php | 1 + .../unit/CalDAV/PublicCalendarRootTest.php | 1 + .../tests/unit/CalDAV/PublicCalendarTest.php | 5 +- .../unit/CalDAV/Publishing/PublisherTest.php | 1 + .../unit/CalDAV/Publishing/PublishingTest.php | 1 + .../unit/CalDAV/Reminder/BackendTest.php | 2 +- .../unit/CalDAV/Reminder/NotifierTest.php | 2 +- .../CalDAV/Reminder/ReminderServiceTest.php | 4 +- .../AbstractPrincipalBackendTest.php | 1 + .../ResourcePrincipalBackendTest.php | 1 + .../RoomPrincipalBackendTest.php | 1 + .../unit/CalDAV/Schedule/IMipPluginTest.php | 1 + .../unit/CalDAV/Schedule/IMipServiceTest.php | 14 +- .../tests/unit/CalDAV/Schedule/PluginTest.php | 10 +- .../Request/CalendarSearchReportTest.php | 1 + .../unit/CalDAV/Search/SearchPluginTest.php | 1 + .../unit/CalDAV/Status/StatusServiceTest.php | 1 + .../tests/unit/CalDAV/TimezoneServiceTest.php | 1 + apps/dav/tests/unit/CalDAV/TipBrokerTest.php | 1 + .../CalDAV/WebcalCaching/ConnectionTest.php | 2 +- .../unit/CalDAV/WebcalCaching/PluginTest.php | 1 + .../RefreshWebcalServiceTest.php | 10 +- apps/dav/tests/unit/CapabilitiesTest.php | 1 + .../unit/CardDAV/Activity/BackendTest.php | 1 + .../unit/CardDAV/AddressBookImplTest.php | 12 +- .../tests/unit/CardDAV/CardDavBackendTest.php | 90 +- apps/dav/tests/unit/CardDAV/ConverterTest.php | 14 +- .../unit/CardDAV/SystemAddressBookTest.php | 12 +- .../tests/unit/Command/ListCalendarsTest.php | 5 +- .../tests/unit/Command/MoveCalendarTest.php | 25 +- .../tests/unit/Comments/CommentsNodeTest.php | 2 +- .../unit/Comments/CommentsPluginTest.php | 2 +- .../tests/unit/Connector/Sabre/AuthTest.php | 8 +- .../unit/Connector/Sabre/BearerAuthTest.php | 1 + .../Sabre/CommentsPropertiesPluginTest.php | 2 +- .../unit/Connector/Sabre/DirectoryTest.php | 4 +- .../Sabre/Exception/ForbiddenTest.php | 2 +- .../Sabre/Exception/InvalidPathTest.php | 2 +- .../Connector/Sabre/FakeLockerPluginTest.php | 8 +- .../tests/unit/Connector/Sabre/FileTest.php | 50 +- .../unit/Connector/Sabre/FilesPluginTest.php | 8 +- .../Connector/Sabre/MaintenancePluginTest.php | 2 +- .../unit/Connector/Sabre/ObjectTreeTest.php | 4 +- .../unit/Connector/Sabre/PrincipalTest.php | 61 +- .../unit/Connector/Sabre/RequestTest/Auth.php | 2 +- .../BirthdayCalendarControllerTest.php | 1 + .../InvitationResponseControllerTest.php | 2 +- .../tests/unit/DAV/AnonymousOptionsTest.php | 1 + .../unit/DAV/CustomPropertiesBackendTest.php | 6 +- .../dav/tests/unit/DAV/GroupPrincipalTest.php | 1 + .../tests/unit/DAV/Sharing/BackendTest.php | 8 +- .../dav/tests/unit/DAV/ViewOnlyPluginTest.php | 12 +- .../unit/Files/FileSearchBackendTest.php | 1 + .../unit/Files/MultipartRequestParserTest.php | 39 +- .../Files/Sharing/FilesDropPluginTest.php | 1 + .../Migration/CalDAVRemoveEmptyValueTest.php | 1 + .../RefreshWebcalJobRegistrarTest.php | 1 + .../RegenerateBirthdayCalendarsTest.php | 1 + .../Apple/AppleProvisioningNodeTest.php | 1 + .../Apple/AppleProvisioningPluginTest.php | 1 + .../unit/Settings/CalDAVSettingsTest.php | 17 +- .../unit/SystemTag/SystemTagPluginTest.php | 32 +- .../SystemTagsObjectTypeCollectionTest.php | 2 +- .../tests/unit/Upload/AssemblyStreamTest.php | 4 +- .../lib/Command/DisableMasterKey.php | 3 +- .../lib/Command/EnableMasterKey.php | 2 +- .../lib/Command/FixEncryptedVersion.php | 16 +- .../encryption/lib/Command/FixKeyLocation.php | 46 +- apps/encryption/lib/Command/RecoverUser.php | 3 +- .../lib/Command/ScanLegacyFormat.php | 2 +- .../lib/Controller/SettingsController.php | 4 +- apps/encryption/lib/Crypto/Crypt.php | 6 +- apps/encryption/lib/Crypto/DecryptAll.php | 10 +- apps/encryption/lib/Crypto/EncryptAll.php | 16 +- apps/encryption/lib/Crypto/Encryption.php | 8 +- .../Exceptions/PrivateKeyMissingException.php | 2 +- .../Exceptions/PublicKeyMissingException.php | 2 +- apps/encryption/lib/HookManager.php | 2 +- apps/encryption/lib/KeyManager.php | 6 +- .../lib/Migration/SetMasterKeyStatus.php | 3 +- apps/encryption/lib/Settings/Admin.php | 5 +- apps/encryption/lib/Settings/Personal.php | 5 +- apps/encryption/templates/settings-admin.php | 30 +- .../templates/settings-personal.php | 32 +- .../tests/Command/FixEncryptedVersionTest.php | 22 +- .../tests/Command/TestEnableMasterKey.php | 10 +- .../tests/Controller/StatusControllerTest.php | 4 +- apps/encryption/tests/Crypto/CryptTest.php | 6 +- .../tests/Crypto/DecryptAllTest.php | 12 +- .../tests/Crypto/EncryptAllTest.php | 40 +- .../encryption/tests/EncryptedStorageTest.php | 30 +- apps/encryption/tests/SessionTest.php | 6 +- apps/encryption/tests/Settings/AdminTest.php | 1 + apps/federatedfilesharing/appinfo/routes.php | 1 + .../lib/BackgroundJob/RetryJob.php | 6 +- .../Controller/MountPublicLinkController.php | 5 +- .../Controller/RequestHandlerController.php | 4 +- .../lib/FederatedShareProvider.php | 34 +- .../lib/Notifications.php | 4 +- .../lib/OCM/CloudFederationProviderFiles.php | 19 +- .../lib/Settings/Admin.php | 5 +- .../lib/Settings/Personal.php | 4 +- .../lib/Settings/PersonalSection.php | 5 +- .../tests/AddressHandlerTest.php | 6 +- .../MountPublicLinkControllerTest.php | 1 + .../RequestHandlerControllerTest.php | 12 +- .../tests/FederatedShareProviderTest.php | 8 +- .../tests/NotificationsTest.php | 2 +- .../tests/Settings/AdminTest.php | 1 + apps/federatedfilesharing/tests/TestCase.php | 4 +- .../tests/TokenHandlerTest.php | 4 +- .../lib/BackgroundJob/GetSharedSecret.php | 2 +- .../lib/BackgroundJob/RequestSharedSecret.php | 4 +- apps/federation/lib/DbHandler.php | 14 +- apps/federation/lib/Settings/Admin.php | 7 +- .../lib/SyncFederationAddressBooks.php | 2 +- apps/federation/templates/settings-admin.php | 6 +- .../BackgroundJob/GetSharedSecretTest.php | 4 +- .../BackgroundJob/RequestSharedSecretTest.php | 2 +- .../Controller/OCSAuthAPIControllerTest.php | 2 +- apps/federation/tests/DbHandlerTest.php | 24 +- .../Middleware/AddServerMiddlewareTest.php | 4 +- apps/federation/tests/Settings/AdminTest.php | 1 + .../tests/SyncFederationAddressbooksTest.php | 4 +- apps/federation/tests/TrustedServersTest.php | 24 +- apps/files/ajax/download.php | 4 +- apps/files/lib/Activity/FavoriteProvider.php | 1 + apps/files/lib/Activity/Filter/Favorites.php | 1 + .../files/lib/Activity/Filter/FileChanges.php | 1 + apps/files/lib/Activity/Provider.php | 1 + .../lib/Activity/Settings/FavoriteAction.php | 5 +- .../lib/Activity/Settings/FileChanged.php | 5 +- .../Activity/Settings/FileFavoriteChanged.php | 5 +- apps/files/lib/App.php | 2 +- .../lib/BackgroundJob/TransferOwnership.php | 8 +- apps/files/lib/Command/Copy.php | 8 +- apps/files/lib/Command/Delete.php | 24 +- apps/files/lib/Command/Get.php | 6 +- apps/files/lib/Command/Move.php | 6 +- apps/files/lib/Command/Object/Delete.php | 6 +- apps/files/lib/Command/Object/Get.php | 6 +- apps/files/lib/Command/Object/ObjectUtil.php | 12 +- apps/files/lib/Command/Object/Put.php | 12 +- apps/files/lib/Command/Put.php | 4 +- apps/files/lib/Command/RepairTree.php | 6 +- apps/files/lib/Command/Scan.php | 4 +- apps/files/lib/Command/ScanAppData.php | 5 +- apps/files/lib/Command/TransferOwnership.php | 8 +- apps/files/lib/Controller/ApiController.php | 4 +- .../Controller/DirectEditingController.php | 1 + .../DirectEditingViewController.php | 1 + .../TransferOwnershipController.php | 6 +- apps/files/lib/Controller/ViewController.php | 8 +- .../lib/Listener/SyncLivePhotosListener.php | 8 +- apps/files/lib/Notification/Notifier.php | 4 +- apps/files/lib/Search/FilesSearchProvider.php | 2 +- .../lib/Service/DirectEditingService.php | 1 + apps/files/lib/Service/LivePhotosService.php | 2 +- .../lib/Service/OwnershipTransferService.php | 14 +- apps/files/lib/Service/TagService.php | 2 +- apps/files/lib/Service/UserConfig.php | 1 + apps/files/lib/Service/ViewConfig.php | 1 + apps/files/templates/index.php | 1 + .../tests/Activity/Filter/GenericTest.php | 1 + apps/files/tests/Activity/ProviderTest.php | 1 + .../tests/Activity/Setting/GenericTest.php | 1 + apps/files_external/ajax/applicable.php | 7 +- apps/files_external/ajax/oauth2.php | 1 + apps/files_external/appinfo/routes.php | 1 + .../lib/AppInfo/Application.php | 1 + .../files_external/lib/Command/Applicable.php | 1 + apps/files_external/lib/Command/Backends.php | 1 + apps/files_external/lib/Command/Config.php | 3 +- apps/files_external/lib/Command/Create.php | 5 +- apps/files_external/lib/Command/Delete.php | 1 + apps/files_external/lib/Command/Export.php | 1 + apps/files_external/lib/Command/Import.php | 3 +- .../lib/Command/ListCommand.php | 7 +- apps/files_external/lib/Command/Notify.php | 8 +- apps/files_external/lib/Command/Option.php | 3 +- .../lib/Command/StorageAuthBase.php | 6 +- apps/files_external/lib/Command/Verify.php | 1 + .../lib/Config/ConfigAdapter.php | 1 + .../lib/Config/ExternalMountPoint.php | 1 + .../lib/Config/IConfigHandler.php | 1 + .../lib/Config/SimpleSubstitutionTrait.php | 3 +- .../files_external/lib/Config/UserContext.php | 1 + .../lib/Config/UserPlaceholderHandler.php | 1 + .../lib/Controller/AjaxController.php | 3 +- .../Controller/GlobalStoragesController.php | 1 + .../lib/Controller/StoragesController.php | 5 +- .../UserGlobalStoragesController.php | 1 + .../lib/Controller/UserStoragesController.php | 1 + .../lib/Lib/Auth/AmazonS3/AccessKey.php | 1 + .../lib/Lib/Auth/AuthMechanism.php | 1 + apps/files_external/lib/Lib/Auth/Builtin.php | 1 + .../lib/Lib/Auth/IUserProvided.php | 1 + .../lib/Lib/Auth/InvalidAuth.php | 1 + .../lib/Lib/Auth/NullMechanism.php | 1 + .../lib/Lib/Auth/OAuth1/OAuth1.php | 1 + .../lib/Lib/Auth/OAuth2/OAuth2.php | 1 + .../lib/Lib/Auth/OpenStack/OpenStackV2.php | 1 + .../lib/Lib/Auth/OpenStack/Rackspace.php | 1 + .../lib/Lib/Auth/Password/GlobalAuth.php | 1 + .../Lib/Auth/Password/LoginCredentials.php | 3 +- .../lib/Lib/Auth/Password/Password.php | 1 + .../Lib/Auth/Password/SessionCredentials.php | 1 + .../lib/Lib/Auth/Password/UserProvided.php | 1 + .../lib/Lib/Auth/PublicKey/RSA.php | 1 + .../lib/Lib/Auth/PublicKey/RSAPrivateKey.php | 1 + .../lib/Lib/Auth/SMB/KerberosAuth.php | 1 + .../lib/Lib/Backend/AmazonS3.php | 1 + .../lib/Lib/Backend/Backend.php | 1 + apps/files_external/lib/Lib/Backend/DAV.php | 1 + apps/files_external/lib/Lib/Backend/FTP.php | 1 + .../lib/Lib/Backend/InvalidBackend.php | 1 + .../lib/Lib/Backend/LegacyBackend.php | 1 + apps/files_external/lib/Lib/Backend/Local.php | 1 + .../lib/Lib/Backend/OwnCloud.php | 1 + apps/files_external/lib/Lib/Backend/SFTP.php | 1 + .../lib/Lib/Backend/SFTP_Key.php | 1 + apps/files_external/lib/Lib/Backend/SMB.php | 1 + .../files_external/lib/Lib/Backend/SMB_OC.php | 1 + apps/files_external/lib/Lib/Backend/Swift.php | 1 + .../lib/Lib/Config/IAuthMechanismProvider.php | 1 + .../lib/Lib/Config/IBackendProvider.php | 1 + .../lib/Lib/DefinitionParameter.php | 3 +- .../lib/Lib/DependencyTrait.php | 1 + .../lib/Lib/FrontendDefinitionTrait.php | 3 +- .../lib/Lib/IFrontendDefinition.php | 1 + apps/files_external/lib/Lib/IIdentifier.php | 1 + .../lib/Lib/IdentifierTrait.php | 1 + ...icientDataForMeaningfulAnswerException.php | 1 + .../lib/Lib/LegacyDependencyCheckPolyfill.php | 1 + .../lib/Lib/MissingDependency.php | 1 + .../lib/Lib/Notify/SMBNotifyHandler.php | 1 + apps/files_external/lib/Lib/PersonalMount.php | 1 + apps/files_external/lib/Lib/PriorityTrait.php | 1 + .../lib/Lib/SessionStorageWrapper.php | 1 + .../lib/Lib/Storage/AmazonS3.php | 13 +- apps/files_external/lib/Lib/Storage/FTP.php | 9 +- .../lib/Lib/Storage/FtpConnection.php | 18 +- .../lib/Lib/Storage/OwnCloud.php | 5 +- apps/files_external/lib/Lib/Storage/SFTP.php | 13 +- apps/files_external/lib/Lib/Storage/SMB.php | 23 +- .../lib/Lib/Storage/StreamWrapper.php | 1 + apps/files_external/lib/Lib/Storage/Swift.php | 10 +- apps/files_external/lib/Lib/StorageConfig.php | 3 +- .../lib/Lib/StorageModifierTrait.php | 1 + .../lib/Lib/VisibilityTrait.php | 1 + .../lib/Migration/DummyUserSession.php | 1 + .../Version1015Date20211104103506.php | 2 +- apps/files_external/lib/MountConfig.php | 1 + apps/files_external/lib/NotFoundException.php | 1 + .../lib/Service/BackendService.php | 3 +- .../lib/Service/DBConfigService.php | 9 +- .../lib/Service/GlobalStoragesService.php | 1 + .../Service/ImportLegacyStoragesService.php | 1 + .../lib/Service/LegacyStoragesService.php | 3 +- .../lib/Service/StoragesService.php | 3 +- .../lib/Service/UserGlobalStoragesService.php | 1 + .../lib/Service/UserStoragesService.php | 1 + apps/files_external/lib/Service/UserTrait.php | 1 + apps/files_external/lib/Settings/Admin.php | 7 +- apps/files_external/lib/Settings/Personal.php | 7 +- .../lib/Settings/PersonalSection.php | 1 + apps/files_external/lib/Settings/Section.php | 5 +- apps/files_external/templates/settings.php | 18 +- .../tests/Auth/AuthMechanismTest.php | 1 + .../tests/Auth/Password/GlobalAuth.php | 1 + .../tests/Backend/BackendTest.php | 1 + .../tests/Backend/LegacyBackendTest.php | 1 + .../tests/Command/ApplicableTest.php | 1 + .../tests/Command/CommandTest.php | 1 + .../tests/Command/ListCommandTest.php | 1 + .../Config/UserPlaceholderHandlerTest.php | 1 + .../tests/Controller/AjaxControllerTest.php | 1 + .../GlobalStoragesControllerTest.php | 1 + .../Controller/StoragesControllerTest.php | 1 + .../Controller/UserStoragesControllerTest.php | 1 + .../tests/DefinitionParameterTest.php | 1 + .../tests/FrontendDefinitionTraitTest.php | 1 + .../LegacyDependencyCheckPolyfillTest.php | 1 + .../tests/OwnCloudFunctionsTest.php | 1 + .../tests/PersonalMountTest.php | 1 + .../tests/Service/BackendServiceTest.php | 1 + .../tests/Service/DBConfigServiceTest.php | 1 + .../Service/GlobalStoragesServiceTest.php | 1 + .../tests/Service/StoragesServiceTest.php | 5 +- .../Service/UserGlobalStoragesServiceTest.php | 1 + .../tests/Service/UserStoragesServiceTest.php | 1 + .../tests/Settings/AdminTest.php | 1 + .../tests/Settings/SectionTest.php | 1 + .../tests/Storage/Amazons3MultiPartTest.php | 1 + .../tests/Storage/Amazons3Test.php | 1 + apps/files_external/tests/Storage/FtpTest.php | 1 + .../tests/Storage/OwncloudTest.php | 1 + .../tests/Storage/SFTP_KeyTest.php | 1 + .../files_external/tests/Storage/SftpTest.php | 1 + apps/files_external/tests/Storage/SmbTest.php | 3 +- .../tests/Storage/SwiftTest.php | 1 + .../tests/Storage/WebdavTest.php | 1 + .../tests/StorageConfigTest.php | 1 + apps/files_external/tests/config.php | 1 + .../tests/sso-setup/apps.config.php | 14 +- .../lib/Notification/Notifier.php | 2 +- .../lib/Service/ReminderService.php | 2 +- apps/files_sharing/appinfo/routes.php | 1 + apps/files_sharing/lib/Activity/Filter.php | 1 + .../lib/Activity/Providers/Base.php | 3 +- .../lib/Activity/Providers/Downloads.php | 1 + .../lib/Activity/Providers/Groups.php | 1 + .../lib/Activity/Providers/PublicLinks.php | 1 + .../lib/Activity/Providers/RemoteShares.php | 1 + .../lib/Activity/Providers/Users.php | 1 + .../lib/Activity/Settings/PublicLinks.php | 5 +- .../Activity/Settings/PublicLinksUpload.php | 5 +- .../lib/Activity/Settings/RemoteShare.php | 5 +- .../lib/Activity/Settings/Shared.php | 5 +- .../files_sharing/lib/AppInfo/Application.php | 1 + apps/files_sharing/lib/Cache.php | 1 + apps/files_sharing/lib/Capabilities.php | 3 +- .../Collaboration/ShareRecipientSorter.php | 7 +- .../lib/Command/CleanupRemoteStorages.php | 1 + .../lib/Command/DeleteOrphanShares.php | 6 +- .../Controller/ExternalSharesController.php | 1 + .../Controller/PublicPreviewController.php | 1 + .../lib/Controller/RemoteController.php | 1 + .../lib/Controller/ShareAPIController.php | 30 +- .../lib/Controller/ShareController.php | 3 +- .../lib/Controller/ShareInfoController.php | 1 + .../DefaultPublicShareTemplateProvider.php | 14 +- .../lib/DeleteOrphanedSharesJob.php | 2 +- .../lib/Exceptions/BrokenPath.php | 1 + .../lib/Exceptions/S2SException.php | 1 + .../lib/Exceptions/SharingRightsException.php | 1 + apps/files_sharing/lib/ExpireSharesJob.php | 5 +- apps/files_sharing/lib/External/Cache.php | 1 + apps/files_sharing/lib/External/Manager.php | 47 +- apps/files_sharing/lib/External/Mount.php | 1 + .../lib/External/MountProvider.php | 1 + apps/files_sharing/lib/External/Scanner.php | 1 + apps/files_sharing/lib/External/Storage.php | 20 +- apps/files_sharing/lib/External/Watcher.php | 1 + apps/files_sharing/lib/Helper.php | 1 + apps/files_sharing/lib/Hooks.php | 1 + apps/files_sharing/lib/ISharedStorage.php | 1 + .../lib/Middleware/OCSShareAPIMiddleware.php | 1 + .../lib/Middleware/ShareInfoMiddleware.php | 1 + .../lib/Migration/OwncloudGuestShareType.php | 3 +- .../lib/Migration/SetAcceptedStatus.php | 2 +- .../lib/Migration/SetPasswordColumn.php | 3 +- apps/files_sharing/lib/MountProvider.php | 3 +- .../lib/Notification/Notifier.php | 4 +- apps/files_sharing/lib/OrphanHelper.php | 8 +- apps/files_sharing/lib/Scanner.php | 1 + apps/files_sharing/lib/ShareBackend/File.php | 1 + .../files_sharing/lib/ShareBackend/Folder.php | 1 + apps/files_sharing/lib/SharedMount.php | 3 +- apps/files_sharing/lib/SharedStorage.php | 15 +- apps/files_sharing/lib/Updater.php | 3 +- apps/files_sharing/lib/ViewOnly.php | 1 + apps/files_sharing/tests/ApiTest.php | 3 +- apps/files_sharing/tests/ApplicationTest.php | 1 + apps/files_sharing/tests/CacheTest.php | 3 +- apps/files_sharing/tests/CapabilitiesTest.php | 1 + .../ShareRecipientSorterTest.php | 9 +- .../Command/CleanupRemoteStoragesTest.php | 1 + .../tests/Command/FixShareOwnersTest.php | 1 + .../ExternalShareControllerTest.php | 1 + .../PublicPreviewControllerTest.php | 1 + .../Controller/ShareAPIControllerTest.php | 109 +- .../tests/Controller/ShareControllerTest.php | 5 +- .../Controller/ShareInfoControllerTest.php | 1 + .../Controller/ShareesAPIControllerTest.php | 3 +- .../tests/DeleteOrphanedSharesJobTest.php | 1 + .../tests/EncryptedSizePropagationTest.php | 1 + .../tests/EtagPropagationTest.php | 3 +- .../tests/ExpireSharesJobTest.php | 1 + .../tests/External/CacheTest.php | 3 +- .../tests/External/ManagerTest.php | 3 +- .../tests/External/ScannerTest.php | 1 + .../tests/ExternalStorageTest.php | 1 + .../tests/GroupEtagPropagationTest.php | 1 + apps/files_sharing/tests/HelperTest.php | 1 + apps/files_sharing/tests/LockingTest.php | 1 + .../Middleware/OCSShareAPIMiddlewareTest.php | 1 + .../Middleware/ShareInfoMiddlewareTest.php | 1 + .../Middleware/SharingCheckMiddlewareTest.php | 5 +- .../tests/Migration/SetPasswordColumnTest.php | 3 +- .../files_sharing/tests/MountProviderTest.php | 1 + .../tests/PropagationTestCase.php | 1 + apps/files_sharing/tests/ShareTest.php | 1 + apps/files_sharing/tests/SharedMountTest.php | 3 +- .../files_sharing/tests/SharedStorageTest.php | 5 +- .../tests/SizePropagationTest.php | 1 + apps/files_sharing/tests/TestCase.php | 11 +- .../tests/UnshareChildrenTest.php | 1 + apps/files_sharing/tests/UpdaterTest.php | 1 + apps/files_sharing/tests/WatcherTest.php | 1 + .../lib/AppInfo/Application.php | 1 + .../lib/BackgroundJob/ExpireTrash.php | 1 + apps/files_trashbin/lib/Capabilities.php | 1 + apps/files_trashbin/lib/Command/CleanUp.php | 5 +- apps/files_trashbin/lib/Command/Expire.php | 1 + .../lib/Command/ExpireTrash.php | 3 +- .../lib/Command/RestoreAllFiles.php | 19 +- apps/files_trashbin/lib/Command/Size.php | 22 +- .../lib/Events/MoveToTrashEvent.php | 1 + .../lib/Exceptions/CopyRecursiveException.php | 1 + apps/files_trashbin/lib/Expiration.php | 9 +- apps/files_trashbin/lib/Helper.php | 3 +- apps/files_trashbin/lib/Hooks.php | 1 + .../lib/Listeners/SyncLivePhotosListener.php | 8 +- apps/files_trashbin/lib/Sabre/TrashRoot.php | 2 +- apps/files_trashbin/lib/Storage.php | 3 +- .../lib/Trash/BackendNotFoundException.php | 1 + .../lib/Trash/ITrashBackend.php | 1 + apps/files_trashbin/lib/Trash/ITrashItem.php | 1 + .../lib/Trash/ITrashManager.php | 1 + .../lib/Trash/LegacyTrashBackend.php | 1 + apps/files_trashbin/lib/Trash/TrashItem.php | 1 + .../files_trashbin/lib/Trash/TrashManager.php | 1 + apps/files_trashbin/lib/Trashbin.php | 11 +- .../lib/UserMigration/TrashbinMigrator.php | 12 +- .../tests/BackgroundJob/ExpireTrashTest.php | 1 + .../files_trashbin/tests/CapabilitiesTest.php | 1 + .../tests/Command/CleanUpTest.php | 7 +- .../tests/Command/ExpireTest.php | 1 + .../Controller/PreviewControllerTest.php | 1 + apps/files_trashbin/tests/ExpirationTest.php | 1 + apps/files_trashbin/tests/StorageTest.php | 3 +- apps/files_trashbin/tests/TrashbinTest.php | 9 +- apps/files_versions/appinfo/routes.php | 3 +- .../lib/AppInfo/Application.php | 1 + .../lib/BackgroundJob/ExpireVersions.php | 1 + apps/files_versions/lib/Capabilities.php | 1 + apps/files_versions/lib/Command/CleanUp.php | 3 +- apps/files_versions/lib/Command/Expire.php | 1 + .../lib/Command/ExpireVersions.php | 3 +- .../lib/Controller/PreviewController.php | 1 + apps/files_versions/lib/Db/VersionsMapper.php | 22 +- .../lib/Events/CreateVersionEvent.php | 1 + apps/files_versions/lib/Expiration.php | 9 +- .../Listener/VersionStorageMoveListener.php | 2 +- .../Version1020Date20221114144058.php | 4 +- apps/files_versions/lib/Sabre/Plugin.php | 2 +- .../lib/Sabre/RootCollection.php | 1 + .../lib/Sabre/VersionCollection.php | 2 +- apps/files_versions/lib/Sabre/VersionFile.php | 4 +- apps/files_versions/lib/Sabre/VersionHome.php | 1 + apps/files_versions/lib/Sabre/VersionRoot.php | 2 +- apps/files_versions/lib/Storage.php | 35 +- .../lib/Versions/BackendNotFoundException.php | 1 + .../lib/Versions/LegacyVersionsBackend.php | 16 +- .../lib/Versions/VersionManager.php | 2 +- .../BackgroundJob/ExpireVersionsTest.php | 1 + .../tests/Command/CleanupTest.php | 7 +- .../tests/Command/ExpireTest.php | 1 + .../Controller/PreviewControllerTest.php | 1 + apps/files_versions/tests/ExpirationTest.php | 1 + apps/files_versions/tests/StorageTest.php | 2 +- apps/files_versions/tests/VersioningTest.php | 173 +- .../lib/BackgroundJobs/RetryJob.php | 2 +- apps/oauth2/appinfo/routes.php | 1 + apps/oauth2/lib/Db/AccessToken.php | 1 + apps/oauth2/lib/Db/Client.php | 1 + .../LoginRedirectorControllerTest.php | 1 + .../Controller/OauthApiControllerTest.php | 1 + .../Controller/SettingsControllerTest.php | 1 + .../oauth2/tests/Db/AccessTokenMapperTest.php | 5 +- apps/oauth2/tests/Db/ClientMapperTest.php | 1 + apps/oauth2/tests/Settings/AdminTest.php | 1 + .../lib/AppInfo/Application.php | 1 + apps/provisioning_api/lib/Capabilities.php | 1 + .../lib/Controller/AUserData.php | 2 +- .../lib/Controller/AppConfigController.php | 8 +- .../lib/Controller/GroupsController.php | 2 +- .../lib/Controller/PreferencesController.php | 4 +- .../lib/Controller/UsersController.php | 2 +- .../Exceptions/NotSubAdminException.php | 1 + .../tests/CapabilitiesTest.php | 5 +- .../Controller/AppConfigControllerTest.php | 3 +- .../tests/Controller/GroupsControllerTest.php | 4 +- .../tests/Controller/UsersControllerTest.php | 2 +- .../ProvisioningApiMiddlewareTest.php | 1 + apps/settings/lib/Activity/GroupProvider.php | 1 + apps/settings/lib/Activity/GroupSetting.php | 5 +- apps/settings/lib/Activity/Provider.php | 6 +- apps/settings/lib/Activity/SecurityFilter.php | 1 + .../settings/lib/Activity/SecuritySetting.php | 1 + apps/settings/lib/Activity/Setting.php | 5 +- .../lib/BackgroundJobs/VerifyUserData.php | 8 +- .../Controller/AdminSettingsController.php | 1 + .../lib/Controller/AppSettingsController.php | 5 +- .../Controller/ChangePasswordController.php | 1 + .../lib/Controller/CommonSettingsTrait.php | 1 + .../lib/Controller/MailSettingsController.php | 1 + .../Controller/PersonalSettingsController.php | 1 + .../lib/Controller/UsersController.php | 10 +- apps/settings/lib/Hooks.php | 1 + .../lib/Listener/MailProviderListener.php | 4 +- .../settings/lib/Mailer/NewUserMailHelper.php | 1 + .../lib/Middleware/SubadminMiddleware.php | 1 + .../lib/Sections/Admin/Delegation.php | 1 + .../lib/Service/AuthorizedGroupService.php | 2 +- .../Settings/Admin/ArtificialIntelligence.php | 6 +- apps/settings/lib/Settings/Admin/Mail.php | 5 +- apps/settings/lib/Settings/Admin/Overview.php | 7 +- apps/settings/lib/Settings/Admin/Security.php | 5 +- apps/settings/lib/Settings/Admin/Server.php | 5 +- apps/settings/lib/Settings/Admin/Sharing.php | 7 +- apps/settings/lib/Settings/Admin/Users.php | 4 +- .../lib/Settings/Personal/Additional.php | 5 +- .../lib/Settings/Personal/PersonalInfo.php | 6 +- .../lib/Settings/Personal/ServerDevNotice.php | 5 +- .../SetupChecks/DatabaseHasMissingIndices.php | 2 +- .../lib/SetupChecks/PhpMaxFileSize.php | 8 +- .../lib/SetupChecks/PhpOpcacheSetup.php | 2 +- .../lib/SetupChecks/SecurityHeaders.php | 4 +- .../lib/WellKnown/SecurityTxtHandler.php | 4 +- apps/settings/templates/settings/empty.php | 1 + .../tests/Activity/SecurityFilterTest.php | 1 + .../tests/Activity/SecurityProviderTest.php | 1 + .../tests/Activity/SecuritySettingTest.php | 1 + .../tests/AppInfo/ApplicationTest.php | 1 + .../AdminSettingsControllerTest.php | 1 + .../Controller/AppSettingsControllerTest.php | 1 + .../Controller/AuthSettingsControllerTest.php | 3 +- .../Controller/CheckSetupControllerTest.php | 8 +- .../Controller/MailSettingsControllerTest.php | 1 + .../TwoFactorSettingsControllerTest.php | 1 + .../tests/Controller/UsersControllerTest.php | 13 +- .../tests/Mailer/NewUserMailHelperTest.php | 1 + .../Middleware/SubadminMiddlewareTest.php | 1 + .../tests/Settings/Admin/MailTest.php | 1 + .../tests/Settings/Admin/SecurityTest.php | 1 + .../tests/Settings/Admin/SharingTest.php | 13 +- apps/sharebymail/lib/Activity.php | 1 + apps/sharebymail/lib/Settings/Admin.php | 5 +- apps/sharebymail/lib/ShareByMailProvider.php | 41 +- apps/sharebymail/tests/CapabilitiesTest.php | 1 + .../tests/ShareByMailProviderTest.php | 57 +- apps/systemtags/appinfo/routes.php | 1 + apps/systemtags/lib/Activity/Listener.php | 4 +- apps/systemtags/lib/Activity/Provider.php | 5 +- apps/systemtags/lib/Activity/Setting.php | 5 +- .../lib/Controller/LastUsedController.php | 1 + .../lib/Search/TagSearchProvider.php | 4 +- apps/systemtags/lib/Settings/Admin.php | 5 +- .../systemtags/tests/Activity/SettingTest.php | 1 + apps/systemtags/tests/Settings/AdminTest.php | 1 + apps/testing/clean_opcode_cache.php | 1 + .../lib/AlternativeHomeUserBackend.php | 1 + apps/testing/lib/AppInfo/Application.php | 1 + .../lib/Controller/ConfigController.php | 1 + .../lib/Controller/LockingController.php | 15 +- .../Controller/RateLimitTestController.php | 1 + .../lib/Locking/FakeDBLockingProvider.php | 1 + .../lib/Provider/FakeText2ImageProvider.php | 1 + .../Provider/FakeTextProcessingProvider.php | 1 + .../FakeTextProcessingProviderSync.php | 1 + .../lib/Provider/FakeTranslationProvider.php | 1 + .../FakeContextWriteProvider.php | 1 + .../FakeTextToImageProvider.php | 1 + .../TaskProcessing/FakeTextToTextProvider.php | 1 + .../TaskProcessing/FakeTranscribeProvider.php | 1 + .../TaskProcessing/FakeTranslateProvider.php | 1 + apps/theming/appinfo/routes.php | 1 + apps/theming/lib/AppInfo/Application.php | 1 + apps/theming/lib/Capabilities.php | 1 + apps/theming/lib/Command/UpdateConfig.php | 1 + .../theming/lib/Controller/IconController.php | 1 + .../lib/Controller/ThemingController.php | 1 + .../lib/Controller/UserThemeController.php | 6 +- apps/theming/lib/IconBuilder.php | 37 +- apps/theming/lib/ImageManager.php | 3 +- .../lib/Jobs/RestoreBackgroundImageColor.php | 2 +- .../theming/lib/Service/BackgroundService.php | 10 +- .../lib/Service/ThemeInjectionService.php | 13 +- apps/theming/lib/Service/ThemesService.php | 1 + apps/theming/lib/Settings/Admin.php | 5 +- apps/theming/lib/Settings/AdminSection.php | 5 +- apps/theming/lib/Settings/Personal.php | 5 +- apps/theming/lib/Settings/PersonalSection.php | 5 +- apps/theming/lib/Themes/CommonThemeTrait.php | 2 +- apps/theming/lib/Themes/DefaultTheme.php | 2 +- apps/theming/lib/ThemingDefaults.php | 15 +- apps/theming/lib/Util.php | 5 +- apps/theming/tests/CapabilitiesTest.php | 1 + .../tests/Controller/IconControllerTest.php | 1 + .../Controller/ThemingControllerTest.php | 1 + .../Controller/UserThemeControllerTest.php | 1 + apps/theming/tests/IconBuilderTest.php | 7 +- apps/theming/tests/ImageManagerTest.php | 1 + .../tests/Service/ThemesServiceTest.php | 1 + apps/theming/tests/ServicesTest.php | 1 + .../tests/Settings/AdminSectionTest.php | 1 + apps/theming/tests/Settings/AdminTest.php | 1 + apps/theming/tests/Settings/PersonalTest.php | 1 + .../tests/Themes/AccessibleThemeTestCase.php | 1 + .../Themes/DarkHighContrastThemeTest.php | 1 + apps/theming/tests/Themes/DarkThemeTest.php | 1 + .../theming/tests/Themes/DefaultThemeTest.php | 1 + .../theming/tests/Themes/DyslexiaFontTest.php | 1 + .../tests/Themes/HighContrastThemeTest.php | 1 + apps/theming/tests/ThemingDefaultsTest.php | 1 + apps/theming/tests/UtilTest.php | 13 +- .../Version1002Date20170926101419.php | 2 +- .../lib/Service/BackupCodeStorage.php | 4 +- .../RememberBackupCodesJobTest.php | 4 +- .../Unit/Provider/BackupCodesProviderTest.php | 2 +- apps/updatenotification/templates/empty.php | 1 + apps/user_ldap/ajax/clearMappings.php | 2 +- apps/user_ldap/ajax/deleteConfiguration.php | 2 +- apps/user_ldap/ajax/getConfiguration.php | 2 +- .../ajax/getNewServerConfigPrefix.php | 2 +- apps/user_ldap/ajax/setConfiguration.php | 2 +- apps/user_ldap/ajax/wizard.php | 6 +- apps/user_ldap/lib/Access.php | 56 +- apps/user_ldap/lib/AccessFactory.php | 1 + apps/user_ldap/lib/AppInfo/Application.php | 1 + apps/user_ldap/lib/Command/PromoteGroup.php | 2 +- apps/user_ldap/lib/Command/ResetGroup.php | 1 + apps/user_ldap/lib/Command/ResetUser.php | 1 + apps/user_ldap/lib/Command/Search.php | 4 +- apps/user_ldap/lib/Command/SetConfig.php | 2 +- apps/user_ldap/lib/Command/ShowConfig.php | 2 +- apps/user_ldap/lib/Command/ShowRemnants.php | 4 +- .../lib/Command/TestUserSettings.php | 6 +- apps/user_ldap/lib/Command/UpdateUUID.php | 2 +- apps/user_ldap/lib/Configuration.php | 6 +- apps/user_ldap/lib/Connection.php | 17 +- apps/user_ldap/lib/ConnectionFactory.php | 1 + .../lib/Controller/ConfigAPIController.php | 1 + .../Controller/RenewPasswordController.php | 3 +- .../lib/Exceptions/AttributeNotSet.php | 1 + .../ConstraintViolationException.php | 1 + apps/user_ldap/lib/Exceptions/NotOnLDAP.php | 1 + apps/user_ldap/lib/GroupPluginManager.php | 5 +- apps/user_ldap/lib/Group_LDAP.php | 26 +- apps/user_ldap/lib/Group_Proxy.php | 2 +- .../lib/Handler/ExtStorageConfigHandler.php | 1 + apps/user_ldap/lib/Helper.php | 8 +- apps/user_ldap/lib/IGroupLDAP.php | 1 + apps/user_ldap/lib/ILDAPGroupPlugin.php | 1 + apps/user_ldap/lib/ILDAPUserPlugin.php | 1 + apps/user_ldap/lib/IUserLDAP.php | 1 + apps/user_ldap/lib/Jobs/CleanUp.php | 14 +- apps/user_ldap/lib/Jobs/Sync.php | 39 +- apps/user_ldap/lib/Jobs/UpdateGroups.php | 2 +- apps/user_ldap/lib/LDAP.php | 6 +- .../user_ldap/lib/Mapping/AbstractMapping.php | 12 +- apps/user_ldap/lib/Migration/UUIDFix.php | 1 + apps/user_ldap/lib/Migration/UUIDFixGroup.php | 1 + .../user_ldap/lib/Migration/UUIDFixInsert.php | 3 +- apps/user_ldap/lib/Migration/UUIDFixUser.php | 1 + apps/user_ldap/lib/Notification/Notifier.php | 1 + apps/user_ldap/lib/PagedResults/TLinkId.php | 4 +- apps/user_ldap/lib/Settings/Admin.php | 5 +- apps/user_ldap/lib/Settings/Section.php | 5 +- apps/user_ldap/lib/User/DeletedUsersIndex.php | 3 +- apps/user_ldap/lib/User/Manager.php | 8 +- apps/user_ldap/lib/User/OfflineUser.php | 6 +- apps/user_ldap/lib/User/User.php | 54 +- apps/user_ldap/lib/UserPluginManager.php | 7 +- apps/user_ldap/lib/User_LDAP.php | 18 +- apps/user_ldap/lib/User_Proxy.php | 6 +- apps/user_ldap/lib/Wizard.php | 38 +- apps/user_ldap/tests/AccessTest.php | 3 +- apps/user_ldap/tests/ConnectionTest.php | 4 +- apps/user_ldap/tests/GroupLDAPPluginTest.php | 1 + apps/user_ldap/tests/Group_LDAPTest.php | 2 +- apps/user_ldap/tests/HelperTest.php | 1 + .../Integration/AbstractIntegrationTest.php | 6 +- .../user_ldap/tests/Integration/Bootstrap.php | 1 + .../Integration/ExceptionOnLostConnection.php | 20 +- .../Lib/IntegrationTestAttributeDetection.php | 1 + .../IntegrationTestFetchUsersByLoginName.php | 2 +- .../Integration/Lib/IntegrationTestPaging.php | 2 +- .../Lib/User/IntegrationTestUserAvatar.php | 2 +- .../Lib/User/IntegrationTestUserCleanUp.php | 2 +- .../User/IntegrationTestUserDisplayName.php | 2 +- apps/user_ldap/tests/Jobs/SyncTest.php | 23 +- apps/user_ldap/tests/LDAPGroupPluginDummy.php | 1 + apps/user_ldap/tests/LDAPProviderTest.php | 103 +- apps/user_ldap/tests/LDAPTest.php | 1 + apps/user_ldap/tests/LDAPUserPluginDummy.php | 1 + .../tests/Mapping/AbstractMappingTest.php | 2 +- .../tests/Migration/AbstractUUIDFixTest.php | 1 + .../tests/Migration/UUIDFixGroupTest.php | 1 + .../tests/Migration/UUIDFixInsertTest.php | 11 +- .../tests/Migration/UUIDFixUserTest.php | 1 + .../tests/Service/UpdateGroupsServiceTest.php | 8 +- apps/user_ldap/tests/Settings/AdminTest.php | 1 + apps/user_ldap/tests/Settings/SectionTest.php | 1 + .../tests/User/DeletedUsersIndexTest.php | 1 + apps/user_ldap/tests/User/UserTest.php | 4 +- apps/user_ldap/tests/UserLDAPPluginTest.php | 1 + apps/user_ldap/tests/User_LDAPTest.php | 302 +- apps/user_ldap/tests/User_ProxyTest.php | 1 + apps/user_ldap/tests/WizardTest.php | 2 +- apps/user_status/lib/Connector/UserStatus.php | 2 +- .../lib/Controller/HeartbeatController.php | 6 +- .../Listener/OutOfOfficeStatusListener.php | 2 +- .../lib/Listener/UserLiveStatusListener.php | 2 +- .../user_status/lib/Service/StatusService.php | 4 +- .../tests/Unit/Service/StatusServiceTest.php | 4 +- .../lib/BackgroundJobs/WebhookCall.php | 4 +- .../lib/Db/WebhookListener.php | 2 +- .../lib/Service/PHPMongoQuery.php | 154 +- apps/webhook_listeners/lib/Settings/Admin.php | 4 +- apps/workflowengine/appinfo/routes.php | 1 + .../lib/AppInfo/Application.php | 1 + .../lib/BackgroundJobs/Rotate.php | 3 +- .../lib/Check/AbstractStringCheck.php | 1 + .../workflowengine/lib/Check/FileMimeType.php | 1 + apps/workflowengine/lib/Check/FileSize.php | 1 + .../lib/Check/FileSystemTags.php | 1 + .../lib/Check/RequestRemoteAddress.php | 1 + apps/workflowengine/lib/Check/RequestTime.php | 5 +- apps/workflowengine/lib/Check/RequestURL.php | 1 + .../lib/Check/RequestUserAgent.php | 1 + .../lib/Check/UserGroupMembership.php | 1 + .../lib/Controller/RequestTimeController.php | 1 + apps/workflowengine/lib/Entity/File.php | 2 +- .../lib/Helper/ScopeContext.php | 4 +- apps/workflowengine/lib/Manager.php | 11 +- apps/workflowengine/lib/Service/Logger.php | 2 +- .../workflowengine/lib/Settings/ASettings.php | 4 +- apps/workflowengine/lib/Settings/Section.php | 1 + .../tests/Check/AbstractStringCheckTest.php | 1 + .../tests/Check/RequestRemoteAddressTest.php | 1 + .../tests/Check/RequestTimeTest.php | 1 + .../tests/Check/RequestUserAgentTest.php | 1 + apps/workflowengine/tests/ManagerTest.php | 3 +- build/gen-coverage-badge.php | 7 +- .../features/bootstrap/AppConfiguration.php | 1 + build/integration/features/bootstrap/Auth.php | 1 + .../integration/features/bootstrap/Avatar.php | 3 +- .../features/bootstrap/BasicStructure.php | 51 +- .../features/bootstrap/CalDavContext.php | 9 +- .../bootstrap/CapabilitiesContext.php | 7 +- .../features/bootstrap/CardDavContext.php | 15 +- .../features/bootstrap/ChecksumsContext.php | 7 +- .../bootstrap/CollaborationContext.php | 4 +- .../features/bootstrap/CommandLine.php | 3 +- .../features/bootstrap/CommandLineContext.php | 1 + .../features/bootstrap/CommentsContext.php | 25 +- .../features/bootstrap/ContactsMenu.php | 1 + .../features/bootstrap/DavFeatureContext.php | 1 + .../features/bootstrap/Download.php | 15 +- .../features/bootstrap/ExternalStorage.php | 1 + .../features/bootstrap/FakeSMTPHelper.php | 1 + .../features/bootstrap/FeatureContext.php | 1 + .../features/bootstrap/FederationContext.php | 9 +- .../features/bootstrap/FilesDropContext.php | 1 + .../features/bootstrap/LDAPContext.php | 9 +- build/integration/features/bootstrap/Mail.php | 5 +- .../features/bootstrap/MetadataContext.php | 1 + .../features/bootstrap/Provisioning.php | 31 +- .../bootstrap/RateLimitingContext.php | 1 + .../features/bootstrap/RemoteContext.php | 3 +- .../integration/features/bootstrap/Search.php | 1 + .../features/bootstrap/SetupContext.php | 1 + .../features/bootstrap/ShareesContext.php | 1 + .../features/bootstrap/Sharing.php | 77 +- .../features/bootstrap/SharingContext.php | 1 + .../features/bootstrap/TagsContext.php | 11 +- .../features/bootstrap/TalkContext.php | 1 + .../features/bootstrap/Trashbin.php | 3 +- .../integration/features/bootstrap/WebDav.php | 109 +- build/license.php | 21 +- build/signed-off-checker.php | 3 +- console.php | 18 +- core/Application.php | 1 + .../BackgroundCleanupUpdaterBackupsJob.php | 4 +- core/BackgroundJobs/GenerateMetadataJob.php | 4 +- core/Command/App/Disable.php | 1 + core/Command/App/GetPath.php | 2 +- core/Command/App/ListApps.php | 1 + core/Command/App/Update.php | 2 +- core/Command/Background/JobBase.php | 2 +- core/Command/Background/ListCommand.php | 6 +- core/Command/Config/App/GetConfig.php | 2 +- core/Command/Config/App/SetConfig.php | 8 +- core/Command/Config/System/Base.php | 1 + core/Command/Config/System/GetConfig.php | 2 +- core/Command/Config/System/SetConfig.php | 4 +- core/Command/Db/AddMissingColumns.php | 2 +- core/Command/Db/AddMissingIndices.php | 2 +- core/Command/Db/AddMissingPrimaryKeys.php | 2 +- core/Command/Db/ConvertFilecacheBigInt.php | 1 + core/Command/Db/ConvertMysqlToMB4.php | 5 +- core/Command/Db/ConvertType.php | 2 +- core/Command/Db/Migrations/ExecuteCommand.php | 1 + .../Command/Db/Migrations/GenerateCommand.php | 3 +- core/Command/Db/Migrations/PreviewCommand.php | 6 +- core/Command/Db/SchemaEncoder.php | 2 +- .../Encryption/ChangeKeyStorageRoot.php | 4 +- core/Command/Encryption/DecryptAll.php | 8 +- core/Command/Encryption/EncryptAll.php | 3 +- core/Command/Encryption/ListModules.php | 4 +- core/Command/Encryption/MigrateKeyStorage.php | 6 +- core/Command/Encryption/SetDefaultModule.php | 4 +- core/Command/FilesMetadata/Get.php | 60 +- core/Command/Group/Add.php | 2 +- core/Command/Group/AddUser.php | 1 + core/Command/Group/ListCommand.php | 7 +- core/Command/Group/RemoveUser.php | 1 + core/Command/Info/File.php | 62 +- core/Command/Info/FileUtils.php | 38 +- core/Command/Info/Space.php | 10 +- core/Command/Integrity/CheckApp.php | 2 +- core/Command/Maintenance/Install.php | 12 +- .../Mimetype/GenerateMimetypeFileBuilder.php | 2 +- .../Command/Maintenance/Mimetype/UpdateDB.php | 2 +- .../Maintenance/RepairShareOwnership.php | 12 +- core/Command/Maintenance/UpdateTheme.php | 1 + core/Command/Preview/Generate.php | 28 +- core/Command/Preview/Repair.php | 44 +- core/Command/Preview/ResetRenderedTexts.php | 2 +- core/Command/SystemTag/Add.php | 1 + core/Command/SystemTag/Delete.php | 1 + core/Command/SystemTag/Edit.php | 1 + core/Command/SystemTag/ListCommand.php | 1 + core/Command/TaskProcessing/ListCommand.php | 1 + core/Command/TaskProcessing/Statistics.php | 11 +- core/Command/TwoFactorAuth/Base.php | 1 + core/Command/TwoFactorAuth/Disable.php | 4 +- core/Command/TwoFactorAuth/Enable.php | 4 +- core/Command/TwoFactorAuth/State.php | 12 +- core/Command/Upgrade.php | 12 +- core/Command/User/Add.php | 4 +- core/Command/User/AuthTokens/Delete.php | 1 + core/Command/User/AuthTokens/ListCommand.php | 1 + .../User/ClearGeneratedAvatarCacheCommand.php | 4 +- core/Command/User/Info.php | 3 +- core/Command/User/LastSeen.php | 2 +- core/Command/User/ListCommand.php | 5 +- core/Command/User/ResetPassword.php | 10 +- core/Command/User/SyncAccountDataCommand.php | 1 + core/Command/User/Welcome.php | 1 + core/Controller/AvatarController.php | 16 +- core/Controller/ClientFlowLoginController.php | 5 +- core/Controller/ContactsMenuController.php | 1 + core/Controller/GuestAvatarController.php | 3 +- core/Controller/LostController.php | 4 +- core/Controller/NavigationController.php | 1 + core/Controller/OCJSController.php | 1 + core/Controller/OCSController.php | 7 +- .../TaskProcessingApiController.php | 2 +- .../TextProcessingApiController.php | 2 +- core/Controller/TextToImageApiController.php | 2 +- .../TwoFactorChallengeController.php | 2 +- core/Controller/WalledGardenController.php | 1 + core/Controller/WellKnownController.php | 2 +- core/Controller/WhatsNewController.php | 5 +- .../BeforeMessageLoggedEventListener.php | 2 +- .../Version13000Date20170705121758.php | 1 + .../Version13000Date20170718121200.php | 1 + .../Version13000Date20170814074715.php | 1 + .../Version13000Date20170919121250.php | 1 + .../Version13000Date20170926101637.php | 3 +- .../Version14000Date20180129121024.php | 1 + .../Version14000Date20180516101403.php | 1 + .../Version14000Date20180626223656.php | 1 + .../Version14000Date20180712153140.php | 1 + .../Version23000Date20211213203940.php | 2 +- .../Version25000Date20220515204012.php | 1 + .../Version27000Date20220613163520.php | 2 +- .../Version28000Date20240828142927.php | 2 +- core/routes.php | 2 +- core/strings.php | 10 +- core/templates/error.php | 2 +- core/templates/print_exception.php | 1 + core/templates/print_xml_exception.php | 1 + core/templates/twofactorshowchallenge.php | 2 +- cron.php | 8 +- lib/base.php | 14 +- lib/private/Accounts/Hooks.php | 3 +- lib/private/Activity/EventMerger.php | 1 + lib/private/Activity/Manager.php | 1 + lib/private/AllConfig.php | 15 +- lib/private/App/AppManager.php | 1 + lib/private/App/AppStore/Bundles/Bundle.php | 1 + .../App/AppStore/Bundles/BundleFetcher.php | 1 + .../App/AppStore/Bundles/EducationBundle.php | 1 + .../App/AppStore/Bundles/EnterpriseBundle.php | 1 + .../App/AppStore/Bundles/GroupwareBundle.php | 1 + .../AppStore/Bundles/PublicSectorBundle.php | 1 + .../AppStore/Bundles/SocialSharingBundle.php | 1 + .../AppStore/Fetcher/AppDiscoverFetcher.php | 3 +- .../App/AppStore/Fetcher/AppFetcher.php | 3 +- .../App/AppStore/Fetcher/CategoryFetcher.php | 1 + lib/private/App/AppStore/Fetcher/Fetcher.php | 7 +- lib/private/App/AppStore/Version/Version.php | 1 + .../App/AppStore/Version/VersionParser.php | 3 +- lib/private/App/DependencyAnalyzer.php | 5 +- lib/private/App/InfoParser.php | 9 +- lib/private/App/Platform.php | 1 + lib/private/App/PlatformRepository.php | 1 + lib/private/AppConfig.php | 68 +- lib/private/AppFramework/App.php | 4 +- .../Bootstrap/RegistrationContext.php | 4 +- .../DependencyInjection/DIContainer.php | 1 + lib/private/AppFramework/Http/Dispatcher.php | 10 +- lib/private/AppFramework/Http/Request.php | 32 +- .../Middleware/MiddlewareDispatcher.php | 8 +- .../AppFramework/Middleware/OCSMiddleware.php | 1 + .../NeedAuthenticationException.php | 1 + .../PublicShare/PublicShareMiddleware.php | 1 + .../Middleware/Security/CORSMiddleware.php | 2 +- .../Exceptions/AppNotEnabledException.php | 1 + .../LaxSameSiteCookieFailedException.php | 1 + .../Exceptions/NotConfirmedException.php | 1 + .../PasswordConfirmationMiddleware.php | 1 + .../Security/SameSiteCookieMiddleware.php | 1 + lib/private/AppFramework/OCS/BaseResponse.php | 3 +- lib/private/AppFramework/OCS/V1Response.php | 5 +- lib/private/AppFramework/OCS/V2Response.php | 1 + .../Utility/ControllerMethodReflector.php | 8 +- lib/private/AppScriptDependency.php | 1 + lib/private/AppScriptSort.php | 1 + .../UserDeletedFilesCleanupListener.php | 4 +- .../LoginCredentials/Credentials.php | 1 + .../Authentication/LoginCredentials/Store.php | 2 +- .../Authentication/Token/PublicKeyToken.php | 2 +- .../Token/PublicKeyTokenProvider.php | 20 +- .../Authentication/Token/RemoteWipe.php | 4 +- .../Authentication/Token/TokenCleanupJob.php | 1 + .../Db/ProviderUserAssignmentDao.php | 8 +- .../Authentication/TwoFactorAuth/Manager.php | 8 +- lib/private/Avatar/Avatar.php | 10 +- lib/private/Avatar/AvatarManager.php | 2 +- lib/private/Avatar/UserAvatar.php | 2 +- lib/private/BackgroundJob/JobList.php | 2 +- .../Listener/GenerateBlurhashMetadata.php | 2 +- lib/private/Calendar/Manager.php | 2 +- .../Collaboration/AutoComplete/Manager.php | 3 +- .../Collaborators/GroupPlugin.php | 1 + .../Collaborators/LookupPlugin.php | 1 + .../Collaborators/MailPlugin.php | 1 + .../Collaborators/RemoteGroupPlugin.php | 1 + .../Collaborators/RemotePlugin.php | 1 + .../Collaboration/Collaborators/Search.php | 1 + .../Collaborators/SearchResult.php | 1 + .../Collaborators/UserPlugin.php | 5 +- .../File/FileReferenceEventListener.php | 6 +- .../Reference/File/FileReferenceProvider.php | 12 +- .../Collaboration/Resources/Manager.php | 2 +- lib/private/Color.php | 1 + lib/private/Command/CronBus.php | 1 + lib/private/Comments/Comment.php | 4 +- lib/private/Comments/Manager.php | 40 +- lib/private/Config.php | 4 +- lib/private/Console/Application.php | 16 +- lib/private/Console/TimestampFormatter.php | 2 +- .../Contacts/ContactsMenu/ActionFactory.php | 1 + .../ContactsMenu/Actions/LinkAction.php | 1 + .../Contacts/ContactsMenu/ContactsStore.php | 2 +- lib/private/Contacts/ContactsMenu/Manager.php | 1 + .../ContactsMenu/Providers/EMailProvider.php | 1 + lib/private/ContactsManager.php | 16 +- lib/private/DB/Adapter.php | 4 +- lib/private/DB/AdapterPgSql.php | 2 +- lib/private/DB/AdapterSqlite.php | 4 +- lib/private/DB/Connection.php | 22 +- lib/private/DB/ConnectionFactory.php | 4 +- lib/private/DB/MigrationService.php | 7 +- lib/private/DB/MySqlTools.php | 1 + lib/private/DB/PreparedStatement.php | 2 +- .../DB/QueryBuilder/CompositeExpression.php | 2 +- .../ExpressionBuilder/ExpressionBuilder.php | 28 +- .../SqliteExpressionBuilder.php | 1 + .../FunctionBuilder/FunctionBuilder.php | 1 + .../FunctionBuilder/OCIFunctionBuilder.php | 1 + .../FunctionBuilder/PgSqlFunctionBuilder.php | 1 + .../FunctionBuilder/SqliteFunctionBuilder.php | 1 + .../Partitioned/JoinCondition.php | 2 +- .../Partitioned/PartitionedQueryBuilder.php | 10 +- lib/private/DB/QueryBuilder/QueryBuilder.php | 2 +- .../Sharded/AutoIncrementHandler.php | 4 +- .../QueryBuilder/Sharded/HashShardMapper.php | 2 +- .../QueryBuilder/Sharded/ShardQueryRunner.php | 2 +- .../Sharded/ShardedQueryBuilder.php | 16 +- lib/private/DB/SchemaWrapper.php | 1 + lib/private/DateTimeFormatter.php | 128 +- lib/private/Diagnostics/Event.php | 1 + lib/private/Diagnostics/EventLogger.php | 7 +- lib/private/Diagnostics/QueryLogger.php | 2 +- lib/private/DirectEditing/Manager.php | 1 + lib/private/DirectEditing/Token.php | 1 + lib/private/Encryption/DecryptAll.php | 14 +- lib/private/Encryption/EncryptionWrapper.php | 4 +- lib/private/Encryption/File.php | 2 +- lib/private/Encryption/HookManager.php | 2 +- lib/private/Encryption/Keys/Storage.php | 1 + lib/private/EventSource.php | 8 +- .../Federation/CloudFederationFactory.php | 1 + .../CloudFederationNotification.php | 1 + .../Federation/CloudFederationShare.php | 1 + lib/private/Federation/CloudIdManager.php | 2 +- lib/private/Files/Cache/Cache.php | 38 +- lib/private/Files/Cache/CacheEntry.php | 4 +- lib/private/Files/Cache/FailedCache.php | 2 +- lib/private/Files/Cache/Propagator.php | 4 +- lib/private/Files/Cache/QuerySearchHelper.php | 3 +- lib/private/Files/Cache/SearchBuilder.php | 7 +- lib/private/Files/Cache/Storage.php | 10 +- lib/private/Files/Cache/StorageGlobal.php | 2 +- lib/private/Files/Cache/Updater.php | 4 +- .../Files/Cache/Wrapper/JailPropagator.php | 1 + .../Files/Config/CachedMountFileInfo.php | 1 + .../Files/Config/MountProviderCollection.php | 6 +- lib/private/Files/Config/UserMountCache.php | 18 +- lib/private/Files/FileInfo.php | 2 +- lib/private/Files/Filesystem.php | 4 +- lib/private/Files/Mount/Manager.php | 4 +- lib/private/Files/Mount/MountPoint.php | 4 +- lib/private/Files/Mount/RootMountProvider.php | 2 +- lib/private/Files/Node/Folder.php | 5 +- lib/private/Files/Node/LazyFolder.php | 2 +- lib/private/Files/Node/LazyUserFolder.php | 2 +- lib/private/Files/Node/Node.php | 2 +- lib/private/Files/Node/Root.php | 2 +- lib/private/Files/Notify/Change.php | 1 + lib/private/Files/Notify/RenameChange.php | 1 + .../AppdataPreviewObjectStoreStorage.php | 2 +- lib/private/Files/ObjectStore/Azure.php | 5 +- lib/private/Files/ObjectStore/Mapper.php | 4 +- .../Files/ObjectStore/ObjectStoreScanner.php | 2 +- .../Files/ObjectStore/ObjectStoreStorage.php | 14 +- lib/private/Files/ObjectStore/S3.php | 5 +- .../Files/ObjectStore/S3ConnectionTrait.php | 9 +- .../Files/ObjectStore/S3ObjectTrait.php | 20 +- lib/private/Files/ObjectStore/S3Signature.php | 3 +- .../Files/ObjectStore/StorageObjectStore.php | 1 + .../Files/ObjectStore/SwiftFactory.php | 2 +- .../MergeDistributiveOperations.php | 2 +- .../Files/Search/SearchBinaryOperator.php | 1 + lib/private/Files/Search/SearchOrder.php | 1 + lib/private/Files/Search/SearchQuery.php | 9 +- lib/private/Files/SetupManager.php | 8 +- lib/private/Files/SimpleFS/SimpleFile.php | 1 + lib/private/Files/SimpleFS/SimpleFolder.php | 1 + lib/private/Files/Storage/Common.php | 14 +- lib/private/Files/Storage/DAV.php | 38 +- lib/private/Files/Storage/Home.php | 2 +- lib/private/Files/Storage/StorageFactory.php | 2 +- .../Files/Storage/Wrapper/Encryption.php | 6 +- lib/private/Files/Storage/Wrapper/Quota.php | 2 +- lib/private/Files/Storage/Wrapper/Wrapper.php | 2 +- lib/private/Files/Stream/Encryption.php | 18 +- .../Files/Stream/SeekableHttpStream.php | 3 +- lib/private/Files/Type/Detection.php | 4 +- lib/private/Files/View.php | 14 +- lib/private/FilesMetadata/MetadataQuery.php | 2 +- .../Model/MetadataValueWrapper.php | 14 +- .../Service/IndexRequestService.php | 20 +- .../Service/MetadataRequestService.php | 32 +- .../FullTextSearch/Model/IndexDocument.php | 8 +- lib/private/GlobalScale/Config.php | 1 + lib/private/Group/Backend.php | 2 +- lib/private/Group/Database.php | 24 +- lib/private/Group/Group.php | 4 +- lib/private/Group/MetaData.php | 2 +- lib/private/Hooks/BasicEmitter.php | 1 + lib/private/Hooks/Emitter.php | 1 + lib/private/Hooks/EmitterTrait.php | 1 + lib/private/Hooks/PublicEmitter.php | 1 + lib/private/Http/Client/Client.php | 568 +- lib/private/Http/Client/ClientService.php | 2 +- lib/private/Http/Client/DnsPinMiddleware.php | 4 +- .../Http/Client/GuzzlePromiseAdapter.php | 4 +- lib/private/Http/Client/NegativeDnsCache.php | 6 +- lib/private/Http/WellKnown/RequestManager.php | 4 +- lib/private/Installer.php | 8 +- lib/private/L10N/L10N.php | 2 +- .../L10N/LanguageNotFoundException.php | 1 + lib/private/LDAP/NullLDAPProviderFactory.php | 2 +- lib/private/LargeFileHelper.php | 5 +- lib/private/Lock/DBLockingProvider.php | 2 +- lib/private/Lock/MemcacheLockingProvider.php | 4 +- lib/private/Lockdown/Filesystem/NullCache.php | 1 + .../Lockdown/Filesystem/NullStorage.php | 1 + lib/private/Lockdown/LockdownManager.php | 1 + lib/private/Log.php | 4 +- lib/private/Log/ExceptionSerializer.php | 3 +- lib/private/Log/File.php | 2 +- lib/private/Log/LogDetails.php | 3 +- lib/private/Log/LogFactory.php | 1 + lib/private/Log/PsrLoggerAdapter.php | 54 +- lib/private/Log/Systemdlog.php | 1 + lib/private/Mail/EMailTemplate.php | 12 +- lib/private/Mail/Provider/Manager.php | 32 +- lib/private/Memcache/APCu.php | 1 + lib/private/Memcache/ArrayCache.php | 1 + lib/private/Memcache/CADTrait.php | 1 + lib/private/Memcache/CASTrait.php | 1 + lib/private/Memcache/Cache.php | 1 + lib/private/Memcache/Factory.php | 1 + lib/private/Memcache/Memcached.php | 1 + lib/private/Memcache/NullCache.php | 1 + lib/private/Memcache/ProfilerWrapperCache.php | 2 +- lib/private/Memcache/Redis.php | 5 +- lib/private/Migration/ConsoleOutput.php | 1 + lib/private/Migration/MetadataManager.php | 2 +- lib/private/Migration/NullOutput.php | 1 + lib/private/Migration/SimpleOutput.php | 1 + lib/private/NaturalSort.php | 6 +- lib/private/NavigationManager.php | 2 +- lib/private/Net/IpAddressClassifier.php | 4 +- lib/private/Notification/Manager.php | 8 +- lib/private/OCM/Model/OCMProvider.php | 6 +- lib/private/OCM/Model/OCMResource.php | 6 +- lib/private/OCS/DiscoveryService.php | 2 +- lib/private/OCS/Exception.php | 1 + lib/private/Preview/BackgroundCleanupJob.php | 4 +- lib/private/Preview/Bundled.php | 1 + lib/private/Preview/Generator.php | 23 +- lib/private/Preview/GeneratorHelper.php | 1 + lib/private/Preview/HEIC.php | 2 +- lib/private/Preview/Imaginary.php | 5 +- lib/private/Preview/Krita.php | 1 + lib/private/Preview/MarkDown.php | 10 +- lib/private/Preview/MimeIconProvider.php | 1 + lib/private/Preview/Movie.php | 6 +- lib/private/Preview/ProviderV1Adapter.php | 4 +- lib/private/Preview/SGI.php | 1 + lib/private/Preview/TGA.php | 1 + lib/private/Preview/Watcher.php | 2 +- lib/private/Preview/WebP.php | 2 +- lib/private/PreviewManager.php | 2 +- lib/private/PreviewNotAvailableException.php | 1 + lib/private/Profiler/FileProfilerStorage.php | 2 +- lib/private/RedisFactory.php | 6 +- lib/private/Remote/Api/ApiBase.php | 1 + lib/private/Remote/Api/ApiCollection.php | 1 + lib/private/Remote/Api/ApiFactory.php | 1 + lib/private/Remote/Api/NotFoundException.php | 1 + lib/private/Remote/Api/OCS.php | 1 + lib/private/Remote/Credentials.php | 1 + lib/private/Remote/Instance.php | 1 + lib/private/Remote/InstanceFactory.php | 1 + lib/private/Remote/User.php | 1 + lib/private/Repair.php | 2 +- .../Repair/AddAppConfigLazyMigration.php | 2 +- .../Repair/AddCleanupUpdaterBackupsJob.php | 1 + .../Repair/AddMetadataGenerationJob.php | 1 + lib/private/Repair/CleanTags.php | 4 +- lib/private/Repair/ClearFrontendCaches.php | 1 + .../Repair/ClearGeneratedAvatarCache.php | 1 + .../Repair/ClearGeneratedAvatarCacheJob.php | 1 + lib/private/Repair/Collation.php | 16 +- lib/private/Repair/MoveUpdaterStepFile.php | 1 + lib/private/Repair/NC13/AddLogRotateJob.php | 1 + .../NC21/AddCheckForUserCertificatesJob.php | 1 + .../Repair/NC25/AddMissingSecretJob.php | 4 +- .../Repair/OldGroupMembershipShares.php | 6 +- lib/private/Repair/Owncloud/CleanPreviews.php | 1 + .../Repair/Owncloud/DropAccountTermsTable.php | 1 + .../Repair/Owncloud/MigrateOauthTables.php | 4 +- lib/private/Repair/Owncloud/MoveAvatars.php | 1 + .../Repair/Owncloud/SaveAccountsTableData.php | 1 + .../Repair/Owncloud/UpdateLanguageCodes.php | 1 + lib/private/Repair/RemoveLinkShares.php | 2 +- lib/private/Repair/RepairInvalidShares.php | 2 +- lib/private/Repair/RepairMimeTypes.php | 16 +- lib/private/RichObjectStrings/Validator.php | 1 + lib/private/Route/CachingRouter.php | 2 +- lib/private/Route/Route.php | 2 +- lib/private/Search/SearchQuery.php | 2 +- lib/private/Security/Bruteforce/Throttler.php | 16 +- .../CSP/ContentSecurityPolicyManager.php | 2 +- .../FeaturePolicy/FeaturePolicyManager.php | 2 +- lib/private/Security/Hasher.php | 4 +- lib/private/Security/Ip/Address.php | 2 +- .../RateLimiting/Backend/DatabaseBackend.php | 2 +- .../Backend/MemoryCacheBackend.php | 2 +- lib/private/Security/SecureRandom.php | 2 +- .../Security/VerificationToken/CleanUpJob.php | 8 +- lib/private/Server.php | 1 + lib/private/Settings/Manager.php | 1 + lib/private/Settings/Section.php | 11 +- lib/private/Setup.php | 22 +- lib/private/Setup/AbstractDatabase.php | 14 +- lib/private/Setup/MySQL.php | 2 +- lib/private/Setup/OCI.php | 6 +- lib/private/Setup/PostgreSQL.php | 6 +- lib/private/Share/Helper.php | 2 +- lib/private/Share/Share.php | 4 +- lib/private/Share20/DefaultShareProvider.php | 34 +- .../Share20/Exception/BackendError.php | 1 + .../Share20/Exception/InvalidShare.php | 1 + lib/private/Share20/LegacyHooks.php | 1 + lib/private/Share20/Manager.php | 22 +- lib/private/Share20/ProviderFactory.php | 4 +- lib/private/Share20/Share.php | 4 +- lib/private/Share20/ShareAttributes.php | 6 +- lib/private/Share20/ShareHelper.php | 1 + lib/private/Streamer.php | 2 +- lib/private/Support/Subscription/Registry.php | 4 +- lib/private/SystemTag/SystemTagManager.php | 6 +- .../SystemTag/SystemTagObjectMapper.php | 2 +- lib/private/TagManager.php | 4 +- lib/private/Tags.php | 8 +- lib/private/Talk/Broker.php | 8 +- lib/private/TaskProcessing/Manager.php | 20 +- .../RemoveOldTasksBackgroundJob.php | 2 +- lib/private/Teams/TeamManager.php | 1 + lib/private/TempManager.php | 2 +- lib/private/Template/JSCombiner.php | 1 + lib/private/Template/JSConfigHelper.php | 44 +- lib/private/TemplateLayout.php | 6 +- lib/private/TextToImage/Manager.php | 6 +- .../RemoveOldTasksBackgroundJob.php | 4 +- lib/private/URLGenerator.php | 4 +- lib/private/Updater/ChangesCheck.php | 8 +- lib/private/Updater/VersionCheck.php | 16 +- lib/private/User/Backend.php | 2 +- lib/private/User/Database.php | 18 +- lib/private/User/Manager.php | 8 +- lib/private/User/Session.php | 5 +- lib/private/User/User.php | 2 +- lib/private/legacy/OC_App.php | 2 +- lib/private/legacy/OC_Files.php | 10 +- lib/private/legacy/OC_Helper.php | 24 +- lib/private/legacy/OC_Hook.php | 6 +- lib/private/legacy/OC_Image.php | 14 +- lib/private/legacy/OC_Template.php | 6 +- lib/private/legacy/OC_User.php | 8 +- lib/private/legacy/OC_Util.php | 22 +- lib/private/legacy/template/functions.php | 14 +- lib/public/Accounts/IAccount.php | 2 +- lib/public/Accounts/IAccountManager.php | 6 +- .../PropertyDoesNotExistException.php | 1 + lib/public/Activity/ActivitySettings.php | 4 +- lib/public/Activity/IEventMerger.php | 1 + lib/public/Activity/IFilter.php | 5 +- lib/public/Activity/IProvider.php | 1 + lib/public/Activity/ISetting.php | 5 +- lib/public/App/AppPathNotFoundException.php | 1 + lib/public/AppFramework/ApiController.php | 12 +- lib/public/AppFramework/App.php | 2 +- lib/public/AppFramework/Controller.php | 2 +- lib/public/AppFramework/Db/Entity.php | 2 +- lib/public/AppFramework/Db/QBMapper.php | 4 +- .../AppFramework/Http/Attribute/OpenAPI.php | 10 +- .../Http/ContentSecurityPolicy.php | 2 +- .../Http/EmptyContentSecurityPolicy.php | 4 +- .../AppFramework/Http/FileDisplayResponse.php | 1 + lib/public/AppFramework/Http/JSONResponse.php | 2 +- lib/public/AppFramework/Http/Response.php | 6 +- .../Http/Template/ExternalShareMenuAction.php | 1 + .../Http/Template/IMenuAction.php | 1 + .../Http/Template/LinkMenuAction.php | 1 + .../Http/Template/PublicTemplateResponse.php | 1 + .../Http/Template/SimpleMenuAction.php | 1 + .../AppFramework/Http/TemplateResponse.php | 2 +- .../OCS/OCSBadRequestException.php | 1 + lib/public/AppFramework/OCS/OCSException.php | 1 + .../OCS/OCSForbiddenException.php | 1 + .../AppFramework/OCS/OCSNotFoundException.php | 1 + .../OCS/OCSPreconditionFailedException.php | 1 + lib/public/AppFramework/OCSController.php | 12 +- .../Utility/IControllerMethodReflector.php | 4 +- .../CredentialsUnavailableException.php | 1 + .../PasswordUnavailableException.php | 1 + .../IProvideUserSecretBackend.php | 1 + .../LoginCredentials/ICredentials.php | 1 + .../TwoFactorAuth/IRegistry.php | 2 +- lib/public/BeforeSabrePubliclyLoadedEvent.php | 1 + ...BackendTemporarilyUnavailableException.php | 1 + lib/public/Calendar/ICalendar.php | 2 +- lib/public/Calendar/IHandleImipMessage.php | 2 +- lib/public/Calendar/IManager.php | 2 +- lib/public/Calendar/IMetadataProvider.php | 1 + lib/public/Calendar/Resource/IBackend.php | 1 + lib/public/Calendar/Resource/IResource.php | 1 + .../Calendar/Resource/IResourceMetadata.php | 1 + lib/public/Calendar/Room/IBackend.php | 1 + lib/public/Calendar/Room/IRoom.php | 1 + lib/public/Calendar/Room/IRoomMetadata.php | 1 + lib/public/Capabilities/IPublicCapability.php | 1 + .../Collaboration/AutoComplete/IManager.php | 3 +- .../Collaboration/AutoComplete/ISorter.php | 1 + .../Collaboration/Collaborators/ISearch.php | 3 +- .../Collaborators/ISearchPlugin.php | 1 + .../Collaborators/ISearchResult.php | 1 + .../Collaborators/SearchResultType.php | 5 +- .../Reference/LinkReferenceProvider.php | 4 +- lib/public/Color.php | 9 +- lib/public/Comments/CommentsEntityEvent.php | 6 +- lib/public/Comments/ICommentsEventHandler.php | 1 + lib/public/Comments/ICommentsManager.php | 10 +- lib/public/Constants.php | 2 +- lib/public/Contacts/ContactsMenu/IAction.php | 1 + .../Contacts/ContactsMenu/IActionFactory.php | 1 + .../Contacts/ContactsMenu/IContactsStore.php | 1 + lib/public/Contacts/ContactsMenu/IEntry.php | 1 + .../Contacts/ContactsMenu/ILinkAction.php | 1 + lib/public/Contacts/IManager.php | 16 +- lib/public/DB/ISchemaWrapper.php | 1 + .../DB/QueryBuilder/IExpressionBuilder.php | 28 +- .../DB/QueryBuilder/IFunctionBuilder.php | 1 + lib/public/DB/QueryBuilder/IQueryBuilder.php | 2 +- lib/public/DirectEditing/ACreateEmpty.php | 1 + .../DirectEditing/ACreateFromTemplate.php | 1 + lib/public/DirectEditing/ATemplate.php | 1 + lib/public/DirectEditing/IToken.php | 1 + .../RegisterDirectEditorEvent.php | 1 + lib/public/Encryption/IEncryptionModule.php | 4 +- .../ActionNotSupportedException.php | 1 + .../AuthenticationFailedException.php | 1 + .../Exceptions/BadRequestException.php | 1 + .../ProviderAlreadyExistsException.php | 1 + .../ProviderCouldNotAddShareException.php | 1 + .../ProviderDoesNotExistsException.php | 1 + .../Federation/ICloudFederationFactory.php | 1 + .../ICloudFederationNotification.php | 1 + .../Federation/ICloudFederationProvider.php | 1 + .../ICloudFederationProviderManager.php | 1 + .../Federation/ICloudFederationShare.php | 1 + lib/public/Files.php | 3 +- lib/public/Files/Cache/ICache.php | 2 +- .../Files/Config/ICachedMountFileInfo.php | 1 + lib/public/Files/DavUtil.php | 1 + lib/public/Files/EmptyFileNameException.php | 1 + lib/public/Files/GenericFileException.php | 1 + lib/public/Files/IAppData.php | 1 + .../Files/InvalidDirectoryException.php | 1 + lib/public/Files/Notify/IChange.php | 1 + lib/public/Files/Notify/INotifyHandler.php | 1 + lib/public/Files/Notify/IRenameChange.php | 1 + .../Files/Search/ISearchBinaryOperator.php | 1 + lib/public/Files/Search/ISearchComparison.php | 1 + lib/public/Files/Search/ISearchOperator.php | 1 + lib/public/Files/Search/ISearchOrder.php | 1 + lib/public/Files/Search/ISearchQuery.php | 1 + lib/public/Files/SimpleFS/ISimpleFile.php | 1 + lib/public/Files/SimpleFS/ISimpleFolder.php | 1 + lib/public/Files/SimpleFS/ISimpleRoot.php | 1 + .../Files/Storage/IChunkedFileWrite.php | 1 + .../Storage/IDisableEncryptionStorage.php | 1 + lib/public/Files/Storage/INotifyStorage.php | 1 + lib/public/Files/Storage/IStorageFactory.php | 2 +- lib/public/Files/Template/FieldType.php | 10 +- .../Template/RegisterTemplateCreatorEvent.php | 1 + lib/public/GlobalScale/IConfig.php | 1 + lib/public/Group/Backend/ABackend.php | 4 +- lib/public/Group/Backend/INamedBackend.php | 1 + .../Group/Backend/ISearchableGroupBackend.php | 6 +- lib/public/HintException.php | 12 +- lib/public/Http/Client/IClient.php | 540 +- lib/public/Http/Client/IPromise.php | 4 +- lib/public/IAddressBook.php | 23 +- lib/public/IConfig.php | 6 +- lib/public/IDBConnection.php | 4 +- lib/public/IDateTimeFormatter.php | 106 +- lib/public/IImage.php | 2 +- lib/public/IL10N.php | 2 +- lib/public/IRequest.php | 10 +- lib/public/ITagManager.php | 2 +- lib/public/ITags.php | 4 +- lib/public/IURLGenerator.php | 2 +- lib/public/LDAP/IDeletionFlagSupport.php | 1 + lib/public/LDAP/ILDAPProvider.php | 1 + lib/public/LDAP/ILDAPProviderFactory.php | 1 + lib/public/Lockdown/ILockdownManager.php | 1 + lib/public/Log/IFileBased.php | 1 + lib/public/Log/ILogFactory.php | 1 + lib/public/Log/IWriter.php | 1 + lib/public/Log/RotationTrait.php | 5 +- lib/public/Mail/IEMailTemplate.php | 10 +- lib/public/Mail/IMailer.php | 4 +- lib/public/Mail/Provider/Address.php | 20 +- lib/public/Mail/Provider/Attachment.php | 38 +- lib/public/Mail/Provider/IAddress.php | 16 +- lib/public/Mail/Provider/IAttachment.php | 30 +- lib/public/Mail/Provider/IManager.php | 32 +- lib/public/Mail/Provider/IMessage.php | 76 +- lib/public/Mail/Provider/IMessageSend.php | 4 +- lib/public/Mail/Provider/IProvider.php | 30 +- lib/public/Mail/Provider/IService.php | 28 +- lib/public/Mail/Provider/Message.php | 78 +- .../Attributes/MigrationAttribute.php | 2 +- lib/public/Migration/BigIntMigration.php | 2 +- lib/public/Notification/IManager.php | 8 +- .../OCM/Events/ResourceTypeRegisterEvent.php | 2 +- lib/public/Remote/Api/IApiCollection.php | 1 + lib/public/Remote/Api/IApiFactory.php | 1 + lib/public/Remote/Api/ICapabilitiesApi.php | 1 + lib/public/Remote/Api/IUserApi.php | 1 + lib/public/Remote/ICredentials.php | 1 + lib/public/Remote/IInstance.php | 1 + lib/public/Remote/IInstanceFactory.php | 1 + lib/public/Remote/IUser.php | 1 + lib/public/RichObjectStrings/Definitions.php | 1 + lib/public/RichObjectStrings/IValidator.php | 1 + .../InvalidObjectExeption.php | 1 + lib/public/Security/ISecureRandom.php | 2 +- lib/public/Settings/IIconSection.php | 5 +- lib/public/Settings/IManager.php | 1 + lib/public/Settings/ISettings.php | 5 +- lib/public/Share/IAttributes.php | 1 + lib/public/Share/IShareHelper.php | 1 + lib/public/SystemTag/ISystemTagManager.php | 4 +- .../SystemTag/ISystemTagObjectMapper.php | 14 +- .../SystemTag/SystemTagsEntityEvent.php | 6 +- lib/public/Teams/ITeamManager.php | 1 + lib/public/Teams/ITeamResourceProvider.php | 1 + lib/public/Teams/Team.php | 1 + lib/public/Teams/TeamResource.php | 1 + lib/public/TextToImage/Task.php | 2 +- lib/public/User/Backend/ABackend.php | 2 +- lib/public/Util.php | 6 +- lib/public/WorkflowEngine/ICheck.php | 1 + lib/public/WorkflowEngine/IManager.php | 1 + lib/public/WorkflowEngine/IOperation.php | 1 + ocs-provider/index.php | 1 + ocs/providers.php | 1 + ocs/v1.php | 1 + ocs/v2.php | 1 + tests/Core/Command/Config/ImportTest.php | 1 + tests/Core/Command/Config/ListConfigsTest.php | 1 + .../Config/System/DeleteConfigTest.php | 1 + .../Command/Config/System/GetConfigTest.php | 1 + .../Command/Config/System/SetConfigTest.php | 1 + .../Encryption/ChangeKeyStorageRootTest.php | 5 +- .../Command/Encryption/DecryptAllTest.php | 7 +- tests/Core/Command/Encryption/DisableTest.php | 1 + tests/Core/Command/Encryption/EnableTest.php | 1 + .../Command/Encryption/EncryptAllTest.php | 9 +- .../Encryption/SetDefaultModuleTest.php | 1 + tests/Core/Command/Group/AddTest.php | 1 + tests/Core/Command/Group/AddUserTest.php | 1 + tests/Core/Command/Group/DeleteTest.php | 1 + tests/Core/Command/Group/InfoTest.php | 1 + tests/Core/Command/Group/ListCommandTest.php | 1 + tests/Core/Command/Group/RemoveUserTest.php | 1 + tests/Core/Command/Log/FileTest.php | 1 + tests/Core/Command/Log/ManageTest.php | 1 + .../Maintenance/DataFingerprintTest.php | 1 + .../Maintenance/Mimetype/UpdateDBTest.php | 1 + tests/Core/Command/Maintenance/ModeTest.php | 3 +- .../Core/Command/Maintenance/UpdateTheme.php | 1 + tests/Core/Command/Preview/RepairTest.php | 3 +- tests/Core/Command/SystemTag/AddTest.php | 1 + tests/Core/Command/SystemTag/DeleteTest.php | 1 + tests/Core/Command/SystemTag/EditTest.php | 5 +- .../Command/SystemTag/ListCommandTest.php | 1 + .../Command/TwoFactorAuth/CleanupTest.php | 2 +- .../Command/TwoFactorAuth/DisableTest.php | 6 +- .../Core/Command/TwoFactorAuth/EnableTest.php | 6 +- .../Command/TwoFactorAuth/EnforceTest.php | 12 +- .../Core/Command/TwoFactorAuth/StateTest.php | 6 +- tests/Core/Command/User/AddTest.php | 1 + .../Command/User/AuthTokens/DeleteTest.php | 1 + tests/Core/Command/User/DeleteTest.php | 1 + tests/Core/Command/User/DisableTest.php | 1 + tests/Core/Command/User/EnableTest.php | 1 + tests/Core/Command/User/LastSeenTest.php | 1 + tests/Core/Command/User/SettingTest.php | 1 + .../Controller/AutoCompleteControllerTest.php | 9 +- .../Core/Controller/AvatarControllerTest.php | 15 +- .../ChangePasswordControllerTest.php | 1 + .../ClientFlowLoginControllerTest.php | 1 + tests/Core/Controller/CssControllerTest.php | 1 + .../Controller/GuestAvatarControllerTest.php | 1 + tests/Core/Controller/JsControllerTest.php | 1 + tests/Core/Controller/LostControllerTest.php | 49 +- .../Controller/NavigationControllerTest.php | 1 + tests/Core/Controller/OCSControllerTest.php | 1 + .../Core/Controller/PreviewControllerTest.php | 1 + .../TwoFactorChallengeControllerTest.php | 2 +- tests/Core/Controller/UserControllerTest.php | 1 + .../Controller/WellKnownControllerTest.php | 6 +- .../Core/Data/LoginFlowV2CredentialsTest.php | 1 + .../Service/LoginFlowV2ServiceUnitTest.php | 1 + .../CleanPreviewsBackgroundJobTest.php | 3 +- .../Repair/Owncloud/CleanPreviewsTest.php | 1 + .../Owncloud/UpdateLanguageCodesTest.php | 13 +- tests/apps.php | 1 + tests/bootstrap.php | 1 + tests/enable_all.php | 1 + tests/lib/APITest.php | 3 +- tests/lib/Accounts/AccountManagerTest.php | 2 +- tests/lib/Accounts/AccountPropertyTest.php | 1 + tests/lib/Accounts/AccountTest.php | 1 + tests/lib/Accounts/HooksTest.php | 1 + tests/lib/AllConfigTest.php | 3 +- tests/lib/App/AppStore/Bundles/BundleBase.php | 1 + .../AppStore/Bundles/BundleFetcherTest.php | 1 + .../AppStore/Bundles/EducationBundleTest.php | 1 + .../AppStore/Bundles/EnterpriseBundleTest.php | 1 + .../AppStore/Bundles/GroupwareBundleTest.php | 1 + .../Bundles/SocialSharingBundleTest.php | 1 + .../Fetcher/AppDiscoverFetcherTest.php | 1 + .../App/AppStore/Fetcher/AppFetcherTest.php | 1 + .../AppStore/Fetcher/CategoryFetcherTest.php | 1 + .../lib/App/AppStore/Fetcher/FetcherBase.php | 1 + .../AppStore/Version/VersionParserTest.php | 1 + .../lib/App/AppStore/Version/VersionTest.php | 1 + tests/lib/App/DependencyAnalyzerTest.php | 3 +- tests/lib/App/InfoParserTest.php | 1 + tests/lib/App/PlatformRepositoryTest.php | 1 + tests/lib/AppConfigTest.php | 8 +- .../Bootstrap/CoordinatorTest.php | 2 +- .../AuthPublicShareControllerTest.php | 1 + .../Controller/ControllerTest.php | 4 +- .../Controller/PublicShareControllerTest.php | 1 + tests/lib/AppFramework/Db/QBMapperTest.php | 5 +- .../DIIntergrationTests.php | 1 + .../Http/ContentSecurityPolicyTest.php | 1 + .../lib/AppFramework/Http/DispatcherTest.php | 12 +- .../Http/EmptyContentSecurityPolicyTest.php | 7 +- .../Http/FileDisplayResponseTest.php | 1 + tests/lib/AppFramework/Http/OutputTest.php | 1 + tests/lib/AppFramework/Http/RequestStream.php | 5 +- tests/lib/AppFramework/Http/RequestTest.php | 3 +- .../Middleware/MiddlewareDispatcherTest.php | 12 +- .../Middleware/MiddlewareTest.php | 4 +- .../Middleware/OCSMiddlewareTest.php | 1 + .../PublicShare/PublicShareMiddlewareTest.php | 1 + .../Security/BruteForceMiddlewareTest.php | 1 + .../Security/CORSMiddlewareTest.php | 1 + .../PasswordConfirmationMiddlewareTest.php | 1 + .../Security/SameSiteCookieMiddlewareTest.php | 1 + .../Security/SecurityMiddlewareTest.php | 1 + .../lib/AppFramework/Routing/RoutingTest.php | 1 + .../AppFramework/Services/AppConfigTest.php | 186 +- .../Utility/ControllerMethodReflectorTest.php | 2 +- tests/lib/AppScriptSortTest.php | 1 + tests/lib/AppTest.php | 1 + tests/lib/Archive/TARTest.php | 1 + tests/lib/Archive/TestBase.php | 3 +- tests/lib/Archive/ZIPTest.php | 1 + .../Login/ALoginCommandTest.php | 1 + .../Token/PublicKeyTokenMapperTest.php | 2 +- .../TwoFactorAuth/EnforcementStateTest.php | 1 + tests/lib/AutoLoaderTest.php | 1 + tests/lib/Avatar/AvatarManagerTest.php | 15 +- tests/lib/Avatar/UserAvatarTest.php | 1 + tests/lib/BackgroundJob/DummyJobList.php | 1 + tests/lib/BackgroundJob/JobListTest.php | 1 + tests/lib/BackgroundJob/JobTest.php | 1 + tests/lib/BackgroundJob/QueuedJobTest.php | 1 + tests/lib/BackgroundJob/TestJob.php | 1 + .../BackgroundJob/TestParallelAwareJob.php | 1 + tests/lib/BackgroundJob/TimedJobTest.php | 1 + tests/lib/Cache/CappedMemoryCacheTest.php | 1 + tests/lib/Cache/FileCacheTest.php | 1 + tests/lib/Cache/TestCache.php | 1 + tests/lib/Calendar/ManagerTest.php | 3 +- tests/lib/CapabilitiesManagerTest.php | 1 + .../Collaborators/GroupPluginTest.php | 13 +- .../Collaborators/LookupPluginTest.php | 7 +- .../Collaborators/MailPluginTest.php | 29 +- .../Collaborators/RemotePluginTest.php | 11 +- .../Collaborators/SearchResultTest.php | 5 +- .../Collaborators/SearchTest.php | 5 +- .../Collaborators/UserPluginTest.php | 39 +- tests/lib/Command/CronBusTest.php | 1 + tests/lib/Command/Integrity/SignAppTest.php | 1 + tests/lib/Command/Integrity/SignCoreTest.php | 1 + tests/lib/Comments/CommentTest.php | 1 + tests/lib/Comments/FakeFactory.php | 1 + tests/lib/Comments/FakeManager.php | 1 + tests/lib/Comments/ManagerTest.php | 1 + tests/lib/ConfigTest.php | 1 + tests/lib/ContactsManagerTest.php | 1 + tests/lib/DB/AdapterTest.php | 1 + tests/lib/DB/ConnectionFactoryTest.php | 1 + tests/lib/DB/MigratorTest.php | 2 +- tests/lib/DB/OCPostgreSqlPlatformTest.php | 3 +- .../QueryBuilder/ExpressionBuilderDBTest.php | 1 + .../DB/QueryBuilder/ExpressionBuilderTest.php | 1 + .../DB/QueryBuilder/FunctionBuilderTest.php | 5 +- .../PartitionedQueryBuilderTest.php | 1 + .../lib/DB/QueryBuilder/QueryBuilderTest.php | 1 + tests/lib/DB/QueryBuilder/QuoteHelperTest.php | 1 + tests/lib/DateTimeFormatterTest.php | 1 + tests/lib/Diagnostics/EventLoggerTest.php | 21 +- tests/lib/Diagnostics/QueryLoggerTest.php | 5 +- tests/lib/DirectEditing/ManagerTest.php | 1 + tests/lib/EmojiHelperTest.php | 6148 ++++++++--------- tests/lib/Encryption/DecryptAllTest.php | 9 +- .../lib/Encryption/EncryptionWrapperTest.php | 9 +- tests/lib/Encryption/ManagerTest.php | 1 + tests/lib/Encryption/UpdateTest.php | 3 +- tests/lib/Encryption/UtilTest.php | 1 + tests/lib/EventSourceFactoryTest.php | 1 + tests/lib/Files/AppData/AppDataTest.php | 1 + tests/lib/Files/AppData/FactoryTest.php | 1 + tests/lib/Files/Cache/CacheTest.php | 27 +- tests/lib/Files/Cache/HomeCacheTest.php | 1 + .../Files/Cache/MoveFromCacheTraitTest.php | 1 + tests/lib/Files/Cache/PropagatorTest.php | 3 +- tests/lib/Files/Cache/ScannerTest.php | 1 + tests/lib/Files/Cache/SearchBuilderTest.php | 1 + tests/lib/Files/Cache/UpdaterLegacyTest.php | 1 + tests/lib/Files/Cache/UpdaterTest.php | 1 + tests/lib/Files/Cache/WatcherTest.php | 1 + .../lib/Files/Cache/Wrapper/CacheJailTest.php | 1 + .../Wrapper/CachePermissionsMaskTest.php | 1 + tests/lib/Files/Config/UserMountCacheTest.php | 3 +- tests/lib/Files/EtagTest.php | 1 + tests/lib/Files/FileInfoTest.php | 1 + tests/lib/Files/FilesystemTest.php | 5 +- tests/lib/Files/Mount/ManagerTest.php | 1 + tests/lib/Files/Mount/MountPointTest.php | 1 + tests/lib/Files/Mount/MountTest.php | 1 + .../Mount/ObjectHomeMountProviderTest.php | 1 + .../lib/Files/Mount/RootMountProviderTest.php | 44 +- tests/lib/Files/Node/FileTest.php | 1 + tests/lib/Files/Node/FolderTest.php | 7 +- tests/lib/Files/Node/HookConnectorTest.php | 3 +- tests/lib/Files/Node/IntegrationTest.php | 1 + tests/lib/Files/Node/NodeTest.php | 1 + tests/lib/Files/Node/RootTest.php | 1 + tests/lib/Files/ObjectStore/AzureTest.php | 1 + tests/lib/Files/ObjectStore/LocalTest.php | 1 + tests/lib/Files/ObjectStore/MapperTest.php | 1 + .../ObjectStore/ObjectStoreScannerTest.php | 1 + .../ObjectStore/ObjectStoreStorageTest.php | 1 + ...ObjectStoreStoragesDifferentBucketTest.php | 1 + .../ObjectStoreStoragesSameBucketTest.php | 1 + tests/lib/Files/ObjectStore/S3Test.php | 3 +- tests/lib/Files/ObjectStore/SwiftTest.php | 1 + tests/lib/Files/PathVerificationTest.php | 1 + .../Search/QueryOptimizer/CombinedTests.php | 101 +- .../QueryOptimizer/FlattenNestedBoolTest.php | 7 +- .../MergeDistributiveOperationsTest.php | 65 +- .../QueryOptimizer/OrEqualsToInTest.php | 37 +- .../Files/Search/SearchIntegrationTest.php | 7 +- tests/lib/Files/SimpleFS/SimpleFileTest.php | 1 + tests/lib/Files/SimpleFS/SimpleFolderTest.php | 1 + tests/lib/Files/Storage/CommonTest.php | 1 + tests/lib/Files/Storage/CopyDirectoryTest.php | 1 + tests/lib/Files/Storage/HomeTest.php | 1 + tests/lib/Files/Storage/LocalTest.php | 1 + tests/lib/Files/Storage/Storage.php | 1 + .../lib/Files/Storage/StorageFactoryTest.php | 1 + tests/lib/Files/Storage/StoragesTest.php | 1 + .../Storage/Wrapper/AvailabilityTest.php | 3 +- .../Files/Storage/Wrapper/EncodingTest.php | 1 + .../Files/Storage/Wrapper/EncryptionTest.php | 7 +- tests/lib/Files/Storage/Wrapper/JailTest.php | 1 + .../Files/Storage/Wrapper/KnownMtimeTest.php | 1 + .../Storage/Wrapper/PermissionsMaskTest.php | 1 + tests/lib/Files/Storage/Wrapper/QuotaTest.php | 1 + .../lib/Files/Storage/Wrapper/WrapperTest.php | 1 + .../Files/Stream/DummyEncryptionWrapper.php | 1 + tests/lib/Files/Stream/EncryptionTest.php | 15 +- tests/lib/Files/Stream/QuotaTest.php | 1 + tests/lib/Files/Type/DetectionTest.php | 1 + tests/lib/Files/Type/LoaderTest.php | 1 + tests/lib/Files/Utils/ScannerTest.php | 1 + tests/lib/Files/ViewTest.php | 15 +- tests/lib/GlobalScale/ConfigTest.php | 3 +- tests/lib/Group/Backend.php | 1 + tests/lib/Group/DatabaseTest.php | 1 + tests/lib/Group/Dummy.php | 1 + tests/lib/Group/ManagerTest.php | 8 +- tests/lib/Group/MetaDataTest.php | 1 + tests/lib/HelperStorageTest.php | 1 + tests/lib/HookHelper.php | 1 + tests/lib/Hooks/BasicEmitterTest.php | 1 + tests/lib/Http/Client/ClientServiceTest.php | 4 +- .../lib/Http/Client/NegativeDnsCacheTest.php | 4 +- tests/lib/Http/Client/ResponseTest.php | 1 + tests/lib/Http/WellKnown/JrdResponseTest.php | 4 +- .../lib/Http/WellKnown/RequestManagerTest.php | 12 +- tests/lib/ImageTest.php | 9 +- tests/lib/InfoXmlTest.php | 1 + tests/lib/InitialStateServiceTest.php | 2 +- tests/lib/InstallerTest.php | 1 + tests/lib/IntegrityCheck/CheckerTest.php | 415 +- .../IntegrityCheck/Helpers/AppLocatorTest.php | 1 + .../Helpers/EnvironmentHelperTest.php | 1 + .../Helpers/FileAccessHelperTest.php | 1 + .../ExcludeFileByNameFilterIteratorTest.php | 1 + tests/lib/L10N/FactoryTest.php | 92 +- tests/lib/L10N/L10nTest.php | 19 +- tests/lib/L10N/LanguageIteratorTest.php | 1 + tests/lib/LargeFileHelperGetFileSizeTest.php | 1 + tests/lib/LargeFileHelperTest.php | 1 + tests/lib/LegacyHelperTest.php | 153 +- tests/lib/Lock/DBLockingProviderTest.php | 1 + tests/lib/Lock/LockingProvider.php | 1 + .../lib/Lock/MemcacheLockingProviderTest.php | 1 + .../Lock/NonCachingDBLockingProviderTest.php | 1 + tests/lib/Lockdown/Filesystem/NoFSTest.php | 1 + .../lib/Lockdown/Filesystem/NullCacheTest.php | 1 + .../Lockdown/Filesystem/NullStorageTest.php | 1 + tests/lib/Lockdown/LockdownManagerTest.php | 1 + tests/lib/Log/FileTest.php | 13 +- tests/lib/Log/LogFactoryTest.php | 1 + tests/lib/LoggerTest.php | 3 +- tests/lib/Mail/EMailTemplateTest.php | 1 + tests/lib/Mail/MailerTest.php | 1 + tests/lib/Mail/MessageTest.php | 5 +- tests/lib/Mail/Provider/ManagerTest.php | 70 +- tests/lib/Memcache/CasTraitTest.php | 1 + tests/lib/Memcache/FactoryTest.php | 1 + tests/lib/Migration/BackgroundRepairTest.php | 1 + tests/lib/NaturalSortTest.php | 1 + tests/lib/NavigationManagerTest.php | 25 +- tests/lib/Notification/ActionTest.php | 1 + tests/lib/OCS/DiscoveryServiceTest.php | 7 +- tests/lib/OCS/MapStatusCodeTest.php | 1 + tests/lib/OCS/ProviderTest.php | 1 + .../lib/Preview/BackgroundCleanupJobTest.php | 5 +- tests/lib/Preview/BitmapTest.php | 1 + tests/lib/Preview/GeneratorTest.php | 1 + tests/lib/Preview/HEICTest.php | 3 +- tests/lib/Preview/ImageTest.php | 1 + tests/lib/Preview/MP3Test.php | 1 + tests/lib/Preview/MovieTest.php | 1 + tests/lib/Preview/OfficeTest.php | 1 + tests/lib/Preview/Provider.php | 1 + tests/lib/Preview/SVGTest.php | 1 + tests/lib/Preview/TXTTest.php | 1 + tests/lib/PublicNamespace/UtilTest.php | 1 + tests/lib/Remote/Api/OCSTest.php | 1 + tests/lib/Remote/InstanceTest.php | 1 + tests/lib/Repair/CleanTagsTest.php | 1 + tests/lib/Repair/ClearFrontendCachesTest.php | 1 + .../Repair/ClearGeneratedAvatarCacheTest.php | 7 +- .../Repair/OldGroupMembershipSharesTest.php | 1 + tests/lib/Repair/RepairCollationTest.php | 7 +- tests/lib/Repair/RepairInvalidSharesTest.php | 1 + tests/lib/Repair/RepairMimeTypesTest.php | 1 + tests/lib/RepairTest.php | 1 + .../lib/RichObjectStrings/DefinitionsTest.php | 1 + tests/lib/RichObjectStrings/ValidatorTest.php | 1 + tests/lib/Route/RouterTest.php | 2 +- .../Security/CSRF/CsrfTokenManagerTest.php | 12 +- tests/lib/Security/Ip/RemoteAddressTest.php | 6 +- .../lib/Security/Normalizer/IpAddressTest.php | 2 +- tests/lib/ServerTest.php | 1 + tests/lib/Session/CryptoSessionDataTest.php | 1 + tests/lib/Session/CryptoWrappingTest.php | 1 + tests/lib/Settings/ManagerTest.php | 1 + tests/lib/Settings/SectionTest.php | 1 + tests/lib/SetupTest.php | 1 + tests/lib/Share/Backend.php | 3 +- tests/lib/Share/HelperTest.php | 1 + tests/lib/Share/ShareTest.php | 1 + .../lib/Share20/DefaultShareProviderTest.php | 43 +- tests/lib/Share20/LegacyHooksTest.php | 1 + tests/lib/Share20/ManagerTest.php | 21 +- tests/lib/Share20/ShareHelperTest.php | 1 + tests/lib/Share20/ShareTest.php | 1 + tests/lib/SubAdminTest.php | 1 + tests/lib/TagsTest.php | 7 +- .../lib/TaskProcessing/TaskProcessingTest.php | 3 +- tests/lib/TempManagerTest.php | 4 +- tests/lib/Template/CSSResourceLocatorTest.php | 1 + tests/lib/Template/JSCombinerTest.php | 1 + tests/lib/Template/JSResourceLocatorTest.php | 3 +- tests/lib/Template/ResourceLocatorTest.php | 1 + tests/lib/TemplateFunctionsTest.php | 55 +- tests/lib/TestCase.php | 7 +- tests/lib/TestMoveableMountPoint.php | 1 + .../lib/TextProcessing/TextProcessingTest.php | 1 + tests/lib/Traits/ClientServiceTrait.php | 1 + tests/lib/Traits/EncryptionTrait.php | 1 + tests/lib/Traits/MountProviderTrait.php | 1 + tests/lib/Traits/UserTrait.php | 1 + tests/lib/Updater/ReleaseMetadataTest.php | 40 +- tests/lib/Updater/VersionCheckTest.php | 7 +- tests/lib/UpdaterTest.php | 1 + tests/lib/UrlGeneratorTest.php | 1 + tests/lib/User/AvatarUserDummy.php | 1 + tests/lib/User/Backend.php | 1 + tests/lib/User/DatabaseTest.php | 1 + tests/lib/User/Dummy.php | 1 + tests/lib/User/ManagerTest.php | 2 +- tests/lib/User/SessionTest.php | 1 + tests/lib/User/UserTest.php | 2 +- tests/lib/Util/Group/Dummy.php | 1 + tests/lib/Util/User/Dummy.php | 1 + tests/lib/UtilCheckServerTest.php | 1 + tests/lib/UtilTest.php | 49 +- tests/preseed-config.php | 1 + tests/redis-cluster.config.php | 1 + tests/redis.config.php | 1 + tests/startsessionlistener.php | 3 +- themes/example/defaults.php | 1 + 1999 files changed, 10032 insertions(+), 8716 deletions(-) diff --git a/apps/admin_audit/lib/Actions/Files.php b/apps/admin_audit/lib/Actions/Files.php index bf9660b1939..57204e0b022 100644 --- a/apps/admin_audit/lib/Actions/Files.php +++ b/apps/admin_audit/lib/Actions/Files.php @@ -41,7 +41,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - "Exception thrown in file read: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file read: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -61,7 +61,7 @@ class Files extends Action { $this->renamedNodes[$source->getId()] = $source; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - "Exception thrown in file rename: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file rename: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -81,7 +81,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - "Exception thrown in file rename: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file rename: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -105,7 +105,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - "Exception thrown in file create: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file create: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -132,7 +132,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - "Exception thrown in file copy: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file copy: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -155,7 +155,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - "Exception thrown in file write: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file write: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -181,7 +181,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - "Exception thrown in file delete: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file delete: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } @@ -210,7 +210,7 @@ class Files extends Action { ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( - "Exception thrown in file preview: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] + 'Exception thrown in file preview: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e] ); return; } diff --git a/apps/cloud_federation_api/lib/Capabilities.php b/apps/cloud_federation_api/lib/Capabilities.php index 61cc45a24e6..d5cb30bdc3f 100644 --- a/apps/cloud_federation_api/lib/Capabilities.php +++ b/apps/cloud_federation_api/lib/Capabilities.php @@ -55,8 +55,8 @@ class Capabilities implements ICapability { $resource = $this->provider->createNewResourceType(); $resource->setName('file') - ->setShareTypes(['user', 'group']) - ->setProtocols(['webdav' => '/public.php/webdav/']); + ->setShareTypes(['user', 'group']) + ->setProtocols(['webdav' => '/public.php/webdav/']); $this->provider->addResourceType($resource); diff --git a/apps/cloud_federation_api/lib/Config.php b/apps/cloud_federation_api/lib/Config.php index 9aefca746a1..610769f2d8e 100644 --- a/apps/cloud_federation_api/lib/Config.php +++ b/apps/cloud_federation_api/lib/Config.php @@ -1,4 +1,5 @@ |JSONResponse|JSONResponse - * 201: The notification was successfully received. The display name of the recipient might be returned in the body - * 400: Bad request due to invalid parameters, e.g. when `shareWith` is not found or required properties are missing - * 501: Share type or the resource type is not supported + * 201: The notification was successfully received. The display name of the recipient might be returned in the body + * 400: Bad request due to invalid parameters, e.g. when `shareWith` is not found or required properties are missing + * 501: Share type or the resource type is not supported */ #[PublicPage] #[NoCSRFRequired] @@ -196,10 +197,10 @@ class RequestHandlerController extends Controller { * @param array|null $notification The actual payload of the notification * * @return JSONResponse, array{}>|JSONResponse|JSONResponse - * 201: The notification was successfully received - * 400: Bad request due to invalid parameters, e.g. when `type` is invalid or missing - * 403: Getting resource is not allowed - * 501: The resource type is not supported + * 201: The notification was successfully received + * 400: Bad request due to invalid parameters, e.g. when `type` is invalid or missing + * 403: Getting resource is not allowed + * 501: The resource type is not supported */ #[NoCSRFRequired] #[PublicPage] diff --git a/apps/comments/lib/Activity/Filter.php b/apps/comments/lib/Activity/Filter.php index 6f010d855cb..8dcafd872d7 100644 --- a/apps/comments/lib/Activity/Filter.php +++ b/apps/comments/lib/Activity/Filter.php @@ -1,4 +1,5 @@ mountCollection->getMountCache(); - $mounts = $cache->getMountsForFileId((int)$event->getComment()->getObjectId()); + $mounts = $cache->getMountsForFileId((int) $event->getComment()->getObjectId()); if (empty($mounts)) { return; } @@ -47,7 +47,7 @@ class Listener { foreach ($mounts as $mount) { $owner = $mount->getUser()->getUID(); $ownerFolder = $this->rootFolder->getUserFolder($owner); - $nodes = $ownerFolder->getById((int)$event->getComment()->getObjectId()); + $nodes = $ownerFolder->getById((int) $event->getComment()->getObjectId()); if (!empty($nodes)) { /** @var Node $node */ $node = array_shift($nodes); @@ -75,7 +75,7 @@ class Listener { foreach ($users as $user => $path) { // numerical user ids end up as integers from array keys, but string // is required - $activity->setAffectedUser((string)$user); + $activity->setAffectedUser((string) $user); $activity->setSubject('add_comment_subject', [ 'actor' => $actor, diff --git a/apps/comments/lib/Activity/Provider.php b/apps/comments/lib/Activity/Provider.php index 704ef0e0a48..4806eeec693 100644 --- a/apps/comments/lib/Activity/Provider.php +++ b/apps/comments/lib/Activity/Provider.php @@ -1,4 +1,5 @@ rootFolder->getUserFolder($currentUser->getUID()); - $files = $userFolder->getById((int)$comment->getObjectId()); + $files = $userFolder->getById((int) $comment->getObjectId()); $this->markProcessed($comment, $currentUser); diff --git a/apps/comments/lib/Listener/CommentsEntityEventListener.php b/apps/comments/lib/Listener/CommentsEntityEventListener.php index 5aeeb3c63ea..2a805d80083 100644 --- a/apps/comments/lib/Listener/CommentsEntityEventListener.php +++ b/apps/comments/lib/Listener/CommentsEntityEventListener.php @@ -28,7 +28,7 @@ class CommentsEntityEventListener implements IEventListener { } $event->addEntityCollection('files', function ($name): bool { - $nodes = $this->rootFolder->getUserFolder($this->userId)->getById((int)$name); + $nodes = $this->rootFolder->getUserFolder($this->userId)->getById((int) $name); return !empty($nodes); }); } diff --git a/apps/comments/lib/MaxAutoCompleteResultsInitialState.php b/apps/comments/lib/MaxAutoCompleteResultsInitialState.php index b4c8f8719db..96bc2e6ea16 100644 --- a/apps/comments/lib/MaxAutoCompleteResultsInitialState.php +++ b/apps/comments/lib/MaxAutoCompleteResultsInitialState.php @@ -22,6 +22,6 @@ class MaxAutoCompleteResultsInitialState extends InitialStateProvider { } public function getData(): int { - return (int)$this->config->getAppValue('comments', 'maxAutoCompleteResults', '10'); + return (int) $this->config->getAppValue('comments', 'maxAutoCompleteResults', '10'); } } diff --git a/apps/comments/lib/Notification/Notifier.php b/apps/comments/lib/Notification/Notifier.php index d5563ef7d85..9ed63029fc9 100644 --- a/apps/comments/lib/Notification/Notifier.php +++ b/apps/comments/lib/Notification/Notifier.php @@ -84,7 +84,7 @@ class Notifier implements INotifier { throw new UnknownNotificationException('Unsupported comment object'); } $userFolder = $this->rootFolder->getUserFolder($notification->getUser()); - $nodes = $userFolder->getById((int)$parameters[1]); + $nodes = $userFolder->getById((int) $parameters[1]); if (empty($nodes)) { throw new AlreadyProcessedException(); } diff --git a/apps/comments/lib/Search/Result.php b/apps/comments/lib/Search/Result.php index f9bdc71f0a3..a37b80686d2 100644 --- a/apps/comments/lib/Search/Result.php +++ b/apps/comments/lib/Search/Result.php @@ -1,4 +1,5 @@ mapper->find( $this->getUid(), - (int)$name + (int) $name ), $this->principalUri, $this->getACL() ); } catch (DoesNotExistException $ex) { - throw new NotFound("Contact does not exist: " . $ex->getMessage(), 0, $ex); + throw new NotFound('Contact does not exist: ' . $ex->getMessage(), 0, $ex); } } @@ -92,7 +92,7 @@ class AddressBook extends ExternalAddressBook implements IACL { try { $this->mapper->find( $this->getUid(), - (int)$name + (int) $name ); return true; } catch (DoesNotExistException $e) { @@ -112,7 +112,7 @@ class AddressBook extends ExternalAddressBook implements IACL { * @throws Exception */ public function propPatch(PropPatch $propPatch) { - throw new Exception("This addressbook is immutable"); + throw new Exception('This addressbook is immutable'); } /** diff --git a/apps/contactsinteraction/lib/Db/CardSearchDao.php b/apps/contactsinteraction/lib/Db/CardSearchDao.php index 0929cb7efa0..09fa4711adb 100644 --- a/apps/contactsinteraction/lib/Db/CardSearchDao.php +++ b/apps/contactsinteraction/lib/Db/CardSearchDao.php @@ -50,7 +50,7 @@ class CardSearchDao { } $addressbooksQuery->selectDistinct('id') ->from('addressbooks') - ->where($addressbooksQuery->expr()->eq('principaluri', $cardQuery->createNamedParameter("principals/users/" . $user->getUID()))); + ->where($addressbooksQuery->expr()->eq('principaluri', $cardQuery->createNamedParameter('principals/users/' . $user->getUID()))); $propQuery->selectDistinct('cardid') ->from('cards_properties') ->where($propQuery->expr()->in('addressbookid', $propQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY)) diff --git a/apps/contactsinteraction/lib/Db/RecentContactMapper.php b/apps/contactsinteraction/lib/Db/RecentContactMapper.php index c835b5287c8..02d2c1e8ea1 100644 --- a/apps/contactsinteraction/lib/Db/RecentContactMapper.php +++ b/apps/contactsinteraction/lib/Db/RecentContactMapper.php @@ -100,7 +100,7 @@ class RecentContactMapper extends QBMapper { return null; } - return (int)$row['last_contact']; + return (int) $row['last_contact']; } public function cleanUp(int $olderThan): void { diff --git a/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php b/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php index ac0cd927512..78b366f015e 100644 --- a/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php +++ b/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php @@ -45,12 +45,12 @@ class ContactInteractionListener implements IEventListener { } if ($event->getUid() === null && $event->getEmail() === null && $event->getFederatedCloudId() === null) { - $this->logger->warning("Contact interaction event has no user identifier set"); + $this->logger->warning('Contact interaction event has no user identifier set'); return; } if ($event->getUid() !== null && $event->getUid() === $event->getActor()->getUID()) { - $this->logger->info("Ignoring contact interaction with self"); + $this->logger->info('Ignoring contact interaction with self'); return; } diff --git a/apps/dav/appinfo/routes.php b/apps/dav/appinfo/routes.php index 91c1ba58ea2..dba7bcbbdf0 100644 --- a/apps/dav/appinfo/routes.php +++ b/apps/dav/appinfo/routes.php @@ -1,4 +1,5 @@ avatar->getFile($this->size)->getMTime(); if (!empty($timestamp)) { - return (int)$timestamp; + return (int) $timestamp; } return $timestamp; } diff --git a/apps/dav/lib/Avatars/RootCollection.php b/apps/dav/lib/Avatars/RootCollection.php index d7cdb92c6be..2de5272bb68 100644 --- a/apps/dav/lib/Avatars/RootCollection.php +++ b/apps/dav/lib/Avatars/RootCollection.php @@ -1,4 +1,5 @@ time->getTime() - (60 * 60); $this->calDavBackend->deleteOutdatedSchedulingObjects($time, 50000); - $this->logger->info("Removed outdated scheduling objects"); + $this->logger->info('Removed outdated scheduling objects'); } } diff --git a/apps/dav/lib/BackgroundJob/OutOfOfficeEventDispatcherJob.php b/apps/dav/lib/BackgroundJob/OutOfOfficeEventDispatcherJob.php index 8293b370996..cc4fd5dce9d 100644 --- a/apps/dav/lib/BackgroundJob/OutOfOfficeEventDispatcherJob.php +++ b/apps/dav/lib/BackgroundJob/OutOfOfficeEventDispatcherJob.php @@ -41,7 +41,7 @@ class OutOfOfficeEventDispatcherJob extends QueuedJob { try { $absence = $this->absenceMapper->findById($id); - } catch (DoesNotExistException | \OCP\DB\Exception $e) { + } catch (DoesNotExistException|\OCP\DB\Exception $e) { $this->logger->error('Failed to dispatch out-of-office event: ' . $e->getMessage(), [ 'exception' => $e, 'argument' => $argument, diff --git a/apps/dav/lib/BackgroundJob/UploadCleanup.php b/apps/dav/lib/BackgroundJob/UploadCleanup.php index d90e6cbd171..aa19dbb22ec 100644 --- a/apps/dav/lib/BackgroundJob/UploadCleanup.php +++ b/apps/dav/lib/BackgroundJob/UploadCleanup.php @@ -44,7 +44,7 @@ class UploadCleanup extends TimedJob { /** @var Folder $uploads */ $uploads = $userRoot->get('uploads'); $uploadFolder = $uploads->get($folder); - } catch (NotFoundException | NoUserException $e) { + } catch (NotFoundException|NoUserException $e) { $this->jobList->remove(self::class, $argument); return; } @@ -53,7 +53,7 @@ class UploadCleanup extends TimedJob { $time = $this->time->getTime() - 60 * 60 * 24; if (!($uploadFolder instanceof Folder)) { - $this->logger->error("Found a file inside the uploads folder. Uid: " . $uid . ' folder: ' . $folder); + $this->logger->error('Found a file inside the uploads folder. Uid: ' . $uid . ' folder: ' . $folder); if ($uploadFolder->getMTime() < $time) { $uploadFolder->delete(); } diff --git a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php index 1593be49a5d..8d5c229241d 100644 --- a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php +++ b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php @@ -55,14 +55,14 @@ class UserStatusAutomation extends TimedJob { $userId = $argument['userId']; $user = $this->userManager->get($userId); - if($user === null) { + if ($user === null) { return; } $ooo = $this->coordinator->getCurrentOutOfOfficeData($user); $continue = $this->processOutOfOfficeData($user, $ooo); - if($continue === false) { + if ($continue === false) { return; } @@ -150,7 +150,7 @@ class UserStatusAutomation extends TimedJob { $effectiveEnd = \DateTime::createFromImmutable($originalEnd)->sub(new \DateInterval('P7D')); try { - $it = new RRuleIterator((string)$available->RRULE, $effectiveStart); + $it = new RRuleIterator((string) $available->RRULE, $effectiveStart); $it->fastForward($lastMidnight); $startToday = $it->current(); @@ -196,7 +196,7 @@ class UserStatusAutomation extends TimedJob { return; } - if(!$hasDndForOfficeHours) { + if (!$hasDndForOfficeHours) { // Office hours are not set to DND, so there is nothing to do. return; } @@ -207,7 +207,7 @@ class UserStatusAutomation extends TimedJob { } private function processOutOfOfficeData(IUser $user, ?IOutOfOfficeData $ooo): bool { - if(empty($ooo)) { + if (empty($ooo)) { // Reset the user status if the absence doesn't exist $this->logger->debug('User has no OOO period in effect, reverting DND status if applicable'); $this->manager->revertUserStatus($user->getUID(), IUserStatus::MESSAGE_OUT_OF_OFFICE, IUserStatus::DND); @@ -215,12 +215,12 @@ class UserStatusAutomation extends TimedJob { return true; } - if(!$this->coordinator->isInEffect($ooo)) { + if (!$this->coordinator->isInEffect($ooo)) { // Reset the user status if the absence is (no longer) in effect $this->logger->debug('User has no OOO period in effect, reverting DND status if applicable'); $this->manager->revertUserStatus($user->getUID(), IUserStatus::MESSAGE_OUT_OF_OFFICE, IUserStatus::DND); - if($ooo->getStartDate() > $this->time->getTime()) { + if ($ooo->getStartDate() > $this->time->getTime()) { // Set the next run to take place at the start of the ooo period if it is in the future // This might be overwritten if there is an availability setting, but we can't determine // if this is the case here diff --git a/apps/dav/lib/BulkUpload/BulkUploadPlugin.php b/apps/dav/lib/BulkUpload/BulkUploadPlugin.php index ae7f55d7107..80e7da98da1 100644 --- a/apps/dav/lib/BulkUpload/BulkUploadPlugin.php +++ b/apps/dav/lib/BulkUpload/BulkUploadPlugin.php @@ -1,4 +1,5 @@ getPath() !== "bulk") { + if ($request->getPath() !== 'bulk') { return true; } @@ -77,16 +78,16 @@ class BulkUploadPlugin extends ServerPlugin { $node = $this->userFolder->getFirstNodeById($node->getId()); $writtenFiles[$headers['x-file-path']] = [ - "error" => false, - "etag" => $node->getETag(), - "fileid" => DavUtil::getDavFileId($node->getId()), - "permissions" => DavUtil::getDavPermissions($node), + 'error' => false, + 'etag' => $node->getETag(), + 'fileid' => DavUtil::getDavFileId($node->getId()), + 'permissions' => DavUtil::getDavPermissions($node), ]; } catch (\Exception $e) { $this->logger->error($e->getMessage(), ['path' => $headers['x-file-path']]); $writtenFiles[$headers['x-file-path']] = [ - "error" => true, - "message" => $e->getMessage(), + 'error' => true, + 'message' => $e->getMessage(), ]; } } diff --git a/apps/dav/lib/BulkUpload/MultipartRequestParser.php b/apps/dav/lib/BulkUpload/MultipartRequestParser.php index 2d3cf7d421c..654246c98c8 100644 --- a/apps/dav/lib/BulkUpload/MultipartRequestParser.php +++ b/apps/dav/lib/BulkUpload/MultipartRequestParser.php @@ -1,4 +1,5 @@ stream = $stream; @@ -60,7 +61,7 @@ class MultipartRequestParser { [$mimeType, $boundary] = explode(';', $contentType); [$boundaryKey, $boundaryValue] = explode('=', $boundary); } catch (\Exception $e) { - throw new BadRequest("Error while parsing boundary in Content-Type header.", Http::STATUS_BAD_REQUEST, $e); + throw new BadRequest('Error while parsing boundary in Content-Type header.', Http::STATUS_BAD_REQUEST, $e); } $boundaryValue = trim($boundaryValue); @@ -96,7 +97,7 @@ class MultipartRequestParser { $seekBackResult = fseek($this->stream, -$expectedContentLength, SEEK_CUR); if ($seekBackResult === -1) { - throw new Exception("Unknown error while seeking content", Http::STATUS_INTERNAL_SERVER_ERROR); + throw new Exception('Unknown error while seeking content', Http::STATUS_INTERNAL_SERVER_ERROR); } return $expectedContent === $content; @@ -134,7 +135,7 @@ class MultipartRequestParser { $headers = $this->readPartHeaders(); - $content = $this->readPartContent($headers["content-length"], $headers["x-file-md5"]); + $content = $this->readPartContent($headers['content-length'], $headers['x-file-md5']); return [$headers, $content]; } @@ -146,7 +147,7 @@ class MultipartRequestParser { */ private function readBoundary(): string { if (!$this->isAtBoundary()) { - throw new BadRequest("Boundary not found where it should be."); + throw new BadRequest('Boundary not found where it should be.'); } return fread($this->stream, strlen($this->boundary)); @@ -180,12 +181,12 @@ class MultipartRequestParser { } } - if (!isset($headers["content-length"])) { - throw new LengthRequired("The Content-Length header must not be null."); + if (!isset($headers['content-length'])) { + throw new LengthRequired('The Content-Length header must not be null.'); } - if (!isset($headers["x-file-md5"])) { - throw new BadRequest("The X-File-MD5 header must not be null."); + if (!isset($headers['x-file-md5'])) { + throw new BadRequest('The X-File-MD5 header must not be null.'); } return $headers; @@ -201,7 +202,7 @@ class MultipartRequestParser { $computedMd5 = $this->computeMd5Hash($length); if ($md5 !== $computedMd5) { - throw new BadRequest("Computed md5 hash is incorrect."); + throw new BadRequest('Computed md5 hash is incorrect.'); } if ($length === 0) { @@ -215,7 +216,7 @@ class MultipartRequestParser { } if ($length !== 0 && feof($this->stream)) { - throw new Exception("Unexpected EOF while reading stream."); + throw new Exception('Unexpected EOF while reading stream.'); } // Read '\r\n'. diff --git a/apps/dav/lib/CalDAV/Activity/Backend.php b/apps/dav/lib/CalDAV/Activity/Backend.php index c2018baab92..41b24314388 100644 --- a/apps/dav/lib/CalDAV/Activity/Backend.php +++ b/apps/dav/lib/CalDAV/Activity/Backend.php @@ -1,4 +1,5 @@ 'calendar', - 'id' => (string)$data['id'], + 'id' => (string) $data['id'], 'name' => $l->t('Personal'), ]; } return [ 'type' => 'calendar', - 'id' => (string)$data['id'], + 'id' => (string) $data['id'], 'name' => $data['name'], ]; } @@ -72,7 +73,7 @@ abstract class Base implements IProvider { protected function generateLegacyCalendarParameter($id, $name) { return [ 'type' => 'calendar', - 'id' => (string)$id, + 'id' => (string) $id, 'name' => $name, ]; } diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php index a7509831f29..04569cb8d65 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php @@ -1,4 +1,5 @@ vobject->getBaseComponents(); foreach ($components as $key => $component) { $components[$key]->STATUS = 'CANCELLED'; - $components[$key]->SEQUENCE = isset($component->SEQUENCE) ? ((int)$component->SEQUENCE->getValue()) + 1 : 1; + $components[$key]->SEQUENCE = isset($component->SEQUENCE) ? ((int) $component->SEQUENCE->getValue()) + 1 : 1; if ($component->name === 'VEVENT') { $components[$key]->METHOD = 'CANCEL'; } @@ -116,9 +116,9 @@ class CalendarObject implements ICalendarObject, IACL { throw new NotFound('Invalid node'); } if (isset($base->{'X-FILENAME'})) { - return (string)$base->{'X-FILENAME'}; + return (string) $base->{'X-FILENAME'}; } - return (string)$base->UID . '.ics'; + return (string) $base->UID . '.ics'; } public function setName($name): void { diff --git a/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php b/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php index 733e8079111..049d76e7c10 100644 --- a/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php +++ b/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php @@ -1,4 +1,5 @@ getOwner(), 17); - if($owner !== $this->user->getUID()) { + if ($owner !== $this->user->getUID()) { $this->server->httpResponse->setStatus(403); return false; } diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index 0990cd674dd..faf76f6697a 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -169,7 +169,7 @@ class BirthdayService { return null; } $birthday = $doc->{$dateField}; - if (!(string)$birthday) { + if (!(string) $birthday) { return null; } // Skip if the BDAY property is not of the right type. @@ -188,18 +188,18 @@ class BirthdayService { $omitYear = (isset($parameters['X-APPLE-OMIT-YEAR']) && $parameters['X-APPLE-OMIT-YEAR'] === $dateParts['year']); // 'X-APPLE-OMIT-YEAR' is not always present, at least iOS 12.4 uses the hard coded date of 1604 (the start of the gregorian calendar) when the year is unknown - if ($omitYear || (int)$dateParts['year'] === 1604) { + if ($omitYear || (int) $dateParts['year'] === 1604) { $dateParts['year'] = null; } } $originalYear = null; if ($dateParts['year'] !== null) { - $originalYear = (int)$dateParts['year']; + $originalYear = (int) $dateParts['year']; } - $leapDay = ((int)$dateParts['month'] === 2 - && (int)$dateParts['date'] === 29); + $leapDay = ((int) $dateParts['month'] === 2 + && (int) $dateParts['date'] === 29); if ($dateParts['year'] === null || $originalYear < 1970) { $birthday = ($leapDay ? '1972-' : '1970-') . $dateParts['month'] . '-' . $dateParts['date']; diff --git a/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php b/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php index 3f6eff4e1f4..06fb7236000 100644 --- a/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php +++ b/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php @@ -62,7 +62,7 @@ class CachedSubscriptionImpl implements ICalendar { * @param string $pattern which should match within the $searchProperties * @param array $searchProperties defines the properties within the query pattern should match * @param array $options - optional parameters: - * ['timerange' => ['start' => new DateTime(...), 'end' => new DateTime(...)]] + * ['timerange' => ['start' => new DateTime(...), 'end' => new DateTime(...)]] * @param int|null $limit - limit number of search results * @param int|null $offset - offset for paging of search results * @return array an array of events/journals/todos which are arrays of key-value-pairs diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 0aec5525cdb..81ad1f4a0f1 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -1,4 +1,5 @@ executeQuery(); - $column = (int)$result->fetchOne(); + $column = (int) $result->fetchOne(); $result->closeCursor(); return $column; } @@ -243,7 +244,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription } $result = $query->executeQuery(); - $column = (int)$result->fetchOne(); + $column = (int) $result->fetchOne(); $result->closeCursor(); return $column; } @@ -521,8 +522,8 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription '{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'), '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], $this->legacyEndpoint), - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ, - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC, + '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int) $row['access'] === Backend::ACCESS_READ, + '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int) $row['access'] === self::ACCESS_PUBLIC, ]; $calendar = $this->rowToCalendar($row, $calendar); @@ -586,8 +587,8 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription '{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'), '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint), - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ, - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC, + '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int) $row['access'] === Backend::ACCESS_READ, + '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int) $row['access'] === self::ACCESS_PUBLIC, ]; $calendar = $this->rowToCalendar($row, $calendar); @@ -799,7 +800,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription return [$calendarId, $calendarData]; }, $this->db); - $this->dispatcher->dispatchTyped(new CalendarCreatedEvent((int)$calendarId, $calendarData)); + $this->dispatcher->dispatchTyped(new CalendarCreatedEvent((int) $calendarId, $calendarData)); return $calendarId; } @@ -847,7 +848,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $query->where($query->expr()->eq('id', $query->createNamedParameter($calendarId))); $query->executeStatement(); - $this->addChanges($calendarId, [""], 2); + $this->addChanges($calendarId, [''], 2); $calendarData = $this->getCalendarById($calendarId); $shares = $this->getShares($calendarId); @@ -1046,9 +1047,9 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription 'lastmodified' => $row['lastmodified'], 'etag' => '"' . $row['etag'] . '"', 'calendarid' => $row['calendarid'], - 'size' => (int)$row['size'], + 'size' => (int) $row['size'], 'component' => strtolower($row['componenttype']), - 'classification' => (int)$row['classification'] + 'classification' => (int) $row['classification'] ]; } $stmt->closeCursor(); @@ -1113,9 +1114,9 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription 'etag' => '"' . $row['etag'] . '"', 'calendarid' => $row['calendarid'], 'calendaruri' => $row['calendaruri'], - 'size' => (int)$row['size'], + 'size' => (int) $row['size'], 'component' => strtolower($row['componenttype']), - 'classification' => (int)$row['classification'], + 'classification' => (int) $row['classification'], '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}deleted-at' => $row['deleted_at'] === null ? $row['deleted_at'] : (int) $row['deleted_at'], ]; } @@ -1173,10 +1174,10 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription 'lastmodified' => $row['lastmodified'], 'etag' => '"' . $row['etag'] . '"', 'calendarid' => $row['calendarid'], - 'size' => (int)$row['size'], + 'size' => (int) $row['size'], 'calendardata' => $this->readBlob($row['calendardata']), 'component' => strtolower($row['componenttype']), - 'classification' => (int)$row['classification'], + 'classification' => (int) $row['classification'], '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}deleted-at' => $row['deleted_at'] === null ? $row['deleted_at'] : (int) $row['deleted_at'], ]; } @@ -1221,10 +1222,10 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription 'lastmodified' => $row['lastmodified'], 'etag' => '"' . $row['etag'] . '"', 'calendarid' => $row['calendarid'], - 'size' => (int)$row['size'], + 'size' => (int) $row['size'], 'calendardata' => $this->readBlob($row['calendardata']), 'component' => strtolower($row['componenttype']), - 'classification' => (int)$row['classification'] + 'classification' => (int) $row['classification'] ]; } $result->closeCursor(); @@ -1354,15 +1355,15 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription return $this->atomic(function () use ($calendarId, $objectUri, $calendarData, $extraData, $calendarType) { $query = $this->db->getQueryBuilder(); $query->update('calendarobjects') - ->set('calendardata', $query->createNamedParameter($calendarData, IQueryBuilder::PARAM_LOB)) - ->set('lastmodified', $query->createNamedParameter(time())) - ->set('etag', $query->createNamedParameter($extraData['etag'])) - ->set('size', $query->createNamedParameter($extraData['size'])) - ->set('componenttype', $query->createNamedParameter($extraData['componentType'])) - ->set('firstoccurence', $query->createNamedParameter($extraData['firstOccurence'])) - ->set('lastoccurence', $query->createNamedParameter($extraData['lastOccurence'])) - ->set('classification', $query->createNamedParameter($extraData['classification'])) - ->set('uid', $query->createNamedParameter($extraData['uid'])) + ->set('calendardata', $query->createNamedParameter($calendarData, IQueryBuilder::PARAM_LOB)) + ->set('lastmodified', $query->createNamedParameter(time())) + ->set('etag', $query->createNamedParameter($extraData['etag'])) + ->set('size', $query->createNamedParameter($extraData['size'])) + ->set('componenttype', $query->createNamedParameter($extraData['componentType'])) + ->set('firstoccurence', $query->createNamedParameter($extraData['firstOccurence'])) + ->set('lastoccurence', $query->createNamedParameter($extraData['lastOccurence'])) + ->set('classification', $query->createNamedParameter($extraData['classification'])) + ->set('uid', $query->createNamedParameter($extraData['uid'])) ->where($query->expr()->eq('calendarid', $query->createNamedParameter($calendarId))) ->andWhere($query->expr()->eq('uri', $query->createNamedParameter($objectUri))) ->andWhere($query->expr()->eq('calendartype', $query->createNamedParameter($calendarType))) @@ -1510,13 +1511,13 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription if (!empty($pathInfo['extension'])) { // Append a suffix to "free" the old URI for recreation $newUri = sprintf( - "%s-deleted.%s", + '%s-deleted.%s', $pathInfo['filename'], $pathInfo['extension'] ); } else { $newUri = sprintf( - "%s-deleted", + '%s-deleted', $pathInfo['filename'] ); } @@ -1565,7 +1566,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $this->cachedObjects = []; $this->atomic(function () use ($objectData) { $id = (int) $objectData['id']; - $restoreUri = str_replace("-deleted.ics", ".ics", $objectData['uri']); + $restoreUri = str_replace('-deleted.ics', '.ics', $objectData['uri']); $targetObject = $this->getCalendarObject( $objectData['calendarid'], $restoreUri @@ -1992,7 +1993,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription // For the pagination with hasLimit and hasTimeRange, a stable ordering is helpful. $outerQuery->addOrderBy('id'); - $offset = (int)$offset; + $offset = (int) $offset; $outerQuery->setFirstResult($offset); $calendarObjects = []; @@ -2013,7 +2014,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * * 25 rows and 3 retries is entirely arbitrary. */ - $maxResults = (int)max($limit, 25); + $maxResults = (int) max($limit, 25); $outerQuery->setMaxResults($maxResults); for ($attempt = $objectsCount = 0; $attempt < 3 && $objectsCount < $limit; $attempt++) { @@ -2220,7 +2221,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $subscriptions = $this->getSubscriptionsForUser($principalUri); foreach ($calendars as $calendar) { $calendarAnd = $calendarObjectIdQuery->expr()->andX( - $calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int)$calendar['id'])), + $calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int) $calendar['id'])), $calendarObjectIdQuery->expr()->eq('cob.calendartype', $calendarObjectIdQuery->createNamedParameter(self::CALENDAR_TYPE_CALENDAR)), ); @@ -2234,7 +2235,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription } foreach ($subscriptions as $subscription) { $subscriptionAnd = $calendarObjectIdQuery->expr()->andX( - $calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int)$subscription['id'])), + $calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int) $subscription['id'])), $calendarObjectIdQuery->expr()->eq('cob.calendartype', $calendarObjectIdQuery->createNamedParameter(self::CALENDAR_TYPE_SUBSCRIPTION)), ); @@ -2323,8 +2324,8 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $result = $query->executeQuery(); $calendarObjects = []; while (($array = $result->fetch()) !== false) { - $array['calendarid'] = (int)$array['calendarid']; - $array['calendartype'] = (int)$array['calendartype']; + $array['calendarid'] = (int) $array['calendarid']; + $array['calendartype'] = (int) $array['calendartype']; $array['calendardata'] = $this->readBlob($array['calendardata']); $calendarObjects[] = $array; @@ -2394,10 +2395,10 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription 'etag' => '"' . $row['etag'] . '"', 'calendarid' => $row['calendarid'], 'calendaruri' => $row['calendaruri'], - 'size' => (int)$row['size'], + 'size' => (int) $row['size'], 'calendardata' => $this->readBlob($row['calendardata']), 'component' => strtolower($row['componenttype']), - 'classification' => (int)$row['classification'], + 'classification' => (int) $row['classification'], 'deleted_at' => isset($row['deleted_at']) ? ((int) $row['deleted_at']) : null, ]; } @@ -2513,7 +2514,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription while ($entry = $stmt->fetch(\PDO::FETCH_NUM)) { // assign uri (column 0) to appropriate mutation based on operation (column 1) // forced (int) is needed as doctrine with OCI returns the operation field as string not integer - match ((int)$entry[1]) { + match ((int) $entry[1]) { 1 => $result['added'][] = $entry[0], 2 => $result['modified'][] = $entry[0], 3 => $result['deleted'][] = $entry[0], @@ -2694,7 +2695,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription return $this->getSubscriptionById($subscriptionId); }, $this->db); - $this->dispatcher->dispatchTyped(new SubscriptionUpdatedEvent((int)$subscriptionId, $subscriptionRow, [], $mutations)); + $this->dispatcher->dispatchTyped(new SubscriptionUpdatedEvent((int) $subscriptionId, $subscriptionRow, [], $mutations)); return true; }); @@ -2732,7 +2733,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription ->executeStatement(); if ($subscriptionRow) { - $this->dispatcher->dispatchTyped(new SubscriptionDeletedEvent((int)$subscriptionId, $subscriptionRow, [])); + $this->dispatcher->dispatchTyped(new SubscriptionDeletedEvent((int) $subscriptionId, $subscriptionRow, [])); } }, $this->db); } @@ -2772,7 +2773,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription 'calendardata' => $row['calendardata'], 'lastmodified' => $row['lastmodified'], 'etag' => '"' . $row['etag'] . '"', - 'size' => (int)$row['size'], + 'size' => (int) $row['size'], ]; } @@ -2790,9 +2791,9 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription public function getSchedulingObjects($principalUri) { $query = $this->db->getQueryBuilder(); $stmt = $query->select(['uri', 'calendardata', 'lastmodified', 'etag', 'size']) - ->from('schedulingobjects') - ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri))) - ->executeQuery(); + ->from('schedulingobjects') + ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri))) + ->executeQuery(); $results = []; while (($row = $stmt->fetch()) !== false) { @@ -2801,7 +2802,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription 'uri' => $row['uri'], 'lastmodified' => $row['lastmodified'], 'etag' => '"' . $row['etag'] . '"', - 'size' => (int)$row['size'], + 'size' => (int) $row['size'], ]; } $stmt->closeCursor(); @@ -2820,9 +2821,9 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $this->cachedObjects = []; $query = $this->db->getQueryBuilder(); $query->delete('schedulingobjects') - ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri))) - ->andWhere($query->expr()->eq('uri', $query->createNamedParameter($objectUri))) - ->executeStatement(); + ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri))) + ->andWhere($query->expr()->eq('uri', $query->createNamedParameter($objectUri))) + ->executeStatement(); } /** @@ -2840,11 +2841,11 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription ->setMaxResults($limit); $result = $query->executeQuery(); $count = $result->rowCount(); - if($count === 0) { + if ($count === 0) { return; } $ids = array_map(static function (array $id) { - return (int)$id[0]; + return (int) $id[0]; }, $result->fetchAll(\PDO::FETCH_NUM)); $result->closeCursor(); @@ -2852,12 +2853,12 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $deleteQuery = $this->db->getQueryBuilder(); $deleteQuery->delete('schedulingobjects') ->where($deleteQuery->expr()->in('id', $deleteQuery->createParameter('ids'), IQueryBuilder::PARAM_INT_ARRAY)); - foreach(array_chunk($ids, 1000) as $chunk) { + foreach (array_chunk($ids, 1000) as $chunk) { $deleteQuery->setParameter('ids', $chunk, IQueryBuilder::PARAM_INT_ARRAY); $numDeleted += $deleteQuery->executeStatement(); } - if($numDeleted === $limit) { + if ($numDeleted === $limit) { $this->logger->info("Deleted $limit scheduling objects, continuing with next batch"); $this->deleteOutdatedSchedulingObjects($modifiedBefore, $limit); } @@ -2905,7 +2906,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription ->from($table) ->where($query->expr()->eq('id', $query->createNamedParameter($calendarId))); $result = $query->executeQuery(); - $syncToken = (int)$result->fetchOne(); + $syncToken = (int) $result->fetchOne(); $result->closeCursor(); $query = $this->db->getQueryBuilder(); @@ -2965,7 +2966,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription ); $resultDeleted = $qbDeleted->executeQuery(); $deletedUris = array_map(function (string $uri) { - return str_replace("-deleted.ics", ".ics", $uri); + return str_replace('-deleted.ics', '.ics', $uri); }, $resultDeleted->fetchAll(\PDO::FETCH_COLUMN)); $resultDeleted->closeCursor(); $this->addChanges($calendarId, $deletedUris, 3, $calendarType); @@ -3009,7 +3010,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription // Track first component type and uid if ($uid === null) { $componentType = $component->name; - $uid = (string)$component->UID; + $uid = (string) $component->UID; } } } @@ -3332,7 +3333,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param array $calendarObjectUris */ public function purgeCachedEventsForSubscription(int $subscriptionId, array $calendarObjectIds, array $calendarObjectUris): void { - if(empty($calendarObjectUris)) { + if (empty($calendarObjectUris)) { return; } @@ -3432,7 +3433,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription throw new \InvalidArgumentException('Calendarobject does not exists: ' . $uri); } - return (int)$objectIds['id']; + return (int) $objectIds['id']; } /** diff --git a/apps/dav/lib/CalDAV/CalendarHome.php b/apps/dav/lib/CalDAV/CalendarHome.php index d01c2affbc8..59a976ca6bc 100644 --- a/apps/dav/lib/CalDAV/CalendarHome.php +++ b/apps/dav/lib/CalDAV/CalendarHome.php @@ -149,9 +149,9 @@ class CalendarHome extends \Sabre\CalDAV\CalendarHome { // Calendar - this covers all "regular" calendars, but not shared // only check if the method is available - if($this->caldavBackend instanceof CalDavBackend) { + if ($this->caldavBackend instanceof CalDavBackend) { $calendar = $this->caldavBackend->getCalendarByUri($this->principalInfo['uri'], $name); - if(!empty($calendar)) { + if (!empty($calendar)) { return new Calendar($this->caldavBackend, $calendar, $this->l10n, $this->config, $this->logger); } } diff --git a/apps/dav/lib/CalDAV/CalendarImpl.php b/apps/dav/lib/CalDAV/CalendarImpl.php index cac9bad0d89..e568b8f72a2 100644 --- a/apps/dav/lib/CalDAV/CalendarImpl.php +++ b/apps/dav/lib/CalDAV/CalendarImpl.php @@ -84,7 +84,7 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { /** @var VCalendar $vobj */ $vobj = Reader::read($timezoneProp); $components = $vobj->getComponents(); - if(empty($components)) { + if (empty($components)) { return null; } /** @var VTimeZone $vtimezone */ @@ -96,7 +96,7 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { * @param string $pattern which should match within the $searchProperties * @param array $searchProperties defines the properties within the query pattern should match * @param array $options - optional parameters: - * ['timerange' => ['start' => new DateTime(...), 'end' => new DateTime(...)]] + * ['timerange' => ['start' => new DateTime(...), 'end' => new DateTime(...)]] * @param int|null $limit - limit number of search results * @param int|null $offset - offset for paging of search results * @return array an array of events/journals/todos which are arrays of key-value-pairs @@ -233,7 +233,7 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { } $iTipMessage->uid = isset($vEvent->{'UID'}) ? $vEvent->{'UID'}->getValue() : ''; $iTipMessage->component = 'VEVENT'; - $iTipMessage->sequence = isset($vEvent->{'SEQUENCE'}) ? (int)$vEvent->{'SEQUENCE'}->getValue() : 0; + $iTipMessage->sequence = isset($vEvent->{'SEQUENCE'}) ? (int) $vEvent->{'SEQUENCE'}->getValue() : 0; $iTipMessage->message = $vObject; $server->server->emit('schedule', [$iTipMessage]); } diff --git a/apps/dav/lib/CalDAV/CalendarManager.php b/apps/dav/lib/CalDAV/CalendarManager.php index a415a830d2e..538ee2e5289 100644 --- a/apps/dav/lib/CalDAV/CalendarManager.php +++ b/apps/dav/lib/CalDAV/CalendarManager.php @@ -1,4 +1,5 @@ objectData['calendarid']; + return (int) $this->objectData['calendarid']; } public function getPrincipalUri(): string { diff --git a/apps/dav/lib/CalDAV/EventComparisonService.php b/apps/dav/lib/CalDAV/EventComparisonService.php index e3c7749a772..63395e7ce1c 100644 --- a/apps/dav/lib/CalDAV/EventComparisonService.php +++ b/apps/dav/lib/CalDAV/EventComparisonService.php @@ -37,14 +37,14 @@ class EventComparisonService { */ private function removeIfUnchanged(VEvent $filterEvent, array &$eventsToFilter): bool { $filterEventData = []; - foreach(self::EVENT_DIFF as $eventDiff) { + foreach (self::EVENT_DIFF as $eventDiff) { $filterEventData[] = IMipService::readPropertyWithDefault($filterEvent, $eventDiff, ''); } /** @var VEvent $component */ foreach ($eventsToFilter as $k => $eventToFilter) { $eventToFilterData = []; - foreach(self::EVENT_DIFF as $eventDiff) { + foreach (self::EVENT_DIFF as $eventDiff) { $eventToFilterData[] = IMipService::readPropertyWithDefault($eventToFilter, $eventDiff, ''); } // events are identical and can be removed @@ -73,23 +73,23 @@ class EventComparisonService { $newEventComponents = $new->getComponents(); foreach ($newEventComponents as $k => $event) { - if(!$event instanceof VEvent) { + if (!$event instanceof VEvent) { unset($newEventComponents[$k]); } } - if(empty($old)) { + if (empty($old)) { return ['old' => null, 'new' => $newEventComponents]; } $oldEventComponents = $old->getComponents(); - if(is_array($oldEventComponents) && !empty($oldEventComponents)) { + if (is_array($oldEventComponents) && !empty($oldEventComponents)) { foreach ($oldEventComponents as $k => $event) { - if(!$event instanceof VEvent) { + if (!$event instanceof VEvent) { unset($oldEventComponents[$k]); continue; } - if($this->removeIfUnchanged($event, $newEventComponents)) { + if ($this->removeIfUnchanged($event, $newEventComponents)) { unset($oldEventComponents[$k]); } } diff --git a/apps/dav/lib/CalDAV/EventReader.php b/apps/dav/lib/CalDAV/EventReader.php index b1a4aac26d7..008e43fe52f 100644 --- a/apps/dav/lib/CalDAV/EventReader.php +++ b/apps/dav/lib/CalDAV/EventReader.php @@ -67,8 +67,8 @@ class EventReader { * @since 30.0.0 * * @param VCalendar|VEvent|Array|String $input - * @param string|null $uid - * @param DateTimeZone|null $timeZone reference timezone for floating dates and times + * @param string|null $uid + * @param DateTimeZone|null $timeZone reference timezone for floating dates and times */ public function __construct(VCalendar|VEvent|array|string $input, ?string $uid = null, ?DateTimeZone $timeZone = null) { @@ -308,9 +308,9 @@ class EventReader { * * @since 30.0.0 * - * @return string|null R - Relative or A - Absolute + * @return string|null R - Relative or A - Absolute */ - public function recurringPattern(): string | null { + public function recurringPattern(): string|null { if ($this->rruleIterator === null && $this->rdateIterator === null) { return null; } @@ -325,9 +325,9 @@ class EventReader { * * @since 30.0.0 * - * @return string|null daily, weekly, monthly, yearly, fixed + * @return string|null daily, weekly, monthly, yearly, fixed */ - public function recurringPrecision(): string | null { + public function recurringPrecision(): string|null { if ($this->rruleIterator !== null) { return $this->rruleIterator->precision(); } @@ -344,7 +344,7 @@ class EventReader { * * @return int|null */ - public function recurringInterval(): int | null { + public function recurringInterval(): int|null { return $this->rruleIterator?->interval(); } @@ -387,7 +387,7 @@ class EventReader { * * @return int|null */ - public function recurringConcludesAfter(): int | null { + public function recurringConcludesAfter(): int|null { // construct count place holder $count = 0; @@ -412,7 +412,7 @@ class EventReader { * * @return DateTime|null */ - public function recurringConcludesOn(): DateTime | null { + public function recurringConcludesOn(): DateTime|null { if ($this->rruleIterator !== null) { // retrieve rrule conclusion date @@ -639,7 +639,7 @@ class EventReader { * * @return DateTime */ - public function recurrenceDate(): DateTime | null { + public function recurrenceDate(): DateTime|null { if ($this->recurrenceCurrentDate !== null) { return DateTime::createFromInterface($this->recurrenceCurrentDate); } else { @@ -758,7 +758,7 @@ class EventReader { * * @since 30.0.0 * - * @param DateTimeInterface $dt date and time to advance + * @param DateTimeInterface $dt date and time to advance * * @return void */ diff --git a/apps/dav/lib/CalDAV/EventReaderRDate.php b/apps/dav/lib/CalDAV/EventReaderRDate.php index 65362be4b07..9d9669dc0f3 100644 --- a/apps/dav/lib/CalDAV/EventReaderRDate.php +++ b/apps/dav/lib/CalDAV/EventReaderRDate.php @@ -13,15 +13,15 @@ use DateTime; class EventReaderRDate extends \Sabre\VObject\Recur\RDateIterator { - public function concludes(): DateTime | null { + public function concludes(): DateTime|null { return $this->concludesOn(); } - public function concludesAfter(): int | null { + public function concludesAfter(): int|null { return !empty($this->dates) ? count($this->dates) : null; } - public function concludesOn(): DateTime | null { + public function concludesOn(): DateTime|null { if (count($this->dates) > 0) { return new DateTime( $this->dates[array_key_last($this->dates)], diff --git a/apps/dav/lib/CalDAV/EventReaderRRule.php b/apps/dav/lib/CalDAV/EventReaderRRule.php index fa47930caa8..fc229ddcd44 100644 --- a/apps/dav/lib/CalDAV/EventReaderRRule.php +++ b/apps/dav/lib/CalDAV/EventReaderRRule.php @@ -22,7 +22,7 @@ class EventReaderRRule extends \Sabre\VObject\Recur\RRuleIterator { return $this->interval; } - public function concludes(): DateTime | null { + public function concludes(): DateTime|null { // evaluate if until value is a date if ($this->until instanceof DateTimeInterface) { return DateTime::createFromInterface($this->until); @@ -48,11 +48,11 @@ class EventReaderRRule extends \Sabre\VObject\Recur\RRuleIterator { return null; } - public function concludesAfter(): int | null { + public function concludesAfter(): int|null { return !empty($this->count) ? $this->count : null; } - public function concludesOn(): DateTime | null { + public function concludesOn(): DateTime|null { return isset($this->until) ? DateTime::createFromInterface($this->until) : null; } diff --git a/apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php b/apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php index 2b4f8ed0223..20138b4edf8 100644 --- a/apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php +++ b/apps/dav/lib/CalDAV/ICSExportPlugin/ICSExportPlugin.php @@ -1,4 +1,5 @@ l('weekdayName', $dt, ['width' => 'abbreviated']); + return (string) $l10n->l('weekdayName', $dt, ['width' => 'abbreviated']); } private function getDateString(IL10N $l10n, DateTime $dt):string { - return (string)$l10n->l('date', $dt, ['width' => 'medium']); + return (string) $l10n->l('date', $dt, ['width' => 'medium']); } private function getDateTimeString(IL10N $l10n, DateTime $dt):string { - return (string)$l10n->l('datetime', $dt, ['width' => 'medium|short']); + return (string) $l10n->l('datetime', $dt, ['width' => 'medium|short']); } private function getTimeString(IL10N $l10n, DateTime $dt):string { - return (string)$l10n->l('time', $dt, ['width' => 'short']); + return (string) $l10n->l('time', $dt, ['width' => 'short']); } private function getTitleFromVEvent(VEvent $vevent, IL10N $l10n):string { if (isset($vevent->SUMMARY)) { - return (string)$vevent->SUMMARY; + return (string) $vevent->SUMMARY; } return $l10n->t('Untitled event'); diff --git a/apps/dav/lib/CalDAV/Reminder/Notifier.php b/apps/dav/lib/CalDAV/Reminder/Notifier.php index f3c784ea21f..216729f8302 100644 --- a/apps/dav/lib/CalDAV/Reminder/Notifier.php +++ b/apps/dav/lib/CalDAV/Reminder/Notifier.php @@ -292,7 +292,7 @@ class Notifier implements INotifier { * @return string */ private function getWeekDayName(DateTime $dt):string { - return (string)$this->l10n->l('weekdayName', $dt, ['width' => 'abbreviated']); + return (string) $this->l10n->l('weekdayName', $dt, ['width' => 'abbreviated']); } /** @@ -300,7 +300,7 @@ class Notifier implements INotifier { * @return string */ private function getDateString(DateTime $dt):string { - return (string)$this->l10n->l('date', $dt, ['width' => 'medium']); + return (string) $this->l10n->l('date', $dt, ['width' => 'medium']); } /** @@ -308,7 +308,7 @@ class Notifier implements INotifier { * @return string */ private function getDateTimeString(DateTime $dt):string { - return (string)$this->l10n->l('datetime', $dt, ['width' => 'medium|short']); + return (string) $this->l10n->l('datetime', $dt, ['width' => 'medium|short']); } /** @@ -316,6 +316,6 @@ class Notifier implements INotifier { * @return string */ private function getTimeString(DateTime $dt):string { - return (string)$this->l10n->l('time', $dt, ['width' => 'short']); + return (string) $this->l10n->l('time', $dt, ['width' => 'short']); } } diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php index be81e534dd3..35a179deabc 100644 --- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php +++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php @@ -447,7 +447,7 @@ class ReminderService { $uniqueReminders = []; foreach ($reminders as $reminder) { $key = $reminder['notification_date']. $reminder['event_hash'].$reminder['type']; - if(!isset($uniqueReminders[$key])) { + if (!isset($uniqueReminders[$key])) { $uniqueReminders[$key] = $reminder; } } diff --git a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php index 2eb8ebfc84e..0824c2340dd 100644 --- a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php +++ b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php @@ -1,4 +1,5 @@ executeQuery(); } catch (Exception $e) { - $this->logger->error("Could not search resources: " . $e->getMessage(), ['exception' => $e]); + $this->logger->error('Could not search resources: ' . $e->getMessage(), ['exception' => $e]); } $rows = []; diff --git a/apps/dav/lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php index 40396f67ce9..c70d93daf52 100644 --- a/apps/dav/lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php +++ b/apps/dav/lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php @@ -1,4 +1,5 @@ scheduleStatus = '5.0; EMail delivery failed'; return; } - $recipientName = $iTipMessage->recipientName ? (string)$iTipMessage->recipientName : null; + $recipientName = $iTipMessage->recipientName ? (string) $iTipMessage->recipientName : null; $newEvents = $iTipMessage->message; $oldEvents = $this->getVCalendar(); @@ -152,7 +152,7 @@ class IMipPlugin extends SabreIMipPlugin { // No changed events after all - this shouldn't happen if there is significant change yet here we are // The scheduling status is debatable - if(empty($vEvent)) { + if (empty($vEvent)) { $this->logger->warning('iTip message said the change was significant but comparison did not detect any updated VEvents'); $iTipMessage->scheduleStatus = '1.0;We got the message, but it\'s not significant enough to warrant an email'; return; @@ -164,14 +164,14 @@ class IMipPlugin extends SabreIMipPlugin { // we also might not have an old event as this could be a new // invitation, or a new recurrence exception $attendee = $this->imipService->getCurrentAttendee($iTipMessage); - if($attendee === null) { + if ($attendee === null) { $uid = $vEvent->UID ?? 'no UID found'; $this->logger->debug('Could not find recipient ' . $recipient . ' as attendee for event with UID ' . $uid); $iTipMessage->scheduleStatus = '5.0; EMail delivery failed'; return; } // Don't send emails to things - if($this->imipService->isRoomOrResource($attendee)) { + if ($this->imipService->isRoomOrResource($attendee)) { $this->logger->debug('No invitation sent as recipient is room or resource', [ 'attendee' => $recipient, ]); diff --git a/apps/dav/lib/CalDAV/Schedule/IMipService.php b/apps/dav/lib/CalDAV/Schedule/IMipService.php index 81367d76ebe..137fb3585a3 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipService.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipService.php @@ -89,7 +89,7 @@ class IMipService { return $default; } $newstring = $vevent->$property->getValue(); - if(isset($oldVEvent->$property) && $oldVEvent->$property->getValue() !== $newstring) { + if (isset($oldVEvent->$property) && $oldVEvent->$property->getValue() !== $newstring) { $oldstring = $oldVEvent->$property->getValue(); return sprintf($strikethrough, $oldstring, $newstring); } @@ -144,7 +144,7 @@ class IMipService { $data = []; $data['meeting_when'] = $this->generateWhenString($eventReaderCurrent); - foreach(self::STRING_DIFF as $key => $property) { + foreach (self::STRING_DIFF as $key => $property) { $data[$key] = self::readPropertyWithDefault($vEvent, $property, $defaultVal); } @@ -154,7 +154,7 @@ class IMipService { $data['meeting_location_html'] = $locationHtml; } - if(!empty($oldVEvent)) { + if (!empty($oldVEvent)) { $oldMeetingWhen = $this->generateWhenString($eventReaderPrevious); $data['meeting_title_html'] = $this->generateDiffString($vEvent, $oldVEvent, 'SUMMARY', $data['meeting_title']); $data['meeting_description_html'] = $this->generateDiffString($vEvent, $oldVEvent, 'DESCRIPTION', $data['meeting_description']); @@ -336,7 +336,7 @@ class IMipService { public function generateWhenStringRecurringDaily(EventReader $er): string { // initialize - $interval = (int)$er->recurringInterval(); + $interval = (int) $er->recurringInterval(); $startTime = null; $conclusion = null; // time of the day @@ -387,7 +387,7 @@ class IMipService { public function generateWhenStringRecurringWeekly(EventReader $er): string { // initialize - $interval = (int)$er->recurringInterval(); + $interval = (int) $er->recurringInterval(); $startTime = null; $conclusion = null; // days of the week @@ -440,7 +440,7 @@ class IMipService { public function generateWhenStringRecurringMonthly(EventReader $er): string { // initialize - $interval = (int)$er->recurringInterval(); + $interval = (int) $er->recurringInterval(); $startTime = null; $conclusion = null; // days of month @@ -505,7 +505,7 @@ class IMipService { public function generateWhenStringRecurringYearly(EventReader $er): string { // initialize - $interval = (int)$er->recurringInterval(); + $interval = (int) $er->recurringInterval(); $startTime = null; $conclusion = null; // months of year @@ -777,10 +777,10 @@ class IMipService { $strikethrough = "%s"; $newMeetingWhen = $this->generateWhenString($eventReaderCurrent); - $newSummary = isset($vEvent->SUMMARY) && (string)$vEvent->SUMMARY !== '' ? (string)$vEvent->SUMMARY : $this->l10n->t('Untitled event'); - $newDescription = isset($vEvent->DESCRIPTION) && (string)$vEvent->DESCRIPTION !== '' ? (string)$vEvent->DESCRIPTION : $defaultVal; - $newUrl = isset($vEvent->URL) && (string)$vEvent->URL !== '' ? sprintf('%1$s', $vEvent->URL) : $defaultVal; - $newLocation = isset($vEvent->LOCATION) && (string)$vEvent->LOCATION !== '' ? (string)$vEvent->LOCATION : $defaultVal; + $newSummary = isset($vEvent->SUMMARY) && (string) $vEvent->SUMMARY !== '' ? (string) $vEvent->SUMMARY : $this->l10n->t('Untitled event'); + $newDescription = isset($vEvent->DESCRIPTION) && (string) $vEvent->DESCRIPTION !== '' ? (string) $vEvent->DESCRIPTION : $defaultVal; + $newUrl = isset($vEvent->URL) && (string) $vEvent->URL !== '' ? sprintf('%1$s', $vEvent->URL) : $defaultVal; + $newLocation = isset($vEvent->LOCATION) && (string) $vEvent->LOCATION !== '' ? (string) $vEvent->LOCATION : $defaultVal; $newLocationHtml = $this->linkify($newLocation) ?? $newLocation; $data = []; @@ -791,7 +791,7 @@ class IMipService { $data['meeting_description_html'] = $newDescription !== '' ? sprintf($strikethrough, $newDescription) : ''; $data['meeting_description'] = $newDescription; $data['meeting_url_html'] = $newUrl !== '' ? sprintf($strikethrough, $newUrl) : ''; - $data['meeting_url'] = isset($vEvent->URL) ? (string)$vEvent->URL : ''; + $data['meeting_url'] = isset($vEvent->URL) ? (string) $vEvent->URL : ''; $data['meeting_location_html'] = $newLocationHtml !== '' ? sprintf($strikethrough, $newLocationHtml) : ''; $data['meeting_location'] = $newLocation; return $data; @@ -808,7 +808,7 @@ class IMipService { $component = $vObject->VEVENT; if (isset($component->RRULE)) { - $it = new EventIterator($vObject, (string)$component->UID); + $it = new EventIterator($vObject, (string) $component->UID); $maxDate = new \DateTime(IMipPlugin::MAX_DATE); if ($it->isInfinite()) { return $maxDate->getTimestamp(); @@ -831,7 +831,7 @@ class IMipService { return $dtEnd->getDateTime()->getTimeStamp(); } - if(isset($component->DURATION)) { + if (isset($component->DURATION)) { /** @var \DateTime $endDate */ $endDate = clone $dtStart->getDateTime(); // $component->DTEND->getDateTime() returns DateTimeImmutable @@ -839,7 +839,7 @@ class IMipService { return $endDate->getTimestamp(); } - if(!$dtStart->hasTime()) { + if (!$dtStart->hasTime()) { /** @var \DateTime $endDate */ // $component->DTSTART->getDateTime() returns DateTimeImmutable $endDate = clone $dtStart->getDateTime(); @@ -855,7 +855,7 @@ class IMipService { * @param Property|null $attendee */ public function setL10n(?Property $attendee = null) { - if($attendee === null) { + if ($attendee === null) { return; } @@ -871,7 +871,7 @@ class IMipService { * @return bool */ public function getAttendeeRsvpOrReqForParticipant(?Property $attendee = null) { - if($attendee === null) { + if ($attendee === null) { return false; } @@ -979,10 +979,10 @@ class IMipService { htmlspecialchars($organizer->getNormalizedValue()), htmlspecialchars($organizerName ?: $organizerEmail)); $organizerText = sprintf('%s <%s>', $organizerName, $organizerEmail); - if(isset($organizer['PARTSTAT'])) { + if (isset($organizer['PARTSTAT'])) { /** @var Parameter $partstat */ $partstat = $organizer['PARTSTAT']; - if(strcasecmp($partstat->getValue(), 'ACCEPTED') === 0) { + if (strcasecmp($partstat->getValue(), 'ACCEPTED') === 0) { $organizerHTML .= ' ✔︎'; $organizerText .= ' ✔︎'; } @@ -1154,7 +1154,7 @@ class IMipService { public function isRoomOrResource(Property $attendee): bool { $cuType = $attendee->offsetGet('CUTYPE'); - if(!$cuType instanceof Parameter) { + if (!$cuType instanceof Parameter) { return false; } $type = $cuType->getValue() ?? 'INDIVIDUAL'; @@ -1178,7 +1178,7 @@ class IMipService { $interval = $dateInterval->m; $scale = 'month'; } elseif ($dateInterval->d >= 7) { - $interval = (int)($dateInterval->d / 7); + $interval = (int) ($dateInterval->d / 7); $scale = 'week'; } elseif ($dateInterval->d > 0) { $interval = $dateInterval->d; diff --git a/apps/dav/lib/CalDAV/Search/SearchPlugin.php b/apps/dav/lib/CalDAV/Search/SearchPlugin.php index fb55dec593c..a0810458145 100644 --- a/apps/dav/lib/CalDAV/Search/SearchPlugin.php +++ b/apps/dav/lib/CalDAV/Search/SearchPlugin.php @@ -1,4 +1,5 @@ userManager->get($userId); - if($user === null) { + if ($user === null) { return; } $availability = $this->availabilityCoordinator->getCurrentOutOfOfficeData($user); - if($availability !== null && $this->availabilityCoordinator->isInEffect($availability)) { + if ($availability !== null && $this->availabilityCoordinator->isInEffect($availability)) { $this->logger->debug('An Absence is in effect, skipping calendar status check', ['user' => $userId]); return; } $calendarEvents = $this->cache->get($userId); - if($calendarEvents === null) { + if ($calendarEvents === null) { $calendarEvents = $this->getCalendarEvents($user); $this->cache->set($userId, $calendarEvents, 300); } - if(empty($calendarEvents)) { + if (empty($calendarEvents)) { try { $this->userStatusService->revertUserStatus($userId, IUserStatus::MESSAGE_CALENDAR_BUSY); } catch (Exception $e) { @@ -81,7 +81,7 @@ class StatusService { $currentStatus = null; } - if(($currentStatus !== null && $currentStatus->getMessageId() === IUserStatus::MESSAGE_CALL) + if (($currentStatus !== null && $currentStatus->getMessageId() === IUserStatus::MESSAGE_CALL) || ($currentStatus !== null && $currentStatus->getStatus() === IUserStatus::DND) || ($currentStatus !== null && $currentStatus->getStatus() === IUserStatus::INVISIBLE)) { // We don't overwrite the call status, DND status or Invisible status @@ -101,7 +101,7 @@ class StatusService { if (isset($component['DTSTART']) && $userStatusTimestamp !== null) { /** @var DateTimeImmutable $dateTime */ $dateTime = $component['DTSTART'][0]; - if($dateTime instanceof DateTimeImmutable && $userStatusTimestamp > $dateTime->getTimestamp()) { + if ($dateTime instanceof DateTimeImmutable && $userStatusTimestamp > $dateTime->getTimestamp()) { return false; } } @@ -112,7 +112,7 @@ class StatusService { return true; }); - if(empty($applicableEvents)) { + if (empty($applicableEvents)) { try { $this->userStatusService->revertUserStatus($userId, IUserStatus::MESSAGE_CALENDAR_BUSY); } catch (Exception $e) { @@ -130,7 +130,7 @@ class StatusService { } // Only update the status if it's neccesary otherwise we mess up the timestamp - if($currentStatus === null || $currentStatus->getMessageId() !== IUserStatus::MESSAGE_CALENDAR_BUSY) { + if ($currentStatus === null || $currentStatus->getMessageId() !== IUserStatus::MESSAGE_CALENDAR_BUSY) { // One event that fulfills all status conditions is enough // 1. Not an OOO event // 2. Current user status (that is not a calendar status) was not set after the start of this event @@ -148,7 +148,7 @@ class StatusService { private function getCalendarEvents(User $user): array { $calendars = $this->calendarManager->getCalendarsForPrincipal('principals/users/' . $user->getUID()); - if(empty($calendars)) { + if (empty($calendars)) { return []; } @@ -172,7 +172,7 @@ class StatusService { $dtEnd = DateTimeImmutable::createFromMutable($this->timeFactory->getDateTime('+5 minutes')); // Only query the calendars when there's any to search - if($query instanceof CalendarQuery && !empty($query->getCalendarUris())) { + if ($query instanceof CalendarQuery && !empty($query->getCalendarUris())) { // Query the next hour $query->setTimerangeStart($dtStart); $query->setTimerangeEnd($dtEnd); diff --git a/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php b/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php index ea1bf7d4f0f..e07be39c7b4 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php @@ -28,9 +28,9 @@ class Plugin extends ServerPlugin { * @var string[] */ public const ENABLE_FOR_CLIENTS = [ - "/^MSFT-WIN-3/", - "/Evolution/", - "/KIO/" + '/^MSFT-WIN-3/', + '/Evolution/', + '/KIO/' ]; /** diff --git a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php index 14c72285f67..07cb4a28a8e 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php @@ -45,12 +45,12 @@ class RefreshWebcalService { } // Check the refresh rate if there is any - if(!empty($subscription['{http://apple.com/ns/ical/}refreshrate'])) { + if (!empty($subscription['{http://apple.com/ns/ical/}refreshrate'])) { // add the refresh interval to the lastmodified timestamp $refreshInterval = new \DateInterval($subscription['{http://apple.com/ns/ical/}refreshrate']); $updateTime = $this->time->getDateTime(); $updateTime->setTimestamp($subscription['lastmodified'])->add($refreshInterval); - if($updateTime->getTimestamp() > $this->time->getTime()) { + if ($updateTime->getTimestamp() > $this->time->getTime()) { return; } } @@ -131,7 +131,7 @@ class RefreshWebcalService { try { $objectUri = $this->getRandomCalendarObjectUri(); $this->calDavBackend->createCalendarObject($subscription['id'], $objectUri, $vObject->serialize(), CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION); - } catch (NoInstancesException | BadRequest $ex) { + } catch (NoInstancesException|BadRequest $ex) { $this->logger->warning('Unable to create calendar object from subscription {subscriptionId}', ['exception' => $ex, 'subscriptionId' => $subscription['id'], 'source' => $subscription['source']]); } } @@ -143,7 +143,7 @@ class RefreshWebcalService { return $dataSet['uri']; }, $localData); - if(!empty($ids) && !empty($uris)) { + if (!empty($ids) && !empty($uris)) { // Clean up on aisle 5 // The only events left over in the $localData array should be those that don't exist upstream // All deleted VObjects from upstream are removed @@ -157,7 +157,7 @@ class RefreshWebcalService { $this->updateSubscription($subscription, $mutations); } catch (ParseException $ex) { - $this->logger->error("Subscription {subscriptionId} could not be refreshed due to a parsing error", ['exception' => $ex, 'subscriptionId' => $subscription['id']]); + $this->logger->error('Subscription {subscriptionId} could not be refreshed due to a parsing error', ['exception' => $ex, 'subscriptionId' => $subscription['id']]); } } diff --git a/apps/dav/lib/Capabilities.php b/apps/dav/lib/Capabilities.php index c951c261115..3a1a9879e2d 100644 --- a/apps/dav/lib/Capabilities.php +++ b/apps/dav/lib/Capabilities.php @@ -1,4 +1,5 @@ 'addressbook', - 'id' => (string)$data['id'], + 'id' => (string) $data['id'], 'name' => $l->t('Personal'), ]; } return [ 'type' => 'addressbook', - 'id' => (string)$data['id'], + 'id' => (string) $data['id'], 'name' => $data['name'], ]; } diff --git a/apps/dav/lib/CardDAV/Activity/Setting.php b/apps/dav/lib/CardDAV/Activity/Setting.php index aa25898065f..cc68cf87c83 100644 --- a/apps/dav/lib/CardDAV/Activity/Setting.php +++ b/apps/dav/lib/CardDAV/Activity/Setting.php @@ -27,8 +27,8 @@ class Setting extends CalDAVSetting { /** * @return int whether the filter should be rather on the top or bottom of - * the admin section. The filters are arranged in ascending order of the - * priority values. It is required to return a value between 0 and 100. + * the admin section. The filters are arranged in ascending order of the + * priority values. It is required to return a value between 0 and 100. */ public function getPriority(): int { return 50; diff --git a/apps/dav/lib/CardDAV/AddressBook.php b/apps/dav/lib/CardDAV/AddressBook.php index 2ec645f04d2..c48f036f2bf 100644 --- a/apps/dav/lib/CardDAV/AddressBook.php +++ b/apps/dav/lib/CardDAV/AddressBook.php @@ -250,7 +250,7 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareable, IMov } try { - return $this->carddavBackend->moveCard($sourceNode->getAddressbookId(), (int)$this->addressBookInfo['id'], $sourceNode->getUri(), $sourceNode->getOwner()); + return $this->carddavBackend->moveCard($sourceNode->getAddressbookId(), (int) $this->addressBookInfo['id'], $sourceNode->getUri(), $sourceNode->getOwner()); } catch (Exception $e) { // Avoid injecting LoggerInterface everywhere Server::get(LoggerInterface::class)->error('Could not move calendar object: ' . $e->getMessage(), ['exception' => $e]); diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php index 44ff7b40752..36bc30e02f9 100644 --- a/apps/dav/lib/CardDAV/AddressBookImpl.php +++ b/apps/dav/lib/CardDAV/AddressBookImpl.php @@ -91,19 +91,19 @@ class AddressBookImpl implements IAddressBookEnabled { * @param string $pattern which should match within the $searchProperties * @param array $searchProperties defines the properties within the query pattern should match * @param array $options Options to define the output format and search behavior - * - 'types' boolean (since 15.0.0) If set to true, fields that come with a TYPE property will be an array - * example: ['id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => ['type => 'HOME', 'value' => 'g@h.i']] - * - 'escape_like_param' - If set to false wildcards _ and % are not escaped - * - 'limit' - Set a numeric limit for the search results - * - 'offset' - Set the offset for the limited search results - * - 'wildcard' - Whether the search should use wildcards + * - 'types' boolean (since 15.0.0) If set to true, fields that come with a TYPE property will be an array + * example: ['id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => ['type => 'HOME', 'value' => 'g@h.i']] + * - 'escape_like_param' - If set to false wildcards _ and % are not escaped + * - 'limit' - Set a numeric limit for the search results + * - 'offset' - Set the offset for the limited search results + * - 'wildcard' - Whether the search should use wildcards * @psalm-param array{types?: bool, escape_like_param?: bool, limit?: int, offset?: int, wildcard?: bool} $options * @return array an array of contacts which are arrays of key-value-pairs - * example result: - * [ - * ['id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => 'a@b.c', 'GEO' => '37.386013;-122.082932'], - * ['id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => ['d@e.f', 'g@h.i']] - * ] + * example result: + * [ + * ['id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => 'a@b.c', 'GEO' => '37.386013;-122.082932'], + * ['id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => ['d@e.f', 'g@h.i']] + * ] * @since 5.0.0 */ public function search($pattern, $searchProperties, $options) { @@ -144,13 +144,13 @@ class AddressBookImpl implements IAddressBookEnabled { if (is_string($entry)) { $property = $vCard->createProperty($key, $entry); } else { - if (($key === "ADR" || $key === "PHOTO") && is_string($entry["value"])) { - $entry["value"] = stripslashes($entry["value"]); - $entry["value"] = explode(';', $entry["value"]); + if (($key === 'ADR' || $key === 'PHOTO') && is_string($entry['value'])) { + $entry['value'] = stripslashes($entry['value']); + $entry['value'] = explode(';', $entry['value']); } - $property = $vCard->createProperty($key, $entry["value"]); - if (isset($entry["type"])) { - $property->add('TYPE', $entry["type"]); + $property = $vCard->createProperty($key, $entry['value']); + if (isset($entry['type'])) { + $property->add('TYPE', $entry['type']); } } $vCard->add($property); @@ -353,7 +353,7 @@ class AddressBookImpl implements IAddressBookEnabled { $path = 'addressbooks/users/' . $user . '/' . $uri; $properties = $this->propertyMapper->findPropertyByPathAndName($user, $path, '{http://owncloud.org/ns}enabled'); if (count($properties) > 0) { - return (bool)$properties[0]->getPropertyvalue(); + return (bool) $properties[0]->getPropertyvalue(); } return true; } diff --git a/apps/dav/lib/CardDAV/Card.php b/apps/dav/lib/CardDAV/Card.php index 67f605d2fb4..218684ed832 100644 --- a/apps/dav/lib/CardDAV/Card.php +++ b/apps/dav/lib/CardDAV/Card.php @@ -26,7 +26,7 @@ class Card extends \Sabre\CardDAV\Card { } public function getAddressbookId(): int { - return (int)$this->cardData['addressbookid']; + return (int) $this->cardData['addressbookid']; } public function getPrincipalUri(): string { diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 9d787c917d3..90d54329b99 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -154,7 +154,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { continue; } - $readOnly = (int)$row['access'] === Backend::ACCESS_READ; + $readOnly = (int) $row['access'] === Backend::ACCESS_READ; if (isset($addressBooks[$row['id']])) { if ($readOnly) { // New share can not have more permissions then the old one. @@ -330,14 +330,14 @@ class CardDavBackend implements BackendInterface, SyncSupport { $query->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId))) ->executeStatement(); - $this->addChange($addressBookId, "", 2); + $this->addChange($addressBookId, '', 2); - $addressBookRow = $this->getAddressBookById((int)$addressBookId); - $shares = $this->getShares((int)$addressBookId); + $addressBookRow = $this->getAddressBookById((int) $addressBookId); + $shares = $this->getShares((int) $addressBookId); return [$addressBookRow, $shares]; }, $this->db); - $this->dispatcher->dispatchTyped(new AddressBookUpdatedEvent((int)$addressBookId, $addressBookRow, $shares, $mutations)); + $this->dispatcher->dispatchTyped(new AddressBookUpdatedEvent((int) $addressBookId, $addressBookRow, $shares, $mutations)); return true; }); @@ -417,7 +417,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { */ public function deleteAddressBook($addressBookId) { $this->atomic(function () use ($addressBookId) { - $addressBookId = (int)$addressBookId; + $addressBookId = (int) $addressBookId; $addressBookData = $this->getAddressBookById($addressBookId); $shares = $this->getShares($addressBookId); @@ -616,7 +616,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { ->andWhere($q->expr()->eq('uid', $q->createNamedParameter($uid))) ->setMaxResults(1); $result = $q->executeQuery(); - $count = (bool)$result->fetchOne(); + $count = (bool) $result->fetchOne(); $result->closeCursor(); if ($count) { throw new \Sabre\DAV\Exception\BadRequest('VCard object with uid already exists in this addressbook collection.'); @@ -729,7 +729,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($sourceAddressBookId, IQueryBuilder::PARAM_INT), IQueryBuilder::PARAM_INT)) ->executeStatement(); - $this->purgeProperties($sourceAddressBookId, (int)$card['id']); + $this->purgeProperties($sourceAddressBookId, (int) $card['id']); $this->updateProperties($sourceAddressBookId, $card['uri'], $card['carddata']); $this->addChange($sourceAddressBookId, $card['uri'], 3); @@ -945,7 +945,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { ->from('addressbooks') ->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId))); $result = $query->executeQuery(); - $syncToken = (int)$result->fetchOne(); + $syncToken = (int) $result->fetchOne(); $result->closeCursor(); $query = $this->db->getQueryBuilder(); @@ -1032,11 +1032,11 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param string $pattern which should match within the $searchProperties * @param array $searchProperties defines the properties within the query pattern should match * @param array $options = array() to define the search behavior - * - 'types' boolean (since 15.0.0) If set to true, fields that come with a TYPE property will be an array - * - 'escape_like_param' - If set to false wildcards _ and % are not escaped, otherwise they are - * - 'limit' - Set a numeric limit for the search results - * - 'offset' - Set the offset for the limited search results - * - 'wildcard' - Whether the search should use wildcards + * - 'types' boolean (since 15.0.0) If set to true, fields that come with a TYPE property will be an array + * - 'escape_like_param' - If set to false wildcards _ and % are not escaped, otherwise they are + * - 'limit' - Set a numeric limit for the search results + * - 'offset' - Set the offset for the limited search results + * - 'wildcard' - Whether the search should use wildcards * @psalm-param array{types?: bool, escape_like_param?: bool, limit?: int, offset?: int, wildcard?: bool} $options * @return array an array of contacts which are arrays of key-value-pairs */ @@ -1169,7 +1169,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { $matches = $result->fetchAll(); $result->closeCursor(); $matches = array_map(function ($match) { - return (int)$match['cardid']; + return (int) $match['cardid']; }, $matches); $cards = []; @@ -1370,7 +1370,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { throw new \InvalidArgumentException('Card does not exists: ' . $uri); } - return (int)$cardIds['id']; + return (int) $cardIds['id']; } /** diff --git a/apps/dav/lib/CardDAV/ContactsManager.php b/apps/dav/lib/CardDAV/ContactsManager.php index 14bf8db7be5..c4751497a67 100644 --- a/apps/dav/lib/CardDAV/ContactsManager.php +++ b/apps/dav/lib/CardDAV/ContactsManager.php @@ -13,13 +13,13 @@ use OCP\IL10N; use OCP\IURLGenerator; class ContactsManager { - /** @var CardDavBackend */ + /** @var CardDavBackend */ private $backend; - /** @var IL10N */ + /** @var IL10N */ private $l10n; - /** @var PropertyMapper */ + /** @var PropertyMapper */ private $propertyMapper; /** @@ -51,7 +51,7 @@ class ContactsManager { * @param IURLGenerator $urlGenerator */ public function setupSystemContactsProvider(IManager $cm, ?string $userId, IURLGenerator $urlGenerator) { - $addressBooks = $this->backend->getAddressBooksForUser("principals/system/system"); + $addressBooks = $this->backend->getAddressBooksForUser('principals/system/system'); $this->register($cm, $addressBooks, $urlGenerator, $userId); } diff --git a/apps/dav/lib/CardDAV/ImageExportPlugin.php b/apps/dav/lib/CardDAV/ImageExportPlugin.php index e2173db519b..cbf78dcc707 100644 --- a/apps/dav/lib/CardDAV/ImageExportPlugin.php +++ b/apps/dav/lib/CardDAV/ImageExportPlugin.php @@ -55,7 +55,7 @@ class ImageExportPlugin extends ServerPlugin { return true; } - $size = isset($queryParams['size']) ? (int)$queryParams['size'] : -1; + $size = isset($queryParams['size']) ? (int) $queryParams['size'] : -1; $path = $request->getPath(); $node = $this->server->tree->getNodeForPath($path); diff --git a/apps/dav/lib/CardDAV/PhotoCache.php b/apps/dav/lib/CardDAV/PhotoCache.php index 3ea99c29a51..83b5f417896 100644 --- a/apps/dav/lib/CardDAV/PhotoCache.php +++ b/apps/dav/lib/CardDAV/PhotoCache.php @@ -1,4 +1,5 @@ 'png', 'image/jpeg' => 'jpg', diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php index 264d34a150b..259ffdf8fda 100644 --- a/apps/dav/lib/CardDAV/SyncService.php +++ b/apps/dav/lib/CardDAV/SyncService.php @@ -143,7 +143,7 @@ class SyncService { \GuzzleHttp\Psr7\Utils::uriFor($path) ); - return (string)$uri; + return (string) $uri; } /** @@ -184,7 +184,7 @@ class SyncService { $options ); - return (string)$response->getBody(); + return (string) $response->getBody(); } private function buildSyncCollectionRequestBody(?string $syncToken): string { diff --git a/apps/dav/lib/CardDAV/SystemAddressbook.php b/apps/dav/lib/CardDAV/SystemAddressbook.php index 4ba06d0fc9c..aff51ac5b9b 100644 --- a/apps/dav/lib/CardDAV/SystemAddressbook.php +++ b/apps/dav/lib/CardDAV/SystemAddressbook.php @@ -254,7 +254,7 @@ class SystemAddressbook extends AddressBook { try { $this->getChild($uri); $added[] = $uri; - } catch (NotFound | Forbidden $e) { + } catch (NotFound|Forbidden $e) { $deleted[] = $uri; } } @@ -262,7 +262,7 @@ class SystemAddressbook extends AddressBook { try { $this->getChild($uri); $modified[] = $uri; - } catch (NotFound | Forbidden $e) { + } catch (NotFound|Forbidden $e) { $deleted[] = $uri; } } diff --git a/apps/dav/lib/CardDAV/UserAddressBooks.php b/apps/dav/lib/CardDAV/UserAddressBooks.php index d0719e02492..e2d3fe4d8c8 100644 --- a/apps/dav/lib/CardDAV/UserAddressBooks.php +++ b/apps/dav/lib/CardDAV/UserAddressBooks.php @@ -89,7 +89,7 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome { try { $trustedServers = \OC::$server->get(TrustedServers::class); $request = \OC::$server->get(IRequest::class); - } catch (QueryException | NotFoundExceptionInterface | ContainerExceptionInterface $e) { + } catch (QueryException|NotFoundExceptionInterface|ContainerExceptionInterface $e) { // nothing to do, the request / trusted servers don't exist } if ($addressBook['principaluri'] === 'principals/system/system') { diff --git a/apps/dav/lib/Command/CreateAddressBook.php b/apps/dav/lib/Command/CreateAddressBook.php index e7d7824d1b6..9626edeba26 100644 --- a/apps/dav/lib/Command/CreateAddressBook.php +++ b/apps/dav/lib/Command/CreateAddressBook.php @@ -24,14 +24,14 @@ class CreateAddressBook extends Command { protected function configure(): void { $this - ->setName('dav:create-addressbook') - ->setDescription('Create a dav addressbook') - ->addArgument('user', - InputArgument::REQUIRED, - 'User for whom the addressbook will be created') - ->addArgument('name', - InputArgument::REQUIRED, - 'Name of the addressbook'); + ->setName('dav:create-addressbook') + ->setDescription('Create a dav addressbook') + ->addArgument('user', + InputArgument::REQUIRED, + 'User for whom the addressbook will be created') + ->addArgument('name', + InputArgument::REQUIRED, + 'Name of the addressbook'); } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/apps/dav/lib/Command/DeleteCalendar.php b/apps/dav/lib/Command/DeleteCalendar.php index 423a9b03434..93c901b2ba6 100644 --- a/apps/dav/lib/Command/DeleteCalendar.php +++ b/apps/dav/lib/Command/DeleteCalendar.php @@ -56,7 +56,7 @@ class DeleteCalendar extends Command { InputInterface $input, OutputInterface $output ): int { - /** @var string $user **/ + /** @var string $user * */ $user = $input->getArgument('uid'); if (!$this->userManager->userExists($user)) { throw new \InvalidArgumentException( @@ -67,7 +67,7 @@ class DeleteCalendar extends Command { if ($birthday !== false) { $name = BirthdayService::BIRTHDAY_CALENDAR_URI; } else { - /** @var string $name **/ + /** @var string $name * */ $name = $input->getArgument('name'); if (!$name) { throw new \InvalidArgumentException( diff --git a/apps/dav/lib/Command/FixCalendarSyncCommand.php b/apps/dav/lib/Command/FixCalendarSyncCommand.php index 5e92b3270d2..e94e1dc9c4a 100644 --- a/apps/dav/lib/Command/FixCalendarSyncCommand.php +++ b/apps/dav/lib/Command/FixCalendarSyncCommand.php @@ -56,7 +56,7 @@ class FixCalendarSyncCommand extends Command { } private function fixUserCalendars(IUser $user, ?ProgressBar $progress = null): void { - $calendars = $this->calDavBackend->getCalendarsForUser("principals/users/" . $user->getUID()); + $calendars = $this->calDavBackend->getCalendarsForUser('principals/users/' . $user->getUID()); foreach ($calendars as $calendar) { $this->calDavBackend->restoreChanges($calendar['id']); diff --git a/apps/dav/lib/Command/ListCalendars.php b/apps/dav/lib/Command/ListCalendars.php index 5344530e8a5..af3459686e5 100644 --- a/apps/dav/lib/Command/ListCalendars.php +++ b/apps/dav/lib/Command/ListCalendars.php @@ -1,4 +1,5 @@ addArgument('destinationuid', InputArgument::REQUIRED, 'User who will receive the calendar') - ->addOption('force', 'f', InputOption::VALUE_NONE, "Force the migration by removing existing shares and renaming calendars in case of conflicts"); + ->addOption('force', 'f', InputOption::VALUE_NONE, 'Force the migration by removing existing shares and renaming calendars in case of conflicts'); } protected function execute(InputInterface $input, OutputInterface $output): int { @@ -97,8 +98,8 @@ class MoveCalendar extends Command { * Warn that share links have changed if there are shares */ $this->io->note([ - "Please note that moving calendar " . $calendar['uri'] . " from user <$userOrigin> to <$userDestination> has caused share links to change.", - "Sharees will need to change \"example.com/remote.php/dav/calendars/uid/" . $calendar['uri'] . "_shared_by_$userOrigin\" to \"example.com/remote.php/dav/calendars/uid/" . $newName ?: $calendar['uri'] . "_shared_by_$userDestination\"" + 'Please note that moving calendar ' . $calendar['uri'] . " from user <$userOrigin> to <$userDestination> has caused share links to change.", + 'Sharees will need to change "example.com/remote.php/dav/calendars/uid/' . $calendar['uri'] . "_shared_by_$userOrigin\" to \"example.com/remote.php/dav/calendars/uid/" . $newName ?: $calendar['uri'] . "_shared_by_$userDestination\"" ]); } @@ -155,7 +156,7 @@ class MoveCalendar extends Command { if ($force) { $this->calDav->updateShares(new Calendar($this->calDav, $calendar, $this->l10n, $this->config, $this->logger), [], ['principal:principals/groups/' . $userOrGroup]); } else { - throw new \InvalidArgumentException("User <$userDestination> is not part of the group <$userOrGroup> with whom the calendar <" . $calendar['uri'] . "> was shared. You may use -f to move the calendar while deleting this share."); + throw new \InvalidArgumentException("User <$userDestination> is not part of the group <$userOrGroup> with whom the calendar <" . $calendar['uri'] . '> was shared. You may use -f to move the calendar while deleting this share.'); } } @@ -166,7 +167,7 @@ class MoveCalendar extends Command { if ($force) { $this->calDav->updateShares(new Calendar($this->calDav, $calendar, $this->l10n, $this->config, $this->logger), [], ['principal:principals/users/' . $userOrGroup]); } else { - throw new \InvalidArgumentException("The calendar <" . $calendar['uri'] . "> is already shared to user <$userDestination>.You may use -f to move the calendar while deleting this share."); + throw new \InvalidArgumentException('The calendar <' . $calendar['uri'] . "> is already shared to user <$userDestination>.You may use -f to move the calendar while deleting this share."); } } } diff --git a/apps/dav/lib/Command/SendEventReminders.php b/apps/dav/lib/Command/SendEventReminders.php index f5afb30ed70..89bb5ce8c20 100644 --- a/apps/dav/lib/Command/SendEventReminders.php +++ b/apps/dav/lib/Command/SendEventReminders.php @@ -1,4 +1,5 @@ birthdayService->syncUser($user); return self::SUCCESS; } - $output->writeln("Start birthday calendar sync for all users ..."); + $output->writeln('Start birthday calendar sync for all users ...'); $p = new ProgressBar($output); $p->start(); $this->userManager->callForSeenUsers(function ($user) use ($p) { diff --git a/apps/dav/lib/Comments/CommentNode.php b/apps/dav/lib/Comments/CommentNode.php index 3a9e5362528..a257611dd15 100644 --- a/apps/dav/lib/Comments/CommentNode.php +++ b/apps/dav/lib/Comments/CommentNode.php @@ -30,7 +30,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { public const PROPERTY_NAME_MENTION_ID = '{http://owncloud.org/ns}mentionId'; public const PROPERTY_NAME_MENTION_DISPLAYNAME = '{http://owncloud.org/ns}mentionDisplayName'; - /** @var IComment */ + /** @var IComment */ public $comment; /** @var ICommentsManager */ diff --git a/apps/dav/lib/Comments/CommentsPlugin.php b/apps/dav/lib/Comments/CommentsPlugin.php index 7db64313121..ed6614312e1 100644 --- a/apps/dav/lib/Comments/CommentsPlugin.php +++ b/apps/dav/lib/Comments/CommentsPlugin.php @@ -34,13 +34,13 @@ class CommentsPlugin extends ServerPlugin { public const REPORT_PARAM_OFFSET = '{http://owncloud.org/ns}offset'; public const REPORT_PARAM_TIMESTAMP = '{http://owncloud.org/ns}datetime'; - /** @var ICommentsManager */ + /** @var ICommentsManager */ protected $commentsManager; /** @var \Sabre\DAV\Server $server */ private $server; - /** @var \OCP\IUserSession */ + /** @var \OCP\IUserSession */ protected $userSession; /** @@ -158,7 +158,7 @@ class CommentsPlugin extends ServerPlugin { } if (!is_null($args['datetime'])) { - $args['datetime'] = new \DateTime((string)$args['datetime']); + $args['datetime'] = new \DateTime((string) $args['datetime']); } $results = $node->findChildren($args['limit'], $args['offset'], $args['datetime']); diff --git a/apps/dav/lib/Comments/EntityCollection.php b/apps/dav/lib/Comments/EntityCollection.php index 367dab54c5e..19af2d9c234 100644 --- a/apps/dav/lib/Comments/EntityCollection.php +++ b/apps/dav/lib/Comments/EntityCollection.php @@ -27,7 +27,7 @@ use Sabre\DAV\PropPatch; class EntityCollection extends RootCollection implements IProperties { public const PROPERTY_NAME_READ_MARKER = '{http://owncloud.org/ns}readMarker'; - /** @var string */ + /** @var string */ protected $id; protected LoggerInterface $logger; diff --git a/apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php b/apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php index b39dc7197b0..0e2b1c58748 100644 --- a/apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php +++ b/apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php @@ -1,4 +1,5 @@ server->tree->getNodeForPath($path); if ($node instanceof File) { $type = strtolower( - (string)$request->getHeader('X-Recalculate-Hash') + (string) $request->getHeader('X-Recalculate-Hash') ); $hash = $node->hash($type); diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php index 71514016bda..84e914bee35 100644 --- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php @@ -59,14 +59,14 @@ class CommentPropertiesPlugin extends ServerPlugin { continue; } - $ids[] = (string)$id; + $ids[] = (string) $id; } $ids[] = (string) $directory->getId(); $unread = $this->commentsManager->getNumberOfUnreadCommentsForObjects('files', $ids, $this->userSession->getUser()); foreach ($unread as $id => $count) { - $this->cachedUnreadCount[(int)$id] = $count; + $this->cachedUnreadCount[(int) $id] = $count; } } @@ -95,7 +95,7 @@ class CommentPropertiesPlugin extends ServerPlugin { } $propFind->handle(self::PROPERTY_NAME_COUNT, function () use ($node): int { - return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId()); + return $this->commentsManager->getNumberOfCommentsForObject('files', (string) $node->getId()); }); $propFind->handle(self::PROPERTY_NAME_HREF, function () use ($node): ?string { @@ -117,7 +117,7 @@ class CommentPropertiesPlugin extends ServerPlugin { // in case we end up somewhere else, unexpectedly. return null; } - $commentsPart = 'dav/comments/files/' . rawurldecode((string)$node->getId()); + $commentsPart = 'dav/comments/files/' . rawurldecode((string) $node->getId()); return substr_replace($href, $commentsPart, $entryPoint + strlen('/remote.php/')); } @@ -131,8 +131,8 @@ class CommentPropertiesPlugin extends ServerPlugin { return null; } - $lastRead = $this->commentsManager->getReadMark('files', (string)$node->getId(), $user); + $lastRead = $this->commentsManager->getReadMark('files', (string) $node->getId(), $user); - return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId(), $lastRead); + return $this->commentsManager->getNumberOfCommentsForObject('files', (string) $node->getId(), $lastRead); } } diff --git a/apps/dav/lib/Connector/Sabre/DavAclPlugin.php b/apps/dav/lib/Connector/Sabre/DavAclPlugin.php index 336930cf17d..7846896182f 100644 --- a/apps/dav/lib/Connector/Sabre/DavAclPlugin.php +++ b/apps/dav/lib/Connector/Sabre/DavAclPlugin.php @@ -52,7 +52,7 @@ class DavAclPlugin extends \Sabre\DAVACL\Plugin { } if ($this->getCurrentUserPrincipal() === $node->getOwner()) { - throw new Forbidden("Access denied"); + throw new Forbidden('Access denied'); } else { throw new NotFound( sprintf( diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php index b429f453679..71a48c0cb14 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -294,7 +294,7 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICol } $relativePath = $this->fileView->getRelativePath($this->info->getPath()); if ($relativePath === null) { - $this->getLogger()->warning("error while getting quota as the relative path cannot be found"); + $this->getLogger()->warning('error while getting quota as the relative path cannot be found'); return [0, 0]; } @@ -311,13 +311,13 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICol ]; return $this->quotaInfo; } catch (\OCP\Files\NotFoundException $e) { - $this->getLogger()->warning("error while getting quota into", ['exception' => $e]); + $this->getLogger()->warning('error while getting quota into', ['exception' => $e]); return [0, 0]; } catch (\OCP\Files\StorageNotAvailableException $e) { - $this->getLogger()->warning("error while getting quota into", ['exception' => $e]); + $this->getLogger()->warning('error while getting quota into', ['exception' => $e]); return [0, 0]; } catch (NotPermittedException $e) { - $this->getLogger()->warning("error while getting quota into", ['exception' => $e]); + $this->getLogger()->warning('error while getting quota into', ['exception' => $e]); return [0, 0]; } } diff --git a/apps/dav/lib/Connector/Sabre/Exception/BadGateway.php b/apps/dav/lib/Connector/Sabre/Exception/BadGateway.php index 41ace002660..1e1e4aaed04 100644 --- a/apps/dav/lib/Connector/Sabre/Exception/BadGateway.php +++ b/apps/dav/lib/Connector/Sabre/Exception/BadGateway.php @@ -1,4 +1,5 @@ path); } diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 7d2933c5014..1bab3ba713c 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -228,7 +228,7 @@ class File extends Node implements IFile { } $lengthHeader = $this->request->getHeader('content-length'); - $expected = $lengthHeader !== '' ? (int)$lengthHeader : -1; + $expected = $lengthHeader !== '' ? (int) $lengthHeader : -1; if ($result === false && $expected >= 0) { throw new Exception( $this->l10n->t( diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 4c2537a3541..2739da47284 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -607,7 +607,7 @@ class FilesPlugin extends ServerPlugin { $mutation, function (mixed $value) use ($accessRight, $knownMetadata, $node, $mutation, $filesMetadataManager): bool { /** @var FilesMetadata $metadata */ - $metadata = $filesMetadataManager->getMetadata((int)$node->getFileId(), true); + $metadata = $filesMetadataManager->getMetadata((int) $node->getFileId(), true); $metadata->setStorageId($node->getNode()->getStorage()->getCache()->getNumericStorageId()); $metadataKey = substr($mutation, strlen(self::FILE_METADATA_PREFIX)); diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php index 9b29950e4b4..bb4a94dfc60 100644 --- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php @@ -184,9 +184,9 @@ class FilesReportPlugin extends ServerPlugin { } elseif ($name === '{DAV:}limit') { foreach ($reportProps['value'] as $propVal) { if ($propVal['name'] === '{DAV:}nresults') { - $limit = (int)$propVal['value']; + $limit = (int) $propVal['value']; } elseif ($propVal['name'] === $ncns . 'firstresult') { - $offset = (int)$propVal['value']; + $offset = (int) $propVal['value']; } } } @@ -363,7 +363,7 @@ class FilesReportPlugin extends ServerPlugin { * Prepare propfind response for the given nodes * * @param string $filesUri $filesUri URI leading to root of the files URI, - * with a leading slash but no trailing slash + * with a leading slash but no trailing slash * @param string[] $requestedProps requested properties * @param Node[] nodes nodes for which to fetch and prepare responses * @return Response[] @@ -410,7 +410,7 @@ class FilesReportPlugin extends ServerPlugin { $results = []; foreach ($fileIds as $fileId) { - $entry = $folder->getFirstNodeById((int)$fileId); + $entry = $folder->getFirstNodeById((int) $fileId); if ($entry) { $results[] = $this->wrapNode($entry); } diff --git a/apps/dav/lib/Connector/Sabre/MtimeSanitizer.php b/apps/dav/lib/Connector/Sabre/MtimeSanitizer.php index efed6ce09f8..91ecb62ac4d 100644 --- a/apps/dav/lib/Connector/Sabre/MtimeSanitizer.php +++ b/apps/dav/lib/Connector/Sabre/MtimeSanitizer.php @@ -1,4 +1,5 @@ info->getMtime(); if (!empty($timestamp)) { - return (int)$timestamp; + return (int) $timestamp; } return $timestamp; } @@ -265,7 +265,7 @@ abstract class Node implements \Sabre\DAV\INode { if ($storage && $storage->instanceOfStorage(ISharedStorage::class)) { /** @var ISharedStorage $storage */ - $permissions = (int)$storage->getShare()->getPermissions(); + $permissions = (int) $storage->getShare()->getPermissions(); } else { $permissions = $this->info->getPermissions(); } diff --git a/apps/dav/lib/Connector/Sabre/ObjectTree.php b/apps/dav/lib/Connector/Sabre/ObjectTree.php index 7ac5b476154..94098b4aca3 100644 --- a/apps/dav/lib/Connector/Sabre/ObjectTree.php +++ b/apps/dav/lib/Connector/Sabre/ObjectTree.php @@ -25,7 +25,7 @@ class ObjectTree extends CachingTree { protected $fileView; /** - * @var \OCP\Files\Mount\IMountManager + * @var \OCP\Files\Mount\IMountManager */ protected $mountManager; @@ -38,7 +38,7 @@ class ObjectTree extends CachingTree { /** * @param \Sabre\DAV\INode $rootNode * @param \OC\Files\View $view - * @param \OCP\Files\Mount\IMountManager $mountManager + * @param \OCP\Files\Mount\IMountManager $mountManager */ public function init(\Sabre\DAV\INode $rootNode, \OC\Files\View $view, \OCP\Files\Mount\IMountManager $mountManager) { $this->rootNode = $rootNode; diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php index f09ff4def64..671029f1475 100644 --- a/apps/dav/lib/Connector/Sabre/Principal.php +++ b/apps/dav/lib/Connector/Sabre/Principal.php @@ -1,4 +1,5 @@ 'principals/system/' . $name, - '{DAV:}displayname' => $this->languageFactory->get('dav')->t("Accounts"), + '{DAV:}displayname' => $this->languageFactory->get('dav')->t('Accounts'), ]; } return null; diff --git a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php index 5bb0f9cac31..4cc309ce43a 100644 --- a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php +++ b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php @@ -81,7 +81,7 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin { $destinationPath = $this->server->calculateUri($request->getHeader('Destination')); $quotaPath = $this->getPathForDestination($destinationPath); if ($quotaPath && is_numeric($length)) { - return $this->checkQuota($quotaPath, (int)$length); + return $this->checkQuota($quotaPath, (int) $length); } } diff --git a/apps/dav/lib/Connector/Sabre/Server.php b/apps/dav/lib/Connector/Sabre/Server.php index f3bfac1d6e0..11146373274 100644 --- a/apps/dav/lib/Connector/Sabre/Server.php +++ b/apps/dav/lib/Connector/Sabre/Server.php @@ -69,7 +69,7 @@ class Server extends \Sabre\DAV\Server { $DOM->appendChild($error); $h = function ($v) { - return htmlspecialchars((string)$v, ENT_NOQUOTES, 'UTF-8'); + return htmlspecialchars((string) $v, ENT_NOQUOTES, 'UTF-8'); }; if (self::$exposeVersion) { diff --git a/apps/dav/lib/Connector/Sabre/ShareTypeList.php b/apps/dav/lib/Connector/Sabre/ShareTypeList.php index abe56cd0301..5c881c8e3c3 100644 --- a/apps/dav/lib/Connector/Sabre/ShareTypeList.php +++ b/apps/dav/lib/Connector/Sabre/ShareTypeList.php @@ -57,7 +57,7 @@ class ShareTypeList implements Element { } foreach ($tree as $elem) { if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}share-type') { - $shareTypes[] = (int)$elem['value']; + $shareTypes[] = (int) $elem['value']; } } return new self($shareTypes); diff --git a/apps/dav/lib/Connector/Sabre/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php index d7572c46ed3..ee219aff18f 100644 --- a/apps/dav/lib/Connector/Sabre/TagsPlugin.php +++ b/apps/dav/lib/Connector/Sabre/TagsPlugin.php @@ -117,7 +117,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin { * * @param integer $fileId file id * @return array list($tags, $favorite) with $tags as tag array - * and $favorite is a boolean whether the file was favorited + * and $favorite is a boolean whether the file was favorited */ private function getTagsAndFav($fileId) { $isFav = false; @@ -203,9 +203,9 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin { )) { // note: pre-fetching only supported for depth <= 1 $folderContent = $node->getChildren(); - $fileIds[] = (int)$node->getId(); + $fileIds[] = (int) $node->getId(); foreach ($folderContent as $info) { - $fileIds[] = (int)$info->getId(); + $fileIds[] = (int) $info->getId(); } $tags = $this->getTagger()->getTagsForObjects($fileIds); if ($tags === false) { @@ -260,7 +260,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin { }); $propPatch->handle(self::FAVORITE_PROPERTYNAME, function ($favState) use ($node) { - if ((int)$favState === 1 || $favState === 'true') { + if ((int) $favState === 1 || $favState === 'true') { $this->getTagger()->tagAs($node->getId(), self::TAG_FAVORITE); } else { $this->getTagger()->unTag($node->getId(), self::TAG_FAVORITE); diff --git a/apps/dav/lib/Controller/BirthdayCalendarController.php b/apps/dav/lib/Controller/BirthdayCalendarController.php index e82c4ad534c..11aa6e308a1 100644 --- a/apps/dav/lib/Controller/BirthdayCalendarController.php +++ b/apps/dav/lib/Controller/BirthdayCalendarController.php @@ -1,4 +1,5 @@ isRequestPublic($request)) { - return [true, "principals/system/public"]; + return [true, 'principals/system/public']; } - return [false, "No public access to this resource."]; + return [false, 'No public access to this resource.']; } /** diff --git a/apps/dav/lib/DAV/Sharing/Backend.php b/apps/dav/lib/DAV/Sharing/Backend.php index f63e4dce454..cdcf0ca7d44 100644 --- a/apps/dav/lib/DAV/Sharing/Backend.php +++ b/apps/dav/lib/DAV/Sharing/Backend.php @@ -58,7 +58,7 @@ abstract class Backend { } // Don't add share for owner - if($shareable->getOwner() !== null && strcasecmp($shareable->getOwner(), $principal) === 0) { + if ($shareable->getOwner() !== null && strcasecmp($shareable->getOwner(), $principal) === 0) { continue; } @@ -83,7 +83,7 @@ abstract class Backend { } // Don't add unshare for owner - if($shareable->getOwner() !== null && strcasecmp($shareable->getOwner(), $principal) === 0) { + if ($shareable->getOwner() !== null && strcasecmp($shareable->getOwner(), $principal) === 0) { continue; } @@ -92,7 +92,7 @@ abstract class Backend { // Check if a user has a groupshare that they're trying to free themselves from // If so we need to add a self::ACCESS_UNSHARED row - if(!str_contains($principal, 'group') + if (!str_contains($principal, 'group') && $this->service->hasGroupShare($oldShares) ) { $this->service->unshare($shareable->getResourceId(), $principal); @@ -123,31 +123,31 @@ abstract class Backend { * @return list */ public function getShares(int $resourceId): array { - $cached = $this->shareCache->get((string)$resourceId); + $cached = $this->shareCache->get((string) $resourceId); if ($cached) { return $cached; } $rows = $this->service->getShares($resourceId); $shares = []; - foreach($rows as $row) { + foreach ($rows as $row) { $p = $this->principalBackend->getPrincipalByPath($row['principaluri']); $shares[] = [ 'href' => "principal:{$row['principaluri']}", - 'commonName' => isset($p['{DAV:}displayname']) ? (string)$p['{DAV:}displayname'] : '', + 'commonName' => isset($p['{DAV:}displayname']) ? (string) $p['{DAV:}displayname'] : '', 'status' => 1, 'readOnly' => (int) $row['access'] === Backend::ACCESS_READ, - '{http://owncloud.org/ns}principal' => (string)$row['principaluri'], + '{http://owncloud.org/ns}principal' => (string) $row['principaluri'], '{http://owncloud.org/ns}group-share' => isset($p['uri']) && (str_starts_with($p['uri'], 'principals/groups') || str_starts_with($p['uri'], 'principals/circles')) ]; } - $this->shareCache->set((string)$resourceId, $shares); + $this->shareCache->set((string) $resourceId, $shares); return $shares; } public function preloadShares(array $resourceIds): void { $resourceIds = array_filter($resourceIds, function (int $resourceId) { - return empty($this->shareCache->get((string)$resourceId)); + return empty($this->shareCache->get((string) $resourceId)); }); if (empty($resourceIds)) { return; @@ -155,18 +155,18 @@ abstract class Backend { $rows = $this->service->getSharesForIds($resourceIds); $sharesByResource = array_fill_keys($resourceIds, []); - foreach($rows as $row) { - $resourceId = (int)$row['resourceid']; + foreach ($rows as $row) { + $resourceId = (int) $row['resourceid']; $p = $this->principalBackend->getPrincipalByPath($row['principaluri']); $sharesByResource[$resourceId][] = [ 'href' => "principal:{$row['principaluri']}", - 'commonName' => isset($p['{DAV:}displayname']) ? (string)$p['{DAV:}displayname'] : '', + 'commonName' => isset($p['{DAV:}displayname']) ? (string) $p['{DAV:}displayname'] : '', 'status' => 1, 'readOnly' => (int) $row['access'] === self::ACCESS_READ, - '{http://owncloud.org/ns}principal' => (string)$row['principaluri'], + '{http://owncloud.org/ns}principal' => (string) $row['principaluri'], '{http://owncloud.org/ns}group-share' => isset($p['uri']) && str_starts_with($p['uri'], 'principals/groups') ]; - $this->shareCache->set((string)$resourceId, $sharesByResource[$resourceId]); + $this->shareCache->set((string) $resourceId, $sharesByResource[$resourceId]); } } diff --git a/apps/dav/lib/DAV/ViewOnlyPlugin.php b/apps/dav/lib/DAV/ViewOnlyPlugin.php index df3301e2e6b..b9e409a4781 100644 --- a/apps/dav/lib/DAV/ViewOnlyPlugin.php +++ b/apps/dav/lib/DAV/ViewOnlyPlugin.php @@ -74,7 +74,7 @@ class ViewOnlyPlugin extends ServerPlugin { $nodes = $this->userFolder->getById($node->getId()); $node = array_pop($nodes); if (!$node) { - throw new NotFoundException("Version file not accessible by current user"); + throw new NotFoundException('Version file not accessible by current user'); } } } else { diff --git a/apps/dav/lib/Db/Absence.php b/apps/dav/lib/Db/Absence.php index 550958aaabd..ffe0287f654 100644 --- a/apps/dav/lib/Db/Absence.php +++ b/apps/dav/lib/Db/Absence.php @@ -63,7 +63,7 @@ class Absence extends Entity implements JsonSerializable { public function toOutOufOfficeData(IUser $user, string $timezone): IOutOfOfficeData { if ($user->getUID() !== $this->getUserId()) { - throw new InvalidArgumentException("The user doesn't match the user id of this absence! Expected " . $this->getUserId() . ", got " . $user->getUID()); + throw new InvalidArgumentException("The user doesn't match the user id of this absence! Expected " . $this->getUserId() . ', got ' . $user->getUID()); } if ($this->getId() === null) { throw new Exception('Creating out-of-office data without ID'); @@ -74,7 +74,7 @@ class Absence extends Entity implements JsonSerializable { $endDate = new DateTime($this->getLastDay(), $tz); $endDate->setTime(23, 59); return new OutOfOfficeData( - (string)$this->getId(), + (string) $this->getId(), $user, $startDate->getTimestamp(), $endDate->getTimestamp(), diff --git a/apps/dav/lib/Direct/DirectFile.php b/apps/dav/lib/Direct/DirectFile.php index 45d86fcaeae..3c684b83ef2 100644 --- a/apps/dav/lib/Direct/DirectFile.php +++ b/apps/dav/lib/Direct/DirectFile.php @@ -96,7 +96,7 @@ class DirectFile implements IFile { throw new NotFound(); } if (!$file instanceof File) { - throw new Forbidden("direct download not allowed on directories"); + throw new Forbidden('direct download not allowed on directories'); } $this->file = $file; diff --git a/apps/dav/lib/Events/CalendarDeletedEvent.php b/apps/dav/lib/Events/CalendarDeletedEvent.php index 20c4b187246..326af0702ad 100644 --- a/apps/dav/lib/Events/CalendarDeletedEvent.php +++ b/apps/dav/lib/Events/CalendarDeletedEvent.php @@ -24,7 +24,7 @@ class CalendarDeletedEvent extends Event { /** @var array */ private $calendarData; - /** @var array */ + /** @var array */ private $shares; /** diff --git a/apps/dav/lib/Events/CalendarMovedToTrashEvent.php b/apps/dav/lib/Events/CalendarMovedToTrashEvent.php index 02ea0182e0a..b2eb8e1f018 100644 --- a/apps/dav/lib/Events/CalendarMovedToTrashEvent.php +++ b/apps/dav/lib/Events/CalendarMovedToTrashEvent.php @@ -21,7 +21,7 @@ class CalendarMovedToTrashEvent extends Event { /** @var array */ private $calendarData; - /** @var array */ + /** @var array */ private $shares; /** diff --git a/apps/dav/lib/Events/CalendarRestoredEvent.php b/apps/dav/lib/Events/CalendarRestoredEvent.php index a4ba75755e3..5ea754ef200 100644 --- a/apps/dav/lib/Events/CalendarRestoredEvent.php +++ b/apps/dav/lib/Events/CalendarRestoredEvent.php @@ -21,7 +21,7 @@ class CalendarRestoredEvent extends Event { /** @var array */ private $calendarData; - /** @var array */ + /** @var array */ private $shares; /** diff --git a/apps/dav/lib/Exception/UnsupportedLimitOnInitialSyncException.php b/apps/dav/lib/Exception/UnsupportedLimitOnInitialSyncException.php index 1022625c23b..c6b7f8564c5 100644 --- a/apps/dav/lib/Exception/UnsupportedLimitOnInitialSyncException.php +++ b/apps/dav/lib/Exception/UnsupportedLimitOnInitialSyncException.php @@ -1,4 +1,5 @@ maxResults, + (int) $limit->maxResults, $offset, $orders, $this->user, @@ -476,7 +477,7 @@ class FileSearchBackend implements ISearchBackend { if (is_numeric($value)) { return max(0, 0 + $value); } - $date = \DateTime::createFromFormat(\DateTimeInterface::ATOM, (string)$value); + $date = \DateTime::createFromFormat(\DateTimeInterface::ATOM, (string) $value); return ($date instanceof \DateTime && $date->getTimestamp() !== false) ? $date->getTimestamp() : 0; default: return $value; diff --git a/apps/dav/lib/Files/LazySearchBackend.php b/apps/dav/lib/Files/LazySearchBackend.php index a0ad730ff2b..6ba539ddd87 100644 --- a/apps/dav/lib/Files/LazySearchBackend.php +++ b/apps/dav/lib/Files/LazySearchBackend.php @@ -1,4 +1,5 @@ logger->debug("Creating activity for Calendar having its shares updated"); + $this->logger->debug('Creating activity for Calendar having its shares updated'); $this->activityBackend->onCalendarUpdateShares( $event->getCalendarData(), diff --git a/apps/dav/lib/Listener/SubscriptionListener.php b/apps/dav/lib/Listener/SubscriptionListener.php index 9c9904d1aa2..971ec23fd64 100644 --- a/apps/dav/lib/Listener/SubscriptionListener.php +++ b/apps/dav/lib/Listener/SubscriptionListener.php @@ -43,8 +43,8 @@ class SubscriptionListener implements IEventListener { $this->logger->debug('Refreshing webcal data for subscription ' . $subscriptionId); $this->refreshWebcalService->refreshSubscription( - (string)$subscriptionData['principaluri'], - (string)$subscriptionData['uri'] + (string) $subscriptionData['principaluri'], + (string) $subscriptionData['uri'] ); $this->logger->debug('Scheduling webcal data refreshment for subscription ' . $subscriptionId); diff --git a/apps/dav/lib/Migration/BuildCalendarSearchIndex.php b/apps/dav/lib/Migration/BuildCalendarSearchIndex.php index 222554a3732..050ab17c763 100644 --- a/apps/dav/lib/Migration/BuildCalendarSearchIndex.php +++ b/apps/dav/lib/Migration/BuildCalendarSearchIndex.php @@ -1,4 +1,5 @@ select($query->func()->max('cardid')) ->from('cards_properties') ->where($query->expr()->eq('name', $query->createNamedParameter('X-SOCIALPROFILE'))); - $maxId = (int)$query->execute()->fetchOne(); + $maxId = (int) $query->execute()->fetchOne(); if ($maxId === 0) { return; diff --git a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php index f727f4ea09a..67b12b15070 100644 --- a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php @@ -60,7 +60,7 @@ class BuildSocialSearchIndexBackgroundJob extends QueuedJob { ->from('cards', 'c') ->orderBy('id', 'ASC') ->where($query->expr()->like('carddata', $query->createNamedParameter('%SOCIALPROFILE%'))) - ->andWhere($query->expr()->gt('id', $query->createNamedParameter((int)$offset, IQueryBuilder::PARAM_INT))) + ->andWhere($query->expr()->gt('id', $query->createNamedParameter((int) $offset, IQueryBuilder::PARAM_INT))) ->setMaxResults(100); $social_cards = $query->executeQuery()->fetchAll(); diff --git a/apps/dav/lib/Migration/CalDAVRemoveEmptyValue.php b/apps/dav/lib/Migration/CalDAVRemoveEmptyValue.php index c7f57dcb117..17260cfaa6c 100644 --- a/apps/dav/lib/Migration/CalDAVRemoveEmptyValue.php +++ b/apps/dav/lib/Migration/CalDAVRemoveEmptyValue.php @@ -1,4 +1,5 @@ startProgress(count($objects)); foreach ($objects as $row) { - $calObject = $this->calDavBackend->getCalendarObject((int)$row['calendarid'], $row['uri']); + $calObject = $this->calDavBackend->getCalendarObject((int) $row['calendarid'], $row['uri']); $data = preg_replace('/' . $pattern . '/', ':', $calObject['calendardata']); if ($data !== $calObject['calendardata']) { @@ -52,14 +53,14 @@ class CalDAVRemoveEmptyValue implements IRepairStep { } catch (InvalidDataException $e) { $this->logger->info('Calendar object for calendar {cal} with uri {uri} still invalid', [ 'app' => 'dav', - 'cal' => (int)$row['calendarid'], + 'cal' => (int) $row['calendarid'], 'uri' => $row['uri'], ]); $warnings++; continue; } - $this->calDavBackend->updateCalendarObject((int)$row['calendarid'], $row['uri'], $data); + $this->calDavBackend->updateCalendarObject((int) $row['calendarid'], $row['uri'], $data); $count++; } } diff --git a/apps/dav/lib/Migration/FixBirthdayCalendarComponent.php b/apps/dav/lib/Migration/FixBirthdayCalendarComponent.php index d22e4b82c9f..df49dedc941 100644 --- a/apps/dav/lib/Migration/FixBirthdayCalendarComponent.php +++ b/apps/dav/lib/Migration/FixBirthdayCalendarComponent.php @@ -1,4 +1,5 @@ closeCursor(); if ($count !== false) { - $count = (int)$count; + $count = (int) $count; } else { $count = 0; } diff --git a/apps/dav/lib/Migration/RemoveObjectProperties.php b/apps/dav/lib/Migration/RemoveObjectProperties.php index b87eb82af19..32e59eec7b5 100644 --- a/apps/dav/lib/Migration/RemoveObjectProperties.php +++ b/apps/dav/lib/Migration/RemoveObjectProperties.php @@ -1,4 +1,5 @@ ['column1', 'column2'], ...] + * ['table1' => ['column1', 'column2'], ...] * @since 13.0.0 */ protected function getColumnsByTable() { diff --git a/apps/dav/lib/Migration/Version1005Date20180530124431.php b/apps/dav/lib/Migration/Version1005Date20180530124431.php index ac1994893fd..b5f9ff26962 100644 --- a/apps/dav/lib/Migration/Version1005Date20180530124431.php +++ b/apps/dav/lib/Migration/Version1005Date20180530124431.php @@ -1,4 +1,5 @@ userManager->countSeenUsers() > 100 || array_sum($this->userManager->countUsers()) > 100) { + if ($this->userManager->countSeenUsers() > 100 || array_sum($this->userManager->countUsers()) > 100) { $this->config->setAppValue('dav', 'needs_system_address_book_sync', 'yes'); $output->info('Could not sync system address books during update - too many user records have been found. Please call occ dav:sync-system-addressbook manually.'); return; diff --git a/apps/dav/lib/Migration/Version1029Date20221114151721.php b/apps/dav/lib/Migration/Version1029Date20221114151721.php index 05b04486c88..dba5e0b1a48 100644 --- a/apps/dav/lib/Migration/Version1029Date20221114151721.php +++ b/apps/dav/lib/Migration/Version1029Date20221114151721.php @@ -28,7 +28,7 @@ class Version1029Date20221114151721 extends SimpleMigrationStep { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); $calendarObjectsTable = $schema->getTable('calendarobjects'); - if(!$calendarObjectsTable->hasIndex('calobj_clssfction_index')) { + if (!$calendarObjectsTable->hasIndex('calobj_clssfction_index')) { $calendarObjectsTable->addIndex(['classification'], 'calobj_clssfction_index'); return $schema; } diff --git a/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php b/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php index f1313b89582..c8ef7a5cc19 100644 --- a/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php +++ b/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php @@ -1,4 +1,5 @@ getDavUrlForContact($addressBook['principaluri'], $addressBook['uri'], $contactRow['uri']) . '?photo'; } - $title = (string)$vCard->FN; + $title = (string) $vCard->FN; $subline = $this->generateSubline($vCard); $resourceUrl = $this->getDeepLinkToContactsApp($addressBook['uri'], (string) $vCard->UID); $result = new SearchResultEntry($thumbnailUrl, $title, $subline, $resourceUrl, 'icon-contacts-dark', true); - $result->addAttribute("displayName", $title); - $result->addAttribute("email", $subline); - $result->addAttribute("phoneNumber", (string)$vCard->TEL); + $result->addAttribute('displayName', $title); + $result->addAttribute('email', $subline); + $result->addAttribute('phoneNumber', (string) $vCard->TEL); return $result; }, $searchResults); @@ -166,7 +166,7 @@ class ContactsSearchProvider implements IFilteringProvider { return ''; } - return (string)$emailAddresses[0]; + return (string) $emailAddresses[0]; } public function getSupportedFilters(): array { diff --git a/apps/dav/lib/Search/EventsSearchProvider.php b/apps/dav/lib/Search/EventsSearchProvider.php index 6c9fe5167c5..071fceee1fe 100644 --- a/apps/dav/lib/Search/EventsSearchProvider.php +++ b/apps/dav/lib/Search/EventsSearchProvider.php @@ -149,7 +149,7 @@ class EventsSearchProvider extends ACalendarSearchProvider implements IFiltering } $formattedResults = \array_map(function (array $eventRow) use ($calendarsById, $subscriptionsById): SearchResultEntry { $component = $this->getPrimaryComponent($eventRow['calendardata'], self::$componentType); - $title = (string)($component->SUMMARY ?? $this->l10n->t('Untitled event')); + $title = (string) ($component->SUMMARY ?? $this->l10n->t('Untitled event')); $subline = $this->generateSubline($component); if ($eventRow['calendartype'] === CalDavBackend::CALENDAR_TYPE_CALENDAR) { @@ -164,7 +164,7 @@ class EventsSearchProvider extends ACalendarSearchProvider implements IFiltering if ($dtStart instanceof DateTime) { $startDateTime = $dtStart->getDateTime()->format('U'); - $result->addAttribute("createdAt", $startDateTime); + $result->addAttribute('createdAt', $startDateTime); } return $result; diff --git a/apps/dav/lib/Search/TasksSearchProvider.php b/apps/dav/lib/Search/TasksSearchProvider.php index 15baf070e81..d37ed3ecac5 100644 --- a/apps/dav/lib/Search/TasksSearchProvider.php +++ b/apps/dav/lib/Search/TasksSearchProvider.php @@ -95,7 +95,7 @@ class TasksSearchProvider extends ACalendarSearchProvider { ); $formattedResults = \array_map(function (array $taskRow) use ($calendarsById, $subscriptionsById):SearchResultEntry { $component = $this->getPrimaryComponent($taskRow['calendardata'], self::$componentType); - $title = (string)($component->SUMMARY ?? $this->l10n->t('Untitled task')); + $title = (string) ($component->SUMMARY ?? $this->l10n->t('Untitled task')); $subline = $this->generateSubline($component); if ($taskRow['calendartype'] === CalDavBackend::CALENDAR_TYPE_CALENDAR) { diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php index d57a4554fe3..8f4a6bc726f 100644 --- a/apps/dav/lib/Server.php +++ b/apps/dav/lib/Server.php @@ -1,4 +1,5 @@ systemTagsInFilesDetector->detectAssignedSystemTagsIn($userFolder, $this->mediaType); $children = []; foreach ($result as $tagData) { - $tag = new SystemTag((string)$tagData['id'], $tagData['name'], (bool)$tagData['visibility'], (bool)$tagData['editable']); + $tag = new SystemTag((string) $tagData['id'], $tagData['name'], (bool) $tagData['visibility'], (bool) $tagData['editable']); // read only, so we can submit the isAdmin parameter as false generally $node = new SystemTagNode($tag, $user, false, $this->systemTagManager); $node->setNumberOfFiles((int) $tagData['number_files']); diff --git a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php index dc0f1bc5d36..6871f03d6db 100644 --- a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php @@ -37,7 +37,7 @@ class SystemTagsRelationsCollection extends SimpleCollection { function (string $name) use ($rootFolder, $userSession): bool { $user = $userSession->getUser(); if ($user) { - $node = $rootFolder->getUserFolder($user->getUID())->getFirstNodeById((int)$name); + $node = $rootFolder->getUserFolder($user->getUID())->getFirstNodeById((int) $name); return $node !== null; } else { return false; @@ -46,7 +46,7 @@ class SystemTagsRelationsCollection extends SimpleCollection { function (string $name) use ($rootFolder, $userSession): bool { $user = $userSession->getUser(); if ($user) { - $nodes = $rootFolder->getUserFolder($user->getUID())->getById((int)$name); + $nodes = $rootFolder->getUserFolder($user->getUID())->getById((int) $name); foreach ($nodes as $node) { if (($node->getPermissions() & Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE) { return true; diff --git a/apps/dav/lib/Traits/PrincipalProxyTrait.php b/apps/dav/lib/Traits/PrincipalProxyTrait.php index 279f796b720..feec485fe5c 100644 --- a/apps/dav/lib/Traits/PrincipalProxyTrait.php +++ b/apps/dav/lib/Traits/PrincipalProxyTrait.php @@ -1,4 +1,5 @@ getUploadStorage($this->uploadPath); $chunkName = basename($request->getPath()); - $partId = is_numeric($chunkName) ? (int)$chunkName : -1; + $partId = is_numeric($chunkName) ? (int) $chunkName : -1; if (!($partId >= 1 && $partId <= 10000)) { throw new BadRequest('Invalid chunk name, must be numeric between 1 and 10000'); } @@ -147,7 +147,7 @@ class ChunkingV2Plugin extends ServerPlugin { $uploadFile = $this->getUploadFile($this->uploadPath); $tempTargetFile = null; - $additionalSize = (int)$request->getHeader('Content-Length'); + $additionalSize = (int) $request->getHeader('Content-Length'); if ($this->uploadFolder->childExists(self::TEMP_TARGET) && $this->uploadPath) { /** @var UploadFile $tempTargetFile */ $tempTargetFile = $this->uploadFolder->getChild(self::TEMP_TARGET); @@ -162,7 +162,7 @@ class ChunkingV2Plugin extends ServerPlugin { } $stream = $request->getBodyAsStream(); - $storage->putChunkedWritePart($storagePath, $this->uploadId, (string)$partId, $stream, $additionalSize); + $storage->putChunkedWritePart($storagePath, $this->uploadId, (string) $partId, $stream, $additionalSize); $storage->getCache()->update($uploadFile->getId(), ['size' => $uploadFile->getSize() + $additionalSize]); if ($tempTargetFile) { @@ -294,7 +294,7 @@ class ChunkingV2Plugin extends ServerPlugin { throw new InvalidArgumentException('X-OC-MTime header must be an integer (unix timestamp).'); } - return (int)$mtimeFromRequest; + return (int) $mtimeFromRequest; } /** diff --git a/apps/dav/lib/Upload/UploadFile.php b/apps/dav/lib/Upload/UploadFile.php index ae64760e0ce..742eda78d08 100644 --- a/apps/dav/lib/Upload/UploadFile.php +++ b/apps/dav/lib/Upload/UploadFile.php @@ -12,7 +12,7 @@ use OCA\DAV\Connector\Sabre\File; use Sabre\DAV\IFile; class UploadFile implements IFile { - /** @var File */ + /** @var File */ private $file; public function __construct(File $file) { diff --git a/apps/dav/lib/UserMigration/ContactsMigrator.php b/apps/dav/lib/UserMigration/ContactsMigrator.php index 70f92379fe2..a14d3bc5e1c 100644 --- a/apps/dav/lib/UserMigration/ContactsMigrator.php +++ b/apps/dav/lib/UserMigration/ContactsMigrator.php @@ -251,7 +251,7 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator { $vCard->serialize(), ); } catch (Throwable $e) { - $output->writeln("Error creating contact \"" . ($vCard->FN ?? 'null') . "\" from \"$filename\", skipping…"); + $output->writeln('Error creating contact "' . ($vCard->FN ?? 'null') . "\" from \"$filename\", skipping…"); } } diff --git a/apps/dav/tests/unit/AppInfo/PluginManagerTest.php b/apps/dav/tests/unit/AppInfo/PluginManagerTest.php index 8211cdfc02c..377654268db 100644 --- a/apps/dav/tests/unit/AppInfo/PluginManagerTest.php +++ b/apps/dav/tests/unit/AppInfo/PluginManagerTest.php @@ -1,4 +1,5 @@ vobject->expects($this->once()) ->method('getBaseComponent') - ->willReturn((object)['UID' => 'someid']); + ->willReturn((object) ['UID' => 'someid']); $this->calendar->expects($this->once()) ->method('getPermissions') ->willReturn(Constants::PERMISSION_ALL); @@ -156,7 +156,7 @@ class CalendarObjectTest extends TestCase { public function testGetName() { $this->vobject->expects($this->exactly(2)) ->method('getBaseComponent') - ->willReturnOnConsecutiveCalls((object)['UID' => 'someid'], (object)['UID' => 'someid', 'X-FILENAME' => 'real-filename.ics']); + ->willReturnOnConsecutiveCalls((object) ['UID' => 'someid'], (object) ['UID' => 'someid', 'X-FILENAME' => 'real-filename.ics']); $this->assertEquals($this->calendarObject->getName(), 'someid.ics'); $this->assertEquals($this->calendarObject->getName(), 'real-filename.ics'); diff --git a/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php b/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php index e7de7d0a55e..2cee9707bbf 100644 --- a/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php +++ b/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php @@ -1,4 +1,5 @@ [0, 'lastOccurence', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.3.0//EN\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:19110324\r\nDTEND;VALUE=DATE:19110325\r\nDTSTAMP:20200927T180638Z\r\nUID:asdfasdfasdf@google.com\r\nCREATED:20200626T181848Z\r\nDESCRIPTION:Very old event\r\nLAST-MODIFIED:20200922T192707Z\r\nSUMMARY:Some old event\r\nTRANSP:OPAQUE\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"], - 'first occurrence is found when not first VEVENT in group' => [(new DateTime('2020-09-01T110000', new DateTimeZone("America/Los_Angeles")))->getTimestamp(), 'firstOccurence', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.3.0//EN\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nDTSTART;TZID=America/Los_Angeles:20201013T110000\r\nDTEND;TZID=America/Los_Angeles:20201013T120000\r\nDTSTAMP:20200927T180638Z\r\nUID:asdf0000@google.com\r\nRECURRENCE-ID;TZID=America/Los_Angeles:20201013T110000\r\nCREATED:20160330T034726Z\r\nLAST-MODIFIED:20200925T042014Z\r\nSTATUS:CONFIRMED\r\nTRANSP:OPAQUE\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nDTSTART;TZID=America/Los_Angeles:20200901T110000\r\nDTEND;TZID=America/Los_Angeles:20200901T120000\r\nRRULE:FREQ=WEEKLY;BYDAY=TU\r\nEXDATE;TZID=America/Los_Angeles:20200922T110000\r\nEXDATE;TZID=America/Los_Angeles:20200915T110000\r\nEXDATE;TZID=America/Los_Angeles:20200908T110000\r\nDTSTAMP:20200927T180638Z\r\nUID:asdf0000@google.com\r\nCREATED:20160330T034726Z\r\nLAST-MODIFIED:20200915T162810Z\r\nSTATUS:CONFIRMED\r\nTRANSP:OPAQUE\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"], + 'first occurrence is found when not first VEVENT in group' => [(new DateTime('2020-09-01T110000', new DateTimeZone('America/Los_Angeles')))->getTimestamp(), 'firstOccurence', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.3.0//EN\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nDTSTART;TZID=America/Los_Angeles:20201013T110000\r\nDTEND;TZID=America/Los_Angeles:20201013T120000\r\nDTSTAMP:20200927T180638Z\r\nUID:asdf0000@google.com\r\nRECURRENCE-ID;TZID=America/Los_Angeles:20201013T110000\r\nCREATED:20160330T034726Z\r\nLAST-MODIFIED:20200925T042014Z\r\nSTATUS:CONFIRMED\r\nTRANSP:OPAQUE\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nDTSTART;TZID=America/Los_Angeles:20200901T110000\r\nDTEND;TZID=America/Los_Angeles:20200901T120000\r\nRRULE:FREQ=WEEKLY;BYDAY=TU\r\nEXDATE;TZID=America/Los_Angeles:20200922T110000\r\nEXDATE;TZID=America/Los_Angeles:20200915T110000\r\nEXDATE;TZID=America/Los_Angeles:20200908T110000\r\nDTSTAMP:20200927T180638Z\r\nUID:asdf0000@google.com\r\nCREATED:20160330T034726Z\r\nLAST-MODIFIED:20200915T162810Z\r\nSTATUS:CONFIRMED\r\nTRANSP:OPAQUE\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"], 'CLASS:PRIVATE' => [CalDavBackend::CLASSIFICATION_PRIVATE, 'classification', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//dmfs.org//mimedir.icalendar//EN\r\nBEGIN:VTIMEZONE\r\nTZID:Europe/Berlin\r\nX-LIC-LOCATION:Europe/Berlin\r\nBEGIN:DAYLIGHT\r\nTZOFFSETFROM:+0100\r\nTZOFFSETTO:+0200\r\nTZNAME:CEST\r\nDTSTART:19700329T020000\r\nRRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU\r\nEND:DAYLIGHT\r\nBEGIN:STANDARD\r\nTZOFFSETFROM:+0200\r\nTZOFFSETTO:+0100\r\nTZNAME:CET\r\nDTSTART:19701025T030000\r\nRRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\r\nEND:STANDARD\r\nEND:VTIMEZONE\r\nBEGIN:VEVENT\r\nDTSTART;TZID=Europe/Berlin:20160419T130000\r\nSUMMARY:Test\r\nCLASS:PRIVATE\r\nTRANSP:OPAQUE\r\nSTATUS:CONFIRMED\r\nDTEND;TZID=Europe/Berlin:20160419T140000\r\nLAST-MODIFIED:20160419T074202Z\r\nDTSTAMP:20160419T074202Z\r\nCREATED:20160419T074202Z\r\nUID:2e468c48-7860-492e-bc52-92fa0daeeccf.1461051722310\r\nEND:VEVENT\r\nEND:VCALENDAR"], diff --git a/apps/dav/tests/unit/CalDAV/CalendarHomeTest.php b/apps/dav/tests/unit/CalDAV/CalendarHomeTest.php index 9956c17fff3..bba9698bd08 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarHomeTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarHomeTest.php @@ -1,4 +1,5 @@ method('setCurrentPrincipal') ->with($this->calendar->getPrincipalURI()); - /** @var \Sabre\DAVACL\Plugin|MockObject $aclPlugin*/ + /** @var \Sabre\DAVACL\Plugin|MockObject $aclPlugin */ $aclPlugin = $this->createMock(\Sabre\DAVACL\Plugin::class); /** @var Plugin|MockObject $schedulingPlugin */ $schedulingPlugin = $this->createMock(Plugin::class); $iTipMessage = $this->getITipMessage($message); - $iTipMessage->recipient = "mailto:lewis@stardew-tent-living.com"; + $iTipMessage->recipient = 'mailto:lewis@stardew-tent-living.com'; $server = $this->createMock(Server::class); $server->expects($this->any()) @@ -250,7 +251,7 @@ EOF; $iTipMessage->sender = $attendee; $iTipMessage->uid = isset($vEvent->{'UID'}) ? $vEvent->{'UID'}->getValue() : ''; $iTipMessage->component = 'VEVENT'; - $iTipMessage->sequence = isset($vEvent->{'SEQUENCE'}) ? (int)$vEvent->{'SEQUENCE'}->getValue() : 0; + $iTipMessage->sequence = isset($vEvent->{'SEQUENCE'}) ? (int) $vEvent->{'SEQUENCE'}->getValue() : 0; $iTipMessage->message = $vObject; return $iTipMessage; } diff --git a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php index 63d92dff40d..845474562c9 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php @@ -1,4 +1,5 @@ expects($this->once()) ->method('t') ->with('Busy') - ->willReturn("Translated busy"); + ->willReturn('Translated busy'); } else { $l10n->expects($this->never()) ->method('t'); diff --git a/apps/dav/tests/unit/CalDAV/EventReaderTest.php b/apps/dav/tests/unit/CalDAV/EventReaderTest.php index fa07b99fbaf..039763628fb 100644 --- a/apps/dav/tests/unit/CalDAV/EventReaderTest.php +++ b/apps/dav/tests/unit/CalDAV/EventReaderTest.php @@ -16,19 +16,19 @@ use Test\TestCase; class EventReaderTest extends TestCase { - /** @var VCalendar*/ + /** @var VCalendar */ private $vCalendar1a; - /** @var VCalendar*/ + /** @var VCalendar */ private $vCalendar1b; - /** @var VCalendar*/ + /** @var VCalendar */ private $vCalendar1c; - /** @var VCalendar*/ + /** @var VCalendar */ private $vCalendar1d; - /** @var VCalendar*/ + /** @var VCalendar */ private $vCalendar1e; - /** @var VCalendar*/ + /** @var VCalendar */ private $vCalendar2; - /** @var VCalendar*/ + /** @var VCalendar */ private $vCalendar3; protected function setUp(): void { diff --git a/apps/dav/tests/unit/CalDAV/Integration/ExternalCalendarTest.php b/apps/dav/tests/unit/CalDAV/Integration/ExternalCalendarTest.php index 778df5697f0..824b3e1448f 100644 --- a/apps/dav/tests/unit/CalDAV/Integration/ExternalCalendarTest.php +++ b/apps/dav/tests/unit/CalDAV/Integration/ExternalCalendarTest.php @@ -1,4 +1,5 @@ createMock(IConfig::class); - /** @var MockObject | LoggerInterface $logger */ + /** @var MockObject | LoggerInterface $logger */ $logger = $this->createMock(LoggerInterface::class); $c = new PublicCalendar($backend, $calendarInfo, $this->l10n, $config, $logger); $children = $c->getChildren(); @@ -134,7 +135,7 @@ EOD; ]; /** @var MockObject | IConfig $config */ $config = $this->createMock(IConfig::class); - /** @var MockObject | LoggerInterface $logger */ + /** @var MockObject | LoggerInterface $logger */ $logger = $this->createMock(LoggerInterface::class); $c = new PublicCalendar($backend, $calendarInfo, $this->l10n, $config, $logger); diff --git a/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php b/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php index 769e1537646..a410b0f210d 100644 --- a/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php +++ b/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php @@ -1,4 +1,5 @@ assertEquals($rows[3]['notification_date'], 123600); - $reminderId = (int) $rows[3]['id']; + $reminderId = (int) $rows[3]['id']; $newNotificationDate = 123700; $this->reminderBackend->updateReminder($reminderId, $newNotificationDate); diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php index dcf11a1a6b8..396cf480b40 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php @@ -59,7 +59,7 @@ class NotifierTest extends TestCase { ->method('n') ->willReturnCallback(function ($textSingular, $textPlural, $count, $args) { $text = $count === 1 ? $textSingular : $textPlural; - $text = str_replace('%n', (string)$count, $text); + $text = str_replace('%n', (string) $count, $text); return vsprintf($text, $args); }); $this->factory = $this->createMock(IFactory::class); diff --git a/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php b/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php index d4594291d88..198c8d97b12 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php @@ -35,13 +35,13 @@ class ReminderServiceTest extends TestCase { /** @var IUserManager|MockObject */ private $userManager; - /** @var IGroupManager|MockObject*/ + /** @var IGroupManager|MockObject */ private $groupManager; /** @var CalDavBackend|MockObject */ private $caldavBackend; - /** @var ITimeFactory|MockObject */ + /** @var ITimeFactory|MockObject */ private $timeFactory; /** @var IConfig|MockObject */ diff --git a/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php b/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php index ed39129fa56..1546836a29b 100644 --- a/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php +++ b/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php @@ -1,4 +1,5 @@ l10n->expects(self::once()) ->method('t') diff --git a/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php b/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php index 7a1d61a083b..cba61ef0b61 100644 --- a/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php +++ b/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php @@ -42,7 +42,7 @@ class PluginTest extends TestCase { /** @var Server|MockObject */ private $server; - /** @var IConfig|MockObject */ + /** @var IConfig|MockObject */ private $config; /** @var LoggerInterface&MockObject */ @@ -348,10 +348,10 @@ class PluginTest extends TestCase { if (!$exists || $deleted) { if (!$hasExistingCalendars) { $calendarBackend->expects($this->once()) - ->method('createCalendar') - ->with($principalUri, $calendarUri, [ - '{DAV:}displayname' => $displayName, - ]); + ->method('createCalendar') + ->with($principalUri, $calendarUri, [ + '{DAV:}displayname' => $displayName, + ]); $calendarHomeObject->expects($this->exactly($deleted ? 2 : 1)) ->method('getCalDAVBackend') diff --git a/apps/dav/tests/unit/CalDAV/Search/Request/CalendarSearchReportTest.php b/apps/dav/tests/unit/CalDAV/Search/Request/CalendarSearchReportTest.php index cbfd4639ed7..f9a72ccfba8 100644 --- a/apps/dav/tests/unit/CalDAV/Search/Request/CalendarSearchReportTest.php +++ b/apps/dav/tests/unit/CalDAV/Search/Request/CalendarSearchReportTest.php @@ -1,4 +1,5 @@ willThrowException($localServerException); $this->logger->expects(self::once()) ->method('warning') - ->with("Subscription 42 was not refreshed because it violates local access rules", ['exception' => $localServerException]); + ->with('Subscription 42 was not refreshed because it violates local access rules', ['exception' => $localServerException]); $this->connection->queryWebcalFeed($subscription); } diff --git a/apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php b/apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php index 82c03c5cf68..a7ac444e22f 100644 --- a/apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php +++ b/apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php @@ -1,4 +1,5 @@ caldavBackend->expects(self::once()) - ->method("createCalendarObject") + ->method('createCalendarObject') ->willThrowException($noInstanceException); $this->logger->expects(self::once()) @@ -298,7 +298,7 @@ class RefreshWebcalServiceTest extends TestCase { $badRequestException = new BadRequest("can't add reach calendar url"); $this->caldavBackend->expects(self::once()) - ->method("createCalendarObject") + ->method('createCalendarObject') ->willThrowException($badRequestException); $this->logger->expects(self::once()) diff --git a/apps/dav/tests/unit/CapabilitiesTest.php b/apps/dav/tests/unit/CapabilitiesTest.php index e99f7b8da5f..76a5e85fdad 100644 --- a/apps/dav/tests/unit/CapabilitiesTest.php +++ b/apps/dav/tests/unit/CapabilitiesTest.php @@ -1,4 +1,5 @@ getMockBuilder(CardDavBackend::class) - ->setConstructorArgs([$this->db, $this->principal, $this->userManager, $this->dispatcher, $this->sharingBackend]) - ->onlyMethods(['updateProperties', 'purgeProperties'])->getMock(); + ->setConstructorArgs([$this->db, $this->principal, $this->userManager, $this->dispatcher, $this->sharingBackend]) + ->onlyMethods(['updateProperties', 'purgeProperties'])->getMock(); // create a new address book $backend->createAddressBook(self::UNIT_TEST_USER, 'Example', []); @@ -536,13 +536,13 @@ class CardDavBackendTest extends TestCase { $this->assertSame('UID', $result[0]['name']); $this->assertSame($cardUri, $result[0]['value']); - $this->assertSame($bookId, (int)$result[0]['addressbookid']); - $this->assertSame($cardId, (int)$result[0]['cardid']); + $this->assertSame($bookId, (int) $result[0]['addressbookid']); + $this->assertSame($cardId, (int) $result[0]['cardid']); $this->assertSame('FN', $result[1]['name']); $this->assertSame('John Doe', $result[1]['value']); - $this->assertSame($bookId, (int)$result[1]['addressbookid']); - $this->assertSame($cardId, (int)$result[1]['cardid']); + $this->assertSame($bookId, (int) $result[1]['addressbookid']); + $this->assertSame($cardId, (int) $result[1]['cardid']); // update properties for existing vCard $vCard = new VCard(); @@ -561,8 +561,8 @@ class CardDavBackendTest extends TestCase { $this->assertSame('UID', $result[0]['name']); $this->assertSame($cardUri, $result[0]['value']); - $this->assertSame($bookId, (int)$result[0]['addressbookid']); - $this->assertSame($cardId, (int)$result[0]['cardid']); + $this->assertSame($bookId, (int) $result[0]['addressbookid']); + $this->assertSame($cardId, (int) $result[0]['cardid']); } public function testPurgeProperties(): void { @@ -603,8 +603,8 @@ class CardDavBackendTest extends TestCase { $qResult->closeCursor(); $this->assertSame(1, count($result)); - $this->assertSame(1, (int)$result[0]['addressbookid']); - $this->assertSame(2, (int)$result[0]['cardid']); + $this->assertSame(1, (int) $result[0]['addressbookid']); + $this->assertSame(2, (int) $result[0]['cardid']); } public function testGetCardId(): void { @@ -662,16 +662,16 @@ class CardDavBackendTest extends TestCase { $query = $this->db->getQueryBuilder(); for ($i = 0; $i < 3; $i++) { $query->insert($this->dbCardsTable) - ->values( - [ - 'addressbookid' => $query->createNamedParameter(0), - 'carddata' => $query->createNamedParameter($vCards[$i]->serialize(), IQueryBuilder::PARAM_LOB), - 'uri' => $query->createNamedParameter('uri' . $i), - 'lastmodified' => $query->createNamedParameter(time()), - 'etag' => $query->createNamedParameter('etag' . $i), - 'size' => $query->createNamedParameter(120), - ] - ); + ->values( + [ + 'addressbookid' => $query->createNamedParameter(0), + 'carddata' => $query->createNamedParameter($vCards[$i]->serialize(), IQueryBuilder::PARAM_LOB), + 'uri' => $query->createNamedParameter('uri' . $i), + 'lastmodified' => $query->createNamedParameter(time()), + 'etag' => $query->createNamedParameter('etag' . $i), + 'size' => $query->createNamedParameter(120), + ] + ); $query->execute(); $vCardIds[] = $query->getLastInsertId(); } @@ -771,16 +771,16 @@ class CardDavBackendTest extends TestCase { public function testGetCardUri(): void { $query = $this->db->getQueryBuilder(); $query->insert($this->dbCardsTable) - ->values( - [ - 'addressbookid' => $query->createNamedParameter(1), - 'carddata' => $query->createNamedParameter('carddata', IQueryBuilder::PARAM_LOB), - 'uri' => $query->createNamedParameter('uri'), - 'lastmodified' => $query->createNamedParameter(5489543), - 'etag' => $query->createNamedParameter('etag'), - 'size' => $query->createNamedParameter(120), - ] - ); + ->values( + [ + 'addressbookid' => $query->createNamedParameter(1), + 'carddata' => $query->createNamedParameter('carddata', IQueryBuilder::PARAM_LOB), + 'uri' => $query->createNamedParameter('uri'), + 'lastmodified' => $query->createNamedParameter(5489543), + 'etag' => $query->createNamedParameter('etag'), + 'size' => $query->createNamedParameter(120), + ] + ); $query->execute(); $id = $query->getLastInsertId(); @@ -799,26 +799,26 @@ class CardDavBackendTest extends TestCase { $query = $this->db->getQueryBuilder(); for ($i = 0; $i < 2; $i++) { $query->insert($this->dbCardsTable) - ->values( - [ - 'addressbookid' => $query->createNamedParameter($i), - 'carddata' => $query->createNamedParameter('carddata' . $i, IQueryBuilder::PARAM_LOB), - 'uri' => $query->createNamedParameter('uri' . $i), - 'lastmodified' => $query->createNamedParameter(5489543), - 'etag' => $query->createNamedParameter('etag' . $i), - 'size' => $query->createNamedParameter(120), - ] - ); + ->values( + [ + 'addressbookid' => $query->createNamedParameter($i), + 'carddata' => $query->createNamedParameter('carddata' . $i, IQueryBuilder::PARAM_LOB), + 'uri' => $query->createNamedParameter('uri' . $i), + 'lastmodified' => $query->createNamedParameter(5489543), + 'etag' => $query->createNamedParameter('etag' . $i), + 'size' => $query->createNamedParameter(120), + ] + ); $query->execute(); } $result = $this->backend->getContact(0, 'uri0'); $this->assertSame(8, count($result)); - $this->assertSame(0, (int)$result['addressbookid']); + $this->assertSame(0, (int) $result['addressbookid']); $this->assertSame('uri0', $result['uri']); - $this->assertSame(5489543, (int)$result['lastmodified']); + $this->assertSame(5489543, (int) $result['lastmodified']); $this->assertSame('"etag0"', $result['etag']); - $this->assertSame(120, (int)$result['size']); + $this->assertSame(120, (int) $result['size']); // this shouldn't return any result because 'uri1' is in address book 1 // see https://github.com/nextcloud/server/issues/229 @@ -842,7 +842,7 @@ class CardDavBackendTest extends TestCase { 'preferred' => $query->createNamedParameter(0) ] ) - ->execute(); + ->execute(); $result = $this->backend->collectCardProperties(666, 'FN'); $this->assertEquals(['John Doe'], $result); diff --git a/apps/dav/tests/unit/CardDAV/ConverterTest.php b/apps/dav/tests/unit/CardDAV/ConverterTest.php index df6489d5053..a582e31f9f7 100644 --- a/apps/dav/tests/unit/CardDAV/ConverterTest.php +++ b/apps/dav/tests/unit/CardDAV/ConverterTest.php @@ -53,7 +53,7 @@ class ConverterTest extends TestCase { ->willReturn($name); $property->expects($this->any()) ->method('getValue') - ->willReturn((string)$value); + ->willReturn((string) $value); $property->expects($this->any()) ->method('getScope') ->willReturn($scope); @@ -89,7 +89,7 @@ class ConverterTest extends TestCase { * @dataProvider providesNewUsers */ public function testCreation($expectedVCard, $displayName = null, $eMailAddress = null, $cloudId = null): void { - $user = $this->getUserMock((string)$displayName, $eMailAddress, $cloudId); + $user = $this->getUserMock((string) $displayName, $eMailAddress, $cloudId); $accountManager = $this->getAccountManager($user); $converter = new Converter($accountManager, $this->userManager, $this->urlGenerator, $this->logger); @@ -104,7 +104,7 @@ class ConverterTest extends TestCase { } public function testManagerProp(): void { - $user = $this->getUserMock("user", "user@domain.tld", "user@cloud.domain.tld"); + $user = $this->getUserMock('user', 'user@domain.tld', 'user@cloud.domain.tld'); $user->method('getManagerUids') ->willReturn(['mgr']); $this->userManager->expects(self::once()) @@ -168,8 +168,8 @@ class ConverterTest extends TestCase { 'fn' => 'Dr. Foo Bar', 'photo' => 'MTIzNDU2Nzg5', ], - "Dr. Foo Bar", - "foo@bar.net", + 'Dr. Foo Bar', + 'foo@bar.net', 'foo@cloud.net' ], [ @@ -178,9 +178,9 @@ class ConverterTest extends TestCase { 'fn' => 'Dr. Foo Bar', 'photo' => 'MTIzNDU2Nzg5', ], - "Dr. Foo Bar", + 'Dr. Foo Bar', null, - "foo@cloud.net" + 'foo@cloud.net' ], [ [ diff --git a/apps/dav/tests/unit/CardDAV/SystemAddressBookTest.php b/apps/dav/tests/unit/CardDAV/SystemAddressBookTest.php index a1c614cb69d..806c71759f8 100644 --- a/apps/dav/tests/unit/CardDAV/SystemAddressBookTest.php +++ b/apps/dav/tests/unit/CardDAV/SystemAddressBookTest.php @@ -150,7 +150,7 @@ VCF; ->with(123, 'user.vcf') ->willReturn($originalCard); - $card = $this->addressBook->getChild("user.vcf"); + $card = $this->addressBook->getChild('user.vcf'); /** @var VCard $vCard */ $vCard = Reader::read($card->get()); @@ -180,7 +180,7 @@ VCF; ]); $this->expectException(NotFound::class); - $this->addressBook->getChild("LDAP:user.vcf"); + $this->addressBook->getChild('LDAP:user.vcf'); } public function testGetChildWithoutEnumeration(): void { @@ -193,7 +193,7 @@ VCF; ]); $this->expectException(Forbidden::class); - $this->addressBook->getChild("LDAP:user.vcf"); + $this->addressBook->getChild('LDAP:user.vcf'); } public function testGetChildAsGuest(): void { @@ -211,7 +211,7 @@ VCF; ->willReturn($user); $this->expectException(Forbidden::class); - $this->addressBook->getChild("LDAP:user.vcf"); + $this->addressBook->getChild('LDAP:user.vcf'); } public function testGetChildWithGroupEnumerationRestriction(): void { @@ -272,7 +272,7 @@ VCF; ->willReturn($user); $this->expectException(Forbidden::class); - $this->addressBook->getChild("LDAP:user.vcf"); + $this->addressBook->getChild('LDAP:user.vcf'); } public function testGetOwnChildWithPhoneNumberEnumerationRestriction(): void { @@ -305,7 +305,7 @@ VCF; 'carddata' => $cardData, ]); - $this->addressBook->getChild("LDAP:user.vcf"); + $this->addressBook->getChild('LDAP:user.vcf'); } public function testGetMultipleChildrenWithGroupEnumerationRestriction(): void { diff --git a/apps/dav/tests/unit/Command/ListCalendarsTest.php b/apps/dav/tests/unit/Command/ListCalendarsTest.php index 30df9ee79dc..fcb3658a6fc 100644 --- a/apps/dav/tests/unit/Command/ListCalendarsTest.php +++ b/apps/dav/tests/unit/Command/ListCalendarsTest.php @@ -1,4 +1,5 @@ execute([ 'uid' => self::USERNAME, ]); - $this->assertStringContainsString("User <" . self::USERNAME . "> in unknown", $commandTester->getDisplay()); + $this->assertStringContainsString('User <' . self::USERNAME . '> in unknown', $commandTester->getDisplay()); } public function testWithCorrectUserWithNoCalendars(): void { @@ -72,7 +73,7 @@ class ListCalendarsTest extends TestCase { $commandTester->execute([ 'uid' => self::USERNAME, ]); - $this->assertStringContainsString("User <" . self::USERNAME . "> has no calendars\n", $commandTester->getDisplay()); + $this->assertStringContainsString('User <' . self::USERNAME . "> has no calendars\n", $commandTester->getDisplay()); } public function dataExecute() { diff --git a/apps/dav/tests/unit/Command/MoveCalendarTest.php b/apps/dav/tests/unit/Command/MoveCalendarTest.php index 09831fdb1b2..aac947cbf4c 100644 --- a/apps/dav/tests/unit/Command/MoveCalendarTest.php +++ b/apps/dav/tests/unit/Command/MoveCalendarTest.php @@ -1,4 +1,5 @@ 'user2', ]); - $this->assertStringContainsString("[OK] Calendar was moved from user to ", $commandTester->getDisplay()); + $this->assertStringContainsString('[OK] Calendar was moved from user to ', $commandTester->getDisplay()); } public function dataTestMoveWithDestinationNotPartOfGroup(): array { @@ -240,7 +241,7 @@ class MoveCalendarTest extends TestCase { ]); if ($shareWithGroupMembersOnly === true) { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("User is not part of the group with whom the calendar was shared. You may use -f to move the calendar while deleting this share."); + $this->expectExceptionMessage('User is not part of the group with whom the calendar was shared. You may use -f to move the calendar while deleting this share.'); } $commandTester = new CommandTester($this->command); @@ -294,7 +295,7 @@ class MoveCalendarTest extends TestCase { 'destinationuid' => 'user2', ]); - $this->assertStringContainsString("[OK] Calendar was moved from user to ", $commandTester->getDisplay()); + $this->assertStringContainsString('[OK] Calendar was moved from user to ', $commandTester->getDisplay()); } public function testMoveWithDestinationNotPartOfGroupAndForce(): void { @@ -342,7 +343,7 @@ class MoveCalendarTest extends TestCase { '--force' => true ]); - $this->assertStringContainsString("[OK] Calendar was moved from user to ", $commandTester->getDisplay()); + $this->assertStringContainsString('[OK] Calendar was moved from user to ', $commandTester->getDisplay()); } public function dataTestMoveWithCalendarAlreadySharedToDestination(): array { @@ -380,17 +381,17 @@ class MoveCalendarTest extends TestCase { ); $this->calDav->expects($this->once())->method('getShares') - ->with(1234) - ->willReturn([ - [ - 'href' => 'principal:principals/users/user2', - '{DAV:}displayname' => 'Personal' - ] - ]); + ->with(1234) + ->willReturn([ + [ + 'href' => 'principal:principals/users/user2', + '{DAV:}displayname' => 'Personal' + ] + ]); if ($force === false) { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("The calendar is already shared to user .You may use -f to move the calendar while deleting this share."); + $this->expectExceptionMessage('The calendar is already shared to user .You may use -f to move the calendar while deleting this share.'); } else { $this->calDav->expects($this->once())->method('updateShares'); } diff --git a/apps/dav/tests/unit/Comments/CommentsNodeTest.php b/apps/dav/tests/unit/Comments/CommentsNodeTest.php index d2bb60af4b2..c253c59df0f 100644 --- a/apps/dav/tests/unit/Comments/CommentsNodeTest.php +++ b/apps/dav/tests/unit/Comments/CommentsNodeTest.php @@ -19,7 +19,7 @@ use Sabre\DAV\PropPatch; class CommentsNodeTest extends \Test\TestCase { - /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */ protected $commentsManager; protected $comment; diff --git a/apps/dav/tests/unit/Comments/CommentsPluginTest.php b/apps/dav/tests/unit/Comments/CommentsPluginTest.php index 60c3e52ef54..5ca0cedf04b 100644 --- a/apps/dav/tests/unit/Comments/CommentsPluginTest.php +++ b/apps/dav/tests/unit/Comments/CommentsPluginTest.php @@ -29,7 +29,7 @@ class CommentsPluginTest extends \Test\TestCase { /** @var ICommentsManager */ private $commentsManager; - /** @var IUserSession */ + /** @var IUserSession */ private $userSession; /** @var CommentsPluginImplementation */ diff --git a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php index dccb1edd0ae..de258c9aaec 100644 --- a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php @@ -221,11 +221,11 @@ class AuthTest extends TestCase { public function testAuthenticateAlreadyLoggedInWithoutCsrfTokenForNonGet(): void { $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $this->userSession ->expects($this->any()) ->method('isLoggedIn') diff --git a/apps/dav/tests/unit/Connector/Sabre/BearerAuthTest.php b/apps/dav/tests/unit/Connector/Sabre/BearerAuthTest.php index 92d5c95f4c7..d4f3287450c 100644 --- a/apps/dav/tests/unit/Connector/Sabre/BearerAuthTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/BearerAuthTest.php @@ -1,4 +1,5 @@ info->method('getType') ->willReturn(Node::TYPE_FOLDER); $this->info->method('getName') - ->willReturn("folder"); + ->willReturn('folder'); $this->info->method('getPath') - ->willReturn("/admin/files/folder"); + ->willReturn('/admin/files/folder'); $this->info->method('getPermissions') ->willReturn(Constants::PERMISSION_READ); } diff --git a/apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php b/apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php index 74f90507bb3..c7fb6066ed4 100644 --- a/apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php @@ -20,7 +20,7 @@ class ForbiddenTest extends \Test\TestCase { $DOM->appendChild($error); // serialize the exception - $message = "1234567890"; + $message = '1234567890'; $retry = false; $expectedXml = << diff --git a/apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php b/apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php index 3da0c41b7b3..98921d735fa 100644 --- a/apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php @@ -20,7 +20,7 @@ class InvalidPathTest extends \Test\TestCase { $DOM->appendChild($error); // serialize the exception - $message = "1234567890"; + $message = '1234567890'; $retry = false; $expectedXml = << diff --git a/apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php index 40ebc69e42d..18165b79cb2 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php @@ -160,11 +160,11 @@ class FakeLockerPluginTest extends TestCase { ->getMock(); $response->expects($this->once()) - ->method('setStatus') - ->with('204'); + ->method('setStatus') + ->with('204'); $response->expects($this->once()) - ->method('setHeader') - ->with('Content-Length', '0'); + ->method('setHeader') + ->with('Content-Length', '0'); $this->assertSame(false, $this->fakeLockerPlugin->fakeUnlockProvider($request, $response)); } diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index d099a431184..fb15e5904e7 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -264,51 +264,51 @@ class FileTest extends TestCase { public function legalMtimeProvider() { return [ - "string" => [ - 'HTTP_X_OC_MTIME' => "string", + 'string' => [ + 'HTTP_X_OC_MTIME' => 'string', 'expected result' => null ], - "castable string (int)" => [ - 'HTTP_X_OC_MTIME' => "987654321", + 'castable string (int)' => [ + 'HTTP_X_OC_MTIME' => '987654321', 'expected result' => 987654321 ], - "castable string (float)" => [ - 'HTTP_X_OC_MTIME' => "123456789.56", + 'castable string (float)' => [ + 'HTTP_X_OC_MTIME' => '123456789.56', 'expected result' => 123456789 ], - "float" => [ + 'float' => [ 'HTTP_X_OC_MTIME' => 123456789.56, 'expected result' => 123456789 ], - "zero" => [ + 'zero' => [ 'HTTP_X_OC_MTIME' => 0, 'expected result' => null ], - "zero string" => [ - 'HTTP_X_OC_MTIME' => "0", + 'zero string' => [ + 'HTTP_X_OC_MTIME' => '0', 'expected result' => null ], - "negative zero string" => [ - 'HTTP_X_OC_MTIME' => "-0", + 'negative zero string' => [ + 'HTTP_X_OC_MTIME' => '-0', 'expected result' => null ], - "string starting with number following by char" => [ - 'HTTP_X_OC_MTIME' => "2345asdf", + 'string starting with number following by char' => [ + 'HTTP_X_OC_MTIME' => '2345asdf', 'expected result' => null ], - "string castable hex int" => [ - 'HTTP_X_OC_MTIME' => "0x45adf", + 'string castable hex int' => [ + 'HTTP_X_OC_MTIME' => '0x45adf', 'expected result' => null ], - "string that looks like invalid hex int" => [ - 'HTTP_X_OC_MTIME' => "0x123g", + 'string that looks like invalid hex int' => [ + 'HTTP_X_OC_MTIME' => '0x123g', 'expected result' => null ], - "negative int" => [ + 'negative int' => [ 'HTTP_X_OC_MTIME' => -34, 'expected result' => null ], - "negative float" => [ + 'negative float' => [ 'HTTP_X_OC_MTIME' => -34.43, 'expected result' => null ], @@ -322,7 +322,7 @@ class FileTest extends TestCase { public function testPutSingleFileLegalMtime($requestMtime, $resultMtime): void { $request = new Request([ 'server' => [ - 'HTTP_X_OC_MTIME' => (string)$requestMtime, + 'HTTP_X_OC_MTIME' => (string) $requestMtime, ] ], $this->requestId, $this->config, null); $file = 'foo.txt'; @@ -905,10 +905,10 @@ class FileTest extends TestCase { $userView = Filesystem::getView(); } return [ - "filesize" => $userView->filesize($path), - "mtime" => $userView->filemtime($path), - "filetype" => $userView->filetype($path), - "mimetype" => $userView->getMimeType($path) + 'filesize' => $userView->filesize($path), + 'mtime' => $userView->filemtime($path), + 'filetype' => $userView->filetype($path), + 'mimetype' => $userView->getMimeType($path) ]; } diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php index de38f196420..fa5cf268471 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php @@ -74,8 +74,8 @@ class FilesPluginTest extends TestCase { ); $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $this->server->httpResponse = $response; $this->server->xml = new Service(); @@ -696,8 +696,8 @@ class FilesPluginTest extends TestCase { ->disableOriginalConstructor() ->getMock(); $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $request ->expects($this->once()) diff --git a/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php b/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php index 28c22202c1e..9ecc49222e9 100644 --- a/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php @@ -20,7 +20,7 @@ use Test\TestCase; class MaintenancePluginTest extends TestCase { /** @var IConfig */ private $config; - /** @var \PHPUnit\Framework\MockObject\Builder\InvocationMocker|\PHPUnit_Framework_MockObject_Builder_InvocationMocker|IL10N */ + /** @var \PHPUnit\Framework\MockObject\Builder\InvocationMocker|\PHPUnit_Framework_MockObject_Builder_InvocationMocker|IL10N */ private $l10n; /** @var MaintenancePlugin */ private $maintenancePlugin; diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php index f0996a17a33..5010f7698b5 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php @@ -73,7 +73,7 @@ class ObjectTreeTest extends \Test\TestCase { ->with($this->identicalTo($sourcePath)) ->willReturn(false); - /** @var $objectTree \OCA\DAV\Connector\Sabre\ObjectTree */ + /** @var \OCA\DAV\Connector\Sabre\ObjectTree $objectTree */ $mountManager = Filesystem::getMountManager(); $objectTree->init($rootDir, $view, $mountManager); $objectTree->copy($sourcePath, $targetPath); @@ -114,7 +114,7 @@ class ObjectTreeTest extends \Test\TestCase { $objectTree->expects($this->never()) ->method('getNodeForPath'); - /** @var $objectTree \OCA\DAV\Connector\Sabre\ObjectTree */ + /** @var \OCA\DAV\Connector\Sabre\ObjectTree $objectTree */ $mountManager = Filesystem::getMountManager(); $objectTree->init($rootDir, $view, $mountManager); $objectTree->copy($sourcePath, $targetPath); diff --git a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php index 03910f32095..3595c85eb41 100644 --- a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php @@ -1,4 +1,5 @@ createMock(User::class); $fooUser - ->expects($this->once()) - ->method('getUID') - ->willReturn('foo'); + ->expects($this->once()) + ->method('getUID') + ->willReturn('foo'); $fooUser - ->expects($this->once()) - ->method('getDisplayName') - ->willReturn('Dr. Foo-Bar'); + ->expects($this->once()) + ->method('getDisplayName') + ->willReturn('Dr. Foo-Bar'); $fooUser - ->expects($this->once()) - ->method('getSystemEMailAddress') - ->willReturn(''); + ->expects($this->once()) + ->method('getSystemEMailAddress') + ->willReturn(''); $barUser = $this->createMock(User::class); $barUser ->expects($this->once()) ->method('getUID') ->willReturn('bar'); $barUser - ->expects($this->once()) - ->method('getSystemEMailAddress') - ->willReturn('bar@nextcloud.com'); + ->expects($this->once()) + ->method('getSystemEMailAddress') + ->willReturn('bar@nextcloud.com'); $this->userManager ->expects($this->once()) ->method('search') @@ -229,13 +230,13 @@ class PrincipalTest extends TestCase { public function testGetPrincipalsByPathWithMail(): void { $fooUser = $this->createMock(User::class); $fooUser - ->expects($this->once()) - ->method('getSystemEMailAddress') - ->willReturn('foo@nextcloud.com'); + ->expects($this->once()) + ->method('getSystemEMailAddress') + ->willReturn('foo@nextcloud.com'); $fooUser - ->expects($this->once()) - ->method('getUID') - ->willReturn('foo'); + ->expects($this->once()) + ->method('getUID') + ->willReturn('foo'); $this->userManager ->expects($this->once()) ->method('get') @@ -851,13 +852,13 @@ class PrincipalTest extends TestCase { ->willReturn(true); $this->shareManager->expects($this->once()) - ->method('shareWithGroupMembersOnly') - ->willReturn(true); + ->method('shareWithGroupMembersOnly') + ->willReturn(true); $user = $this->createMock(IUser::class); $this->userSession->expects($this->once()) - ->method('getUser') - ->willReturn($user); + ->method('getUser') + ->willReturn($user); $user2 = $this->createMock(IUser::class); $user2->method('getUID')->willReturn('user2'); @@ -865,9 +866,9 @@ class PrincipalTest extends TestCase { $user3->method('getUID')->willReturn('user3'); $this->userManager->expects($this->once()) - ->method('getByEmail') - ->with($email) - ->willReturn([$email === 'user2@foo.bar' ? $user2 : $user3]); + ->method('getByEmail') + ->with($email) + ->willReturn([$email === 'user2@foo.bar' ? $user2 : $user3]); if ($email === 'user2@foo.bar') { $this->groupManager->expects($this->exactly(2)) @@ -912,8 +913,8 @@ class PrincipalTest extends TestCase { ->willReturn(true); $this->shareManager->expects($this->once()) - ->method('shareWithGroupMembersOnly') - ->willReturn(false); + ->method('shareWithGroupMembersOnly') + ->willReturn(false); $user2 = $this->createMock(IUser::class); $user2->method('getUID')->willReturn('user2'); @@ -921,9 +922,9 @@ class PrincipalTest extends TestCase { $user3->method('getUID')->willReturn('user3'); $this->userManager->expects($this->once()) - ->method('getByEmail') - ->with($email) - ->willReturn([$email === 'user2@foo.bar' ? $user2 : $user3]); + ->method('getByEmail') + ->with($email) + ->willReturn([$email === 'user2@foo.bar' ? $user2 : $user3]); $this->assertEquals($expects, $this->connector->findByUri($uri, 'principals/users')); } diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php index bed5eb192d9..cf1ea4c6bae 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php @@ -72,7 +72,7 @@ class Auth implements BackendInterface { \OC::$server->getUserFolder($user); return [true, "principals/$user"]; } - return [false, "login failed"]; + return [false, 'login failed']; } /** diff --git a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php index c7c2bf0e431..282a88d250c 100644 --- a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php +++ b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php @@ -1,4 +1,5 @@ expects($this->once()) ->method('eq') ->with('token', 'namedParameterToken') - ->willReturn((string)$function); + ->willReturn((string) $function); $this->dbConnection->expects($this->once()) ->method('getQueryBuilder') diff --git a/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php b/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php index ea5450391e8..2ea5e9c8b9f 100644 --- a/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php +++ b/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php @@ -1,4 +1,5 @@ fetch()) { $value = $row['propertyvalue']; - if ((int)$row['valuetype'] === CustomPropertiesBackend::PROPERTY_TYPE_HREF) { + if ((int) $row['valuetype'] === CustomPropertiesBackend::PROPERTY_TYPE_HREF) { $value = new Href($value); } $data[$row['propertyname']] = $value; @@ -396,7 +396,7 @@ class CustomPropertiesBackendTest extends TestCase { $this->defaultCalendarValidator->expects(self::once()) ->method('validateScheduleDefaultCalendar') ->with($node) - ->willThrowException(new \Sabre\DAV\Exception("Invalid calendar")); + ->willThrowException(new \Sabre\DAV\Exception('Invalid calendar')); $this->server->method('calculateUri') ->willReturnCallback(function ($uri) { diff --git a/apps/dav/tests/unit/DAV/GroupPrincipalTest.php b/apps/dav/tests/unit/DAV/GroupPrincipalTest.php index 92c89fc62f8..284d11fa9f1 100644 --- a/apps/dav/tests/unit/DAV/GroupPrincipalTest.php +++ b/apps/dav/tests/unit/DAV/GroupPrincipalTest.php @@ -1,4 +1,5 @@ shareCache->expects(self::once()) ->method('get') - ->with((string)$resourceId) + ->with((string) $resourceId) ->willReturn(null); $this->calendarService->expects(self::once()) ->method('getShares') @@ -315,7 +315,7 @@ class BackendTest extends TestCase { ->willReturn(['uri' => $principal, '{DAV:}displayname' => 'bob']); $this->shareCache->expects(self::once()) ->method('set') - ->with((string)$resourceId, $expected); + ->with((string) $resourceId, $expected); $result = $this->backend->getShares($resourceId); $this->assertEquals($expected, $result); @@ -351,7 +351,7 @@ class BackendTest extends TestCase { $this->shareCache->expects(self::once()) ->method('get') - ->with((string)$resourceId) + ->with((string) $resourceId) ->willReturn(null); $service->expects(self::once()) ->method('getShares') @@ -363,7 +363,7 @@ class BackendTest extends TestCase { ->willReturn(['uri' => $principal, '{DAV:}displayname' => 'bob']); $this->shareCache->expects(self::once()) ->method('set') - ->with((string)$resourceId, $expected); + ->with((string) $resourceId, $expected); $result = $backend->getShares($resourceId); $this->assertEquals($expected, $result); diff --git a/apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php b/apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php index eb15bfe0b5a..7a4828dd2de 100644 --- a/apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php +++ b/apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php @@ -132,9 +132,9 @@ class ViewOnlyPluginTest extends TestCase { $this->request->expects($this->once())->method('getPath')->willReturn($davPath); $this->tree->expects($this->once()) - ->method('getNodeForPath') - ->with($davPath) - ->willReturn($davNode); + ->method('getNodeForPath') + ->with($davPath) + ->willReturn($davNode); $storage = $this->createMock(SharedStorage::class); $share = $this->createMock(IShare::class); @@ -147,9 +147,9 @@ class ViewOnlyPluginTest extends TestCase { $extAttr = $this->createMock(IAttributes::class); $share->method('getAttributes')->willReturn($extAttr); $extAttr->expects($this->once()) - ->method('getAttribute') - ->with('permissions', 'download') - ->willReturn($attrEnabled); + ->method('getAttribute') + ->with('permissions', 'download') + ->willReturn($attrEnabled); if (!$expectCanDownloadFile) { $this->expectException(Forbidden::class); diff --git a/apps/dav/tests/unit/Files/FileSearchBackendTest.php b/apps/dav/tests/unit/Files/FileSearchBackendTest.php index f6fe8b1c116..1ac605eeaef 100644 --- a/apps/dav/tests/unit/Files/FileSearchBackendTest.php +++ b/apps/dav/tests/unit/Files/FileSearchBackendTest.php @@ -1,4 +1,5 @@ [ - "Content-Length" => 7, - "X-File-MD5" => "4f2377b4d911f7ec46325fe603c3af03", - "X-File-Path" => "/coucou.txt" + 'headers' => [ + 'Content-Length' => 7, + 'X-File-MD5' => '4f2377b4d911f7ec46325fe603c3af03', + 'X-File-Path' => '/coucou.txt' ], - "content" => "Coucou\n" + 'content' => "Coucou\n" ] ]; } - private function getMultipartParser(array $parts, array $headers = [], string $boundary = "boundary_azertyuiop"): MultipartRequestParser { + private function getMultipartParser(array $parts, array $headers = [], string $boundary = 'boundary_azertyuiop'): MultipartRequestParser { $request = $this->getMockBuilder('Sabre\HTTP\RequestInterface') ->disableOriginalConstructor() ->getMock(); @@ -43,19 +44,19 @@ class MultipartRequestParserTest extends TestCase { return $headers[$key]; }); - $body = ""; + $body = ''; foreach ($parts as $part) { $body .= '--'.$boundary."\r\n"; foreach ($part['headers'] as $headerKey => $headerPart) { - $body .= $headerKey.": ".$headerPart."\r\n"; + $body .= $headerKey.': '.$headerPart."\r\n"; } $body .= "\r\n"; $body .= $part['content']."\r\n"; } - $body .= '--'.$boundary."--"; + $body .= '--'.$boundary.'--'; $stream = fopen('php://temp', 'r+'); fwrite($stream, $body); @@ -73,7 +74,7 @@ class MultipartRequestParserTest extends TestCase { * Test validation of the request's body type */ public function testBodyTypeValidation(): void { - $bodyStream = "I am not a stream, but pretend to be"; + $bodyStream = 'I am not a stream, but pretend to be'; $request = $this->getMockBuilder('Sabre\HTTP\RequestInterface') ->disableOriginalConstructor() ->getMock(); @@ -100,11 +101,11 @@ class MultipartRequestParserTest extends TestCase { [$headers, $content] = $multipartParser->parseNextPart(); - $this->assertSame((int)$headers["content-length"], 7, "Content-Length header should be the same as provided."); - $this->assertSame($headers["x-file-md5"], "4f2377b4d911f7ec46325fe603c3af03", "X-File-MD5 header should be the same as provided."); - $this->assertSame($headers["x-file-path"], "/coucou.txt", "X-File-Path header should be the same as provided."); + $this->assertSame((int) $headers['content-length'], 7, 'Content-Length header should be the same as provided.'); + $this->assertSame($headers['x-file-md5'], '4f2377b4d911f7ec46325fe603c3af03', 'X-File-MD5 header should be the same as provided.'); + $this->assertSame($headers['x-file-path'], '/coucou.txt', 'X-File-Path header should be the same as provided.'); - $this->assertSame($content, "Coucou\n", "Content should be the same"); + $this->assertSame($content, "Coucou\n", 'Content should be the same'); } /** @@ -112,7 +113,7 @@ class MultipartRequestParserTest extends TestCase { */ public function testInvalidMd5Hash(): void { $bodyObject = $this->getValidBodyObject(); - $bodyObject["0"]["headers"]["X-File-MD5"] = "f2377b4d911f7ec46325fe603c3af03"; + $bodyObject['0']['headers']['X-File-MD5'] = 'f2377b4d911f7ec46325fe603c3af03'; $multipartParser = $this->getMultipartParser( $bodyObject ); @@ -126,7 +127,7 @@ class MultipartRequestParserTest extends TestCase { */ public function testNullMd5Hash(): void { $bodyObject = $this->getValidBodyObject(); - unset($bodyObject["0"]["headers"]["X-File-MD5"]); + unset($bodyObject['0']['headers']['X-File-MD5']); $multipartParser = $this->getMultipartParser( $bodyObject ); @@ -140,7 +141,7 @@ class MultipartRequestParserTest extends TestCase { */ public function testNullContentLength(): void { $bodyObject = $this->getValidBodyObject(); - unset($bodyObject["0"]["headers"]["Content-Length"]); + unset($bodyObject['0']['headers']['Content-Length']); $multipartParser = $this->getMultipartParser( $bodyObject ); @@ -154,7 +155,7 @@ class MultipartRequestParserTest extends TestCase { */ public function testLowerContentLength(): void { $bodyObject = $this->getValidBodyObject(); - $bodyObject["0"]["headers"]["Content-Length"] = 6; + $bodyObject['0']['headers']['Content-Length'] = 6; $multipartParser = $this->getMultipartParser( $bodyObject ); @@ -168,7 +169,7 @@ class MultipartRequestParserTest extends TestCase { */ public function testHigherContentLength(): void { $bodyObject = $this->getValidBodyObject(); - $bodyObject["0"]["headers"]["Content-Length"] = 8; + $bodyObject['0']['headers']['Content-Length'] = 8; $multipartParser = $this->getMultipartParser( $bodyObject ); diff --git a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php index 7264119f8c6..b5994f985ab 100644 --- a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php +++ b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php @@ -1,4 +1,5 @@ config->method('getAppValue') - ->withConsecutive( - ['dav', 'sendInvitations', 'yes'], - ['dav', 'generateBirthdayCalendar', 'yes'], - ['dav', 'sendEventReminders', 'yes'], - ['dav', 'sendEventRemindersToSharedUsers', 'yes'], - ['dav', 'sendEventRemindersPush', 'yes'], - ) - ->will($this->onConsecutiveCalls('yes', 'no', 'yes', 'yes', 'yes')); + ->withConsecutive( + ['dav', 'sendInvitations', 'yes'], + ['dav', 'generateBirthdayCalendar', 'yes'], + ['dav', 'sendEventReminders', 'yes'], + ['dav', 'sendEventRemindersToSharedUsers', 'yes'], + ['dav', 'sendEventRemindersPush', 'yes'], + ) + ->will($this->onConsecutiveCalls('yes', 'no', 'yes', 'yes', 'yes')); $this->urlGenerator ->expects($this->once()) ->method('linkToDocs') diff --git a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php index 51711fc1666..67e7afa9c54 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php @@ -543,11 +543,11 @@ class SystemTagPluginTest extends \Test\TestCase { ->willReturn($node); $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $request->expects($this->once()) ->method('getPath') @@ -617,11 +617,11 @@ class SystemTagPluginTest extends \Test\TestCase { ->with(1); $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $request->expects($this->once()) ->method('getPath') @@ -666,11 +666,11 @@ class SystemTagPluginTest extends \Test\TestCase { ->method('createFile'); $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $request->expects($this->once()) ->method('getPath') @@ -714,11 +714,11 @@ class SystemTagPluginTest extends \Test\TestCase { ->willReturn($node); $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + ->disableOriginalConstructor() + ->getMock(); $request->expects($this->once()) ->method('getPath') diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php index b202f340e32..a2a877073f7 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php @@ -70,7 +70,7 @@ class SystemTagsObjectTypeCollectionTest extends \Test\TestCase { return $node !== null; }; $writeAccessClosure = function ($name) use ($userFolder) { - $nodes = $userFolder->getById((int)$name); + $nodes = $userFolder->getById((int) $name); foreach ($nodes as $node) { if (($node->getPermissions() & Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE) { return true; diff --git a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php index 6d821976f4e..217713eca33 100644 --- a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php +++ b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php @@ -55,11 +55,11 @@ class AssemblyStreamTest extends \Test\TestCase { $dataLess8k = $this->makeData(8191); $tonofnodes = []; - $tonofdata = ""; + $tonofdata = ''; for ($i = 0; $i < 101; $i++) { $thisdata = random_int(0, 100); // variable length and content $tonofdata .= $thisdata; - $tonofnodes[] = $this->buildNode((string)$i, (string)$thisdata); + $tonofnodes[] = $this->buildNode((string) $i, (string) $thisdata); } return[ diff --git a/apps/encryption/lib/Command/DisableMasterKey.php b/apps/encryption/lib/Command/DisableMasterKey.php index 7993ba38078..4af4301db01 100644 --- a/apps/encryption/lib/Command/DisableMasterKey.php +++ b/apps/encryption/lib/Command/DisableMasterKey.php @@ -1,4 +1,5 @@ writeln("Specifying a user id and --all are mutually exclusive"); + $output->writeln('Specifying a user id and --all are mutually exclusive'); return 1; } @@ -96,20 +96,20 @@ class FixEncryptedVersion extends Command { } elseif ($all) { $result = 0; $this->userManager->callForSeenUsers(function (IUser $user) use ($pathOption, $output, &$result) { - $output->writeln("Processing files for " . $user->getUID()); + $output->writeln('Processing files for ' . $user->getUID()); $result = $this->runForUser($user->getUID(), $pathOption, $output); return $result === 0; }); return $result; } else { - $output->writeln("Either a user id or --all needs to be provided"); + $output->writeln('Either a user id or --all needs to be provided'); return 1; } } private function runForUser(string $user, string $pathOption, OutputInterface $output): int { $pathToWalk = "/$user/files"; - if ($pathOption !== "") { + if ($pathOption !== '') { $pathToWalk = "$pathToWalk/$pathOption"; } return $this->walkPathOfUser($user, $pathToWalk, $output); @@ -205,7 +205,7 @@ class FixEncryptedVersion extends Command { } return false; } catch (HintException $e) { - $this->logger->warning("Issue: " . $e->getMessage()); + $this->logger->warning('Issue: ' . $e->getMessage()); // If allowOnce is set to false, this becomes recursive. if ($ignoreCorrectEncVersionCall === true) { // Lets rectify the file by correcting encrypted version @@ -254,7 +254,7 @@ class FixEncryptedVersion extends Command { // try with zero first $cacheInfo = ['encryptedVersion' => 0, 'encrypted' => 0]; $cache->put($fileCache->getPath(), $cacheInfo); - $output->writeln("Set the encrypted version to 0 (unencrypted)"); + $output->writeln('Set the encrypted version to 0 (unencrypted)'); if ($this->verifyFileContent($path, $output, false) === true) { $output->writeln("Fixed the file: \"$path\" with version 0 (unencrypted)"); return true; @@ -268,7 +268,7 @@ class FixEncryptedVersion extends Command { $cache->put($fileCache->getPath(), $cacheInfo); $output->writeln("Decrement the encrypted version to $encryptedVersion"); if ($this->verifyFileContent($path, $output, false) === true) { - $output->writeln("Fixed the file: \"$path\" with version " . $encryptedVersion . ""); + $output->writeln("Fixed the file: \"$path\" with version " . $encryptedVersion . ''); return true; } $encryptedVersion--; @@ -291,7 +291,7 @@ class FixEncryptedVersion extends Command { $cache->put($fileCache->getPath(), $cacheInfo); $output->writeln("Increment the encrypted version to $newEncryptedVersion"); if ($this->verifyFileContent($path, $output, false) === true) { - $output->writeln("Fixed the file: \"$path\" with version " . $newEncryptedVersion . ""); + $output->writeln("Fixed the file: \"$path\" with version " . $newEncryptedVersion . ''); return true; } $increment++; diff --git a/apps/encryption/lib/Command/FixKeyLocation.php b/apps/encryption/lib/Command/FixKeyLocation.php index cb3408f77f1..4e6742b91a9 100644 --- a/apps/encryption/lib/Command/FixKeyLocation.php +++ b/apps/encryption/lib/Command/FixKeyLocation.php @@ -50,7 +50,7 @@ class FixKeyLocation extends Command { $this->keyRootDirectory = rtrim($this->encryptionUtil->getKeyStorageRoot(), '/'); $this->rootView = new View(); if (!$encryptionManager instanceof Manager) { - throw new \Exception("Wrong encryption manager"); + throw new \Exception('Wrong encryption manager'); } $this->encryptionManager = $encryptionManager; @@ -65,7 +65,7 @@ class FixKeyLocation extends Command { ->setName('encryption:fix-key-location') ->setDescription('Fix the location of encryption keys for external storage') ->addOption('dry-run', null, InputOption::VALUE_NONE, "Only list files that require key migration, don't try to perform any migration") - ->addArgument('user', InputArgument::REQUIRED, "User id to fix the key locations for"); + ->addArgument('user', InputArgument::REQUIRED, 'User id to fix the key locations for'); } protected function execute(InputInterface $input, OutputInterface $output): int { @@ -83,7 +83,7 @@ class FixKeyLocation extends Command { foreach ($mounts as $mount) { $mountRootFolder = $this->rootFolder->get($mount->getMountPoint()); if (!$mountRootFolder instanceof Folder) { - $output->writeln("System wide mount point is not a directory, skipping: " . $mount->getMountPoint() . ""); + $output->writeln('System wide mount point is not a directory, skipping: ' . $mount->getMountPoint() . ''); continue; } @@ -97,14 +97,14 @@ class FixKeyLocation extends Command { // key was stored incorrectly as user key, migrate if ($dryRun) { - $output->writeln("" . $file->getPath() . " needs migration"); + $output->writeln('' . $file->getPath() . ' needs migration'); } else { - $output->write("Migrating key for " . $file->getPath() . " "); + $output->write('Migrating key for ' . $file->getPath() . ' '); if ($this->copyUserKeyToSystemAndValidate($user, $file)) { - $output->writeln(""); + $output->writeln(''); } else { - $output->writeln("❌"); - $output->writeln(" Failed to validate key for " . $file->getPath() . ", key will not be migrated"); + $output->writeln('❌'); + $output->writeln(' Failed to validate key for ' . $file->getPath() . ', key will not be migrated'); } } } else { @@ -115,42 +115,42 @@ class FixKeyLocation extends Command { if ($isActuallyEncrypted) { if ($dryRun) { if ($shouldBeEncrypted) { - $output->write("" . $file->getPath() . " needs migration"); + $output->write('' . $file->getPath() . ' needs migration'); } else { - $output->write("" . $file->getPath() . " needs decryption"); + $output->write('' . $file->getPath() . ' needs decryption'); } $foundKey = $this->findUserKeyForSystemFile($user, $file); if ($foundKey) { - $output->writeln(", valid key found at " . $foundKey . ""); + $output->writeln(', valid key found at ' . $foundKey . ''); } else { - $output->writeln(" ❌ No key found"); + $output->writeln(' ❌ No key found'); } } else { if ($shouldBeEncrypted) { - $output->write("Migrating key for " . $file->getPath() . ""); + $output->write('Migrating key for ' . $file->getPath() . ''); } else { - $output->write("Decrypting " . $file->getPath() . ""); + $output->write('Decrypting ' . $file->getPath() . ''); } $foundKey = $this->findUserKeyForSystemFile($user, $file); if ($foundKey) { if ($shouldBeEncrypted) { $systemKeyPath = $this->getSystemKeyPath($file); $this->rootView->copy($foundKey, $systemKeyPath); - $output->writeln(" Migrated key from " . $foundKey . ""); + $output->writeln(' Migrated key from ' . $foundKey . ''); } else { $this->decryptWithSystemKey($file, $foundKey); - $output->writeln(" Decrypted with key from " . $foundKey . ""); + $output->writeln(' Decrypted with key from ' . $foundKey . ''); } } else { - $output->writeln(" ❌ No key found"); + $output->writeln(' ❌ No key found'); } } } else { if ($dryRun) { - $output->writeln("" . $file->getPath() . " needs to be marked as not encrypted"); + $output->writeln('' . $file->getPath() . ' needs to be marked as not encrypted'); } else { $this->markAsUnEncrypted($file); - $output->writeln("" . $file->getPath() . " marked as not encrypted"); + $output->writeln('' . $file->getPath() . ' marked as not encrypted'); } } } @@ -288,7 +288,7 @@ class FixKeyLocation extends Command { } /** @var resource|false $handle */ if ($handle === false) { - throw new \Exception("Failed to open " . $node->getPath()); + throw new \Exception('Failed to open ' . $node->getPath()); } return $handle; } @@ -339,7 +339,7 @@ class FixKeyLocation extends Command { /** @var false|resource $dh */ $dh = $this->rootView->opendir($basePath); if (!$dh) { - throw new \Exception("Invalid base path " . $basePath); + throw new \Exception('Invalid base path ' . $basePath); } while ($child = readdir($dh)) { if ($child != '..' && $child != '.') { @@ -398,7 +398,7 @@ class FixKeyLocation extends Command { /** @var false|resource $source */ $source = $storage->fopen($node->getInternalPath(), 'r'); if (!$source) { - throw new \Exception("Failed to open " . $node->getPath() . " with " . $key); + throw new \Exception('Failed to open ' . $node->getPath() . ' with ' . $key); } $decryptedNode = $node->getParent()->newFile($name); @@ -418,7 +418,7 @@ class FixKeyLocation extends Command { } if ($this->isDataEncrypted($decryptedNode)) { - throw new \Exception($node->getPath() . " still encrypted after attempting to decrypt with " . $key); + throw new \Exception($node->getPath() . ' still encrypted after attempting to decrypt with ' . $key); } $this->markAsUnEncrypted($decryptedNode); diff --git a/apps/encryption/lib/Command/RecoverUser.php b/apps/encryption/lib/Command/RecoverUser.php index fcdc3f15fb5..cb331b8d7dc 100644 --- a/apps/encryption/lib/Command/RecoverUser.php +++ b/apps/encryption/lib/Command/RecoverUser.php @@ -1,4 +1,5 @@ l->t('Bad Signature')); } else { - $this->logger->info("Signature check skipped", ['app' => 'encryption']); + $this->logger->info('Signature check skipped', ['app' => 'encryption']); } } } @@ -751,7 +751,7 @@ class Crypt { $result = false; // check if RC4 is used - if (strcasecmp($cipher_algo, "rc4") === 0) { + if (strcasecmp($cipher_algo, 'rc4') === 0) { // decrypt the intermediate key with RSA if (openssl_private_decrypt($encrypted_key, $intermediate, $private_key, OPENSSL_PKCS1_PADDING)) { // decrypt the file key with the intermediate key @@ -776,7 +776,7 @@ class Crypt { $result = false; // check if RC4 is used - if (strcasecmp($cipher_algo, "rc4") === 0) { + if (strcasecmp($cipher_algo, 'rc4') === 0) { // make sure that there is at least one public key to use if (count($public_key) >= 1) { // generate the intermediate key diff --git a/apps/encryption/lib/Crypto/DecryptAll.php b/apps/encryption/lib/Crypto/DecryptAll.php index e1eb1ba6a2a..80c187571b7 100644 --- a/apps/encryption/lib/Crypto/DecryptAll.php +++ b/apps/encryption/lib/Crypto/DecryptAll.php @@ -18,19 +18,19 @@ use Symfony\Component\Console\Question\Question; class DecryptAll { - /** @var Util */ + /** @var Util */ protected $util; - /** @var QuestionHelper */ + /** @var QuestionHelper */ protected $questionHelper; - /** @var Crypt */ + /** @var Crypt */ protected $crypt; - /** @var KeyManager */ + /** @var KeyManager */ protected $keyManager; - /** @var Session */ + /** @var Session */ protected $session; /** diff --git a/apps/encryption/lib/Crypto/EncryptAll.php b/apps/encryption/lib/Crypto/EncryptAll.php index 09b418836d9..310f37aba83 100644 --- a/apps/encryption/lib/Crypto/EncryptAll.php +++ b/apps/encryption/lib/Crypto/EncryptAll.php @@ -44,28 +44,28 @@ class EncryptAll { /** @var Util */ protected $util; - /** @var array */ + /** @var array */ protected $userPasswords; - /** @var IConfig */ + /** @var IConfig */ protected $config; /** @var IMailer */ protected $mailer; - /** @var IL10N */ + /** @var IL10N */ protected $l; - /** @var IFactory */ + /** @var IFactory */ protected $l10nFactory; - /** @var QuestionHelper */ + /** @var QuestionHelper */ protected $questionHelper; - /** @var OutputInterface */ + /** @var OutputInterface */ protected $output; - /** @var InputInterface */ + /** @var InputInterface */ protected $input; /** @var ISecureRandom */ @@ -203,7 +203,7 @@ class EncryptAll { $userNo++; } } - $progress->setMessage("all files encrypted"); + $progress->setMessage('all files encrypted'); $progress->finish(); } diff --git a/apps/encryption/lib/Crypto/Encryption.php b/apps/encryption/lib/Crypto/Encryption.php index dda93e13306..04fee2fd92a 100644 --- a/apps/encryption/lib/Crypto/Encryption.php +++ b/apps/encryption/lib/Crypto/Encryption.php @@ -99,8 +99,8 @@ class Encryption implements IEncryptionModule { * @param array $accessList who has access to the file contains the key 'users' and 'public' * * @return array $header contain data as key-value pairs which should be - * written to the header, in case of a write operation - * or if no additional data is needed return a empty array + * written to the header, in case of a write operation + * or if no additional data is needed return a empty array */ public function begin($path, $user, $mode, array $header, array $accessList) { $this->path = $this->getPathToRealFile($path); @@ -131,7 +131,7 @@ class Encryption implements IEncryptionModule { // always use the version from the original file, also part files // need to have a correct version number if they get moved over to the // final location - $this->version = (int)$this->keyManager->getVersion($this->stripPartFileExtension($path), new View()); + $this->version = (int) $this->keyManager->getVersion($this->stripPartFileExtension($path), new View()); if ( $mode === 'w' @@ -285,7 +285,7 @@ class Encryption implements IEncryptionModule { // Read the chunk from the start of $data $chunk = substr($data, 0, $this->getUnencryptedBlockSize(true)); - $encrypted .= $this->crypt->symmetricEncryptFileContent($chunk, $this->fileKey, $this->version + 1, (string)$position); + $encrypted .= $this->crypt->symmetricEncryptFileContent($chunk, $this->fileKey, $this->version + 1, (string) $position); // Remove the chunk we just processed from // $data, leaving only unprocessed data in $data diff --git a/apps/encryption/lib/Exceptions/PrivateKeyMissingException.php b/apps/encryption/lib/Exceptions/PrivateKeyMissingException.php index 9e3dea67f3e..15fe8f4e72f 100644 --- a/apps/encryption/lib/Exceptions/PrivateKeyMissingException.php +++ b/apps/encryption/lib/Exceptions/PrivateKeyMissingException.php @@ -16,7 +16,7 @@ class PrivateKeyMissingException extends GenericEncryptionException { */ public function __construct($userId) { if (empty($userId)) { - $userId = ""; + $userId = ''; } parent::__construct("Private Key missing for user: $userId"); } diff --git a/apps/encryption/lib/Exceptions/PublicKeyMissingException.php b/apps/encryption/lib/Exceptions/PublicKeyMissingException.php index 3173f0fb44a..78eeeccf47d 100644 --- a/apps/encryption/lib/Exceptions/PublicKeyMissingException.php +++ b/apps/encryption/lib/Exceptions/PublicKeyMissingException.php @@ -16,7 +16,7 @@ class PublicKeyMissingException extends GenericEncryptionException { */ public function __construct($userId) { if (empty($userId)) { - $userId = ""; + $userId = ''; } parent::__construct("Public Key missing for user: $userId"); } diff --git a/apps/encryption/lib/HookManager.php b/apps/encryption/lib/HookManager.php index 71fa4f0a08e..6ad56ebad78 100644 --- a/apps/encryption/lib/HookManager.php +++ b/apps/encryption/lib/HookManager.php @@ -15,7 +15,7 @@ class HookManager { /** * @param array|IHook $instances - * - This accepts either a single instance of IHook or an array of instances of IHook + * - This accepts either a single instance of IHook or an array of instances of IHook * @return bool */ public function registerHook($instances) { diff --git a/apps/encryption/lib/KeyManager.php b/apps/encryption/lib/KeyManager.php index 9fd6c7655af..7b55a04f069 100644 --- a/apps/encryption/lib/KeyManager.php +++ b/apps/encryption/lib/KeyManager.php @@ -42,7 +42,7 @@ class KeyManager { $this->recoveryKeyId = $this->config->getAppValue('encryption', 'recoveryKeyId'); if (empty($this->recoveryKeyId)) { - $this->recoveryKeyId = 'recoveryKey_' . substr(md5((string)time()), 0, 8); + $this->recoveryKeyId = 'recoveryKey_' . substr(md5((string) time()), 0, 8); $this->config->setAppValue('encryption', 'recoveryKeyId', $this->recoveryKeyId); @@ -51,14 +51,14 @@ class KeyManager { $this->publicShareKeyId = $this->config->getAppValue('encryption', 'publicShareKeyId'); if (empty($this->publicShareKeyId)) { - $this->publicShareKeyId = 'pubShare_' . substr(md5((string)time()), 0, 8); + $this->publicShareKeyId = 'pubShare_' . substr(md5((string) time()), 0, 8); $this->config->setAppValue('encryption', 'publicShareKeyId', $this->publicShareKeyId); } $this->masterKeyId = $this->config->getAppValue('encryption', 'masterKeyId'); if (empty($this->masterKeyId)) { - $this->masterKeyId = 'master_' . substr(md5((string)time()), 0, 8); + $this->masterKeyId = 'master_' . substr(md5((string) time()), 0, 8); $this->config->setAppValue('encryption', 'masterKeyId', $this->masterKeyId); } diff --git a/apps/encryption/lib/Migration/SetMasterKeyStatus.php b/apps/encryption/lib/Migration/SetMasterKeyStatus.php index 598f2dd516a..91c8e8acac6 100644 --- a/apps/encryption/lib/Migration/SetMasterKeyStatus.php +++ b/apps/encryption/lib/Migration/SetMasterKeyStatus.php @@ -1,4 +1,5 @@
-

t("Default encryption module")); ?>

- - t("Encryption app is enabled but your keys are not initialized, please log-out and log-in again")); ?> +

t('Default encryption module')); ?>

+ + t('Encryption app is enabled but your keys are not initialized, please log-out and log-in again')); ?>

/>
- t("Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted")); ?> + t('Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted')); ?>


- t("Enable recovery key")) : p($l->t("Disable recovery key")); ?> + t('Enable recovery key')) : p($l->t('Disable recovery key')); ?>
- t("The recovery key is an additional encryption key used to encrypt files. It is used to recover files from an account if the password is forgotten.")) ?> + t('The recovery key is an additional encryption key used to encrypt files. It is used to recover files from an account if the password is forgotten.')) ?>
"/> + placeholder="t('Recovery key password')); ?>"/> "/> + placeholder="t('Repeat recovery key password')); ?>"/> " - value="t("Enable recovery key")) : p($l->t("Disable recovery key")); ?>"/> + status="" + value="t('Enable recovery key')) : p($l->t('Disable recovery key')); ?>"/>



> - t("Change recovery key password:")); ?> + t('Change recovery key password:')); ?>
"/> + placeholder="t('Old recovery key password')); ?>"/>
"/> + placeholder="t('New recovery key password')); ?>"/> "/> + placeholder="t('Repeat new recovery key password')); ?>"/>

diff --git a/apps/encryption/templates/settings-personal.php b/apps/encryption/templates/settings-personal.php index a875c3c6ed6..18b5ef341b9 100644 --- a/apps/encryption/templates/settings-personal.php +++ b/apps/encryption/templates/settings-personal.php @@ -12,19 +12,19 @@ script('encryption', 'settings-personal');

t('Basic encryption module')); ?>

- + - t("Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again.")); ?> + t('Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again.')); ?> - +


- t("Set your old private key password to your current log-in password:")); ?> - t('Set your old private key password to your current log-in password:')); ?> + t('If you do not remember your old password you can ask your administrator to recover your files.')); endif; ?>
@@ -32,29 +32,29 @@ script('encryption', 'settings-personal'); type="password" name="changePrivateKeyPassword" id="oldPrivateKeyPassword" /> - +
- +

- +

- +
- t("Enabling this option will allow you to reobtain access to your encrypted files in case of password loss")); ?> + t('Enabling this option will allow you to reobtain access to your encrypted files in case of password loss')); ?>
/> - + /> +
/> - + /> +

diff --git a/apps/encryption/tests/Command/FixEncryptedVersionTest.php b/apps/encryption/tests/Command/FixEncryptedVersionTest.php index 9ea981e355d..c021c366ad8 100644 --- a/apps/encryption/tests/Command/FixEncryptedVersionTest.php +++ b/apps/encryption/tests/Command/FixEncryptedVersionTest.php @@ -79,7 +79,7 @@ class FixEncryptedVersionTest extends TestCase { $this->util->expects($this->once())->method('isMasterKeyEnabled') ->willReturn(true); - $view = new View("/" . $this->userId . "/files"); + $view = new View('/' . $this->userId . '/files'); $view->touch('hello.txt'); $view->touch('world.txt'); @@ -147,7 +147,7 @@ Fixed the file: \"/$this->userId/files/world.txt\" with version 4", $output); $this->util->expects($this->once())->method('isMasterKeyEnabled') ->willReturn(true); - $view = new View("/" . $this->userId . "/files"); + $view = new View('/' . $this->userId . '/files'); $view->touch('hello.txt'); $view->touch('world.txt'); @@ -206,7 +206,7 @@ Fixed the file: \"/$this->userId/files/world.txt\" with version 4", $output); $this->util->expects($this->once())->method('isMasterKeyEnabled') ->willReturn(true); - $view = new View("/" . $this->userId . "/files"); + $view = new View('/' . $this->userId . '/files'); $view->touch('bar.txt'); for ($i = 0; $i < 40; $i++) { @@ -227,7 +227,7 @@ Fixed the file: \"/$this->userId/files/world.txt\" with version 4", $output); ]); $cacheInfo = $cache->get($fileInfo->getId()); - $encryptedVersion = $cacheInfo["encryptedVersion"]; + $encryptedVersion = $cacheInfo['encryptedVersion']; $this->assertEquals(15, $encryptedVersion); } @@ -236,7 +236,7 @@ Fixed the file: \"/$this->userId/files/world.txt\" with version 4", $output); $this->util->expects($this->once())->method('isMasterKeyEnabled') ->willReturn(true); - $view = new View("/" . $this->userId . "/files"); + $view = new View('/' . $this->userId . '/files'); // create a file, it's encrypted and also the version is set in the database $view->touch('hello.txt'); @@ -279,14 +279,14 @@ Fixed the file: \"/$this->userId/files/hello.txt\" with version 0 (unencrypted)" $this->util->expects($this->once())->method('isMasterKeyEnabled') ->willReturn(true); - $view = new View("/" . $this->userId . "/files"); + $view = new View('/' . $this->userId . '/files'); $view->touch('hello.txt'); $view->touch('world.txt'); $this->commandTester->execute([ 'user' => $this->userId, - '--path' => "/hello.txt" + '--path' => '/hello.txt' ]); $output = $this->commandTester->getDisplay(); @@ -303,7 +303,7 @@ The file \"/$this->userId/files/hello.txt\" is: OK", $output); $this->util->expects($this->once())->method('isMasterKeyEnabled') ->willReturn(true); - $view = new View("/" . $this->userId . "/files"); + $view = new View('/' . $this->userId . '/files'); $view->mkdir('sub'); $view->touch('sub/hello.txt'); @@ -311,7 +311,7 @@ The file \"/$this->userId/files/hello.txt\" is: OK", $output); $this->commandTester->execute([ 'user' => $this->userId, - '--path' => "/sub" + '--path' => '/sub' ]); $output = $this->commandTester->getDisplay(); @@ -327,7 +327,7 @@ The file \"/$this->userId/files/sub/hello.txt\" is: OK", $output); $this->commandTester->execute([ 'user' => null, - '--path' => "/" + '--path' => '/' ]); $output = $this->commandTester->getDisplay(); @@ -341,7 +341,7 @@ The file \"/$this->userId/files/sub/hello.txt\" is: OK", $output); $this->commandTester->execute([ 'user' => 'nonexisting', - '--path' => "/" + '--path' => '/' ]); $output = $this->commandTester->getDisplay(); diff --git a/apps/encryption/tests/Command/TestEnableMasterKey.php b/apps/encryption/tests/Command/TestEnableMasterKey.php index 8e7dabf8bb6..47bc978627d 100644 --- a/apps/encryption/tests/Command/TestEnableMasterKey.php +++ b/apps/encryption/tests/Command/TestEnableMasterKey.php @@ -17,22 +17,22 @@ use Test\TestCase; class TestEnableMasterKey extends TestCase { - /** @var EnableMasterKey */ + /** @var EnableMasterKey */ protected $enableMasterKey; - /** @var Util | \PHPUnit\Framework\MockObject\MockObject */ + /** @var Util | \PHPUnit\Framework\MockObject\MockObject */ protected $util; - /** @var \OCP\IConfig | \PHPUnit\Framework\MockObject\MockObject */ + /** @var \OCP\IConfig | \PHPUnit\Framework\MockObject\MockObject */ protected $config; /** @var \Symfony\Component\Console\Helper\QuestionHelper | \PHPUnit\Framework\MockObject\MockObject */ protected $questionHelper; - /** @var \Symfony\Component\Console\Output\OutputInterface | \PHPUnit\Framework\MockObject\MockObject */ + /** @var \Symfony\Component\Console\Output\OutputInterface | \PHPUnit\Framework\MockObject\MockObject */ protected $output; - /** @var \Symfony\Component\Console\Input\InputInterface | \PHPUnit\Framework\MockObject\MockObject */ + /** @var \Symfony\Component\Console\Input\InputInterface | \PHPUnit\Framework\MockObject\MockObject */ protected $input; protected function setUp(): void { diff --git a/apps/encryption/tests/Controller/StatusControllerTest.php b/apps/encryption/tests/Controller/StatusControllerTest.php index 3c59a80fe15..26210946cce 100644 --- a/apps/encryption/tests/Controller/StatusControllerTest.php +++ b/apps/encryption/tests/Controller/StatusControllerTest.php @@ -22,10 +22,10 @@ class StatusControllerTest extends TestCase { /** @var \OCP\IL10N|\PHPUnit\Framework\MockObject\MockObject */ private $l10nMock; - /** @var \OCA\Encryption\Session | \PHPUnit\Framework\MockObject\MockObject */ + /** @var \OCA\Encryption\Session | \PHPUnit\Framework\MockObject\MockObject */ protected $sessionMock; - /** @var IManager | \PHPUnit\Framework\MockObject\MockObject */ + /** @var IManager | \PHPUnit\Framework\MockObject\MockObject */ protected $encryptionManagerMock; /** @var StatusController */ diff --git a/apps/encryption/tests/Crypto/CryptTest.php b/apps/encryption/tests/Crypto/CryptTest.php index eea4186377c..97f78b66856 100644 --- a/apps/encryption/tests/Crypto/CryptTest.php +++ b/apps/encryption/tests/Crypto/CryptTest.php @@ -125,9 +125,9 @@ class CryptTest extends TestCase { public function testGetCipherWithInvalidCipher() { $this->config->expects($this->once()) - ->method('getSystemValueString') - ->with($this->equalTo('cipher'), $this->equalTo('AES-256-CTR')) - ->willReturn('Not-Existing-Cipher'); + ->method('getSystemValueString') + ->with($this->equalTo('cipher'), $this->equalTo('AES-256-CTR')) + ->willReturn('Not-Existing-Cipher'); $this->logger ->expects($this->once()) ->method('warning') diff --git a/apps/encryption/tests/Crypto/DecryptAllTest.php b/apps/encryption/tests/Crypto/DecryptAllTest.php index 7723fd5ce4f..2a46e542804 100644 --- a/apps/encryption/tests/Crypto/DecryptAllTest.php +++ b/apps/encryption/tests/Crypto/DecryptAllTest.php @@ -17,22 +17,22 @@ use Test\TestCase; class DecryptAllTest extends TestCase { - /** @var DecryptAll */ + /** @var DecryptAll */ protected $instance; - /** @var Util | \PHPUnit\Framework\MockObject\MockObject */ + /** @var Util | \PHPUnit\Framework\MockObject\MockObject */ protected $util; - /** @var KeyManager | \PHPUnit\Framework\MockObject\MockObject */ + /** @var KeyManager | \PHPUnit\Framework\MockObject\MockObject */ protected $keyManager; - /** @var Crypt | \PHPUnit\Framework\MockObject\MockObject */ + /** @var Crypt | \PHPUnit\Framework\MockObject\MockObject */ protected $crypt; - /** @var Session | \PHPUnit\Framework\MockObject\MockObject */ + /** @var Session | \PHPUnit\Framework\MockObject\MockObject */ protected $session; - /** @var QuestionHelper | \PHPUnit\Framework\MockObject\MockObject */ + /** @var QuestionHelper | \PHPUnit\Framework\MockObject\MockObject */ protected $questionHelper; protected function setUp(): void { diff --git a/apps/encryption/tests/Crypto/EncryptAllTest.php b/apps/encryption/tests/Crypto/EncryptAllTest.php index ec05c422dd4..a63b826bf3c 100644 --- a/apps/encryption/tests/Crypto/EncryptAllTest.php +++ b/apps/encryption/tests/Crypto/EncryptAllTest.php @@ -29,49 +29,49 @@ use Test\TestCase; class EncryptAllTest extends TestCase { - /** @var \PHPUnit\Framework\MockObject\MockObject | \OCA\Encryption\KeyManager */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \OCA\Encryption\KeyManager */ protected $keyManager; - /** @var \PHPUnit\Framework\MockObject\MockObject | \OCA\Encryption\Util */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \OCA\Encryption\Util */ protected $util; - /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\IUserManager */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\IUserManager */ protected $userManager; - /** @var \PHPUnit\Framework\MockObject\MockObject | \OCA\Encryption\Users\Setup */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \OCA\Encryption\Users\Setup */ protected $setupUser; - /** @var \PHPUnit\Framework\MockObject\MockObject | \OC\Files\View */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \OC\Files\View */ protected $view; - /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\IConfig */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\IConfig */ protected $config; - /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\Mail\IMailer */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\Mail\IMailer */ protected $mailer; - /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\IL10N */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\IL10N */ protected $l; - /** @var \PHPUnit\Framework\MockObject\MockObject | IFactory */ + /** @var \PHPUnit\Framework\MockObject\MockObject | IFactory */ protected $l10nFactory; - /** @var \PHPUnit\Framework\MockObject\MockObject | \Symfony\Component\Console\Helper\QuestionHelper */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \Symfony\Component\Console\Helper\QuestionHelper */ protected $questionHelper; - /** @var \PHPUnit\Framework\MockObject\MockObject | \Symfony\Component\Console\Input\InputInterface */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \Symfony\Component\Console\Input\InputInterface */ protected $inputInterface; - /** @var \PHPUnit\Framework\MockObject\MockObject | \Symfony\Component\Console\Output\OutputInterface */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \Symfony\Component\Console\Output\OutputInterface */ protected $outputInterface; - /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\UserInterface */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\UserInterface */ protected $userInterface; - /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\Security\ISecureRandom */ + /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\Security\ISecureRandom */ protected $secureRandom; - /** @var EncryptAll */ + /** @var EncryptAll */ protected $encryptAll; protected function setUp(): void { @@ -136,7 +136,7 @@ class EncryptAllTest extends TestCase { } public function testEncryptAll() { - /** @var EncryptAll | \PHPUnit\Framework\MockObject\MockObject $encryptAll */ + /** @var EncryptAll | \PHPUnit\Framework\MockObject\MockObject $encryptAll */ $encryptAll = $this->getMockBuilder(EncryptAll::class) ->setConstructorArgs( [ @@ -165,7 +165,7 @@ class EncryptAllTest extends TestCase { } public function testEncryptAllWithMasterKey() { - /** @var EncryptAll | \PHPUnit\Framework\MockObject\MockObject $encryptAll */ + /** @var EncryptAll | \PHPUnit\Framework\MockObject\MockObject $encryptAll */ $encryptAll = $this->getMockBuilder(EncryptAll::class) ->setConstructorArgs( [ @@ -195,7 +195,7 @@ class EncryptAllTest extends TestCase { } public function testCreateKeyPairs() { - /** @var EncryptAll | \PHPUnit\Framework\MockObject\MockObject $encryptAll */ + /** @var EncryptAll | \PHPUnit\Framework\MockObject\MockObject $encryptAll */ $encryptAll = $this->getMockBuilder(EncryptAll::class) ->setConstructorArgs( [ @@ -245,7 +245,7 @@ class EncryptAllTest extends TestCase { } public function testEncryptAllUsersFiles() { - /** @var EncryptAll | \PHPUnit\Framework\MockObject\MockObject $encryptAll */ + /** @var EncryptAll | \PHPUnit\Framework\MockObject\MockObject $encryptAll */ $encryptAll = $this->getMockBuilder(EncryptAll::class) ->setConstructorArgs( [ @@ -281,7 +281,7 @@ class EncryptAllTest extends TestCase { } public function testEncryptUsersFiles() { - /** @var EncryptAll | \PHPUnit\Framework\MockObject\MockObject $encryptAll */ + /** @var EncryptAll | \PHPUnit\Framework\MockObject\MockObject $encryptAll */ $encryptAll = $this->getMockBuilder(EncryptAll::class) ->setConstructorArgs( [ diff --git a/apps/encryption/tests/EncryptedStorageTest.php b/apps/encryption/tests/EncryptedStorageTest.php index 8c38586eb33..26d5d9c4941 100644 --- a/apps/encryption/tests/EncryptedStorageTest.php +++ b/apps/encryption/tests/EncryptedStorageTest.php @@ -31,23 +31,23 @@ class EncryptedStorageTest extends TestCase { use UserTrait; public function testMoveFromEncrypted() { - $this->createUser("test1", "test2"); - $this->setupForUser("test1", 'test2'); + $this->createUser('test1', 'test2'); + $this->setupForUser('test1', 'test2'); $unwrapped = new Temporary(); - $this->registerMount("test1", new TemporaryNoEncrypted(), "/test1/files/unenc"); - $this->registerMount("test1", $unwrapped, "/test1/files/enc"); + $this->registerMount('test1', new TemporaryNoEncrypted(), '/test1/files/unenc'); + $this->registerMount('test1', $unwrapped, '/test1/files/enc'); - $this->loginWithEncryption("test1"); + $this->loginWithEncryption('test1'); - $view = new View("/test1/files"); + $view = new View('/test1/files'); /** @var IMountManager $mountManager */ $mountManager = \OC::$server->get(IMountManager::class); - $encryptedMount = $mountManager->find("/test1/files/enc"); - $unencryptedMount = $mountManager->find("/test1/files/unenc"); + $encryptedMount = $mountManager->find('/test1/files/enc'); + $unencryptedMount = $mountManager->find('/test1/files/unenc'); $encryptedStorage = $encryptedMount->getStorage(); $unencryptedStorage = $unencryptedMount->getStorage(); $encryptedCache = $encryptedStorage->getCache(); @@ -56,15 +56,15 @@ class EncryptedStorageTest extends TestCase { $this->assertTrue($encryptedStorage->instanceOfStorage(Encryption::class)); $this->assertFalse($unencryptedStorage->instanceOfStorage(Encryption::class)); - $encryptedStorage->file_put_contents("foo.txt", "bar"); - $this->assertEquals("bar", $encryptedStorage->file_get_contents("foo.txt")); - $this->assertStringStartsWith("HBEGIN:oc_encryption_module:", $unwrapped->file_get_contents("foo.txt")); + $encryptedStorage->file_put_contents('foo.txt', 'bar'); + $this->assertEquals('bar', $encryptedStorage->file_get_contents('foo.txt')); + $this->assertStringStartsWith('HBEGIN:oc_encryption_module:', $unwrapped->file_get_contents('foo.txt')); - $this->assertTrue($encryptedCache->get("foo.txt")->isEncrypted()); + $this->assertTrue($encryptedCache->get('foo.txt')->isEncrypted()); - $view->rename("enc/foo.txt", "unenc/foo.txt"); + $view->rename('enc/foo.txt', 'unenc/foo.txt'); - $this->assertEquals("bar", $unencryptedStorage->file_get_contents("foo.txt")); - $this->assertFalse($unencryptedCache->get("foo.txt")->isEncrypted()); + $this->assertEquals('bar', $unencryptedStorage->file_get_contents('foo.txt')); + $this->assertFalse($unencryptedCache->get('foo.txt')->isEncrypted()); } } diff --git a/apps/encryption/tests/SessionTest.php b/apps/encryption/tests/SessionTest.php index 098120e2b03..61e57f66611 100644 --- a/apps/encryption/tests/SessionTest.php +++ b/apps/encryption/tests/SessionTest.php @@ -183,15 +183,15 @@ class SessionTest extends TestCase { $this->sessionMock->expects($this->any()) ->method('set') - ->willReturnCallback([$this, "setValueTester"]); + ->willReturnCallback([$this, 'setValueTester']); $this->sessionMock->expects($this->any()) ->method('get') - ->willReturnCallback([$this, "getValueTester"]); + ->willReturnCallback([$this, 'getValueTester']); $this->sessionMock->expects($this->any()) ->method('remove') - ->willReturnCallback([$this, "removeValueTester"]); + ->willReturnCallback([$this, 'removeValueTester']); $this->instance = new Session($this->sessionMock); diff --git a/apps/encryption/tests/Settings/AdminTest.php b/apps/encryption/tests/Settings/AdminTest.php index 80f7803badd..05db5185cf4 100644 --- a/apps/encryption/tests/Settings/AdminTest.php +++ b/apps/encryption/tests/Settings/AdminTest.php @@ -1,4 +1,5 @@ notifications->sendUpdateToRemote($remote, $remoteId, $token, $action, $data, $try); @@ -75,7 +75,7 @@ class RetryJob extends Job { 'token' => $argument['token'], 'data' => $argument['data'], 'action' => $argument['action'], - 'try' => (int)$argument['try'] + 1, + 'try' => (int) $argument['try'] + 1, 'lastRun' => $this->time->getTime() ] ); @@ -85,7 +85,7 @@ class RetryJob extends Job { * Test if it is time for the next run */ protected function shouldRun(array $argument): bool { - $lastRun = (int)$argument['lastRun']; + $lastRun = (int) $argument['lastRun']; return (($this->time->getTime() - $lastRun) > $this->interval); } } diff --git a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php index b5b5806d335..249e0a42f98 100644 --- a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php +++ b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php @@ -1,4 +1,5 @@ |JSONResponse - * 200: Remote URL returned - * 400: Creating share is not possible + * 200: Remote URL returned + * 400: Creating share is not possible */ #[NoCSRFRequired] #[PublicPage] diff --git a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php index 5edb80b016b..bfab62c9750 100644 --- a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php +++ b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php @@ -51,7 +51,7 @@ class RequestHandlerController extends OCSController { /** @var AddressHandler */ private $addressHandler; - /** @var IUserManager */ + /** @var IUserManager */ private $userManager; /** @var string */ @@ -385,7 +385,7 @@ class RequestHandlerController extends OCSController { try { $provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file'); - $ocmPermissions = $this->ncPermissions2ocmPermissions((int)$ncPermissions); + $ocmPermissions = $this->ncPermissions2ocmPermissions((int) $ncPermissions); $notification = ['sharedSecret' => $token, 'permission' => $ocmPermissions]; $provider->notificationReceived('RESHARE_CHANGE_PERMISSION', $id, $notification); $this->eventDispatcher->dispatchTyped(new CriticalActionPerformedEvent('Federated share with id "%s" has updated permissions "%s"', [$id, implode(', ', $ocmPermissions)])); diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php index 8a8f76ffaf5..29983c79812 100644 --- a/apps/federatedfilesharing/lib/FederatedShareProvider.php +++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php @@ -271,7 +271,7 @@ class FederatedShareProvider implements IShareProvider { $result = $qResult->fetchAll(); $qResult->closeCursor(); - if (isset($result[0]) && (int)$result[0]['remote_id'] > 0) { + if (isset($result[0]) && (int) $result[0]['remote_id'] > 0) { return $result[0]; } @@ -329,12 +329,12 @@ class FederatedShareProvider implements IShareProvider { */ $qb = $this->dbConnection->getQueryBuilder(); $qb->update('share') - ->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId()))) - ->set('permissions', $qb->createNamedParameter($share->getPermissions())) - ->set('uid_owner', $qb->createNamedParameter($share->getShareOwner())) - ->set('uid_initiator', $qb->createNamedParameter($share->getSharedBy())) - ->set('expiration', $qb->createNamedParameter($share->getExpirationDate(), IQueryBuilder::PARAM_DATE)) - ->execute(); + ->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId()))) + ->set('permissions', $qb->createNamedParameter($share->getPermissions())) + ->set('uid_owner', $qb->createNamedParameter($share->getShareOwner())) + ->set('uid_initiator', $qb->createNamedParameter($share->getSharedBy())) + ->set('expiration', $qb->createNamedParameter($share->getExpirationDate(), IQueryBuilder::PARAM_DATE)) + ->execute(); // send the updated permission to the owner/initiator, if they are not the same if ($share->getShareOwner() !== $share->getSharedBy()) { @@ -405,7 +405,7 @@ class FederatedShareProvider implements IShareProvider { public function getRemoteId(IShare $share): string { $query = $this->dbConnection->getQueryBuilder(); $query->select('remote_id')->from('federated_reshares') - ->where($query->expr()->eq('share_id', $query->createNamedParameter((int)$share->getId()))); + ->where($query->expr()->eq('share_id', $query->createNamedParameter((int) $share->getId()))); $result = $query->execute(); $data = $result->fetch(); $result->closeCursor(); @@ -414,7 +414,7 @@ class FederatedShareProvider implements IShareProvider { throw new ShareNotFound(); } - return (string)$data['remote_id']; + return (string) $data['remote_id']; } /** @@ -549,7 +549,7 @@ class FederatedShareProvider implements IShareProvider { public function getSharesInFolder($userId, Folder $node, $reshares, $shallow = true) { if (!$shallow) { - throw new \Exception("non-shallow getSharesInFolder is no longer supported"); + throw new \Exception('non-shallow getSharesInFolder is no longer supported'); } $qb = $this->dbConnection->getQueryBuilder(); @@ -805,15 +805,15 @@ class FederatedShareProvider implements IShareProvider { */ private function createShareObject($data) { $share = new Share($this->rootFolder, $this->userManager); - $share->setId((int)$data['id']) - ->setShareType((int)$data['share_type']) - ->setPermissions((int)$data['permissions']) + $share->setId((int) $data['id']) + ->setShareType((int) $data['share_type']) + ->setPermissions((int) $data['permissions']) ->setTarget($data['file_target']) - ->setMailSend((bool)$data['mail_send']) + ->setMailSend((bool) $data['mail_send']) ->setToken($data['token']); $shareTime = new \DateTime(); - $shareTime->setTimestamp((int)$data['stime']); + $shareTime->setTimestamp((int) $data['stime']); $share->setShareTime($shareTime); $share->setSharedWith($data['share_with']); @@ -823,13 +823,13 @@ class FederatedShareProvider implements IShareProvider { } else { //OLD SHARE $share->setSharedBy($data['uid_owner']); - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); $owner = $path->getOwner(); $share->setShareOwner($owner->getUID()); } - $share->setNodeId((int)$data['file_source']); + $share->setNodeId((int) $data['file_source']); $share->setNodeType($data['item_type']); $share->setProviderId($this->identifier()); diff --git a/apps/federatedfilesharing/lib/Notifications.php b/apps/federatedfilesharing/lib/Notifications.php index 947427141b3..1725e28832b 100644 --- a/apps/federatedfilesharing/lib/Notifications.php +++ b/apps/federatedfilesharing/lib/Notifications.php @@ -116,7 +116,7 @@ class Notifications { ]; $ocmFields = $fields; - $ocmFields['remoteId'] = (string)$id; + $ocmFields['remoteId'] = (string) $id; $ocmFields['localId'] = $shareId; $ocmFields['name'] = $filename; @@ -286,7 +286,7 @@ class Notifications { * @return array * @throws \Exception */ - protected function tryHttpPostToShareEndpoint($remoteDomain, $urlSuffix, array $fields, $action = "share") { + protected function tryHttpPostToShareEndpoint($remoteDomain, $urlSuffix, array $fields, $action = 'share') { if ($this->addressHandler->urlContainProtocol($remoteDomain) === false) { $remoteDomain = 'https://' . $remoteDomain; } diff --git a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php index e1bbbbc310f..9a06e7b349b 100644 --- a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php +++ b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php @@ -1,4 +1,5 @@ getNode()->getId(); + $fileId = (int) $share->getNode()->getId(); [$file, $link] = $this->getFile($this->getCorrectUid($share), $fileId); } catch (\Exception $e) { throw new ShareNotFound(); @@ -382,7 +383,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { $this->federatedShareProvider->removeShareFromTable($share); try { - $fileId = (int)$share->getNode()->getId(); + $fileId = (int) $share->getNode()->getId(); [$file, $link] = $this->getFile($this->getCorrectUid($share), $fileId); } catch (\Exception $e) { throw new ShareNotFound(); @@ -431,7 +432,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { */ private function unshare($id, array $notification) { if (!$this->isS2SEnabled(true)) { - throw new ActionNotSupportedException("incoming shares disabled!"); + throw new ActionNotSupportedException('incoming shares disabled!'); } if (!isset($notification['sharedSecret'])) { @@ -474,12 +475,12 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { // delete all child in case of a group share $qb = $this->connection->getQueryBuilder(); $qb->delete('share_external') - ->where($qb->expr()->eq('parent', $qb->createNamedParameter((int)$share['id']))); + ->where($qb->expr()->eq('parent', $qb->createNamedParameter((int) $share['id']))); $qb->execute(); $ownerDisplayName = $this->getUserDisplayName($owner->getId()); - if ((int)$share['share_type'] === IShare::TYPE_USER) { + if ((int) $share['share_type'] === IShare::TYPE_USER) { if ($share['accepted']) { $path = trim($mountpoint, '/'); } else { @@ -488,7 +489,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { $notification = $this->notificationManager->createNotification(); $notification->setApp('files_sharing') ->setUser($share['user']) - ->setObject('remote_share', (int)$share['id']); + ->setObject('remote_share', (int) $share['id']); $this->notificationManager->markProcessed($notification); $event = $this->activityManager->generateEvent(); @@ -496,7 +497,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { ->setType('remote_share') ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_UNSHARED, [$owner->getId(), $path, $ownerDisplayName]) ->setAffectedUser($user) - ->setObject('remote_share', (int)$share['id'], $path); + ->setObject('remote_share', (int) $share['id'], $path); \OC::$server->getActivityManager()->publish($event); } } @@ -540,7 +541,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { $share = $this->federatedShareProvider->getShareById($id); // We have to respect the default share permissions - $permissions = $share->getPermissions() & (int)$this->config->getAppValue('core', 'shareapi_default_permissions', (string)Constants::PERMISSION_ALL); + $permissions = $share->getPermissions() & (int) $this->config->getAppValue('core', 'shareapi_default_permissions', (string) Constants::PERMISSION_ALL); $share->setPermissions($permissions); // don't allow to share a file back to the owner @@ -563,7 +564,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { $share->setSharedBy($share->getSharedWith()); $share->setSharedWith($shareWith); $result = $this->federatedShareProvider->create($share); - $this->federatedShareProvider->storeRemoteId((int)$result->getId(), $senderId); + $this->federatedShareProvider->storeRemoteId((int) $result->getId(), $senderId); return ['token' => $result->getToken(), 'providerId' => $result->getId()]; } else { throw new ProviderCouldNotAddShareException('resharing not allowed for share: ' . $id); diff --git a/apps/federatedfilesharing/lib/Settings/Admin.php b/apps/federatedfilesharing/lib/Settings/Admin.php index bb41aede1c8..508eaab9665 100644 --- a/apps/federatedfilesharing/lib/Settings/Admin.php +++ b/apps/federatedfilesharing/lib/Settings/Admin.php @@ -1,4 +1,5 @@ time->getTime(); + $created = isset($argument['created']) ? (int) $argument['created'] : $this->time->getTime(); $currentTime = $this->time->getTime(); $source = $this->urlGenerator->getAbsoluteURL('/'); $source = rtrim($source, '/'); diff --git a/apps/federation/lib/BackgroundJob/RequestSharedSecret.php b/apps/federation/lib/BackgroundJob/RequestSharedSecret.php index a1d0d2b0df0..ce681b6fbd1 100644 --- a/apps/federation/lib/BackgroundJob/RequestSharedSecret.php +++ b/apps/federation/lib/BackgroundJob/RequestSharedSecret.php @@ -84,7 +84,7 @@ class RequestSharedSecret extends Job { */ protected function run($argument) { $target = $argument['url']; - $created = isset($argument['created']) ? (int)$argument['created'] : $this->time->getTime(); + $created = isset($argument['created']) ? (int) $argument['created'] : $this->time->getTime(); $currentTime = $this->time->getTime(); $source = $this->urlGenerator->getAbsoluteURL('/'); $source = rtrim($source, '/'); @@ -149,7 +149,7 @@ class RequestSharedSecret extends Job { */ protected function reAddJob(array $argument): void { $url = $argument['url']; - $created = isset($argument['created']) ? (int)$argument['created'] : $this->time->getTime(); + $created = isset($argument['created']) ? (int) $argument['created'] : $this->time->getTime(); $token = $argument['token']; $attempt = $this->getAttempt($argument) + 1; diff --git a/apps/federation/lib/DbHandler.php b/apps/federation/lib/DbHandler.php index ca05417d768..7d9fe4dd2f9 100644 --- a/apps/federation/lib/DbHandler.php +++ b/apps/federation/lib/DbHandler.php @@ -196,7 +196,7 @@ class DbHandler { $statement = $query->executeQuery(); $result = $statement->fetch(); $statement->closeCursor(); - return (string)$result['shared_secret']; + return (string) $result['shared_secret']; } /** @@ -206,8 +206,8 @@ class DbHandler { $hash = $this->hash($url); $query = $this->connection->getQueryBuilder(); $query->update($this->dbTable) - ->set('status', $query->createNamedParameter($status)) - ->where($query->expr()->eq('url_hash', $query->createNamedParameter($hash))); + ->set('status', $query->createNamedParameter($status)) + ->where($query->expr()->eq('url_hash', $query->createNamedParameter($hash))); if (!is_null($token)) { $query->set('sync_token', $query->createNamedParameter($token)); } @@ -221,13 +221,13 @@ class DbHandler { $hash = $this->hash($url); $query = $this->connection->getQueryBuilder(); $query->select('status')->from($this->dbTable) - ->where($query->expr()->eq('url_hash', $query->createParameter('url_hash'))) - ->setParameter('url_hash', $hash); + ->where($query->expr()->eq('url_hash', $query->createParameter('url_hash'))) + ->setParameter('url_hash', $hash); $statement = $query->executeQuery(); $result = $statement->fetch(); $statement->closeCursor(); - return (int)$result['status']; + return (int) $result['status']; } /** @@ -262,7 +262,7 @@ class DbHandler { } $query = $this->connection->getQueryBuilder(); $query->select('url')->from($this->dbTable) - ->where($query->expr()->eq('shared_secret', $query->createNamedParameter($password))); + ->where($query->expr()->eq('shared_secret', $query->createNamedParameter($password))); $statement = $query->executeQuery(); $result = $statement->fetch(); diff --git a/apps/federation/lib/Settings/Admin.php b/apps/federation/lib/Settings/Admin.php index 56e27eda2b9..88d81f7818e 100644 --- a/apps/federation/lib/Settings/Admin.php +++ b/apps/federation/lib/Settings/Admin.php @@ -1,4 +1,5 @@ l->t("Trusted servers"); + return $this->l->t('Trusted servers'); } public function getAuthorizedAppConfig(): array { diff --git a/apps/federation/lib/SyncFederationAddressBooks.php b/apps/federation/lib/SyncFederationAddressBooks.php index 1b47c92db1a..aaed6ca9d94 100644 --- a/apps/federation/lib/SyncFederationAddressBooks.php +++ b/apps/federation/lib/SyncFederationAddressBooks.php @@ -50,7 +50,7 @@ class SyncFederationAddressBooks { continue; } $targetBookId = $trustedServer['url_hash']; - $targetPrincipal = "principals/system/system"; + $targetPrincipal = 'principals/system/system'; $targetBookProperties = [ '{DAV:}displayname' => $url ]; diff --git a/apps/federation/templates/settings-admin.php b/apps/federation/templates/settings-admin.php index dabd341ce72..80340611b2e 100644 --- a/apps/federation/templates/settings-admin.php +++ b/apps/federation/templates/settings-admin.php @@ -19,12 +19,12 @@ style('federation', 'settings-admin')
  • - + diff --git a/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php b/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php index a53bfb8d4c1..bc3e971fad2 100644 --- a/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php +++ b/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php @@ -33,7 +33,7 @@ class GetSharedSecretTest extends TestCase { /** @var \PHPUnit\Framework\MockObject\MockObject|IClient */ private $httpClient; - /** @var \PHPUnit\Framework\MockObject\MockObject|IClientService */ + /** @var \PHPUnit\Framework\MockObject\MockObject|IClientService */ private $httpClientService; /** @var \PHPUnit\Framework\MockObject\MockObject|IJobList */ @@ -42,7 +42,7 @@ class GetSharedSecretTest extends TestCase { /** @var \PHPUnit\Framework\MockObject\MockObject|IURLGenerator */ private $urlGenerator; - /** @var \PHPUnit\Framework\MockObject\MockObject|TrustedServers */ + /** @var \PHPUnit\Framework\MockObject\MockObject|TrustedServers */ private $trustedServers; /** @var \PHPUnit\Framework\MockObject\MockObject|LoggerInterface */ diff --git a/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php index 9bfc6239301..7d67de38f5f 100644 --- a/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php +++ b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php @@ -50,7 +50,7 @@ class RequestSharedSecretTest extends TestCase { /** @var MockObject|ITimeFactory */ private $timeFactory; - /** @var RequestSharedSecret */ + /** @var RequestSharedSecret */ private $requestSharedSecret; protected function setUp(): void { diff --git a/apps/federation/tests/Controller/OCSAuthAPIControllerTest.php b/apps/federation/tests/Controller/OCSAuthAPIControllerTest.php index ef008b991f5..9f2d41a1072 100644 --- a/apps/federation/tests/Controller/OCSAuthAPIControllerTest.php +++ b/apps/federation/tests/Controller/OCSAuthAPIControllerTest.php @@ -23,7 +23,7 @@ class OCSAuthAPIControllerTest extends TestCase { /** @var \PHPUnit\Framework\MockObject\MockObject|IRequest */ private $request; - /** @var \PHPUnit\Framework\MockObject\MockObject|ISecureRandom */ + /** @var \PHPUnit\Framework\MockObject\MockObject|ISecureRandom */ private $secureRandom; /** @var \PHPUnit\Framework\MockObject\MockObject|JobList */ diff --git a/apps/federation/tests/DbHandlerTest.php b/apps/federation/tests/DbHandlerTest.php index fa06807d110..2dc6a54dbbd 100644 --- a/apps/federation/tests/DbHandlerTest.php +++ b/apps/federation/tests/DbHandlerTest.php @@ -18,16 +18,16 @@ use Test\TestCase; */ class DbHandlerTest extends TestCase { - /** @var DbHandler */ + /** @var DbHandler */ private $dbHandler; /** @var IL10N | \PHPUnit\Framework\MockObject\MockObject */ private $il10n; - /** @var IDBConnection */ + /** @var IDBConnection */ private $connection; - /** @var string */ + /** @var string */ private $dbTable = 'trusted_servers'; protected function setUp(): void { @@ -72,9 +72,9 @@ class DbHandlerTest extends TestCase { $qResult->closeCursor(); $this->assertSame(1, count($result)); $this->assertSame($expectedUrl, $result[0]['url']); - $this->assertSame($id, (int)$result[0]['id']); + $this->assertSame($id, (int) $result[0]['id']); $this->assertSame($expectedHash, $result[0]['url_hash']); - $this->assertSame(TrustedServers::STATUS_PENDING, (int)$result[0]['status']); + $this->assertSame(TrustedServers::STATUS_PENDING, (int) $result[0]['status']); } public function dataTestAddServer() { @@ -97,8 +97,8 @@ class DbHandlerTest extends TestCase { $this->assertSame(2, count($result)); $this->assertSame('server1', $result[0]['url']); $this->assertSame('server2', $result[1]['url']); - $this->assertSame($id1, (int)$result[0]['id']); - $this->assertSame($id2, (int)$result[1]['id']); + $this->assertSame($id1, (int) $result[0]['id']); + $this->assertSame($id2, (int) $result[1]['id']); $this->dbHandler->removeServer($id2); $query = $this->connection->getQueryBuilder()->select('*')->from($this->dbTable); @@ -108,7 +108,7 @@ class DbHandlerTest extends TestCase { $qResult->closeCursor(); $this->assertSame(1, count($result)); $this->assertSame('server1', $result[0]['url']); - $this->assertSame($id1, (int)$result[0]['id']); + $this->assertSame($id1, (int) $result[0]['id']); } @@ -128,8 +128,8 @@ class DbHandlerTest extends TestCase { $this->assertSame(2, count($result)); $this->assertSame('server1', $result[0]['url']); $this->assertSame('server2', $result[1]['url']); - $this->assertSame($id1, (int)$result[0]['id']); - $this->assertSame($id2, (int)$result[1]['id']); + $this->assertSame($id1, (int) $result[0]['id']); + $this->assertSame($id2, (int) $result[1]['id']); } /** @@ -216,7 +216,7 @@ class DbHandlerTest extends TestCase { $result = $qResult->fetchAll(); $qResult->closeCursor(); $this->assertSame(1, count($result)); - $this->assertSame(TrustedServers::STATUS_PENDING, (int)$result[0]['status']); + $this->assertSame(TrustedServers::STATUS_PENDING, (int) $result[0]['status']); $this->dbHandler->setServerStatus('http://server1', TrustedServers::STATUS_OK); $query = $this->connection->getQueryBuilder()->select('*')->from($this->dbTable); @@ -224,7 +224,7 @@ class DbHandlerTest extends TestCase { $result = $qResult->fetchAll(); $qResult->closeCursor(); $this->assertSame(1, count($result)); - $this->assertSame(TrustedServers::STATUS_OK, (int)$result[0]['status']); + $this->assertSame(TrustedServers::STATUS_OK, (int) $result[0]['status']); } public function testGetServerStatus() { diff --git a/apps/federation/tests/Middleware/AddServerMiddlewareTest.php b/apps/federation/tests/Middleware/AddServerMiddlewareTest.php index 5cdd255a497..85b918a80f1 100644 --- a/apps/federation/tests/Middleware/AddServerMiddlewareTest.php +++ b/apps/federation/tests/Middleware/AddServerMiddlewareTest.php @@ -17,7 +17,7 @@ use Test\TestCase; class AddServerMiddlewareTest extends TestCase { - /** @var \PHPUnit\Framework\MockObject\MockObject | LoggerInterface */ + /** @var \PHPUnit\Framework\MockObject\MockObject | LoggerInterface */ private $logger; /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\IL10N */ @@ -25,7 +25,7 @@ class AddServerMiddlewareTest extends TestCase { private AddServerMiddleware $middleware; - /** @var \PHPUnit\Framework\MockObject\MockObject | SettingsController */ + /** @var \PHPUnit\Framework\MockObject\MockObject | SettingsController */ private $controller; protected function setUp(): void { diff --git a/apps/federation/tests/Settings/AdminTest.php b/apps/federation/tests/Settings/AdminTest.php index 3bbf4c4a9e7..5b2ad29ea47 100644 --- a/apps/federation/tests/Settings/AdminTest.php +++ b/apps/federation/tests/Settings/AdminTest.php @@ -1,4 +1,5 @@ setMethods(['normalizeUrl', 'updateProtocol']) ->getMock(); $trustedServers->expects($this->once())->method('updateProtocol') - ->with('url')->willReturn('https://url'); + ->with('url')->willReturn('https://url'); $this->timeFactory->method('getTime') ->willReturn(1234567); $this->dbHandler->expects($this->once())->method('addServer')->with('https://url') @@ -127,9 +127,9 @@ class TrustedServersTest extends TestCase { public function testGetSharedSecret(): void { $this->dbHandler->expects($this->once()) - ->method('getSharedSecret') - ->with('url') - ->willReturn('secret'); + ->method('getSharedSecret') + ->with('url') + ->willReturn('secret'); $this->assertSame( $this->trustedServers->getSharedSecret('url'), 'secret' diff --git a/apps/files/ajax/download.php b/apps/files/ajax/download.php index fc434f79e2c..b5129119afb 100644 --- a/apps/files/ajax/download.php +++ b/apps/files/ajax/download.php @@ -9,8 +9,8 @@ OC_Util::checkLoggedIn(); \OC::$server->getSession()->close(); -$files = isset($_GET['files']) ? (string)$_GET['files'] : ''; -$dir = isset($_GET['dir']) ? (string)$_GET['dir'] : ''; +$files = isset($_GET['files']) ? (string) $_GET['files'] : ''; +$dir = isset($_GET['dir']) ? (string) $_GET['dir'] : ''; $files_list = json_decode($files); // in case we get only a single file diff --git a/apps/files/lib/Activity/FavoriteProvider.php b/apps/files/lib/Activity/FavoriteProvider.php index 00f1387df94..de645dfc933 100644 --- a/apps/files/lib/Activity/FavoriteProvider.php +++ b/apps/files/lib/Activity/FavoriteProvider.php @@ -1,4 +1,5 @@ getAppValue('files', 'max_chunk_size', (string)(10 * 1024 * 1024)); + $maxChunkSize = (int) Server::get(IConfig::class)->getAppValue('files', 'max_chunk_size', (string) (10 * 1024 * 1024)); $appConfig['files'] = [ 'max_chunk_size' => $maxChunkSize ]; diff --git a/apps/files/lib/BackgroundJob/TransferOwnership.php b/apps/files/lib/BackgroundJob/TransferOwnership.php index de8d1989733..562cde15f73 100644 --- a/apps/files/lib/BackgroundJob/TransferOwnership.php +++ b/apps/files/lib/BackgroundJob/TransferOwnership.php @@ -99,7 +99,7 @@ class TransferOwnership extends QueuedJob { 'targetUser' => $transfer->getTargetUser(), 'nodeName' => $transfer->getNodeName(), ]) - ->setObject('transfer', (string)$transfer->getId()); + ->setObject('transfer', (string) $transfer->getId()); $this->notificationManager->notify($notification); // Send notification to source user $notification = $this->notificationManager->createNotification(); @@ -111,7 +111,7 @@ class TransferOwnership extends QueuedJob { 'targetUser' => $transfer->getTargetUser(), 'nodeName' => $transfer->getNodeName(), ]) - ->setObject('transfer', (string)$transfer->getId()); + ->setObject('transfer', (string) $transfer->getId()); $this->notificationManager->notify($notification); } @@ -126,7 +126,7 @@ class TransferOwnership extends QueuedJob { 'targetUser' => $transfer->getTargetUser(), 'nodeName' => $transfer->getNodeName(), ]) - ->setObject('transfer', (string)$transfer->getId()); + ->setObject('transfer', (string) $transfer->getId()); $this->notificationManager->notify($notification); // Send notification to source user @@ -139,7 +139,7 @@ class TransferOwnership extends QueuedJob { 'targetUser' => $transfer->getTargetUser(), 'nodeName' => $transfer->getNodeName(), ]) - ->setObject('transfer', (string)$transfer->getId()); + ->setObject('transfer', (string) $transfer->getId()); $this->notificationManager->notify($notification); } } diff --git a/apps/files/lib/Command/Copy.php b/apps/files/lib/Command/Copy.php index 9981497232f..e51a1689907 100644 --- a/apps/files/lib/Command/Copy.php +++ b/apps/files/lib/Command/Copy.php @@ -30,10 +30,10 @@ class Copy extends Command { $this ->setName('files:copy') ->setDescription('Copy a file or folder') - ->addArgument('source', InputArgument::REQUIRED, "Source file id or path") - ->addArgument('target', InputArgument::REQUIRED, "Target path") + ->addArgument('source', InputArgument::REQUIRED, 'Source file id or path') + ->addArgument('target', InputArgument::REQUIRED, 'Target path') ->addOption('force', 'f', InputOption::VALUE_NONE, "Don't ask for confirmation and don't output any warnings") - ->addOption('no-target-directory', 'T', InputOption::VALUE_NONE, "When target path is folder, overwrite the folder instead of copying into the folder"); + ->addOption('no-target-directory', 'T', InputOption::VALUE_NONE, 'When target path is folder, overwrite the folder instead of copying into the folder'); } public function execute(InputInterface $input, OutputInterface $output): int { @@ -98,7 +98,7 @@ class Copy extends Command { /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); - $question = new ConfirmationQuestion("" . $targetInput . " already exists, overwrite? [y/N] ", false); + $question = new ConfirmationQuestion('' . $targetInput . ' already exists, overwrite? [y/N] ', false); if (!$helper->ask($input, $output, $question)) { return 1; } diff --git a/apps/files/lib/Command/Delete.php b/apps/files/lib/Command/Delete.php index 32aa52aed2f..d984f839c91 100644 --- a/apps/files/lib/Command/Delete.php +++ b/apps/files/lib/Command/Delete.php @@ -30,7 +30,7 @@ class Delete extends Command { $this ->setName('files:delete') ->setDescription('Delete a file or folder') - ->addArgument('file', InputArgument::REQUIRED, "File id or path") + ->addArgument('file', InputArgument::REQUIRED, 'File id or path') ->addOption('force', 'f', InputOption::VALUE_NONE, "Don't ask for configuration and don't output any warnings"); } @@ -59,30 +59,30 @@ class Delete extends Command { return self::SUCCESS; } else { $node = $storage->getShare()->getNode(); - $output->writeln(""); + $output->writeln(''); } } $filesByUsers = $this->fileUtils->getFilesByUser($node); if (count($filesByUsers) > 1) { - $output->writeln("Warning: the provided file is accessible by more than one user"); - $output->writeln(" all of the following users will lose access to the file when deleted:"); - $output->writeln(""); + $output->writeln('Warning: the provided file is accessible by more than one user'); + $output->writeln(' all of the following users will lose access to the file when deleted:'); + $output->writeln(''); foreach ($filesByUsers as $user => $filesByUser) { - $output->writeln($user . ":"); - foreach($filesByUser as $file) { - $output->writeln(" - " . $file->getPath()); + $output->writeln($user . ':'); + foreach ($filesByUser as $file) { + $output->writeln(' - ' . $file->getPath()); } } - $output->writeln(""); + $output->writeln(''); } if ($node instanceof Folder) { $maybeContents = " and all it's contents"; } else { - $maybeContents = ""; + $maybeContents = ''; } - $question = new ConfirmationQuestion("Delete " . $node->getPath() . $maybeContents . "? [y/N] ", false); + $question = new ConfirmationQuestion('Delete ' . $node->getPath() . $maybeContents . '? [y/N] ', false); $deleteConfirmed = $helper->ask($input, $output, $question); } @@ -90,7 +90,7 @@ class Delete extends Command { if ($node->isDeletable()) { $node->delete(); } else { - $output->writeln("File cannot be deleted, insufficient permissions."); + $output->writeln('File cannot be deleted, insufficient permissions.'); } } diff --git a/apps/files/lib/Command/Get.php b/apps/files/lib/Command/Get.php index 0d901fe8250..60e028f615e 100644 --- a/apps/files/lib/Command/Get.php +++ b/apps/files/lib/Command/Get.php @@ -26,8 +26,8 @@ class Get extends Command { $this ->setName('files:get') ->setDescription('Get the contents of a file') - ->addArgument('file', InputArgument::REQUIRED, "Source file id or Nextcloud path") - ->addArgument('output', InputArgument::OPTIONAL, "Target local file to output to, defaults to STDOUT"); + ->addArgument('file', InputArgument::REQUIRED, 'Source file id or Nextcloud path') + ->addArgument('output', InputArgument::OPTIONAL, 'Target local file to output to, defaults to STDOUT'); } public function execute(InputInterface $input, OutputInterface $output): int { @@ -48,7 +48,7 @@ class Get extends Command { $isTTY = stream_isatty(STDOUT); if ($outputName === null && $isTTY && $node->getMimePart() !== 'text') { $output->writeln([ - "Warning: Binary output can mess up your terminal", + 'Warning: Binary output can mess up your terminal', " Use occ files:get $fileInput - to output it to the terminal anyway", " Or occ files:get $fileInput to save to a file instead" ]); diff --git a/apps/files/lib/Command/Move.php b/apps/files/lib/Command/Move.php index dd1cd1aae76..cd9e56f8e29 100644 --- a/apps/files/lib/Command/Move.php +++ b/apps/files/lib/Command/Move.php @@ -31,8 +31,8 @@ class Move extends Command { $this ->setName('files:move') ->setDescription('Move a file or folder') - ->addArgument('source', InputArgument::REQUIRED, "Source file id or path") - ->addArgument('target', InputArgument::REQUIRED, "Target path") + ->addArgument('source', InputArgument::REQUIRED, 'Source file id or path') + ->addArgument('target', InputArgument::REQUIRED, 'Target path') ->addOption('force', 'f', InputOption::VALUE_NONE, "Don't ask for configuration and don't output any warnings"); } @@ -88,7 +88,7 @@ class Move extends Command { /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); - $question = new ConfirmationQuestion("" . $targetInput . " already exists, overwrite? [y/N] ", false); + $question = new ConfirmationQuestion('' . $targetInput . ' already exists, overwrite? [y/N] ', false); if (!$helper->ask($input, $output, $question)) { return 1; } diff --git a/apps/files/lib/Command/Object/Delete.php b/apps/files/lib/Command/Object/Delete.php index f9fc3a58229..07613ecc616 100644 --- a/apps/files/lib/Command/Object/Delete.php +++ b/apps/files/lib/Command/Object/Delete.php @@ -27,13 +27,13 @@ class Delete extends Command { $this ->setName('files:object:delete') ->setDescription('Delete an object from the object store') - ->addArgument('object', InputArgument::REQUIRED, "Object to delete") + ->addArgument('object', InputArgument::REQUIRED, 'Object to delete') ->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket to delete the object from, only required in cases where it can't be determined from the config"); } public function execute(InputInterface $input, OutputInterface $output): int { $object = $input->getArgument('object'); - $objectStore = $this->objectUtils->getObjectStore($input->getOption("bucket"), $output); + $objectStore = $this->objectUtils->getObjectStore($input->getOption('bucket'), $output); if (!$objectStore) { return -1; } @@ -41,7 +41,7 @@ class Delete extends Command { if ($fileId = $this->objectUtils->objectExistsInDb($object)) { $output->writeln("Warning, object $object belongs to an existing file, deleting the object will lead to unexpected behavior if not replaced"); $output->writeln(" Note: use occ files:delete $fileId to delete the file cleanly or occ info:file $fileId for more information about the file"); - $output->writeln(""); + $output->writeln(''); } if (!$objectStore->objectExists($object)) { diff --git a/apps/files/lib/Command/Object/Get.php b/apps/files/lib/Command/Object/Get.php index 054278211f6..c32de020c5a 100644 --- a/apps/files/lib/Command/Object/Get.php +++ b/apps/files/lib/Command/Object/Get.php @@ -25,15 +25,15 @@ class Get extends Command { $this ->setName('files:object:get') ->setDescription('Get the contents of an object') - ->addArgument('object', InputArgument::REQUIRED, "Object to get") - ->addArgument('output', InputArgument::REQUIRED, "Target local file to output to, use - for STDOUT") + ->addArgument('object', InputArgument::REQUIRED, 'Object to get') + ->addArgument('output', InputArgument::REQUIRED, 'Target local file to output to, use - for STDOUT') ->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket to get the object from, only required in cases where it can't be determined from the config"); } public function execute(InputInterface $input, OutputInterface $output): int { $object = $input->getArgument('object'); $outputName = $input->getArgument('output'); - $objectStore = $this->objectUtils->getObjectStore($input->getOption("bucket"), $output); + $objectStore = $this->objectUtils->getObjectStore($input->getOption('bucket'), $output); if (!$objectStore) { return self::FAILURE; } diff --git a/apps/files/lib/Command/Object/ObjectUtil.php b/apps/files/lib/Command/Object/ObjectUtil.php index 7021c815490..b85591e8a32 100644 --- a/apps/files/lib/Command/Object/ObjectUtil.php +++ b/apps/files/lib/Command/Object/ObjectUtil.php @@ -41,19 +41,19 @@ class ObjectUtil { public function getObjectStore(?string $bucket, OutputInterface $output): ?IObjectStore { $config = $this->getObjectStoreConfig(); if (!$config) { - $output->writeln("Instance is not using primary object store"); + $output->writeln('Instance is not using primary object store'); return null; } if ($config['multibucket'] && !$bucket) { - $output->writeln("--bucket option required because multi bucket is enabled."); + $output->writeln('--bucket option required because multi bucket is enabled.'); return null; } if (!isset($config['arguments'])) { - throw new \Exception("no arguments configured for object store configuration"); + throw new \Exception('no arguments configured for object store configuration'); } if (!isset($config['class'])) { - throw new \Exception("no class configured for object store configuration"); + throw new \Exception('no class configured for object store configuration'); } if ($bucket) { @@ -65,7 +65,7 @@ class ObjectUtil { $store = new $config['class']($config['arguments']); if (!$store instanceof IObjectStore) { - throw new \Exception("configured object store class is not an object store implementation"); + throw new \Exception('configured object store class is not an object store implementation'); } return $store; } @@ -78,7 +78,7 @@ class ObjectUtil { return false; } - $fileId = (int)substr($object, strlen('urn:oid:')); + $fileId = (int) substr($object, strlen('urn:oid:')); $query = $this->connection->getQueryBuilder(); $query->select('fileid') ->from('filecache') diff --git a/apps/files/lib/Command/Object/Put.php b/apps/files/lib/Command/Object/Put.php index 34e4ceb854b..fc49e28c70a 100644 --- a/apps/files/lib/Command/Object/Put.php +++ b/apps/files/lib/Command/Object/Put.php @@ -29,16 +29,16 @@ class Put extends Command { $this ->setName('files:object:put') ->setDescription('Write a file to the object store') - ->addArgument('input', InputArgument::REQUIRED, "Source local path, use - to read from STDIN") - ->addArgument('object', InputArgument::REQUIRED, "Object to write") + ->addArgument('input', InputArgument::REQUIRED, 'Source local path, use - to read from STDIN') + ->addArgument('object', InputArgument::REQUIRED, 'Object to write') ->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket where to store the object, only required in cases where it can't be determined from the config"); ; } public function execute(InputInterface $input, OutputInterface $output): int { $object = $input->getArgument('object'); - $inputName = (string)$input->getArgument('input'); - $objectStore = $this->objectUtils->getObjectStore($input->getOption("bucket"), $output); + $inputName = (string) $input->getArgument('input'); + $objectStore = $this->objectUtils->getObjectStore($input->getOption('bucket'), $output); if (!$objectStore) { return -1; } @@ -46,11 +46,11 @@ class Put extends Command { if ($fileId = $this->objectUtils->objectExistsInDb($object)) { $output->writeln("Warning, object $object belongs to an existing file, overwriting the object contents can lead to unexpected behavior."); $output->writeln("You can use occ files:put $inputName $fileId to write to the file safely."); - $output->writeln(""); + $output->writeln(''); /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); - $question = new ConfirmationQuestion("Write to the object anyway? [y/N] ", false); + $question = new ConfirmationQuestion('Write to the object anyway? [y/N] ', false); if (!$helper->ask($input, $output, $question)) { return -1; } diff --git a/apps/files/lib/Command/Put.php b/apps/files/lib/Command/Put.php index f72fa902346..fd9d75db78c 100644 --- a/apps/files/lib/Command/Put.php +++ b/apps/files/lib/Command/Put.php @@ -29,8 +29,8 @@ class Put extends Command { $this ->setName('files:put') ->setDescription('Write contents of a file') - ->addArgument('input', InputArgument::REQUIRED, "Source local path, use - to read from STDIN") - ->addArgument('file', InputArgument::REQUIRED, "Target Nextcloud file path to write to or fileid of existing file"); + ->addArgument('input', InputArgument::REQUIRED, 'Source local path, use - to read from STDIN') + ->addArgument('file', InputArgument::REQUIRED, 'Target Nextcloud file path to write to or fileid of existing file'); } public function execute(InputInterface $input, OutputInterface $output): int { diff --git a/apps/files/lib/Command/RepairTree.php b/apps/files/lib/Command/RepairTree.php index 99e92741a2e..ca4aa102647 100644 --- a/apps/files/lib/Command/RepairTree.php +++ b/apps/files/lib/Command/RepairTree.php @@ -33,7 +33,7 @@ class RepairTree extends Command { $rows = $this->findBrokenTreeBits(); $fix = !$input->getOption('dry-run'); - $output->writeln("Found " . count($rows) . " file entries with an invalid path"); + $output->writeln('Found ' . count($rows) . ' file entries with an invalid path'); if ($fix) { $this->connection->beginTransaction(); @@ -50,10 +50,10 @@ class RepairTree extends Command { $output->writeln("Path of file {$row['fileid']} is {$row['path']} but should be {$row['parent_path']}/{$row['name']} based on its parent", OutputInterface::VERBOSITY_VERBOSE); if ($fix) { - $fileId = $this->getFileId((int)$row['parent_storage'], $row['parent_path'] . '/' . $row['name']); + $fileId = $this->getFileId((int) $row['parent_storage'], $row['parent_path'] . '/' . $row['name']); if ($fileId > 0) { $output->writeln("Cache entry has already be recreated with id $fileId, deleting instead"); - $this->deleteById((int)$row['fileid']); + $this->deleteById((int) $row['fileid']); } else { $query->setParameters([ 'fileid' => $row['fileid'], diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php index 68c80f6559a..6b192797ae6 100644 --- a/apps/files/lib/Command/Scan.php +++ b/apps/files/lib/Command/Scan.php @@ -302,9 +302,9 @@ class Scan extends Base { * Formats microtime into a human-readable format */ protected function formatExecTime(): string { - $secs = (int)round($this->execTime); + $secs = (int) round($this->execTime); # convert seconds into HH:MM:SS form - return sprintf('%02d:%02d:%02d', (int)($secs / 3600), ((int)($secs / 60) % 60), $secs % 60); + return sprintf('%02d:%02d:%02d', (int) ($secs / 3600), ((int) ($secs / 60) % 60), $secs % 60); } protected function reconnectToDatabase(OutputInterface $output): Connection { diff --git a/apps/files/lib/Command/ScanAppData.php b/apps/files/lib/Command/ScanAppData.php index 61f4b6f3ba2..635651c8160 100644 --- a/apps/files/lib/Command/ScanAppData.php +++ b/apps/files/lib/Command/ScanAppData.php @@ -1,4 +1,5 @@ execTime); # convert seconds into HH:MM:SS form - return sprintf('%02d:%02d:%02d', (int)($secs / 3600), ((int)($secs / 60) % 60), (int)$secs % 60); + return sprintf('%02d:%02d:%02d', (int) ($secs / 3600), ((int) ($secs / 60) % 60), (int) $secs % 60); } protected function reconnectToDatabase(OutputInterface $output): Connection { - /** @var Connection $connection*/ + /** @var Connection $connection */ $connection = \OC::$server->get(Connection::class); try { $connection->close(); diff --git a/apps/files/lib/Command/TransferOwnership.php b/apps/files/lib/Command/TransferOwnership.php index db4c19dc54e..edc73e62c38 100644 --- a/apps/files/lib/Command/TransferOwnership.php +++ b/apps/files/lib/Command/TransferOwnership.php @@ -78,12 +78,12 @@ class TransferOwnership extends Command { $destinationUserObject = $this->userManager->get($input->getArgument('destination-user')); if (!$sourceUserObject instanceof IUser) { - $output->writeln("Unknown source user " . $input->getArgument('source-user') . ""); + $output->writeln('Unknown source user ' . $input->getArgument('source-user') . ''); return self::FAILURE; } if (!$destinationUserObject instanceof IUser) { - $output->writeln("Unknown destination user " . $input->getArgument('destination-user') . ""); + $output->writeln('Unknown destination user ' . $input->getArgument('destination-user') . ''); return self::FAILURE; } @@ -105,7 +105,7 @@ class TransferOwnership extends Command { } break; default: - $output->writeln("Option --transfer-incoming-shares: wrong usage. Transfer aborted."); + $output->writeln('Option --transfer-incoming-shares: wrong usage. Transfer aborted.'); return self::FAILURE; } @@ -119,7 +119,7 @@ class TransferOwnership extends Command { $includeIncoming ); } catch (TransferOwnershipException $e) { - $output->writeln("" . $e->getMessage() . ""); + $output->writeln('' . $e->getMessage() . ''); return $e->getCode() !== 0 ? $e->getCode() : self::FAILURE; } diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index eb30601a937..27d41f8a016 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -339,7 +339,7 @@ class ApiController extends Controller { #[NoAdminRequired] public function setViewConfig(string $view, string $key, $value): JSONResponse { try { - $this->viewConfig->setConfig($view, $key, (string)$value); + $this->viewConfig->setConfig($view, $key, (string) $value); } catch (\InvalidArgumentException $e) { return new JSONResponse(['message' => $e->getMessage()], Http::STATUS_BAD_REQUEST); } @@ -368,7 +368,7 @@ class ApiController extends Controller { #[NoAdminRequired] public function setConfig(string $key, $value): JSONResponse { try { - $this->userConfig->setConfig($key, (string)$value); + $this->userConfig->setConfig($key, (string) $value); } catch (\InvalidArgumentException $e) { return new JSONResponse(['message' => $e->getMessage()], Http::STATUS_BAD_REQUEST); } diff --git a/apps/files/lib/Controller/DirectEditingController.php b/apps/files/lib/Controller/DirectEditingController.php index 693587f9c8a..422bacf9448 100644 --- a/apps/files/lib/Controller/DirectEditingController.php +++ b/apps/files/lib/Controller/DirectEditingController.php @@ -1,4 +1,5 @@ $recipient, 'nodeName' => $node->getName(), ]) - ->setObject('transfer', (string)$transferOwnership->getId()); + ->setObject('transfer', (string) $transferOwnership->getId()); $this->notificationManager->notify($notification); @@ -146,7 +146,7 @@ class TransferOwnershipController extends OCSController { $notification = $this->notificationManager->createNotification(); $notification->setApp('files') - ->setObject('transfer', (string)$id); + ->setObject('transfer', (string) $id); $this->notificationManager->markProcessed($notification); return new DataResponse([], Http::STATUS_OK); @@ -177,7 +177,7 @@ class TransferOwnershipController extends OCSController { $notification = $this->notificationManager->createNotification(); $notification->setApp('files') - ->setObject('transfer', (string)$id); + ->setObject('transfer', (string) $id); $this->notificationManager->markProcessed($notification); $this->mapper->delete($transferOwnership); diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index 66c0c1cf8f0..5c7b021ffb3 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -88,7 +88,7 @@ class ViewController extends Controller { // This is the entry point from the `/f/{fileid}` URL which is hardcoded in the server. try { - return $this->redirectToFile((int)$fileid, $openfile); + return $this->redirectToFile((int) $fileid, $openfile); } catch (NotFoundException $e) { // Keep the fileid even if not found, it will be used // to detect the file could not be found and warn the user @@ -132,7 +132,7 @@ class ViewController extends Controller { public function index($dir = '', $view = '', $fileid = null) { if ($fileid !== null && $view !== 'trashbin') { try { - return $this->redirectToFileIfInTrashbin((int)$fileid); + return $this->redirectToFileIfInTrashbin((int) $fileid); } catch (NotFoundException $e) { } } @@ -149,14 +149,14 @@ class ViewController extends Controller { // in the correct folder if ($fileid && $dir !== '') { $baseFolder = $this->rootFolder->getUserFolder($userId); - $nodes = $baseFolder->getById((int)$fileid); + $nodes = $baseFolder->getById((int) $fileid); if (!empty($nodes)) { $nodePath = $baseFolder->getRelativePath($nodes[0]->getPath()); $relativePath = $nodePath ? dirname($nodePath) : ''; // If the requested path does not contain the file id // or if the requested path is not the file id itself if (count($nodes) === 1 && $relativePath !== $dir && $nodePath !== $dir) { - return $this->redirectToFile((int)$fileid); + return $this->redirectToFile((int) $fileid); } } } diff --git a/apps/files/lib/Listener/SyncLivePhotosListener.php b/apps/files/lib/Listener/SyncLivePhotosListener.php index 6df9b8d6e95..17242d448a9 100644 --- a/apps/files/lib/Listener/SyncLivePhotosListener.php +++ b/apps/files/lib/Listener/SyncLivePhotosListener.php @@ -94,7 +94,7 @@ class SyncLivePhotosListener implements IEventListener { $targetName = $targetFile->getName(); $peerTargetName = substr($targetName, 0, -strlen($sourceExtension)) . $peerFileExtension; - if (!str_ends_with($targetName, "." . $sourceExtension)) { + if (!str_ends_with($targetName, '.' . $sourceExtension)) { throw new AbortedEventException('Cannot change the extension of a Live Photo'); } @@ -165,12 +165,12 @@ class SyncLivePhotosListener implements IEventListener { /** @var FilesMetadata $targetMetadata */ $targetMetadata = $this->filesMetadataManager->getMetadata($targetFile->getId(), true); $targetMetadata->setStorageId($targetFile->getStorage()->getCache()->getNumericStorageId()); - $targetMetadata->setString('files-live-photo', (string)$targetPeerFile->getId()); + $targetMetadata->setString('files-live-photo', (string) $targetPeerFile->getId()); $this->filesMetadataManager->saveMetadata($targetMetadata); /** @var FilesMetadata $peerMetadata */ $peerMetadata = $this->filesMetadataManager->getMetadata($targetPeerFile->getId(), true); $peerMetadata->setStorageId($targetPeerFile->getStorage()->getCache()->getNumericStorageId()); - $peerMetadata->setString('files-live-photo', (string)$targetFile->getId()); + $peerMetadata->setString('files-live-photo', (string) $targetFile->getId()); $this->filesMetadataManager->saveMetadata($peerMetadata); } @@ -188,7 +188,7 @@ class SyncLivePhotosListener implements IEventListener { unset($this->pendingDeletion[$peerFile->getId()]); return; } else { - throw new AbortedEventException("Cannot delete the video part of a live photo"); + throw new AbortedEventException('Cannot delete the video part of a live photo'); } } else { $this->pendingDeletion[$deletedFile->getId()] = true; diff --git a/apps/files/lib/Notification/Notifier.php b/apps/files/lib/Notification/Notifier.php index 89ddbb9b6ec..12ae2593e87 100644 --- a/apps/files/lib/Notification/Notifier.php +++ b/apps/files/lib/Notification/Notifier.php @@ -275,7 +275,7 @@ class Notifier implements INotifier, IDismissableNotifier { // TODO: This should all be moved to a service that also the transferownershipController uses. try { - $transferOwnership = $this->mapper->getById((int)$notification->getObjectId()); + $transferOwnership = $this->mapper->getById((int) $notification->getObjectId()); } catch (DoesNotExistException $e) { return; } @@ -295,7 +295,7 @@ class Notifier implements INotifier, IDismissableNotifier { 'targetUser' => $transferOwnership->getTargetUser(), 'nodeName' => $transferOwnership->getNodeName() ]) - ->setObject('transfer', (string)$transferOwnership->getId()); + ->setObject('transfer', (string) $transferOwnership->getId()); $this->notificationManager->notify($notification); $this->mapper->delete($transferOwnership); diff --git a/apps/files/lib/Search/FilesSearchProvider.php b/apps/files/lib/Search/FilesSearchProvider.php index 950c8b14ab6..bcb8c1482aa 100644 --- a/apps/files/lib/Search/FilesSearchProvider.php +++ b/apps/files/lib/Search/FilesSearchProvider.php @@ -144,7 +144,7 @@ class FilesSearchProvider implements IFilteringProvider { $this->urlGenerator->getAbsoluteURL($link), $icon, ); - $searchResultEntry->addAttribute('fileId', (string)$result->getId()); + $searchResultEntry->addAttribute('fileId', (string) $result->getId()); $searchResultEntry->addAttribute('path', $path); return $searchResultEntry; }, $userFolder->search($fileQuery)), diff --git a/apps/files/lib/Service/DirectEditingService.php b/apps/files/lib/Service/DirectEditingService.php index c21742d25ea..8816c11bb01 100644 --- a/apps/files/lib/Service/DirectEditingService.php +++ b/apps/files/lib/Service/DirectEditingService.php @@ -1,4 +1,5 @@ getString('files-live-photo'); + return (int) $metadata->getString('files-live-photo'); } } diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php index 2f3cb6788c4..055b3233bc0 100644 --- a/apps/files/lib/Service/OwnershipTransferService.php +++ b/apps/files/lib/Service/OwnershipTransferService.php @@ -80,7 +80,7 @@ class OwnershipTransferService { // If encryption is on we have to ensure the user has logged in before and that all encryption modules are ready if (($this->encryptionManager->isEnabled() && $destinationUser->getLastLogin() === 0) || !$this->encryptionManager->isReadyForUser($destinationUid)) { - throw new TransferOwnershipException("The target user is not ready to accept files. The user has at least to have logged in once.", 2); + throw new TransferOwnershipException('The target user is not ready to accept files. The user has at least to have logged in once.', 2); } // setup filesystem @@ -121,7 +121,7 @@ class OwnershipTransferService { } if ($move && !$firstLogin && count($view->getDirectoryContent($finalTarget)) > 0) { - throw new TransferOwnershipException("Destination path does not exists or is not empty", 1); + throw new TransferOwnershipException('Destination path does not exists or is not empty', 1); } @@ -277,10 +277,10 @@ class OwnershipTransferService { // no file is allowed to be encrypted if (!empty($encryptedFiles)) { - $output->writeln("Some files are encrypted - please decrypt them first."); + $output->writeln('Some files are encrypted - please decrypt them first.'); foreach ($encryptedFiles as $encryptedFile) { /** @var FileInfo $encryptedFile */ - $output->writeln(" " . $encryptedFile->getPath()); + $output->writeln(' ' . $encryptedFile->getPath()); } throw new TransferOwnershipException('Some files are encrypted - please decrypt them first.', 1); } @@ -414,7 +414,7 @@ class OwnershipTransferService { $finalTarget = $finalTarget . '/' . basename($sourcePath); } if ($view->rename($sourcePath, $finalTarget, ['checkSubMounts' => false]) === false) { - throw new TransferOwnershipException("Could not transfer files.", 1); + throw new TransferOwnershipException('Could not transfer files.', 1); } if (!is_dir("$sourceUid/files")) { // because the files folder is moved away we need to recreate it @@ -433,7 +433,7 @@ class OwnershipTransferService { array $shares, OutputInterface $output, ):void { - $output->writeln("Restoring shares ..."); + $output->writeln('Restoring shares ...'); $progress = new ProgressBar($output, count($shares)); foreach ($shares as ['share' => $share, 'suffix' => $suffix]) { @@ -502,7 +502,7 @@ class OwnershipTransferService { string $path, string $finalTarget, bool $move): void { - $output->writeln("Restoring incoming shares ..."); + $output->writeln('Restoring incoming shares ...'); $progress = new ProgressBar($output, count($sourceShares)); $prefix = "$destinationUid/files"; $finalShareTarget = ''; diff --git a/apps/files/lib/Service/TagService.php b/apps/files/lib/Service/TagService.php index 4737938ab52..4bb43145e4a 100644 --- a/apps/files/lib/Service/TagService.php +++ b/apps/files/lib/Service/TagService.php @@ -53,7 +53,7 @@ class TagService { * replace the actual tag selection. * * @param string $path path - * @param array $tags array of tags + * @param array $tags array of tags * @return array list of tags * @throws \OCP\Files\NotFoundException if the file does not exist */ diff --git a/apps/files/lib/Service/UserConfig.php b/apps/files/lib/Service/UserConfig.php index c2339965793..f2e5982bff7 100644 --- a/apps/files/lib/Service/UserConfig.php +++ b/apps/files/lib/Service/UserConfig.php @@ -1,4 +1,5 @@ writeln((string)$value); + $output->writeln((string) $value); } /** diff --git a/apps/files_external/lib/Command/Create.php b/apps/files_external/lib/Command/Create.php index 4396d2e2b13..6c29485e0eb 100644 --- a/apps/files_external/lib/Command/Create.php +++ b/apps/files_external/lib/Command/Create.php @@ -1,4 +1,5 @@ getOption('user'); + $user = (string) $input->getOption('user'); $mountPoint = $input->getArgument('mount_point'); $storageIdentifier = $input->getArgument('storage_backend'); $authIdentifier = $input->getArgument('authentication_backend'); @@ -140,7 +141,7 @@ class Create extends Base { if ($input->getOption('output') === self::OUTPUT_FORMAT_PLAIN) { $output->writeln('Storage created with id ' . $mount->getId() . ''); } else { - $output->writeln((string)$mount->getId()); + $output->writeln((string) $mount->getId()); } } return self::SUCCESS; diff --git a/apps/files_external/lib/Command/Delete.php b/apps/files_external/lib/Command/Delete.php index 1c2bfe39fb0..4a2b3e08c40 100644 --- a/apps/files_external/lib/Command/Delete.php +++ b/apps/files_external/lib/Command/Delete.php @@ -1,4 +1,5 @@ getApplicableUsers() === $mount->getApplicableUsers() && $existingMount->getBackendOptions() === $mount->getBackendOptions() ) { - $output->writeln("Duplicate mount (" . $mount->getMountPoint() . ")"); + $output->writeln('Duplicate mount (' . $mount->getMountPoint() . ')'); return self::FAILURE; } } diff --git a/apps/files_external/lib/Command/ListCommand.php b/apps/files_external/lib/Command/ListCommand.php index fabcce67775..b077db55290 100644 --- a/apps/files_external/lib/Command/ListCommand.php +++ b/apps/files_external/lib/Command/ListCommand.php @@ -1,4 +1,5 @@ globalService->getStorageForAllUsers(); $userId = self::ALL; } else { - $userId = (string)$input->getArgument('user_id'); + $userId = (string) $input->getArgument('user_id'); $storageService = $this->getStorageService($userId); $mounts = $storageService->getAllStorages(); } @@ -85,11 +86,11 @@ class ListCommand extends Base { $output->writeln('[]'); } else { if ($userId === self::ALL) { - $output->writeln("No mounts configured"); + $output->writeln('No mounts configured'); } elseif ($userId) { $output->writeln("No mounts configured by $userId"); } else { - $output->writeln("No admin mounts configured"); + $output->writeln('No admin mounts configured'); } } return; diff --git a/apps/files_external/lib/Command/Notify.php b/apps/files_external/lib/Command/Notify.php index a4e7edf0207..6dfbfdc976d 100644 --- a/apps/files_external/lib/Command/Notify.php +++ b/apps/files_external/lib/Command/Notify.php @@ -136,7 +136,7 @@ class Notify extends StorageAuthBase { $storageIds = array_values(array_unique($storageIds)); if ($dryRun) { - $output->writeln(" dry-run: skipping database write"); + $output->writeln(' dry-run: skipping database write'); } else { $result = $this->updateParent($storageIds, $parent); if ($result === 0) { @@ -168,7 +168,7 @@ class Notify extends StorageAuthBase { } private function getStorageIds(int $mountId, string $path): array { - $pathHash = md5(trim((string)\OC_Util::normalizeUnicode($path), '/')); + $pathHash = md5(trim((string) \OC_Util::normalizeUnicode($path), '/')); $qb = $this->connection->getQueryBuilder(); return $qb ->select('storage_id', 'user_id') @@ -181,7 +181,7 @@ class Notify extends StorageAuthBase { } private function updateParent(array $storageIds, string $parent): int { - $pathHash = md5(trim((string)\OC_Util::normalizeUnicode($parent), '/')); + $pathHash = md5(trim((string) \OC_Util::normalizeUnicode($parent), '/')); $qb = $this->connection->getQueryBuilder(); return $qb ->update('filecache') @@ -215,7 +215,7 @@ class Notify extends StorageAuthBase { private function selfTest(IStorage $storage, INotifyHandler $notifyHandler, OutputInterface $output): void { usleep(100 * 1000); //give time for the notify to start if (!$storage->file_put_contents('/.nc_test_file.txt', 'test content')) { - $output->writeln("Failed to create test file for self-test"); + $output->writeln('Failed to create test file for self-test'); return; } $storage->mkdir('/.nc_test_folder'); diff --git a/apps/files_external/lib/Command/Option.php b/apps/files_external/lib/Command/Option.php index 6051c9c5fbd..5567dd37694 100644 --- a/apps/files_external/lib/Command/Option.php +++ b/apps/files_external/lib/Command/Option.php @@ -1,4 +1,5 @@ writeln((string)$value); + $output->writeln((string) $value); } /** diff --git a/apps/files_external/lib/Command/StorageAuthBase.php b/apps/files_external/lib/Command/StorageAuthBase.php index 6f830a08a60..3decc6a50e0 100644 --- a/apps/files_external/lib/Command/StorageAuthBase.php +++ b/apps/files_external/lib/Command/StorageAuthBase.php @@ -29,7 +29,7 @@ abstract class StorageAuthBase extends Base { private function getUserOption(InputInterface $input): ?string { if ($input->getOption('user')) { - return (string)$input->getOption('user'); + return (string) $input->getOption('user'); } return $_ENV['NOTIFY_USER'] ?? $_SERVER['NOTIFY_USER'] ?? null; @@ -37,7 +37,7 @@ abstract class StorageAuthBase extends Base { private function getPasswordOption(InputInterface $input): ?string { if ($input->getOption('password')) { - return (string)$input->getOption('password'); + return (string) $input->getOption('password'); } return $_ENV['NOTIFY_PASSWORD'] ?? $_SERVER['NOTIFY_PASSWORD'] ?? null; @@ -52,7 +52,7 @@ abstract class StorageAuthBase extends Base { protected function createStorage(InputInterface $input, OutputInterface $output): array { try { /** @var StorageConfig|null $mount */ - $mount = $this->globalService->getStorage((int)$input->getArgument('mount_id')); + $mount = $this->globalService->getStorage((int) $input->getArgument('mount_id')); } catch (NotFoundException $e) { $output->writeln('Mount not found'); return [null, null]; diff --git a/apps/files_external/lib/Command/Verify.php b/apps/files_external/lib/Command/Verify.php index 1455e427b77..37ea93d7df5 100644 --- a/apps/files_external/lib/Command/Verify.php +++ b/apps/files_external/lib/Command/Verify.php @@ -1,4 +1,5 @@ sanitizedPlaceholder = trim(strtolower($this->placeholder)); - if (!(bool)\preg_match('/^[a-z0-9]*$/', $this->sanitizedPlaceholder)) { + if (!(bool) \preg_match('/^[a-z0-9]*$/', $this->sanitizedPlaceholder)) { throw new \RuntimeException(sprintf( 'Invalid placeholder %s, only [a-z0-9] are allowed', $this->sanitizedPlaceholder )); diff --git a/apps/files_external/lib/Config/UserContext.php b/apps/files_external/lib/Config/UserContext.php index 5d9d2910ea2..ac5870c9487 100644 --- a/apps/files_external/lib/Config/UserContext.php +++ b/apps/files_external/lib/Config/UserContext.php @@ -1,4 +1,5 @@ getCode() ? $e->getCode() : StorageNotAvailableException::STATUS_INDETERMINATE; $storage->setStatus( - (int)$status, + (int) $status, $this->l10n->t('Insufficient data: %s', [$e->getMessage()]) ); } catch (StorageNotAvailableException $e) { $storage->setStatus( - (int)$e->getCode(), + (int) $e->getCode(), $this->l10n->t('%s', [$e->getMessage()]) ); } catch (\Exception $e) { diff --git a/apps/files_external/lib/Controller/UserGlobalStoragesController.php b/apps/files_external/lib/Controller/UserGlobalStoragesController.php index 3896eb4b2dc..ec6a25ecc44 100644 --- a/apps/files_external/lib/Controller/UserGlobalStoragesController.php +++ b/apps/files_external/lib/Controller/UserGlobalStoragesController.php @@ -1,4 +1,5 @@ getCredentials($user); - $loginKey = $storage->getBackendOption("login_ldap_attr"); + $loginKey = $storage->getBackendOption('login_ldap_attr'); if ($loginKey) { $backend = $user->getBackend(); if ($backend instanceof IUserBackend && $backend->getBackendName() === 'LDAP') { diff --git a/apps/files_external/lib/Lib/Auth/Password/Password.php b/apps/files_external/lib/Lib/Auth/Password/Password.php index e3393233840..d4291148e3e 100644 --- a/apps/files_external/lib/Lib/Auth/Password/Password.php +++ b/apps/files_external/lib/Lib/Auth/Password/Password.php @@ -1,4 +1,5 @@ flags & $flag); + return (bool) ($this->flags & $flag); } /** diff --git a/apps/files_external/lib/Lib/DependencyTrait.php b/apps/files_external/lib/Lib/DependencyTrait.php index 1d112532128..644132b82bc 100644 --- a/apps/files_external/lib/Lib/DependencyTrait.php +++ b/apps/files_external/lib/Lib/DependencyTrait.php @@ -1,4 +1,5 @@ parameters for mechanism */ private array $parameters = []; diff --git a/apps/files_external/lib/Lib/IFrontendDefinition.php b/apps/files_external/lib/Lib/IFrontendDefinition.php index 0184d5f536c..c8b06a1c30b 100644 --- a/apps/files_external/lib/Lib/IFrontendDefinition.php +++ b/apps/files_external/lib/Lib/IFrontendDefinition.php @@ -1,4 +1,5 @@ objectCache[$key]) && !isset($this->objectCache[$key]["Key"])) { + if (is_array($this->objectCache[$key]) && !isset($this->objectCache[$key]['Key'])) { /** @psalm-suppress InvalidArgument Psalm doesn't understand nested arrays well */ - $this->objectCache[$key]["Key"] = $key; + $this->objectCache[$key]['Key'] = $key; } return $this->objectCache[$key]; } @@ -340,12 +341,12 @@ class AmazonS3 extends \OC\Files\Storage\Common { */ private function getContentLength($path) { if (isset($this->filesCache[$path])) { - return (int)$this->filesCache[$path]['ContentLength']; + return (int) $this->filesCache[$path]['ContentLength']; } $result = $this->headObject($path); if (isset($result['ContentLength'])) { - return (int)$result['ContentLength']; + return (int) $result['ContentLength']; } return 0; @@ -690,7 +691,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { 'storage_mtime' => strtotime($object['LastModified']), 'etag' => trim($object['ETag'], '"'), 'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE, - 'size' => (int)($object['Size'] ?? $object['ContentLength']), + 'size' => (int) ($object['Size'] ?? $object['ContentLength']), ]; } @@ -766,7 +767,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { } if (!is_resource($stream)) { - throw new \InvalidArgumentException("Invalid stream provided"); + throw new \InvalidArgumentException('Invalid stream provided'); } $path = $this->normalizePath($path); diff --git a/apps/files_external/lib/Lib/Storage/FTP.php b/apps/files_external/lib/Lib/Storage/FTP.php index 0af6ca141bb..9f75269aa70 100644 --- a/apps/files_external/lib/Lib/Storage/FTP.php +++ b/apps/files_external/lib/Lib/Storage/FTP.php @@ -1,4 +1,5 @@ secure = ($params['secure'] === 'true'); } else { - $this->secure = (bool)$params['secure']; + $this->secure = (bool) $params['secure']; } } else { $this->secure = false; @@ -66,11 +67,11 @@ class FTP extends Common { $this->password ); } catch (\Exception $e) { - throw new StorageNotAvailableException("Failed to create ftp connection", 0, $e); + throw new StorageNotAvailableException('Failed to create ftp connection', 0, $e); } if ($this->utf8Mode) { if (!$this->connection->setUtf8Mode()) { - throw new StorageNotAvailableException("Could not set UTF-8 mode"); + throw new StorageNotAvailableException('Could not set UTF-8 mode'); } } } @@ -219,7 +220,7 @@ class FTP extends Common { } public function is_dir($path) { - if ($path === "") { + if ($path === '') { return true; } if ($this->getConnection()->chdir($this->buildPath($path)) === true) { diff --git a/apps/files_external/lib/Lib/Storage/FtpConnection.php b/apps/files_external/lib/Lib/Storage/FtpConnection.php index 8855dffbc0f..ee960313371 100644 --- a/apps/files_external/lib/Lib/Storage/FtpConnection.php +++ b/apps/files_external/lib/Lib/Storage/FtpConnection.php @@ -23,11 +23,11 @@ class FtpConnection { } if ($connection === false) { - throw new \Exception("Failed to connect to ftp"); + throw new \Exception('Failed to connect to ftp'); } if (ftp_login($connection, $username, $password) === false) { - throw new \Exception("Failed to connect to login to ftp"); + throw new \Exception('Failed to connect to login to ftp'); } ftp_pasv($connection, true); @@ -39,7 +39,7 @@ class FtpConnection { } public function setUtf8Mode(): bool { - $response = ftp_raw($this->connection, "OPTS UTF8 ON"); + $response = ftp_raw($this->connection, 'OPTS UTF8 ON'); return substr($response[0], 0, 3) === '200'; } @@ -75,8 +75,8 @@ class FtpConnection { $result = @ftp_mdtm($this->connection, $path); // filezilla doesn't like empty path with mdtm - if ($result === -1 && $path === "") { - $result = @ftp_mdtm($this->connection, "/"); + if ($result === -1 && $path === '') { + $result = @ftp_mdtm($this->connection, '/'); } return $result; } @@ -150,13 +150,13 @@ class FtpConnection { $parsedDate = (new \DateTime()) ->setTimestamp(strtotime("$month $day $time")); - $tomorrow = (new \DateTime())->add(new \DateInterval("P1D")); + $tomorrow = (new \DateTime())->add(new \DateInterval('P1D')); // since the provided date doesn't include the year, we either set it to the correct year // or when the date would otherwise be in the future (by more then 1 day to account for timezone errors) // we use last year if ($parsedDate > $tomorrow) { - $parsedDate = $parsedDate->sub(new \DateInterval("P1Y")); + $parsedDate = $parsedDate->sub(new \DateInterval('P1Y')); } $formattedDate = $parsedDate @@ -167,7 +167,7 @@ class FtpConnection { 'name' => $name, 'modify' => $formattedDate, 'perm' => $this->normalizePermissions($permissions), - 'size' => (int)$size, + 'size' => (int) $size, ]; } @@ -216,7 +216,7 @@ class FtpConnection { 'name' => $name, 'modify' => $formattedDate, 'perm' => ($type === 'file') ? 'adfrw' : 'flcdmpe', - 'size' => (int)$size, + 'size' => (int) $size, ]; } } diff --git a/apps/files_external/lib/Lib/Storage/OwnCloud.php b/apps/files_external/lib/Lib/Storage/OwnCloud.php index d5562a3cb32..20175e897f9 100644 --- a/apps/files_external/lib/Lib/Storage/OwnCloud.php +++ b/apps/files_external/lib/Lib/Storage/OwnCloud.php @@ -1,4 +1,5 @@ getConnection()->stat($this->absPath($path)); - $mtime = isset($stat['mtime']) ? (int)$stat['mtime'] : -1; - $size = isset($stat['size']) ? (int)$stat['size'] : 0; + $mtime = isset($stat['mtime']) ? (int) $stat['mtime'] : -1; + $size = isset($stat['size']) ? (int) $stat['size'] : 0; return [ 'mtime' => $mtime, @@ -482,7 +483,7 @@ class SFTP extends Common { $size = $writtenSize; }); if (!$stream) { - throw new \Exception("Failed to wrap stream"); + throw new \Exception('Failed to wrap stream'); } } /** @psalm-suppress InternalMethod */ @@ -490,11 +491,11 @@ class SFTP extends Common { fclose($stream); if ($result) { if ($size === null) { - throw new \Exception("Failed to get written size from sftp storage wrapper"); + throw new \Exception('Failed to get written size from sftp storage wrapper'); } return $size; } else { - throw new \Exception("Failed to write steam to sftp storage"); + throw new \Exception('Failed to write steam to sftp storage'); } } diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index 50ba29ecf13..7ea615c7394 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -1,4 +1,5 @@ 0) { $options->setTimeout($timeout); } @@ -271,7 +272,7 @@ class SMB extends Common implements INotifyStorage { } } catch (ConnectException $e) { $this->logger->error('Error while getting folder content', ['exception' => $e]); - throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e); + throw new StorageNotAvailableException($e->getMessage(), (int) $e->getCode(), $e); } catch (NotFoundException $e) { throw new \OCP\Files\NotFoundException($e->getMessage(), 0, $e); } @@ -425,7 +426,7 @@ class SMB extends Common implements INotifyStorage { return false; } catch (ConnectException $e) { $this->logger->error('Error while deleting file', ['exception' => $e]); - throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e); + throw new StorageNotAvailableException($e->getMessage(), (int) $e->getCode(), $e); } } @@ -509,10 +510,10 @@ class SMB extends Common implements INotifyStorage { } catch (ForbiddenException $e) { return false; } catch (OutOfSpaceException $e) { - throw new EntityTooLargeException("not enough available space to create file", 0, $e); + throw new EntityTooLargeException('not enough available space to create file', 0, $e); } catch (ConnectException $e) { $this->logger->error('Error while opening file', ['exception' => $e]); - throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e); + throw new StorageNotAvailableException($e->getMessage(), (int) $e->getCode(), $e); } } @@ -539,7 +540,7 @@ class SMB extends Common implements INotifyStorage { return false; } catch (ConnectException $e) { $this->logger->error('Error while removing folder', ['exception' => $e]); - throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e); + throw new StorageNotAvailableException($e->getMessage(), (int) $e->getCode(), $e); } } @@ -552,10 +553,10 @@ class SMB extends Common implements INotifyStorage { } return false; } catch (OutOfSpaceException $e) { - throw new EntityTooLargeException("not enough available space to create file", 0, $e); + throw new EntityTooLargeException('not enough available space to create file', 0, $e); } catch (ConnectException $e) { $this->logger->error('Error while creating file', ['exception' => $e]); - throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e); + throw new StorageNotAvailableException($e->getMessage(), (int) $e->getCode(), $e); } } @@ -652,7 +653,7 @@ class SMB extends Common implements INotifyStorage { return true; } catch (ConnectException $e) { $this->logger->error('Error while creating folder', ['exception' => $e]); - throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e); + throw new StorageNotAvailableException($e->getMessage(), (int) $e->getCode(), $e); } catch (Exception $e) { return false; } @@ -678,7 +679,7 @@ class SMB extends Common implements INotifyStorage { } catch (\OCP\Files\ForbiddenException $e) { return false; } catch (ConnectException $e) { - throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e); + throw new StorageNotAvailableException($e->getMessage(), (int) $e->getCode(), $e); } } @@ -722,7 +723,7 @@ class SMB extends Common implements INotifyStorage { */ public static function checkDependencies() { return ( - (bool)\OC_Helper::findBinaryPath('smbclient') + (bool) \OC_Helper::findBinaryPath('smbclient') || NativeServer::available(new System()) ) ? true : ['smbclient']; } diff --git a/apps/files_external/lib/Lib/Storage/StreamWrapper.php b/apps/files_external/lib/Lib/Storage/StreamWrapper.php index 2928c081505..bff6b3de545 100644 --- a/apps/files_external/lib/Lib/Storage/StreamWrapper.php +++ b/apps/files_external/lib/Lib/Storage/StreamWrapper.php @@ -1,4 +1,5 @@ getHost()) { $params['bucket'] = basename($bucketUrl->getPath()); - $params['endpoint_url'] = (string)$bucketUrl->withPath(dirname($bucketUrl->getPath())); + $params['endpoint_url'] = (string) $bucketUrl->withPath(dirname($bucketUrl->getPath())); } if (empty($params['url'])) { @@ -324,7 +324,7 @@ class Swift extends \OC\Files\Storage\Common { } $stat = []; - $stat['size'] = (int)$object->contentLength; + $stat['size'] = (int) $object->contentLength; $stat['mtime'] = $mtime; $stat['atime'] = time(); return $stat; @@ -425,7 +425,7 @@ class Swift extends \OC\Files\Storage\Common { if (is_null($mtime)) { $mtime = time(); } - $metadata = ['timestamp' => (string)$mtime]; + $metadata = ['timestamp' => (string) $mtime]; if ($this->file_exists($path)) { if ($this->is_dir($path) && $path !== '.') { $path .= '/'; diff --git a/apps/files_external/lib/Lib/StorageConfig.php b/apps/files_external/lib/Lib/StorageConfig.php index 682516c73ba..be3b123083d 100644 --- a/apps/files_external/lib/Lib/StorageConfig.php +++ b/apps/files_external/lib/Lib/StorageConfig.php @@ -1,4 +1,5 @@ getType()) { case \OCA\Files_External\Lib\DefinitionParameter::VALUE_BOOLEAN: - $value = (bool)$value; + $value = (bool) $value; break; } $backendOptions[$key] = $value; diff --git a/apps/files_external/lib/Lib/StorageModifierTrait.php b/apps/files_external/lib/Lib/StorageModifierTrait.php index 7cc7a15605c..f0f62a8b1d6 100644 --- a/apps/files_external/lib/Lib/StorageModifierTrait.php +++ b/apps/files_external/lib/Lib/StorageModifierTrait.php @@ -1,4 +1,5 @@ fetch()) { - $config = $this->getStorageConfig((int)$mount['mount_id']); + $config = $this->getStorageConfig((int) $mount['mount_id']); $hostname = $config['hostname']; $bucket = $config['bucket']; $key = $config['key']; diff --git a/apps/files_external/lib/MountConfig.php b/apps/files_external/lib/MountConfig.php index b057fb810bd..f81537a7cf4 100644 --- a/apps/files_external/lib/MountConfig.php +++ b/apps/files_external/lib/MountConfig.php @@ -1,4 +1,5 @@ closeCursor(); foreach ($result as $row) { - if ((int)$row['count'] > 1) { + if ((int) $row['count'] > 1) { $this->removeApplicable($row['mount_id'], $applicableType, $applicableId); } else { $this->removeMount($row['mount_id']); @@ -402,8 +403,8 @@ class DBConfigService { $options = $this->getOptionsForMounts($mountIds); return array_map(function ($mount, $applicable, $config, $options) { - $mount['type'] = (int)$mount['type']; - $mount['priority'] = (int)$mount['priority']; + $mount['type'] = (int) $mount['type']; + $mount['priority'] = (int) $mount['priority']; $mount['applicable'] = $applicable; $mount['config'] = $config; $mount['options'] = $options; @@ -442,7 +443,7 @@ class DBConfigService { } foreach ($rows as $row) { if (isset($row['type'])) { - $row['type'] = (int)$row['type']; + $row['type'] = (int) $row['type']; } $result[$row['mount_id']][] = $row; } diff --git a/apps/files_external/lib/Service/GlobalStoragesService.php b/apps/files_external/lib/Service/GlobalStoragesService.php index c799007cc6d..8d29d520472 100644 --- a/apps/files_external/lib/Service/GlobalStoragesService.php +++ b/apps/files_external/lib/Service/GlobalStoragesService.php @@ -1,4 +1,5 @@ setType($mount['type']); - $config->setId((int)$mount['mount_id']); + $config->setId((int) $mount['mount_id']); return $config; } catch (\UnexpectedValueException $e) { // don't die if a storage backend doesn't exist diff --git a/apps/files_external/lib/Service/UserGlobalStoragesService.php b/apps/files_external/lib/Service/UserGlobalStoragesService.php index 58590b8d682..89f850d3910 100644 --- a/apps/files_external/lib/Service/UserGlobalStoragesService.php +++ b/apps/files_external/lib/Service/UserGlobalStoragesService.php @@ -1,4 +1,5 @@ t("Enable encryption"); -$l->t("Enable previews"); -$l->t("Enable sharing"); -$l->t("Check for changes"); -$l->t("Never"); -$l->t("Once every direct access"); +$l->t('Enable encryption'); +$l->t('Enable previews'); +$l->t('Enable sharing'); +$l->t('Check for changes'); +$l->t('Never'); +$l->t('Once every direct access'); $l->t('Read only'); \OCP\Util::addScript('files_external', 'settings'); @@ -64,7 +64,7 @@ function writeParameterInput($parameter, $options, $classes = []) { - +