aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2024-08-23 15:10:27 +0200
committerDaniel Kesselberg <mail@danielkesselberg.de>2024-08-25 19:34:58 +0200
commitaf6de04e9e141466dc229e444ff3f146f4a34765 (patch)
tree7b93f521865cdecdadb33637dea33bea242e7969 /apps
parent1cc6b3577fdbeadece7e4e6478e7f7755555b41a (diff)
downloadnextcloud-server-af6de04e9e141466dc229e444ff3f146f4a34765.tar.gz
nextcloud-server-af6de04e9e141466dc229e444ff3f146f4a34765.zip
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/admin_audit/lib/Actions/Files.php18
-rw-r--r--apps/cloud_federation_api/lib/Capabilities.php4
-rw-r--r--apps/cloud_federation_api/lib/Controller/RequestHandlerController.php2
-rw-r--r--apps/comments/lib/Activity/Listener.php4
-rw-r--r--apps/comments/lib/Activity/Provider.php2
-rw-r--r--apps/comments/lib/Search/LegacyProvider.php2
-rw-r--r--apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php4
-rw-r--r--apps/comments/tests/Unit/EventHandlerTest.php2
-rw-r--r--apps/comments/tests/Unit/Notification/ListenerTest.php2
-rw-r--r--apps/contactsinteraction/lib/AddressBook.php8
-rw-r--r--apps/contactsinteraction/lib/Card.php4
-rw-r--r--apps/contactsinteraction/lib/Db/CardSearchDao.php2
-rw-r--r--apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php4
-rw-r--r--apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php6
-rw-r--r--apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php2
-rw-r--r--apps/dav/lib/BackgroundJob/DeleteOutdatedSchedulingObjects.php2
-rw-r--r--apps/dav/lib/BackgroundJob/OutOfOfficeEventDispatcherJob.php2
-rw-r--r--apps/dav/lib/BackgroundJob/PruneOutdatedSyncTokensJob.php4
-rw-r--r--apps/dav/lib/BackgroundJob/RefreshWebcalJob.php2
-rw-r--r--apps/dav/lib/BackgroundJob/UploadCleanup.php4
-rw-r--r--apps/dav/lib/BulkUpload/BulkUploadPlugin.php14
-rw-r--r--apps/dav/lib/BulkUpload/MultipartRequestParser.php26
-rw-r--r--apps/dav/lib/CalDAV/Activity/Backend.php30
-rw-r--r--apps/dav/lib/CalDAV/Activity/Filter/Calendar.php4
-rw-r--r--apps/dav/lib/CalDAV/Activity/Filter/Todo.php4
-rw-r--r--apps/dav/lib/CalDAV/Activity/Setting/Calendar.php4
-rw-r--r--apps/dav/lib/CalDAV/Activity/Setting/Event.php4
-rw-r--r--apps/dav/lib/CalDAV/Activity/Setting/Todo.php4
-rw-r--r--apps/dav/lib/CalDAV/BirthdayService.php6
-rw-r--r--apps/dav/lib/CalDAV/CachedSubscriptionImpl.php4
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php98
-rw-r--r--apps/dav/lib/CalDAV/Calendar.php2
-rw-r--r--apps/dav/lib/CalDAV/CalendarImpl.php4
-rw-r--r--apps/dav/lib/CalDAV/CalendarObject.php2
-rw-r--r--apps/dav/lib/CalDAV/EventReader.php26
-rw-r--r--apps/dav/lib/CalDAV/EventReaderRDate.php6
-rw-r--r--apps/dav/lib/CalDAV/EventReaderRRule.php6
-rw-r--r--apps/dav/lib/CalDAV/Publishing/PublishPlugin.php2
-rw-r--r--apps/dav/lib/CalDAV/Reminder/Backend.php18
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php2
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php4
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php8
-rw-r--r--apps/dav/lib/CalDAV/Reminder/ReminderService.php54
-rw-r--r--apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php2
-rw-r--r--apps/dav/lib/CalDAV/RetentionService.php4
-rw-r--r--apps/dav/lib/CalDAV/Schedule/IMipService.php8
-rw-r--r--apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php4
-rw-r--r--apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php2
-rw-r--r--apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php2
-rw-r--r--apps/dav/lib/CalDAV/WebcalCaching/Plugin.php6
-rw-r--r--apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php8
-rw-r--r--apps/dav/lib/CardDAV/Activity/Backend.php22
-rw-r--r--apps/dav/lib/CardDAV/Activity/Filter.php4
-rw-r--r--apps/dav/lib/CardDAV/Activity/Provider/Base.php2
-rw-r--r--apps/dav/lib/CardDAV/Activity/Setting.php4
-rw-r--r--apps/dav/lib/CardDAV/AddressBookImpl.php34
-rw-r--r--apps/dav/lib/CardDAV/Card.php2
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php20
-rw-r--r--apps/dav/lib/CardDAV/ContactsManager.php6
-rw-r--r--apps/dav/lib/CardDAV/MultiGetExportPlugin.php2
-rw-r--r--apps/dav/lib/CardDAV/PhotoCache.php6
-rw-r--r--apps/dav/lib/CardDAV/SyncService.php2
-rw-r--r--apps/dav/lib/CardDAV/SystemAddressbook.php4
-rw-r--r--apps/dav/lib/CardDAV/UserAddressBooks.php2
-rw-r--r--apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php2
-rw-r--r--apps/dav/lib/Command/CreateAddressBook.php16
-rw-r--r--apps/dav/lib/Command/DeleteCalendar.php4
-rw-r--r--apps/dav/lib/Command/FixCalendarSyncCommand.php2
-rw-r--r--apps/dav/lib/Command/MoveCalendar.php10
-rw-r--r--apps/dav/lib/Command/SyncBirthdayCalendar.php2
-rw-r--r--apps/dav/lib/Comments/CommentNode.php2
-rw-r--r--apps/dav/lib/Comments/CommentsPlugin.php4
-rw-r--r--apps/dav/lib/Comments/EntityCollection.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/CachingTree.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/DavAclPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/Directory.php8
-rw-r--r--apps/dav/lib/Connector/Sabre/Exception/FileLocked.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesReportPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/ObjectTree.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/Principal.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/TagsPlugin.php2
-rw-r--r--apps/dav/lib/Controller/InvitationResponseController.php2
-rw-r--r--apps/dav/lib/DAV/PublicAuth.php4
-rw-r--r--apps/dav/lib/DAV/Sharing/Backend.php4
-rw-r--r--apps/dav/lib/DAV/Sharing/Plugin.php2
-rw-r--r--apps/dav/lib/DAV/ViewOnlyPlugin.php2
-rw-r--r--apps/dav/lib/Db/Absence.php2
-rw-r--r--apps/dav/lib/Direct/DirectFile.php2
-rw-r--r--apps/dav/lib/Events/CalendarDeletedEvent.php2
-rw-r--r--apps/dav/lib/Events/CalendarMovedToTrashEvent.php2
-rw-r--r--apps/dav/lib/Events/CalendarRestoredEvent.php2
-rw-r--r--apps/dav/lib/Listener/CalendarShareUpdateListener.php2
-rw-r--r--apps/dav/lib/Migration/BuildCalendarSearchIndex.php2
-rw-r--r--apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php4
-rw-r--r--apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php2
-rw-r--r--apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php2
-rw-r--r--apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php2
-rw-r--r--apps/dav/lib/Migration/Version1004Date20170926103422.php2
-rw-r--r--apps/dav/lib/Migration/Version1025Date20240308063933.php2
-rw-r--r--apps/dav/lib/Search/ACalendarSearchProvider.php4
-rw-r--r--apps/dav/lib/Search/ContactsSearchProvider.php10
-rw-r--r--apps/dav/lib/Search/EventsSearchProvider.php2
-rw-r--r--apps/dav/lib/SystemTag/SystemTagsInUseCollection.php4
-rw-r--r--apps/dav/lib/Upload/UploadFile.php2
-rw-r--r--apps/dav/lib/UserMigration/ContactsMigrator.php2
-rw-r--r--apps/dav/tests/unit/BackgroundJob/PruneOutdatedSyncTokensJobTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/CalDavBackendTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/CalendarImplTest.php4
-rw-r--r--apps/dav/tests/unit/CalDAV/CalendarTest.php4
-rw-r--r--apps/dav/tests/unit/CalDAV/EventReaderTest.php12
-rw-r--r--apps/dav/tests/unit/CalDAV/PublicCalendarTest.php4
-rw-r--r--apps/dav/tests/unit/CalDAV/Reminder/BackendTest.php6
-rw-r--r--apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php4
-rw-r--r--apps/dav/tests/unit/CalDAV/Schedule/IMipServiceTest.php14
-rw-r--r--apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php10
-rw-r--r--apps/dav/tests/unit/CalDAV/WebcalCaching/ConnectionTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php10
-rw-r--r--apps/dav/tests/unit/CardDAV/AddressBookImplTest.php10
-rw-r--r--apps/dav/tests/unit/CardDAV/CardDavBackendTest.php68
-rw-r--r--apps/dav/tests/unit/CardDAV/ConverterTest.php10
-rw-r--r--apps/dav/tests/unit/CardDAV/SystemAddressBookTest.php12
-rw-r--r--apps/dav/tests/unit/Command/ListCalendarsTest.php4
-rw-r--r--apps/dav/tests/unit/Command/MoveCalendarTest.php24
-rw-r--r--apps/dav/tests/unit/Comments/CommentsNodeTest.php2
-rw-r--r--apps/dav/tests/unit/Comments/CommentsPluginTest.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/AuthTest.php8
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php4
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php8
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FileTest.php48
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php10
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php8
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php4
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php60
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php2
-rw-r--r--apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php4
-rw-r--r--apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php12
-rw-r--r--apps/dav/tests/unit/Files/MultipartRequestParserTest.php38
-rw-r--r--apps/dav/tests/unit/Settings/CalDAVSettingsTest.php16
-rw-r--r--apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php32
-rw-r--r--apps/dav/tests/unit/Upload/AssemblyStreamTest.php2
-rw-r--r--apps/encryption/lib/Command/FixEncryptedVersion.php16
-rw-r--r--apps/encryption/lib/Command/FixKeyLocation.php46
-rw-r--r--apps/encryption/lib/Controller/SettingsController.php4
-rw-r--r--apps/encryption/lib/Crypto/Crypt.php6
-rw-r--r--apps/encryption/lib/Crypto/DecryptAll.php10
-rw-r--r--apps/encryption/lib/Crypto/EncryptAll.php16
-rw-r--r--apps/encryption/lib/Crypto/Encryption.php4
-rw-r--r--apps/encryption/lib/Exceptions/PrivateKeyMissingException.php2
-rw-r--r--apps/encryption/lib/Exceptions/PublicKeyMissingException.php2
-rw-r--r--apps/encryption/lib/HookManager.php2
-rw-r--r--apps/encryption/lib/Migration/SetMasterKeyStatus.php2
-rw-r--r--apps/encryption/lib/Settings/Admin.php4
-rw-r--r--apps/encryption/lib/Settings/Personal.php4
-rw-r--r--apps/encryption/templates/settings-admin.php30
-rw-r--r--apps/encryption/templates/settings-personal.php32
-rw-r--r--apps/encryption/tests/Command/FixEncryptedVersionTest.php22
-rw-r--r--apps/encryption/tests/Command/TestEnableMasterKey.php10
-rw-r--r--apps/encryption/tests/Controller/StatusControllerTest.php4
-rw-r--r--apps/encryption/tests/Crypto/CryptTest.php6
-rw-r--r--apps/encryption/tests/Crypto/DecryptAllTest.php12
-rw-r--r--apps/encryption/tests/Crypto/EncryptAllTest.php40
-rw-r--r--apps/encryption/tests/EncryptedStorageTest.php30
-rw-r--r--apps/encryption/tests/SessionTest.php6
-rw-r--r--apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php1
-rw-r--r--apps/federatedfilesharing/lib/Controller/RequestHandlerController.php4
-rw-r--r--apps/federatedfilesharing/lib/FederatedShareProvider.php14
-rw-r--r--apps/federatedfilesharing/lib/Notifications.php2
-rw-r--r--apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php2
-rw-r--r--apps/federatedfilesharing/lib/Settings/Admin.php4
-rw-r--r--apps/federatedfilesharing/lib/Settings/Personal.php4
-rw-r--r--apps/federatedfilesharing/lib/Settings/PersonalSection.php4
-rw-r--r--apps/federatedfilesharing/tests/AddressHandlerTest.php6
-rw-r--r--apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php12
-rw-r--r--apps/federatedfilesharing/tests/FederatedShareProviderTest.php8
-rw-r--r--apps/federatedfilesharing/tests/NotificationsTest.php2
-rw-r--r--apps/federatedfilesharing/tests/TestCase.php4
-rw-r--r--apps/federatedfilesharing/tests/TokenHandlerTest.php4
-rw-r--r--apps/federation/lib/DbHandler.php10
-rw-r--r--apps/federation/lib/Settings/Admin.php6
-rw-r--r--apps/federation/lib/SyncFederationAddressBooks.php2
-rw-r--r--apps/federation/tests/BackgroundJob/GetSharedSecretTest.php4
-rw-r--r--apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php2
-rw-r--r--apps/federation/tests/Controller/OCSAuthAPIControllerTest.php2
-rw-r--r--apps/federation/tests/DbHandlerTest.php6
-rw-r--r--apps/federation/tests/Middleware/AddServerMiddlewareTest.php4
-rw-r--r--apps/federation/tests/SyncFederationAddressbooksTest.php4
-rw-r--r--apps/federation/tests/TrustedServersTest.php24
-rw-r--r--apps/files/lib/Activity/Provider.php2
-rw-r--r--apps/files/lib/Activity/Settings/FavoriteAction.php4
-rw-r--r--apps/files/lib/Activity/Settings/FileChanged.php4
-rw-r--r--apps/files/lib/Activity/Settings/FileFavoriteChanged.php4
-rw-r--r--apps/files/lib/Collaboration/Resources/ResourceProvider.php18
-rw-r--r--apps/files/lib/Command/Copy.php8
-rw-r--r--apps/files/lib/Command/Delete.php22
-rw-r--r--apps/files/lib/Command/DeleteOrphanedFiles.php4
-rw-r--r--apps/files/lib/Command/Get.php6
-rw-r--r--apps/files/lib/Command/Move.php6
-rw-r--r--apps/files/lib/Command/Object/Delete.php6
-rw-r--r--apps/files/lib/Command/Object/Get.php6
-rw-r--r--apps/files/lib/Command/Object/ObjectUtil.php10
-rw-r--r--apps/files/lib/Command/Object/Put.php10
-rw-r--r--apps/files/lib/Command/Put.php4
-rw-r--r--apps/files/lib/Command/RepairTree.php2
-rw-r--r--apps/files/lib/Command/ScanAppData.php2
-rw-r--r--apps/files/lib/Command/TransferOwnership.php8
-rw-r--r--apps/files/lib/Controller/ViewController.php8
-rw-r--r--apps/files/lib/Listener/DeclarativeSettingsSetValueEventListener.php2
-rw-r--r--apps/files/lib/Listener/SyncLivePhotosListener.php4
-rw-r--r--apps/files/lib/Search/FilesSearchProvider.php2
-rw-r--r--apps/files/lib/Service/OwnershipTransferService.php14
-rw-r--r--apps/files/lib/Service/TagService.php2
-rw-r--r--apps/files/tests/Controller/ViewControllerTest.php8
-rw-r--r--apps/files_external/lib/Command/Import.php4
-rw-r--r--apps/files_external/lib/Command/ListCommand.php4
-rw-r--r--apps/files_external/lib/Command/Notify.php4
-rw-r--r--apps/files_external/lib/Controller/AjaxController.php2
-rw-r--r--apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php2
-rw-r--r--apps/files_external/lib/Lib/FrontendDefinitionTrait.php2
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php6
-rw-r--r--apps/files_external/lib/Lib/Storage/FTP.php6
-rw-r--r--apps/files_external/lib/Lib/Storage/FtpConnection.php14
-rw-r--r--apps/files_external/lib/Lib/Storage/OwnCloud.php4
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTP.php12
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php6
-rw-r--r--apps/files_external/lib/Lib/Storage/Swift.php4
-rw-r--r--apps/files_external/lib/Settings/Admin.php6
-rw-r--r--apps/files_external/lib/Settings/Personal.php6
-rw-r--r--apps/files_external/lib/Settings/Section.php4
-rw-r--r--apps/files_external/templates/settings.php18
-rw-r--r--apps/files_external/tests/Service/StoragesServiceTest.php4
-rw-r--r--apps/files_external/tests/sso-setup/apps.config.php14
-rw-r--r--apps/files_sharing/lib/Activity/Providers/Base.php2
-rw-r--r--apps/files_sharing/lib/Activity/Settings/PublicLinks.php4
-rw-r--r--apps/files_sharing/lib/Activity/Settings/PublicLinksUpload.php4
-rw-r--r--apps/files_sharing/lib/Activity/Settings/RemoteShare.php4
-rw-r--r--apps/files_sharing/lib/Activity/Settings/Shared.php4
-rw-r--r--apps/files_sharing/lib/Command/DeleteOrphanShares.php6
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php19
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php2
-rw-r--r--apps/files_sharing/lib/Controller/ShareesAPIController.php4
-rw-r--r--apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php12
-rw-r--r--apps/files_sharing/lib/DeleteOrphanedSharesJob.php2
-rw-r--r--apps/files_sharing/lib/External/Manager.php12
-rw-r--r--apps/files_sharing/lib/External/Storage.php12
-rw-r--r--apps/files_sharing/lib/Migration/OwncloudGuestShareType.php2
-rw-r--r--apps/files_sharing/lib/Migration/SetAcceptedStatus.php2
-rw-r--r--apps/files_sharing/lib/Migration/SetPasswordColumn.php2
-rw-r--r--apps/files_sharing/lib/MountProvider.php2
-rw-r--r--apps/files_sharing/lib/Notification/Notifier.php4
-rw-r--r--apps/files_sharing/lib/ShareBackend/Folder.php4
-rw-r--r--apps/files_sharing/lib/SharedStorage.php6
-rw-r--r--apps/files_sharing/lib/Updater.php2
-rw-r--r--apps/files_sharing/openapi.json4
-rw-r--r--apps/files_sharing/tests/ApiTest.php2
-rw-r--r--apps/files_sharing/tests/CacheTest.php2
-rw-r--r--apps/files_sharing/tests/Collaboration/ShareRecipientSorterTest.php8
-rw-r--r--apps/files_sharing/tests/Controller/ShareAPIControllerTest.php142
-rw-r--r--apps/files_sharing/tests/Controller/ShareControllerTest.php4
-rw-r--r--apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php2
-rw-r--r--apps/files_sharing/tests/External/CacheTest.php2
-rw-r--r--apps/files_sharing/tests/External/ManagerTest.php4
-rw-r--r--apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php4
-rw-r--r--apps/files_sharing/tests/SharedMountTest.php2
-rw-r--r--apps/files_sharing/tests/SharedStorageTest.php4
-rw-r--r--apps/files_sharing/tests/TestCase.php10
-rw-r--r--apps/files_trashbin/lib/Command/CleanUp.php4
-rw-r--r--apps/files_trashbin/lib/Command/ExpireTrash.php2
-rw-r--r--apps/files_trashbin/lib/Command/RestoreAllFiles.php16
-rw-r--r--apps/files_trashbin/lib/Command/Size.php14
-rw-r--r--apps/files_trashbin/lib/Helper.php2
-rw-r--r--apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php6
-rw-r--r--apps/files_trashbin/lib/Sabre/TrashRoot.php2
-rw-r--r--apps/files_trashbin/lib/Storage.php2
-rw-r--r--apps/files_trashbin/lib/Trashbin.php8
-rw-r--r--apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php12
-rw-r--r--apps/files_trashbin/tests/Command/CleanUpTest.php6
-rw-r--r--apps/files_trashbin/tests/StorageTest.php4
-rw-r--r--apps/files_trashbin/tests/TrashbinTest.php8
-rw-r--r--apps/files_versions/appinfo/routes.php2
-rw-r--r--apps/files_versions/lib/Command/CleanUp.php2
-rw-r--r--apps/files_versions/lib/Command/ExpireVersions.php2
-rw-r--r--apps/files_versions/lib/Db/VersionsMapper.php22
-rw-r--r--apps/files_versions/lib/Listener/VersionStorageMoveListener.php2
-rw-r--r--apps/files_versions/lib/Migration/Version1020Date20221114144058.php4
-rw-r--r--apps/files_versions/lib/Sabre/Plugin.php2
-rw-r--r--apps/files_versions/lib/Storage.php26
-rw-r--r--apps/files_versions/lib/Versions/LegacyVersionsBackend.php8
-rw-r--r--apps/files_versions/lib/Versions/VersionManager.php4
-rw-r--r--apps/files_versions/tests/Command/CleanupTest.php6
-rw-r--r--apps/files_versions/tests/VersioningTest.php172
-rw-r--r--apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php2
-rw-r--r--apps/provisioning_api/lib/Controller/AUserData.php2
-rw-r--r--apps/provisioning_api/lib/Controller/AppConfigController.php2
-rw-r--r--apps/provisioning_api/lib/Controller/PreferencesController.php1
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php10
-rw-r--r--apps/provisioning_api/tests/CapabilitiesTest.php4
-rw-r--r--apps/provisioning_api/tests/Controller/GroupsControllerTest.php6
-rw-r--r--apps/settings/lib/Activity/GroupSetting.php4
-rw-r--r--apps/settings/lib/Activity/Setting.php4
-rw-r--r--apps/settings/lib/BackgroundJobs/VerifyUserData.php2
-rw-r--r--apps/settings/lib/Command/AdminDelegation/Add.php2
-rw-r--r--apps/settings/lib/Controller/UsersController.php2
-rw-r--r--apps/settings/lib/Service/AuthorizedGroupService.php2
-rw-r--r--apps/settings/lib/Settings/Admin/ArtificialIntelligence.php4
-rw-r--r--apps/settings/lib/Settings/Admin/Mail.php6
-rw-r--r--apps/settings/lib/Settings/Admin/Overview.php6
-rw-r--r--apps/settings/lib/Settings/Admin/Security.php4
-rw-r--r--apps/settings/lib/Settings/Admin/Server.php6
-rw-r--r--apps/settings/lib/Settings/Admin/Sharing.php4
-rw-r--r--apps/settings/lib/Settings/Admin/Users.php4
-rw-r--r--apps/settings/lib/Settings/Personal/Additional.php4
-rw-r--r--apps/settings/lib/Settings/Personal/PersonalInfo.php4
-rw-r--r--apps/settings/lib/Settings/Personal/ServerDevNotice.php4
-rw-r--r--apps/settings/lib/SetupChecks/CheckServerResponseTrait.php12
-rw-r--r--apps/settings/lib/SetupChecks/DatabaseHasMissingIndices.php2
-rw-r--r--apps/settings/lib/SetupChecks/MaintenanceWindowStart.php2
-rw-r--r--apps/settings/lib/SetupChecks/PushService.php2
-rw-r--r--apps/settings/lib/SetupChecks/SecurityHeaders.php2
-rw-r--r--apps/settings/lib/WellKnown/SecurityTxtHandler.php4
-rw-r--r--apps/settings/tests/Controller/AuthSettingsControllerTest.php2
-rw-r--r--apps/settings/tests/Controller/CheckSetupControllerTest.php8
-rw-r--r--apps/settings/tests/Controller/UsersControllerTest.php12
-rw-r--r--apps/settings/tests/Settings/Admin/MailTest.php2
-rw-r--r--apps/settings/tests/Settings/Admin/SharingTest.php8
-rw-r--r--apps/sharebymail/lib/Settings/Admin.php4
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php12
-rw-r--r--apps/sharebymail/tests/ShareByMailProviderTest.php4
-rw-r--r--apps/systemtags/lib/Activity/Listener.php2
-rw-r--r--apps/systemtags/lib/Activity/Provider.php8
-rw-r--r--apps/systemtags/lib/Activity/Setting.php4
-rw-r--r--apps/systemtags/lib/Controller/LastUsedController.php2
-rw-r--r--apps/systemtags/lib/Settings/Admin.php4
-rw-r--r--apps/theming/lib/IconBuilder.php24
-rw-r--r--apps/theming/lib/Service/BackgroundService.php2
-rw-r--r--apps/theming/lib/Settings/Admin.php4
-rw-r--r--apps/theming/lib/Settings/AdminSection.php4
-rw-r--r--apps/theming/lib/Settings/Personal.php4
-rw-r--r--apps/theming/lib/Settings/PersonalSection.php4
-rw-r--r--apps/theming/lib/Themes/DefaultTheme.php2
-rw-r--r--apps/theming/lib/Util.php2
-rw-r--r--apps/theming/tests/IconBuilderTest.php6
-rw-r--r--apps/theming/tests/UtilTest.php12
-rw-r--r--apps/twofactor_backupcodes/lib/Migration/Version1002Date20170926101419.php2
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php4
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php2
-rw-r--r--apps/updatenotification/lib/Notification/Notifier.php2
-rw-r--r--apps/user_ldap/lib/Access.php20
-rw-r--r--apps/user_ldap/lib/Command/SetConfig.php2
-rw-r--r--apps/user_ldap/lib/Command/ShowConfig.php2
-rw-r--r--apps/user_ldap/lib/Command/UpdateUUID.php2
-rw-r--r--apps/user_ldap/lib/Configuration.php4
-rw-r--r--apps/user_ldap/lib/Connection.php4
-rw-r--r--apps/user_ldap/lib/Controller/RenewPasswordController.php2
-rw-r--r--apps/user_ldap/lib/GroupPluginManager.php2
-rw-r--r--apps/user_ldap/lib/Group_LDAP.php4
-rw-r--r--apps/user_ldap/lib/Group_Proxy.php2
-rw-r--r--apps/user_ldap/lib/Helper.php2
-rw-r--r--apps/user_ldap/lib/Jobs/Sync.php18
-rw-r--r--apps/user_ldap/lib/LDAP.php4
-rw-r--r--apps/user_ldap/lib/Mapping/AbstractMapping.php4
-rw-r--r--apps/user_ldap/lib/Notification/Notifier.php2
-rw-r--r--apps/user_ldap/lib/Settings/Admin.php4
-rw-r--r--apps/user_ldap/lib/Settings/Section.php4
-rw-r--r--apps/user_ldap/lib/User/Manager.php2
-rw-r--r--apps/user_ldap/lib/User/User.php32
-rw-r--r--apps/user_ldap/lib/UserPluginManager.php4
-rw-r--r--apps/user_ldap/lib/User_LDAP.php8
-rw-r--r--apps/user_ldap/lib/User_Proxy.php2
-rw-r--r--apps/user_ldap/lib/Wizard.php14
-rw-r--r--apps/user_ldap/tests/AccessTest.php2
-rw-r--r--apps/user_ldap/tests/ConnectionTest.php4
-rw-r--r--apps/user_ldap/tests/Integration/AbstractIntegrationTest.php6
-rw-r--r--apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php20
-rw-r--r--apps/user_ldap/tests/Integration/Lib/IntegrationTestFetchUsersByLoginName.php2
-rw-r--r--apps/user_ldap/tests/Integration/Lib/IntegrationTestPaging.php2
-rw-r--r--apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php2
-rw-r--r--apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserCleanUp.php2
-rw-r--r--apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserDisplayName.php2
-rw-r--r--apps/user_ldap/tests/Jobs/SyncTest.php22
-rw-r--r--apps/user_ldap/tests/LDAPProviderTest.php102
-rw-r--r--apps/user_ldap/tests/Mapping/AbstractMappingTest.php2
-rw-r--r--apps/user_ldap/tests/Migration/UUIDFixInsertTest.php10
-rw-r--r--apps/user_ldap/tests/Service/UpdateGroupsServiceTest.php8
-rw-r--r--apps/user_ldap/tests/User/UserTest.php4
-rw-r--r--apps/user_ldap/tests/User_LDAPTest.php308
-rw-r--r--apps/user_status/lib/Controller/HeartbeatController.php1
-rw-r--r--apps/user_status/lib/Dashboard/UserStatusWidget.php4
-rw-r--r--apps/user_status/tests/Unit/Service/StatusServiceTest.php4
-rw-r--r--apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php4
-rw-r--r--apps/webhook_listeners/lib/Db/WebhookListener.php2
-rw-r--r--apps/webhook_listeners/lib/Service/PHPMongoQuery.php38
-rw-r--r--apps/webhook_listeners/lib/Settings/Admin.php4
-rw-r--r--apps/workflowengine/lib/Manager.php10
-rw-r--r--apps/workflowengine/lib/Settings/ASettings.php4
-rw-r--r--apps/workflowengine/tests/ManagerTest.php2
403 files changed, 1763 insertions, 1757 deletions
diff --git a/apps/admin_audit/lib/Actions/Files.php b/apps/admin_audit/lib/Actions/Files.php
index bba5b427aee..50448e88f70 100644
--- a/apps/admin_audit/lib/Actions/Files.php
+++ b/apps/admin_audit/lib/Actions/Files.php
@@ -43,7 +43,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;
}
@@ -65,7 +65,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;
}
@@ -87,7 +87,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;
}
@@ -113,7 +113,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;
}
@@ -142,7 +142,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;
}
@@ -167,7 +167,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;
}
@@ -195,7 +195,7 @@ class Files extends Action {
];
} catch (InvalidPathException|NotFoundException $e) {
\OCP\Server::get(LoggerInterface::class)->error(
- "Exception thrown in file update: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
+ 'Exception thrown in file update: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
}
@@ -219,7 +219,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;
}
@@ -248,7 +248,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/Controller/RequestHandlerController.php b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php
index 21c557354ff..a49d70b6930 100644
--- a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php
+++ b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php
@@ -71,6 +71,7 @@ class RequestHandlerController extends Controller {
* @param string $resourceType 'file', 'calendar',...
*
* @return JSONResponse<Http::STATUS_CREATED, CloudFederationAPIAddShare, array{}>|JSONResponse<Http::STATUS_BAD_REQUEST, CloudFederationAPIValidationError, array{}>|JSONResponse<Http::STATUS_NOT_IMPLEMENTED, CloudFederationAPIError, array{}>
+ *
* 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
@@ -196,6 +197,7 @@ class RequestHandlerController extends Controller {
* @param array<string, mixed>|null $notification The actual payload of the notification
*
* @return JSONResponse<Http::STATUS_CREATED, array<string, mixed>, array{}>|JSONResponse<Http::STATUS_BAD_REQUEST, CloudFederationAPIValidationError, array{}>|JSONResponse<Http::STATUS_FORBIDDEN|Http::STATUS_NOT_IMPLEMENTED, CloudFederationAPIError, array{}>
+ *
* 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
diff --git a/apps/comments/lib/Activity/Listener.php b/apps/comments/lib/Activity/Listener.php
index f49f2077a61..b07cb19afda 100644
--- a/apps/comments/lib/Activity/Listener.php
+++ b/apps/comments/lib/Activity/Listener.php
@@ -67,7 +67,7 @@ class Listener {
$activity->setApp('comments')
->setType('comments')
->setAuthor($actor)
- ->setObject($event->getComment()->getObjectType(), (int) $event->getComment()->getObjectId())
+ ->setObject($event->getComment()->getObjectType(), (int)$event->getComment()->getObjectId())
->setMessage('add_comment_message', [
'commentId' => $event->getComment()->getId(),
]);
@@ -79,7 +79,7 @@ class Listener {
$activity->setSubject('add_comment_subject', [
'actor' => $actor,
- 'fileId' => (int) $event->getComment()->getObjectId(),
+ 'fileId' => (int)$event->getComment()->getObjectId(),
'filePath' => trim($path, '/'),
]);
$this->activityManager->publish($activity);
diff --git a/apps/comments/lib/Activity/Provider.php b/apps/comments/lib/Activity/Provider.php
index 704ef0e0a48..e537070a552 100644
--- a/apps/comments/lib/Activity/Provider.php
+++ b/apps/comments/lib/Activity/Provider.php
@@ -148,7 +148,7 @@ class Provider implements IProvider {
$commentId = $messageParameters['commentId'] ?? $messageParameters[0];
try {
- $comment = $this->commentsManager->get((string) $commentId);
+ $comment = $this->commentsManager->get((string)$commentId);
$message = $comment->getMessage();
$mentionCount = 1;
diff --git a/apps/comments/lib/Search/LegacyProvider.php b/apps/comments/lib/Search/LegacyProvider.php
index 3dbc51bbf38..d78e5fe09f3 100644
--- a/apps/comments/lib/Search/LegacyProvider.php
+++ b/apps/comments/lib/Search/LegacyProvider.php
@@ -85,7 +85,7 @@ class LegacyProvider extends Provider {
* @throws NotFoundException
*/
protected function getFileForComment(Folder $userFolder, IComment $comment): Node {
- $nodes = $userFolder->getById((int) $comment->getObjectId());
+ $nodes = $userFolder->getById((int)$comment->getObjectId());
if (empty($nodes)) {
throw new NotFoundException('File not found');
}
diff --git a/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php b/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php
index 0a67a699f86..334f24aec83 100644
--- a/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php
+++ b/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php
@@ -11,9 +11,9 @@ use OCP\Comments\ICommentsManager;
use Test\TestCase;
class CommentersSorterTest extends TestCase {
- /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */
protected $commentsManager;
- /** @var CommentersSorter */
+ /** @var CommentersSorter */
protected $sorter;
protected function setUp(): void {
diff --git a/apps/comments/tests/Unit/EventHandlerTest.php b/apps/comments/tests/Unit/EventHandlerTest.php
index fc7890440f3..6459924ee8a 100644
--- a/apps/comments/tests/Unit/EventHandlerTest.php
+++ b/apps/comments/tests/Unit/EventHandlerTest.php
@@ -13,7 +13,7 @@ use OCP\Comments\IComment;
use Test\TestCase;
class EventHandlerTest extends TestCase {
- /** @var CommentsEventListener */
+ /** @var CommentsEventListener */
protected $eventHandler;
/** @var ActivityListener|\PHPUnit\Framework\MockObject\MockObject */
diff --git a/apps/comments/tests/Unit/Notification/ListenerTest.php b/apps/comments/tests/Unit/Notification/ListenerTest.php
index a81753b3e34..3082333e8a3 100644
--- a/apps/comments/tests/Unit/Notification/ListenerTest.php
+++ b/apps/comments/tests/Unit/Notification/ListenerTest.php
@@ -26,7 +26,7 @@ class ListenerTest extends TestCase {
/** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
protected $urlGenerator;
- /** @var Listener */
+ /** @var Listener */
protected $listener;
protected function setUp(): void {
diff --git a/apps/contactsinteraction/lib/AddressBook.php b/apps/contactsinteraction/lib/AddressBook.php
index dfa66ff6737..60c9eccece3 100644
--- a/apps/contactsinteraction/lib/AddressBook.php
+++ b/apps/contactsinteraction/lib/AddressBook.php
@@ -39,7 +39,7 @@ class AddressBook extends ExternalAddressBook implements IACL {
* @throws Exception
*/
public function delete(): void {
- throw new Exception("This addressbook is immutable");
+ throw new Exception('This addressbook is immutable');
}
/**
@@ -47,7 +47,7 @@ class AddressBook extends ExternalAddressBook implements IACL {
* @throws Exception
*/
public function createFile($name, $data = null) {
- throw new Exception("This addressbook is immutable");
+ throw new Exception('This addressbook is immutable');
}
/**
@@ -65,7 +65,7 @@ class AddressBook extends ExternalAddressBook implements IACL {
$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);
}
}
@@ -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/Card.php b/apps/contactsinteraction/lib/Card.php
index c937c383d90..bf0acca7bd5 100644
--- a/apps/contactsinteraction/lib/Card.php
+++ b/apps/contactsinteraction/lib/Card.php
@@ -70,7 +70,7 @@ class Card implements ICard, IACL {
* @inheritDoc
*/
public function getETag(): ?string {
- return '"' . md5((string) $this->getLastModified()) . '"';
+ return '"' . md5((string)$this->getLastModified()) . '"';
}
/**
@@ -91,7 +91,7 @@ class Card implements ICard, IACL {
* @inheritDoc
*/
public function getName(): string {
- return (string) $this->contact->getId();
+ return (string)$this->contact->getId();
}
/**
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/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/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php b/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php
index d908cd3ae82..c214f8950cb 100644
--- a/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php
+++ b/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php
@@ -53,8 +53,8 @@ class BuildReminderIndexBackgroundJob extends QueuedJob {
}
public function run($argument) {
- $offset = (int) $argument['offset'];
- $stopAt = (int) $argument['stopAt'];
+ $offset = (int)$argument['offset'];
+ $stopAt = (int)$argument['stopAt'];
$this->logger->info('Building calendar reminder index (' . $offset .'/' . $stopAt . ')');
@@ -88,7 +88,7 @@ class BuildReminderIndexBackgroundJob extends QueuedJob {
$result = $query->executeQuery();
while ($row = $result->fetch(\PDO::FETCH_ASSOC)) {
- $offset = (int) $row['id'];
+ $offset = (int)$row['id'];
if (is_resource($row['calendardata'])) {
$row['calendardata'] = stream_get_contents($row['calendardata']);
}
diff --git a/apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php b/apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php
index 1479cd363b3..6fe10c576bb 100644
--- a/apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php
+++ b/apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php
@@ -14,7 +14,7 @@ use OCP\IDBConnection;
class CleanupInvitationTokenJob extends TimedJob {
- /** @var IDBConnection */
+ /** @var IDBConnection */
private $db;
public function __construct(IDBConnection $db, ITimeFactory $time) {
diff --git a/apps/dav/lib/BackgroundJob/DeleteOutdatedSchedulingObjects.php b/apps/dav/lib/BackgroundJob/DeleteOutdatedSchedulingObjects.php
index fa53a8be4f0..bc306d58fe1 100644
--- a/apps/dav/lib/BackgroundJob/DeleteOutdatedSchedulingObjects.php
+++ b/apps/dav/lib/BackgroundJob/DeleteOutdatedSchedulingObjects.php
@@ -30,6 +30,6 @@ class DeleteOutdatedSchedulingObjects extends TimedJob {
protected function run($argument): void {
$time = $this->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/PruneOutdatedSyncTokensJob.php b/apps/dav/lib/BackgroundJob/PruneOutdatedSyncTokensJob.php
index 1ef33410f4f..15fe439beef 100644
--- a/apps/dav/lib/BackgroundJob/PruneOutdatedSyncTokensJob.php
+++ b/apps/dav/lib/BackgroundJob/PruneOutdatedSyncTokensJob.php
@@ -34,8 +34,8 @@ class PruneOutdatedSyncTokensJob extends TimedJob {
}
public function run($argument) {
- $limit = max(1, (int) $this->config->getAppValue(Application::APP_ID, 'totalNumberOfSyncTokensToKeep', '10000'));
- $retention = max(7, (int) $this->config->getAppValue(Application::APP_ID, 'syncTokensRetentionDays', '60')) * 24 * 3600;
+ $limit = max(1, (int)$this->config->getAppValue(Application::APP_ID, 'totalNumberOfSyncTokensToKeep', '10000'));
+ $retention = max(7, (int)$this->config->getAppValue(Application::APP_ID, 'syncTokensRetentionDays', '60')) * 24 * 3600;
$prunedCalendarSyncTokens = $this->calDavBackend->pruneOutdatedSyncTokens($limit, $retention);
$prunedAddressBookSyncTokens = $this->cardDavBackend->pruneOutdatedSyncTokens($limit, $retention);
diff --git a/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php b/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php
index 982d6040fd7..f9d6de9db59 100644
--- a/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php
+++ b/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php
@@ -104,7 +104,7 @@ class RefreshWebcalJob extends Job {
foreach ($forceInt as $column) {
if (isset($row[$column])) {
- $row[$column] = (int) $row[$column];
+ $row[$column] = (int)$row[$column];
}
}
}
diff --git a/apps/dav/lib/BackgroundJob/UploadCleanup.php b/apps/dav/lib/BackgroundJob/UploadCleanup.php
index 59a28626ecd..6d5eca6920c 100644
--- a/apps/dav/lib/BackgroundJob/UploadCleanup.php
+++ b/apps/dav/lib/BackgroundJob/UploadCleanup.php
@@ -45,7 +45,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;
}
@@ -54,7 +54,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/BulkUpload/BulkUploadPlugin.php b/apps/dav/lib/BulkUpload/BulkUploadPlugin.php
index ae7f55d7107..8a99beaec6a 100644
--- a/apps/dav/lib/BulkUpload/BulkUploadPlugin.php
+++ b/apps/dav/lib/BulkUpload/BulkUploadPlugin.php
@@ -44,7 +44,7 @@ class BulkUploadPlugin extends ServerPlugin {
*/
public function httpPost(RequestInterface $request, ResponseInterface $response): bool {
// Limit bulk upload to the /dav/bulk endpoint
- if ($request->getPath() !== "bulk") {
+ if ($request->getPath() !== 'bulk') {
return true;
}
@@ -77,16 +77,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..b6c4fbcc1be 100644
--- a/apps/dav/lib/BulkUpload/MultipartRequestParser.php
+++ b/apps/dav/lib/BulkUpload/MultipartRequestParser.php
@@ -19,10 +19,10 @@ class MultipartRequestParser {
private $stream;
/** @var string */
- private $boundary = "";
+ private $boundary = '';
/** @var string */
- private $lastBoundary = "";
+ private $lastBoundary = '';
/**
* @throws BadRequest
@@ -39,7 +39,7 @@ class MultipartRequestParser {
}
if ($contentType === null) {
- throw new BadRequest("Content-Type can not be null");
+ throw new BadRequest('Content-Type can not be null');
}
$this->stream = $stream;
@@ -60,7 +60,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 +96,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 +134,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 +146,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 +180,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 +201,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 +215,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..56b481097cf 100644
--- a/apps/dav/lib/CalDAV/Activity/Backend.php
+++ b/apps/dav/lib/CalDAV/Activity/Backend.php
@@ -133,7 +133,7 @@ class Backend {
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
- ->setObject('calendar', (int) $calendarData['id'])
+ ->setObject('calendar', (int)$calendarData['id'])
->setType('calendar')
->setAuthor($currentUser);
@@ -161,7 +161,7 @@ class Backend {
[
'actor' => $currentUser,
'calendar' => [
- 'id' => (int) $calendarData['id'],
+ 'id' => (int)$calendarData['id'],
'uri' => $calendarData['uri'],
'name' => $calendarData['{DAV:}displayname'],
],
@@ -192,7 +192,7 @@ class Backend {
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
- ->setObject('calendar', (int) $calendarData['id'])
+ ->setObject('calendar', (int)$calendarData['id'])
->setType('calendar')
->setAuthor($currentUser);
@@ -217,7 +217,7 @@ class Backend {
$parameters = [
'actor' => $event->getAuthor(),
'calendar' => [
- 'id' => (int) $calendarData['id'],
+ 'id' => (int)$calendarData['id'],
'uri' => $calendarData['uri'],
'name' => $calendarData['{DAV:}displayname'],
],
@@ -246,7 +246,7 @@ class Backend {
$parameters = [
'actor' => $event->getAuthor(),
'calendar' => [
- 'id' => (int) $calendarData['id'],
+ 'id' => (int)$calendarData['id'],
'uri' => $calendarData['uri'],
'name' => $calendarData['{DAV:}displayname'],
],
@@ -288,7 +288,7 @@ class Backend {
$parameters = [
'actor' => $event->getAuthor(),
'calendar' => [
- 'id' => (int) $calendarData['id'],
+ 'id' => (int)$calendarData['id'],
'uri' => $calendarData['uri'],
'name' => $calendarData['{DAV:}displayname'],
],
@@ -315,7 +315,7 @@ class Backend {
$parameters = [
'actor' => $event->getAuthor(),
'calendar' => [
- 'id' => (int) $calendarData['id'],
+ 'id' => (int)$calendarData['id'],
'uri' => $calendarData['uri'],
'name' => $calendarData['{DAV:}displayname'],
],
@@ -393,7 +393,7 @@ class Backend {
[
'actor' => $event->getAuthor(),
'calendar' => [
- 'id' => (int) $properties['id'],
+ 'id' => (int)$properties['id'],
'uri' => $properties['uri'],
'name' => $properties['{DAV:}displayname'],
],
@@ -443,7 +443,7 @@ class Backend {
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
- ->setObject('calendar', (int) $calendarData['id'])
+ ->setObject('calendar', (int)$calendarData['id'])
->setType($object['type'] === 'event' ? 'calendar_event' : 'calendar_todo')
->setAuthor($currentUser);
@@ -460,7 +460,7 @@ class Backend {
$params = [
'actor' => $event->getAuthor(),
'calendar' => [
- 'id' => (int) $calendarData['id'],
+ 'id' => (int)$calendarData['id'],
'uri' => $calendarData['uri'],
'name' => $calendarData['{DAV:}displayname'],
],
@@ -534,7 +534,7 @@ class Backend {
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
- ->setObject('calendar', (int) $targetCalendarData['id'])
+ ->setObject('calendar', (int)$targetCalendarData['id'])
->setType($object['type'] === 'event' ? 'calendar_event' : 'calendar_todo')
->setAuthor($currentUser);
@@ -551,12 +551,12 @@ class Backend {
$params = [
'actor' => $event->getAuthor(),
'sourceCalendar' => [
- 'id' => (int) $sourceCalendarData['id'],
+ 'id' => (int)$sourceCalendarData['id'],
'uri' => $sourceCalendarData['uri'],
'name' => $sourceCalendarData['{DAV:}displayname'],
],
'targetCalendar' => [
- 'id' => (int) $targetCalendarData['id'],
+ 'id' => (int)$targetCalendarData['id'],
'uri' => $targetCalendarData['uri'],
'name' => $targetCalendarData['{DAV:}displayname'],
],
@@ -603,9 +603,9 @@ class Backend {
}
if ($componentType === 'VEVENT') {
- return ['id' => (string) $component->UID, 'name' => (string) $component->SUMMARY, 'type' => 'event'];
+ return ['id' => (string)$component->UID, 'name' => (string)$component->SUMMARY, 'type' => 'event'];
}
- return ['id' => (string) $component->UID, 'name' => (string) $component->SUMMARY, 'type' => 'todo', 'status' => (string) $component->STATUS];
+ return ['id' => (string)$component->UID, 'name' => (string)$component->SUMMARY, 'type' => 'todo', 'status' => (string)$component->STATUS];
}
/**
diff --git a/apps/dav/lib/CalDAV/Activity/Filter/Calendar.php b/apps/dav/lib/CalDAV/Activity/Filter/Calendar.php
index 6ac161a0a2c..e5c25fd8ae6 100644
--- a/apps/dav/lib/CalDAV/Activity/Filter/Calendar.php
+++ b/apps/dav/lib/CalDAV/Activity/Filter/Calendar.php
@@ -40,8 +40,8 @@ class Calendar implements IFilter {
/**
* @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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/dav/lib/CalDAV/Activity/Filter/Todo.php b/apps/dav/lib/CalDAV/Activity/Filter/Todo.php
index dfa05ae9099..6ca31f1688c 100644
--- a/apps/dav/lib/CalDAV/Activity/Filter/Todo.php
+++ b/apps/dav/lib/CalDAV/Activity/Filter/Todo.php
@@ -40,8 +40,8 @@ class Todo implements IFilter {
/**
* @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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/dav/lib/CalDAV/Activity/Setting/Calendar.php b/apps/dav/lib/CalDAV/Activity/Setting/Calendar.php
index 4e1fdc0fe97..a201213f784 100644
--- a/apps/dav/lib/CalDAV/Activity/Setting/Calendar.php
+++ b/apps/dav/lib/CalDAV/Activity/Setting/Calendar.php
@@ -24,8 +24,8 @@ class Calendar 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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/dav/lib/CalDAV/Activity/Setting/Event.php b/apps/dav/lib/CalDAV/Activity/Setting/Event.php
index a177d27d2e3..ea049738251 100644
--- a/apps/dav/lib/CalDAV/Activity/Setting/Event.php
+++ b/apps/dav/lib/CalDAV/Activity/Setting/Event.php
@@ -24,8 +24,8 @@ class Event 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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/dav/lib/CalDAV/Activity/Setting/Todo.php b/apps/dav/lib/CalDAV/Activity/Setting/Todo.php
index ecd3634ee12..7ac3b1e0f76 100644
--- a/apps/dav/lib/CalDAV/Activity/Setting/Todo.php
+++ b/apps/dav/lib/CalDAV/Activity/Setting/Todo.php
@@ -25,8 +25,8 @@ class Todo 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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php
index 0990cd674dd..a10d73c4aa0 100644
--- a/apps/dav/lib/CalDAV/BirthdayService.php
+++ b/apps/dav/lib/CalDAV/BirthdayService.php
@@ -87,7 +87,7 @@ class BirthdayService {
return;
}
foreach ($datesToSync as $type) {
- $this->updateCalendar($cardUri, $cardData, $book, (int) $calendar['id'], $type, $reminderOffset);
+ $this->updateCalendar($cardUri, $cardData, $book, (int)$calendar['id'], $type, $reminderOffset);
}
}
}
@@ -247,7 +247,7 @@ class BirthdayService {
$vEvent->{'X-NEXTCLOUD-BC-FIELD-TYPE'} = $dateField;
$vEvent->{'X-NEXTCLOUD-BC-UNKNOWN-YEAR'} = $dateParts['year'] === null ? '1' : '0';
if ($originalYear !== null) {
- $vEvent->{'X-NEXTCLOUD-BC-YEAR'} = (string) $originalYear;
+ $vEvent->{'X-NEXTCLOUD-BC-YEAR'} = (string)$originalYear;
}
if ($reminderOffset) {
$alarm = $vCal->createComponent('VALARM');
@@ -287,7 +287,7 @@ class BirthdayService {
foreach ($books as $book) {
$cards = $this->cardDavBackEnd->getCards($book['id']);
foreach ($cards as $card) {
- $this->onCardChanged((int) $book['id'], $card['uri'], $card['carddata']);
+ $this->onCardChanged((int)$book['id'], $card['uri'], $card['carddata']);
}
}
}
diff --git a/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php b/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php
index 3f6eff4e1f4..17e6f4389cc 100644
--- a/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php
+++ b/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php
@@ -32,7 +32,7 @@ class CachedSubscriptionImpl implements ICalendar {
* @since 13.0.0
*/
public function getKey(): string {
- return (string) $this->calendarInfo['id'];
+ return (string)$this->calendarInfo['id'];
}
/**
@@ -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 70895ac2c43..e35604e8497 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -258,8 +258,8 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$calendars = [];
while (($row = $result->fetch()) !== false) {
$calendars[] = [
- 'id' => (int) $row['id'],
- 'deleted_at' => (int) $row['deleted_at'],
+ 'id' => (int)$row['id'],
+ 'deleted_at' => (int)$row['deleted_at'],
];
}
$result->closeCursor();
@@ -319,7 +319,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$calendars = [];
while ($row = $result->fetch()) {
- $row['principaluri'] = (string) $row['principaluri'];
+ $row['principaluri'] = (string)$row['principaluri'];
$components = [];
if ($row['components']) {
$components = explode(',', $row['components']);
@@ -382,12 +382,12 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
while ($row = $results->fetch()) {
- $row['principaluri'] = (string) $row['principaluri'];
+ $row['principaluri'] = (string)$row['principaluri'];
if ($row['principaluri'] === $principalUri) {
continue;
}
- $readOnly = (int) $row['access'] === Backend::ACCESS_READ;
+ $readOnly = (int)$row['access'] === Backend::ACCESS_READ;
if (isset($calendars[$row['id']])) {
if ($readOnly) {
// New share can not have more permissions than the old one.
@@ -452,7 +452,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$stmt = $query->executeQuery();
$calendars = [];
while ($row = $stmt->fetch()) {
- $row['principaluri'] = (string) $row['principaluri'];
+ $row['principaluri'] = (string)$row['principaluri'];
$components = [];
if ($row['components']) {
$components = explode(',', $row['components']);
@@ -502,7 +502,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->executeQuery();
while ($row = $result->fetch()) {
- $row['principaluri'] = (string) $row['principaluri'];
+ $row['principaluri'] = (string)$row['principaluri'];
[, $name] = Uri\split($row['principaluri']);
$row['displayname'] = $row['displayname'] . "($name)";
$components = [];
@@ -567,7 +567,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
throw new NotFound('Node with name \'' . $uri . '\' could not be found');
}
- $row['principaluri'] = (string) $row['principaluri'];
+ $row['principaluri'] = (string)$row['principaluri'];
[, $name] = Uri\split($row['principaluri']);
$row['displayname'] = $row['displayname'] . ' ' . "($name)";
$components = [];
@@ -622,7 +622,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
return null;
}
- $row['principaluri'] = (string) $row['principaluri'];
+ $row['principaluri'] = (string)$row['principaluri'];
$components = [];
if ($row['components']) {
$components = explode(',', $row['components']);
@@ -670,7 +670,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
return null;
}
- $row['principaluri'] = (string) $row['principaluri'];
+ $row['principaluri'] = (string)$row['principaluri'];
$components = [];
if ($row['components']) {
$components = explode(',', $row['components']);
@@ -718,7 +718,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
return null;
}
- $row['principaluri'] = (string) $row['principaluri'];
+ $row['principaluri'] = (string)$row['principaluri'];
$subscription = [
'id' => $row['id'],
'uri' => $row['uri'],
@@ -774,7 +774,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$transp = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp';
if (isset($properties[$transp])) {
- $values['transparent'] = (int) ($properties[$transp]->getValue() === 'transparent');
+ $values['transparent'] = (int)($properties[$transp]->getValue() === 'transparent');
}
foreach ($this->propertyMap as $xmlName => [$dbName, $type]) {
@@ -827,7 +827,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
switch ($propertyName) {
case '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp':
$fieldName = 'transparent';
- $newValues[$fieldName] = (int) ($propertyValue->getValue() === 'transparent');
+ $newValues[$fieldName] = (int)($propertyValue->getValue() === 'transparent');
break;
default:
$fieldName = $this->propertyMap[$propertyName][0];
@@ -844,7 +844,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);
@@ -1067,12 +1067,12 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'uri' => $row['uri'],
'lastmodified' => $row['lastmodified'],
'etag' => '"' . $row['etag'] . '"',
- 'calendarid' => (int) $row['calendarid'],
- 'calendartype' => (int) $row['calendartype'],
- 'size' => (int) $row['size'],
+ 'calendarid' => (int)$row['calendarid'],
+ 'calendartype' => (int)$row['calendartype'],
+ 'size' => (int)$row['size'],
'component' => strtolower($row['componenttype']),
- 'classification' => (int) $row['classification'],
- '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}deleted-at' => $row['deleted_at'] === null ? $row['deleted_at'] : (int) $row['deleted_at'],
+ 'classification' => (int)$row['classification'],
+ '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}deleted-at' => $row['deleted_at'] === null ? $row['deleted_at'] : (int)$row['deleted_at'],
];
}
$stmt->closeCursor();
@@ -1111,7 +1111,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'size' => (int)$row['size'],
'component' => strtolower($row['componenttype']),
'classification' => (int)$row['classification'],
- '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}deleted-at' => $row['deleted_at'] === null ? $row['deleted_at'] : (int) $row['deleted_at'],
+ '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}deleted-at' => $row['deleted_at'] === null ? $row['deleted_at'] : (int)$row['deleted_at'],
];
}
$stmt->closeCursor();
@@ -1171,7 +1171,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'calendardata' => $this->readBlob($row['calendardata']),
'component' => strtolower($row['componenttype']),
'classification' => (int)$row['classification'],
- '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}deleted-at' => $row['deleted_at'] === null ? $row['deleted_at'] : (int) $row['deleted_at'],
+ '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}deleted-at' => $row['deleted_at'] === null ? $row['deleted_at'] : (int)$row['deleted_at'],
];
}
@@ -1260,7 +1260,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->andWhere($qb->expr()->eq('calendartype', $qb->createNamedParameter($calendarType)))
->andWhere($qb->expr()->isNull('deleted_at'));
$result = $qb->executeQuery();
- $count = (int) $result->fetchOne();
+ $count = (int)$result->fetchOne();
$result->closeCursor();
if ($count !== 0) {
@@ -1348,15 +1348,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)))
@@ -1499,13 +1499,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']
);
}
@@ -1553,8 +1553,8 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
public function restoreCalendarObject(array $objectData): void {
$this->cachedObjects = [];
$this->atomic(function () use ($objectData) {
- $id = (int) $objectData['id'];
- $restoreUri = str_replace("-deleted.ics", ".ics", $objectData['uri']);
+ $id = (int)$objectData['id'];
+ $restoreUri = str_replace('-deleted.ics', '.ics', $objectData['uri']);
$targetObject = $this->getCalendarObject(
$objectData['calendarid'],
$restoreUri
@@ -1583,17 +1583,17 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
// Welp, this should possibly not have happened, but let's ignore
return;
}
- $this->addChanges($row['calendarid'], [$row['uri']], 1, (int) $row['calendartype']);
+ $this->addChanges($row['calendarid'], [$row['uri']], 1, (int)$row['calendartype']);
- $calendarRow = $this->getCalendarById((int) $row['calendarid']);
+ $calendarRow = $this->getCalendarById((int)$row['calendarid']);
if ($calendarRow === null) {
throw new RuntimeException('Calendar object data that was just written can\'t be read back. Check your database configuration.');
}
$this->dispatcher->dispatchTyped(
new CalendarObjectRestoredEvent(
- (int) $objectData['calendarid'],
+ (int)$objectData['calendarid'],
$calendarRow,
- $this->getShares((int) $row['calendarid']),
+ $this->getShares((int)$row['calendarid']),
$row
)
);
@@ -2286,7 +2286,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$result = $calendarObjectIdQuery->executeQuery();
$matches = [];
while (($row = $result->fetch()) !== false) {
- $matches[] = (int) $row['objectid'];
+ $matches[] = (int)$row['objectid'];
}
$result->closeCursor();
@@ -2373,7 +2373,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
'calendardata' => $this->readBlob($row['calendardata']),
'component' => strtolower($row['componenttype']),
'classification' => (int)$row['classification'],
- 'deleted_at' => isset($row['deleted_at']) ? ((int) $row['deleted_at']) : null,
+ 'deleted_at' => isset($row['deleted_at']) ? ((int)$row['deleted_at']) : null,
];
}
@@ -2765,9 +2765,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) {
@@ -2795,9 +2795,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();
}
/**
@@ -2940,7 +2940,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);
@@ -3423,7 +3423,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->from('calendarchanges');
$result = $query->executeQuery();
- $maxId = (int) $result->fetchOne();
+ $maxId = (int)$result->fetchOne();
$result->closeCursor();
if (!$maxId || $maxId < $keep) {
return 0;
diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php
index 2781dbafa67..28267921a6f 100644
--- a/apps/dav/lib/CalDAV/Calendar.php
+++ b/apps/dav/lib/CalDAV/Calendar.php
@@ -376,7 +376,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IRestorable, IShareable
* @inheritDoc
*/
public function restore(): void {
- $this->caldavBackend->restoreCalendar((int) $this->calendarInfo['id']);
+ $this->caldavBackend->restoreCalendar((int)$this->calendarInfo['id']);
}
public function disableTrashbin(): void {
diff --git a/apps/dav/lib/CalDAV/CalendarImpl.php b/apps/dav/lib/CalDAV/CalendarImpl.php
index cac9bad0d89..bba1603c325 100644
--- a/apps/dav/lib/CalDAV/CalendarImpl.php
+++ b/apps/dav/lib/CalDAV/CalendarImpl.php
@@ -43,7 +43,7 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage {
* @since 13.0.0
*/
public function getKey(): string {
- return (string) $this->calendarInfo['id'];
+ return (string)$this->calendarInfo['id'];
}
/**
@@ -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
diff --git a/apps/dav/lib/CalDAV/CalendarObject.php b/apps/dav/lib/CalDAV/CalendarObject.php
index f7af3ce8b4b..0dd9bee9ce4 100644
--- a/apps/dav/lib/CalDAV/CalendarObject.php
+++ b/apps/dav/lib/CalDAV/CalendarObject.php
@@ -62,7 +62,7 @@ class CalendarObject extends \Sabre\CalDAV\CalendarObject {
}
public function getId(): int {
- return (int) $this->objectData['id'];
+ return (int)$this->objectData['id'];
}
protected function isShared() {
diff --git a/apps/dav/lib/CalDAV/EventReader.php b/apps/dav/lib/CalDAV/EventReader.php
index 99e5677d432..bdceb184fb0 100644
--- a/apps/dav/lib/CalDAV/EventReader.php
+++ b/apps/dav/lib/CalDAV/EventReader.php
@@ -66,8 +66,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) {
@@ -295,9 +295,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;
}
@@ -312,9 +312,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();
}
@@ -331,7 +331,7 @@ class EventReader {
*
* @return int|null
*/
- public function recurringInterval(): int | null {
+ public function recurringInterval(): int|null {
return $this->rruleIterator?->interval();
}
@@ -374,14 +374,14 @@ class EventReader {
*
* @return int|null
*/
- public function recurringConcludesAfter(): int | null {
+ public function recurringConcludesAfter(): int|null {
// construct count place holder
$count = 0;
// retrieve and add RRULE iterations count
- $count += (int) $this->rruleIterator?->concludesAfter();
+ $count += (int)$this->rruleIterator?->concludesAfter();
// retrieve and add RDATE iterations count
- $count += (int) $this->rdateIterator?->concludesAfter();
+ $count += (int)$this->rdateIterator?->concludesAfter();
// return count
return !empty($count) ? $count : null;
@@ -399,7 +399,7 @@ class EventReader {
*
* @return DateTime|null
*/
- public function recurringConcludesOn(): DateTime | null {
+ public function recurringConcludesOn(): DateTime|null {
if ($this->rruleIterator !== null) {
// retrieve rrule conclusion date
@@ -626,7 +626,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 {
@@ -745,7 +745,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/Publishing/PublishPlugin.php b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php
index 94c5b7d1f52..1b30884cf12 100644
--- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php
+++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php
@@ -133,7 +133,7 @@ class PublishPlugin extends ServerPlugin {
$path = $request->getPath();
// Only handling xml
- $contentType = (string) $request->getHeader('Content-Type');
+ $contentType = (string)$request->getHeader('Content-Type');
if (!str_contains($contentType, 'application/xml') && !str_contains($contentType, 'text/xml')) {
return;
}
diff --git a/apps/dav/lib/CalDAV/Reminder/Backend.php b/apps/dav/lib/CalDAV/Reminder/Backend.php
index a4f3c7c6e12..1fa30f2538b 100644
--- a/apps/dav/lib/CalDAV/Reminder/Backend.php
+++ b/apps/dav/lib/CalDAV/Reminder/Backend.php
@@ -188,15 +188,15 @@ class Backend {
* @return array
*/
private function fixRowTyping(array $row): array {
- $row['id'] = (int) $row['id'];
- $row['calendar_id'] = (int) $row['calendar_id'];
- $row['object_id'] = (int) $row['object_id'];
- $row['is_recurring'] = (bool) $row['is_recurring'];
- $row['recurrence_id'] = (int) $row['recurrence_id'];
- $row['is_recurrence_exception'] = (bool) $row['is_recurrence_exception'];
- $row['is_relative'] = (bool) $row['is_relative'];
- $row['notification_date'] = (int) $row['notification_date'];
- $row['is_repeat_based'] = (bool) $row['is_repeat_based'];
+ $row['id'] = (int)$row['id'];
+ $row['calendar_id'] = (int)$row['calendar_id'];
+ $row['object_id'] = (int)$row['object_id'];
+ $row['is_recurring'] = (bool)$row['is_recurring'];
+ $row['recurrence_id'] = (int)$row['recurrence_id'];
+ $row['is_recurrence_exception'] = (bool)$row['is_recurrence_exception'];
+ $row['is_relative'] = (bool)$row['is_relative'];
+ $row['notification_date'] = (int)$row['notification_date'];
+ $row['is_repeat_based'] = (bool)$row['is_repeat_based'];
return $row;
}
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php
index 4d087f58d2b..33e7ae9c09f 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php
@@ -113,7 +113,7 @@ abstract class AbstractProvider implements INotificationProvider {
*/
private function getStatusOfEvent(VEvent $vevent):string {
if ($vevent->STATUS) {
- return (string) $vevent->STATUS;
+ return (string)$vevent->STATUS;
}
// Doesn't say so in the standard,
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
index 947d286643c..59f412c0a7b 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
@@ -149,11 +149,11 @@ class EmailProvider extends AbstractProvider {
$this->getAbsoluteImagePath('places/calendar.png'));
if (isset($vevent->LOCATION)) {
- $template->addBodyListItem((string) $vevent->LOCATION, $l10n->t('Where:'),
+ $template->addBodyListItem((string)$vevent->LOCATION, $l10n->t('Where:'),
$this->getAbsoluteImagePath('actions/address.png'));
}
if (isset($vevent->DESCRIPTION)) {
- $template->addBodyListItem((string) $vevent->DESCRIPTION, $l10n->t('Description:'),
+ $template->addBodyListItem((string)$vevent->DESCRIPTION, $l10n->t('Description:'),
$this->getAbsoluteImagePath('actions/more.png'));
}
}
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php
index 5b0ba28a6c1..d8abbc39631 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php
@@ -65,7 +65,7 @@ class PushProvider extends AbstractProvider {
}
$eventDetails = $this->extractEventDetails($vevent);
- $eventUUID = (string) $vevent->UID;
+ $eventUUID = (string)$vevent->UID;
if (!$eventUUID) {
return;
};
@@ -100,13 +100,13 @@ class PushProvider extends AbstractProvider {
return [
'title' => isset($vevent->SUMMARY)
- ? ((string) $vevent->SUMMARY)
+ ? ((string)$vevent->SUMMARY)
: null,
'description' => isset($vevent->DESCRIPTION)
- ? ((string) $vevent->DESCRIPTION)
+ ? ((string)$vevent->DESCRIPTION)
: null,
'location' => isset($vevent->LOCATION)
- ? ((string) $vevent->LOCATION)
+ ? ((string)$vevent->LOCATION)
: null,
'all_day' => $start instanceof Property\ICalendar\Date,
'start_atom' => $start->getDateTime()->format(\DateTimeInterface::ATOM),
diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php
index be81e534dd3..4ac9e83ef08 100644
--- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php
+++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php
@@ -206,14 +206,14 @@ class ReminderService {
if (!$vcalendar) {
return;
}
- $calendarTimeZone = $this->getCalendarTimeZone((int) $objectData['calendarid']);
+ $calendarTimeZone = $this->getCalendarTimeZone((int)$objectData['calendarid']);
$vevents = $this->getAllVEventsFromVCalendar($vcalendar);
if (count($vevents) === 0) {
return;
}
- $uid = (string) $vevents[0]->UID;
+ $uid = (string)$vevents[0]->UID;
$recurrenceExceptions = $this->getRecurrenceExceptionFromListOfVEvents($vevents);
$masterItem = $this->getMasterItemFromListOfVEvents($vevents);
$now = $this->timeFactory->getDateTime();
@@ -283,7 +283,7 @@ class ReminderService {
continue;
}
- if (!\in_array((string) $valarm->ACTION, self::REMINDER_TYPES, true)) {
+ if (!\in_array((string)$valarm->ACTION, self::REMINDER_TYPES, true)) {
// Action allows x-name, we don't insert reminders
// into the database if they are not standard
$processedAlarms[] = $alarmHash;
@@ -353,7 +353,7 @@ class ReminderService {
return;
}
- $this->backend->cleanRemindersForEvent((int) $objectData['id']);
+ $this->backend->cleanRemindersForEvent((int)$objectData['id']);
}
/**
@@ -402,19 +402,19 @@ class ReminderService {
$alarms[] = [
'calendar_id' => $objectData['calendarid'],
'object_id' => $objectData['id'],
- 'uid' => (string) $valarm->parent->UID,
+ 'uid' => (string)$valarm->parent->UID,
'is_recurring' => $isRecurring,
'recurrence_id' => $recurrenceId,
'is_recurrence_exception' => $isRecurrenceException,
'event_hash' => $eventHash,
'alarm_hash' => $alarmHash,
- 'type' => (string) $valarm->ACTION,
+ 'type' => (string)$valarm->ACTION,
'is_relative' => $isRelative,
'notification_date' => $notificationDate->getTimestamp(),
'is_repeat_based' => false,
];
- $repeat = isset($valarm->REPEAT) ? (int) $valarm->REPEAT->getValue() : 0;
+ $repeat = isset($valarm->REPEAT) ? (int)$valarm->REPEAT->getValue() : 0;
for ($i = 0; $i < $repeat; $i++) {
if ($valarm->DURATION === null) {
continue;
@@ -424,13 +424,13 @@ class ReminderService {
$alarms[] = [
'calendar_id' => $objectData['calendarid'],
'object_id' => $objectData['id'],
- 'uid' => (string) $valarm->parent->UID,
+ 'uid' => (string)$valarm->parent->UID,
'is_recurring' => $isRecurring,
'recurrence_id' => $recurrenceId,
'is_recurrence_exception' => $isRecurrenceException,
'event_hash' => $eventHash,
'alarm_hash' => $alarmHash,
- 'type' => (string) $valarm->ACTION,
+ 'type' => (string)$valarm->ACTION,
'is_relative' => $isRelative,
'notification_date' => $clonedNotificationDate->getTimestamp(),
'is_repeat_based' => true,
@@ -453,17 +453,17 @@ class ReminderService {
}
foreach (array_values($uniqueReminders) as $reminder) {
$this->backend->insertReminder(
- (int) $reminder['calendar_id'],
- (int) $reminder['object_id'],
+ (int)$reminder['calendar_id'],
+ (int)$reminder['object_id'],
$reminder['uid'],
$reminder['is_recurring'],
- (int) $reminder['recurrence_id'],
+ (int)$reminder['recurrence_id'],
$reminder['is_recurrence_exception'],
$reminder['event_hash'],
$reminder['alarm_hash'],
$reminder['type'],
$reminder['is_relative'],
- (int) $reminder['notification_date'],
+ (int)$reminder['notification_date'],
$reminder['is_repeat_based']
);
}
@@ -486,7 +486,7 @@ class ReminderService {
$vevents = $this->getAllVEventsFromVCalendar($vevent->parent);
$recurrenceExceptions = $this->getRecurrenceExceptionFromListOfVEvents($vevents);
$now = $this->timeFactory->getDateTime();
- $calendarTimeZone = $this->getCalendarTimeZone((int) $reminder['calendar_id']);
+ $calendarTimeZone = $this->getCalendarTimeZone((int)$reminder['calendar_id']);
try {
$iterator = new EventIterator($vevents, $reminder['uid']);
@@ -602,26 +602,26 @@ class ReminderService {
*/
private function getEventHash(VEvent $vevent):string {
$properties = [
- (string) $vevent->DTSTART->serialize(),
+ (string)$vevent->DTSTART->serialize(),
];
if ($vevent->DTEND) {
- $properties[] = (string) $vevent->DTEND->serialize();
+ $properties[] = (string)$vevent->DTEND->serialize();
}
if ($vevent->DURATION) {
- $properties[] = (string) $vevent->DURATION->serialize();
+ $properties[] = (string)$vevent->DURATION->serialize();
}
if ($vevent->{'RECURRENCE-ID'}) {
- $properties[] = (string) $vevent->{'RECURRENCE-ID'}->serialize();
+ $properties[] = (string)$vevent->{'RECURRENCE-ID'}->serialize();
}
if ($vevent->RRULE) {
- $properties[] = (string) $vevent->RRULE->serialize();
+ $properties[] = (string)$vevent->RRULE->serialize();
}
if ($vevent->EXDATE) {
- $properties[] = (string) $vevent->EXDATE->serialize();
+ $properties[] = (string)$vevent->EXDATE->serialize();
}
if ($vevent->RDATE) {
- $properties[] = (string) $vevent->RDATE->serialize();
+ $properties[] = (string)$vevent->RDATE->serialize();
}
return md5(implode('::', $properties));
@@ -636,15 +636,15 @@ class ReminderService {
*/
private function getAlarmHash(VAlarm $valarm):string {
$properties = [
- (string) $valarm->ACTION->serialize(),
- (string) $valarm->TRIGGER->serialize(),
+ (string)$valarm->ACTION->serialize(),
+ (string)$valarm->TRIGGER->serialize(),
];
if ($valarm->DURATION) {
- $properties[] = (string) $valarm->DURATION->serialize();
+ $properties[] = (string)$valarm->DURATION->serialize();
}
if ($valarm->REPEAT) {
- $properties[] = (string) $valarm->REPEAT->serialize();
+ $properties[] = (string)$valarm->REPEAT->serialize();
}
return md5(implode('::', $properties));
@@ -664,7 +664,7 @@ class ReminderService {
return null;
}
- $uid = (string) $vevents[0]->UID;
+ $uid = (string)$vevents[0]->UID;
$recurrenceExceptions = $this->getRecurrenceExceptionFromListOfVEvents($vevents);
$masterItem = $this->getMasterItemFromListOfVEvents($vevents);
@@ -715,7 +715,7 @@ class ReminderService {
*/
private function getStatusOfEvent(VEvent $vevent):string {
if ($vevent->STATUS) {
- return (string) $vevent->STATUS;
+ return (string)$vevent->STATUS;
}
// Doesn't say so in the standard,
diff --git a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php
index 2eb8ebfc84e..83e2935a46e 100644
--- a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php
+++ b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php
@@ -386,7 +386,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
try {
$stmt = $query->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/RetentionService.php b/apps/dav/lib/CalDAV/RetentionService.php
index 72301927f2b..a41aa12bb66 100644
--- a/apps/dav/lib/CalDAV/RetentionService.php
+++ b/apps/dav/lib/CalDAV/RetentionService.php
@@ -36,10 +36,10 @@ class RetentionService {
public function getDuration(): int {
return max(
- (int) $this->config->getAppValue(
+ (int)$this->config->getAppValue(
Application::APP_ID,
self::RETENTION_CONFIG_KEY,
- (string) self::DEFAULT_RETENTION_SECONDS
+ (string)self::DEFAULT_RETENTION_SECONDS
),
0 // Just making sure we don't delete things in the future when a negative number is passed
);
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipService.php b/apps/dav/lib/CalDAV/Schedule/IMipService.php
index 14272cb5206..3d6317e6968 100644
--- a/apps/dav/lib/CalDAV/Schedule/IMipService.php
+++ b/apps/dav/lib/CalDAV/Schedule/IMipService.php
@@ -256,7 +256,7 @@ class IMipService {
public function generateWhenStringRecurringDaily(EventReader $er): string {
// initialize
- $interval = (int) $er->recurringInterval();
+ $interval = (int)$er->recurringInterval();
$startTime = '';
$endTime = '';
$conclusion = '';
@@ -308,7 +308,7 @@ class IMipService {
public function generateWhenStringRecurringWeekly(EventReader $er): string {
// initialize
- $interval = (int) $er->recurringInterval();
+ $interval = (int)$er->recurringInterval();
$startTime = '';
$endTime = '';
$conclusion = '';
@@ -362,7 +362,7 @@ class IMipService {
public function generateWhenStringRecurringMonthly(EventReader $er): string {
// initialize
- $interval = (int) $er->recurringInterval();
+ $interval = (int)$er->recurringInterval();
$startTime = '';
$endTime = '';
$conclusion = '';
@@ -428,7 +428,7 @@ class IMipService {
public function generateWhenStringRecurringYearly(EventReader $er): string {
// initialize
- $interval = (int) $er->recurringInterval();
+ $interval = (int)$er->recurringInterval();
$startTime = '';
$endTime = '';
$conclusion = '';
diff --git a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php
index 3ef147fe200..1326a42399b 100644
--- a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php
+++ b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php
@@ -83,7 +83,7 @@ class DeletedCalendarObject implements IACL, ICalendarObject, IRestorable {
}
public function getSize() {
- return (int) $this->objectData['size'];
+ return (int)$this->objectData['size'];
}
public function restore(): void {
@@ -91,7 +91,7 @@ class DeletedCalendarObject implements IACL, ICalendarObject, IRestorable {
}
public function getDeletedAt(): ?int {
- return $this->objectData['deleted_at'] ? (int) $this->objectData['deleted_at'] : null;
+ return $this->objectData['deleted_at'] ? (int)$this->objectData['deleted_at'] : null;
}
public function getCalendarUri(): string {
diff --git a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php
index abf5f001e71..c9db04f7d32 100644
--- a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php
+++ b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php
@@ -51,7 +51,7 @@ class DeletedCalendarObjectsCollection implements ICalendarObjectContainer, IACL
$data = $this->caldavBackend->getCalendarObjectById(
$this->principalInfo['uri'],
- (int) $matches[1],
+ (int)$matches[1],
);
// If the object hasn't been deleted yet then we don't want to find it here
diff --git a/apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php b/apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php
index 680e5a1f02a..4a9721d00ec 100644
--- a/apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php
+++ b/apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php
@@ -30,7 +30,7 @@ class CalDavValidatePlugin extends ServerPlugin {
public function beforePut(RequestInterface $request, ResponseInterface $response): bool {
// evaluate if card size exceeds defined limit
$eventSizeLimit = $this->config->getValueInt(Application::APP_ID, 'event_size_limit', 10485760);
- if ((int) $request->getRawServerValue('CONTENT_LENGTH') > $eventSizeLimit) {
+ if ((int)$request->getRawServerValue('CONTENT_LENGTH') > $eventSizeLimit) {
throw new Forbidden("VEvent or VTodo object exceeds $eventSizeLimit bytes");
}
// all tests passed return true
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 102571c8ef9..1f2c006cdfe 100644
--- a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php
+++ b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php
@@ -60,7 +60,7 @@ class RefreshWebcalService {
return;
}
- $localData = $this->calDavBackend->getLimitedCalendarObjects((int) $subscription['id'], CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
+ $localData = $this->calDavBackend->getLimitedCalendarObjects((int)$subscription['id'], CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
$stripTodos = ($subscription[self::STRIP_TODOS] ?? 1) === 1;
$stripAlarms = ($subscription[self::STRIP_ALARMS] ?? 1) === 1;
@@ -124,13 +124,13 @@ 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->error('Unable to create calendar object from subscription {subscriptionId}', ['exception' => $ex, 'subscriptionId' => $subscription['id'], 'source' => $subscription['source']]);
}
}
$ids = array_map(static function ($dataSet): int {
- return (int) $dataSet['id'];
+ return (int)$dataSet['id'];
}, $localData);
$uris = array_map(static function ($dataSet): string {
return $dataSet['uri'];
@@ -150,7 +150,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/CardDAV/Activity/Backend.php b/apps/dav/lib/CardDAV/Activity/Backend.php
index 34cf429022d..d2466e34f9d 100644
--- a/apps/dav/lib/CardDAV/Activity/Backend.php
+++ b/apps/dav/lib/CardDAV/Activity/Backend.php
@@ -111,7 +111,7 @@ class Backend {
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
- ->setObject('addressbook', (int) $addressbookData['id'])
+ ->setObject('addressbook', (int)$addressbookData['id'])
->setType('contacts')
->setAuthor($currentUser);
@@ -139,7 +139,7 @@ class Backend {
[
'actor' => $currentUser,
'addressbook' => [
- 'id' => (int) $addressbookData['id'],
+ 'id' => (int)$addressbookData['id'],
'uri' => $addressbookData['uri'],
'name' => $addressbookData['{DAV:}displayname'],
],
@@ -170,7 +170,7 @@ class Backend {
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
- ->setObject('addressbook', (int) $addressbookData['id'])
+ ->setObject('addressbook', (int)$addressbookData['id'])
->setType('contacts')
->setAuthor($currentUser);
@@ -195,7 +195,7 @@ class Backend {
$parameters = [
'actor' => $event->getAuthor(),
'addressbook' => [
- 'id' => (int) $addressbookData['id'],
+ 'id' => (int)$addressbookData['id'],
'uri' => $addressbookData['uri'],
'name' => $addressbookData['{DAV:}displayname'],
],
@@ -224,7 +224,7 @@ class Backend {
$parameters = [
'actor' => $event->getAuthor(),
'addressbook' => [
- 'id' => (int) $addressbookData['id'],
+ 'id' => (int)$addressbookData['id'],
'uri' => $addressbookData['uri'],
'name' => $addressbookData['{DAV:}displayname'],
],
@@ -266,7 +266,7 @@ class Backend {
$parameters = [
'actor' => $event->getAuthor(),
'addressbook' => [
- 'id' => (int) $addressbookData['id'],
+ 'id' => (int)$addressbookData['id'],
'uri' => $addressbookData['uri'],
'name' => $addressbookData['{DAV:}displayname'],
],
@@ -293,7 +293,7 @@ class Backend {
$parameters = [
'actor' => $event->getAuthor(),
'addressbook' => [
- 'id' => (int) $addressbookData['id'],
+ 'id' => (int)$addressbookData['id'],
'uri' => $addressbookData['uri'],
'name' => $addressbookData['{DAV:}displayname'],
],
@@ -371,7 +371,7 @@ class Backend {
[
'actor' => $event->getAuthor(),
'addressbook' => [
- 'id' => (int) $properties['id'],
+ 'id' => (int)$properties['id'],
'uri' => $properties['uri'],
'name' => $properties['{DAV:}displayname'],
],
@@ -415,7 +415,7 @@ class Backend {
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
- ->setObject('addressbook', (int) $addressbookData['id'])
+ ->setObject('addressbook', (int)$addressbookData['id'])
->setType('contacts')
->setAuthor($currentUser);
@@ -427,7 +427,7 @@ class Backend {
$params = [
'actor' => $event->getAuthor(),
'addressbook' => [
- 'id' => (int) $addressbookData['id'],
+ 'id' => (int)$addressbookData['id'],
'uri' => $addressbookData['uri'],
'name' => $addressbookData['{DAV:}displayname'],
],
@@ -454,7 +454,7 @@ class Backend {
*/
protected function getCardNameAndId(array $cardData): array {
$vObject = Reader::read($cardData['carddata']);
- return ['id' => (string) $vObject->UID, 'name' => (string) ($vObject->FN ?? '')];
+ return ['id' => (string)$vObject->UID, 'name' => (string)($vObject->FN ?? '')];
}
/**
diff --git a/apps/dav/lib/CardDAV/Activity/Filter.php b/apps/dav/lib/CardDAV/Activity/Filter.php
index 84e933fec7c..2003189ab5c 100644
--- a/apps/dav/lib/CardDAV/Activity/Filter.php
+++ b/apps/dav/lib/CardDAV/Activity/Filter.php
@@ -38,8 +38,8 @@ class Filter implements IFilter {
/**
* @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 40;
diff --git a/apps/dav/lib/CardDAV/Activity/Provider/Base.php b/apps/dav/lib/CardDAV/Activity/Provider/Base.php
index 0a1b55efb08..95b4d52b242 100644
--- a/apps/dav/lib/CardDAV/Activity/Provider/Base.php
+++ b/apps/dav/lib/CardDAV/Activity/Provider/Base.php
@@ -21,7 +21,7 @@ abstract class Base implements IProvider {
/** @var IUserManager */
protected $userManager;
- /** @var string[] */
+ /** @var string[] */
protected $userDisplayNames = [];
/** @var IGroupManager */
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/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php
index 55f7f3b7639..5dfb22141e8 100644
--- a/apps/dav/lib/CardDAV/AddressBookImpl.php
+++ b/apps/dav/lib/CardDAV/AddressBookImpl.php
@@ -78,19 +78,19 @@ class AddressBookImpl implements IAddressBook {
* @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) {
@@ -131,13 +131,13 @@ class AddressBookImpl implements IAddressBook {
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);
diff --git a/apps/dav/lib/CardDAV/Card.php b/apps/dav/lib/CardDAV/Card.php
index 67f605d2fb4..8cd4fd7e5ee 100644
--- a/apps/dav/lib/CardDAV/Card.php
+++ b/apps/dav/lib/CardDAV/Card.php
@@ -10,7 +10,7 @@ namespace OCA\DAV\CardDAV;
class Card extends \Sabre\CardDAV\Card {
public function getId(): int {
- return (int) $this->cardData['id'];
+ return (int)$this->cardData['id'];
}
public function getUri(): string {
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index 9d787c917d3..9dee61638a5 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -76,7 +76,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
$result = $query->executeQuery();
- $column = (int) $result->fetchOne();
+ $column = (int)$result->fetchOne();
$result->closeCursor();
return $column;
}
@@ -330,7 +330,7 @@ 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);
@@ -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
*/
@@ -1061,7 +1061,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
array $options = []): array {
return $this->atomic(function () use ($principalUri, $pattern, $searchProperties, $options) {
$addressBookIds = array_map(static function ($row):int {
- return (int) $row['id'];
+ return (int)$row['id'];
}, $this->getAddressBooksForUser($principalUri));
return $this->searchByAddressBookIds($addressBookIds, $pattern, $searchProperties, $options);
@@ -1186,7 +1186,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
}
return array_map(function ($array) {
- $array['addressbookid'] = (int) $array['addressbookid'];
+ $array['addressbookid'] = (int)$array['addressbookid'];
$modified = false;
$array['carddata'] = $this->readBlob($array['carddata'], $modified);
if ($modified) {
@@ -1398,7 +1398,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
->from('addressbookchanges');
$result = $query->executeQuery();
- $maxId = (int) $result->fetchOne();
+ $maxId = (int)$result->fetchOne();
$result->closeCursor();
if (!$maxId || $maxId < $keep) {
return 0;
diff --git a/apps/dav/lib/CardDAV/ContactsManager.php b/apps/dav/lib/CardDAV/ContactsManager.php
index 6126ebc10ee..30af37481ab 100644
--- a/apps/dav/lib/CardDAV/ContactsManager.php
+++ b/apps/dav/lib/CardDAV/ContactsManager.php
@@ -12,10 +12,10 @@ use OCP\IL10N;
use OCP\IURLGenerator;
class ContactsManager {
- /** @var CardDavBackend */
+ /** @var CardDavBackend */
private $backend;
- /** @var IL10N */
+ /** @var IL10N */
private $l10n;
/**
@@ -45,7 +45,7 @@ class ContactsManager {
* @param IURLGenerator $urlGenerator
*/
public function setupSystemContactsProvider(IManager $cm, IURLGenerator $urlGenerator) {
- $addressBooks = $this->backend->getAddressBooksForUser("principals/system/system");
+ $addressBooks = $this->backend->getAddressBooksForUser('principals/system/system');
$this->register($cm, $addressBooks, $urlGenerator);
}
diff --git a/apps/dav/lib/CardDAV/MultiGetExportPlugin.php b/apps/dav/lib/CardDAV/MultiGetExportPlugin.php
index 62ab16721b1..524ed4d433c 100644
--- a/apps/dav/lib/CardDAV/MultiGetExportPlugin.php
+++ b/apps/dav/lib/CardDAV/MultiGetExportPlugin.php
@@ -43,7 +43,7 @@ class MultiGetExportPlugin extends DAV\ServerPlugin {
}
// Only handling xml
- $contentType = (string) $response->getHeader('Content-Type');
+ $contentType = (string)$response->getHeader('Content-Type');
if (!str_contains($contentType, 'application/xml') && !str_contains($contentType, 'text/xml')) {
return;
}
diff --git a/apps/dav/lib/CardDAV/PhotoCache.php b/apps/dav/lib/CardDAV/PhotoCache.php
index 3ea99c29a51..00989386df7 100644
--- a/apps/dav/lib/CardDAV/PhotoCache.php
+++ b/apps/dav/lib/CardDAV/PhotoCache.php
@@ -19,7 +19,7 @@ use Sabre\VObject\Reader;
class PhotoCache {
- /** @var array */
+ /** @var array */
public const ALLOWED_CONTENT_TYPES = [
'image/png' => 'png',
'image/jpeg' => 'jpg',
@@ -119,7 +119,7 @@ class PhotoCache {
$ratio = 1 / $ratio;
}
- $size = (int) ($size * $ratio);
+ $size = (int)($size * $ratio);
if ($size !== -1) {
$photo->resize($size);
}
@@ -240,7 +240,7 @@ class PhotoCache {
if (isset($params['TYPE']) || isset($params['MEDIATYPE'])) {
/** @var Parameter $typeParam */
$typeParam = isset($params['TYPE']) ? $params['TYPE'] : $params['MEDIATYPE'];
- $type = (string) $typeParam->getValue();
+ $type = (string)$typeParam->getValue();
if (str_starts_with($type, 'image/')) {
return $type;
diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php
index 56cbe5255f4..02b862f1930 100644
--- a/apps/dav/lib/CardDAV/SyncService.php
+++ b/apps/dav/lib/CardDAV/SyncService.php
@@ -237,7 +237,7 @@ class SyncService {
*/
public function getLocalSystemAddressBook() {
if (is_null($this->localSystemAddressBook)) {
- $systemPrincipal = "principals/system/system";
+ $systemPrincipal = 'principals/system/system';
$this->localSystemAddressBook = $this->ensureSystemAddressBookExists($systemPrincipal, 'system', [
'{' . Plugin::NS_CARDDAV . '}addressbook-description' => 'System addressbook which holds all users of this instance'
]);
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/CardDAV/Validation/CardDavValidatePlugin.php b/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php
index 635ab6fcc78..7e76b9dac92 100644
--- a/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php
+++ b/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php
@@ -30,7 +30,7 @@ class CardDavValidatePlugin extends ServerPlugin {
public function beforePut(RequestInterface $request, ResponseInterface $response): bool {
// evaluate if card size exceeds defined limit
$cardSizeLimit = $this->config->getValueInt(Application::APP_ID, 'card_size_limit', 5242880);
- if ((int) $request->getRawServerValue('CONTENT_LENGTH') > $cardSizeLimit) {
+ if ((int)$request->getRawServerValue('CONTENT_LENGTH') > $cardSizeLimit) {
throw new Forbidden("VCard object exceeds $cardSizeLimit bytes");
}
// all tests passed return true
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..53cabcfc5ce 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/MoveCalendar.php b/apps/dav/lib/Command/MoveCalendar.php
index b8adc75338a..36f20e5b547 100644
--- a/apps/dav/lib/Command/MoveCalendar.php
+++ b/apps/dav/lib/Command/MoveCalendar.php
@@ -50,7 +50,7 @@ class MoveCalendar extends Command {
->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 +97,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 +155,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 +166,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/SyncBirthdayCalendar.php b/apps/dav/lib/Command/SyncBirthdayCalendar.php
index 5c8ac913af4..de63a8572bb 100644
--- a/apps/dav/lib/Command/SyncBirthdayCalendar.php
+++ b/apps/dav/lib/Command/SyncBirthdayCalendar.php
@@ -55,7 +55,7 @@ class SyncBirthdayCalendar extends Command {
$this->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..3be87460d21 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;
/**
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/AppleQuirksPlugin.php b/apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php
index 8f5195e926b..88fff5e6a5a 100644
--- a/apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/AppleQuirksPlugin.php
@@ -58,8 +58,8 @@ class AppleQuirksPlugin extends ServerPlugin {
* This method handles HTTP REPORT requests.
*
* @param string $reportName
- * @param mixed $report
- * @param mixed $path
+ * @param mixed $report
+ * @param mixed $path
*
* @return bool
*/
diff --git a/apps/dav/lib/Connector/Sabre/CachingTree.php b/apps/dav/lib/Connector/Sabre/CachingTree.php
index a715991fcf6..86e102677c1 100644
--- a/apps/dav/lib/Connector/Sabre/CachingTree.php
+++ b/apps/dav/lib/Connector/Sabre/CachingTree.php
@@ -27,7 +27,7 @@ class CachingTree extends Tree {
// flushing the entire cache
$path = trim($path, '/');
foreach ($this->cache as $nodePath => $node) {
- $nodePath = (string) $nodePath;
+ $nodePath = (string)$nodePath;
if ($path === '' || $nodePath == $path || str_starts_with($nodePath, $path . '/')) {
unset($this->cache[$nodePath]);
}
diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
index 71514016bda..f2da3782def 100644
--- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
@@ -62,7 +62,7 @@ class CommentPropertiesPlugin extends ServerPlugin {
$ids[] = (string)$id;
}
- $ids[] = (string) $directory->getId();
+ $ids[] = (string)$directory->getId();
$unread = $this->commentsManager->getNumberOfUnreadCommentsForObjects('files', $ids, $this->userSession->getUser());
foreach ($unread as $id => $count) {
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 427ec59bc31..503acf8dae5 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/FileLocked.php b/apps/dav/lib/Connector/Sabre/Exception/FileLocked.php
index 5c39e6a437a..bad4bfa12ab 100644
--- a/apps/dav/lib/Connector/Sabre/Exception/FileLocked.php
+++ b/apps/dav/lib/Connector/Sabre/Exception/FileLocked.php
@@ -14,7 +14,7 @@ class FileLocked extends \Sabre\DAV\Exception {
* @param string $message
* @param int $code
*/
- public function __construct($message = "", $code = 0, ?Exception $previous = null) {
+ public function __construct($message = '', $code = 0, ?Exception $previous = null) {
if ($previous instanceof \OCP\Files\LockNotAcquiredException) {
$message = sprintf('Target file %s is locked by another process.', $previous->path);
}
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index bca0d15709f..d4c996df145 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -167,7 +167,7 @@ class FilesPlugin extends ServerPlugin {
}
if (!$sourceNodeFileInfo->isDeletable()) {
- throw new Forbidden($source . " cannot be deleted");
+ throw new Forbidden($source . ' cannot be deleted');
}
}
}
@@ -507,7 +507,7 @@ class FilesPlugin extends ServerPlugin {
if (empty($time)) {
return false;
}
- $node->setCreationTime((int) $time);
+ $node->setCreationTime((int)$time);
return true;
});
diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
index 0a978e099dc..52e84145b17 100644
--- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
@@ -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[]
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..029061694ea 100644
--- a/apps/dav/lib/Connector/Sabre/Principal.php
+++ b/apps/dav/lib/Connector/Sabre/Principal.php
@@ -180,7 +180,7 @@ class Principal implements BackendInterface {
} elseif ($prefix === 'principals/system') {
return [
'uri' => '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/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php
index d7572c46ed3..3f5268f5137 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;
diff --git a/apps/dav/lib/Controller/InvitationResponseController.php b/apps/dav/lib/Controller/InvitationResponseController.php
index 678d0d47b28..cf4e24e8f1c 100644
--- a/apps/dav/lib/Controller/InvitationResponseController.php
+++ b/apps/dav/lib/Controller/InvitationResponseController.php
@@ -156,7 +156,7 @@ class InvitationResponseController extends Controller {
}
$currentTime = $this->timeFactory->getTime();
- if (((int) $row['expiration']) < $currentTime) {
+ if (((int)$row['expiration']) < $currentTime) {
return null;
}
diff --git a/apps/dav/lib/DAV/PublicAuth.php b/apps/dav/lib/DAV/PublicAuth.php
index 2142bd04753..c2b4ada173a 100644
--- a/apps/dav/lib/DAV/PublicAuth.php
+++ b/apps/dav/lib/DAV/PublicAuth.php
@@ -53,9 +53,9 @@ class PublicAuth implements BackendInterface {
*/
public function check(RequestInterface $request, ResponseInterface $response) {
if ($this->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 cbae9ec1a37..2e1a84b6bc8 100644
--- a/apps/dav/lib/DAV/Sharing/Backend.php
+++ b/apps/dav/lib/DAV/Sharing/Backend.php
@@ -136,7 +136,7 @@ abstract class Backend {
'href' => "principal:{$row['principaluri']}",
'commonName' => isset($p['{DAV:}displayname']) ? (string)$p['{DAV:}displayname'] : '',
'status' => 1,
- 'readOnly' => (int) $row['access'] === Backend::ACCESS_READ,
+ 'readOnly' => (int)$row['access'] === Backend::ACCESS_READ,
'{http://owncloud.org/ns}principal' => (string)$row['principaluri'],
'{http://owncloud.org/ns}group-share' => isset($p['uri']) && str_starts_with($p['uri'], 'principals/groups')
];
@@ -162,7 +162,7 @@ abstract class Backend {
'href' => "principal:{$row['principaluri']}",
'commonName' => isset($p['{DAV:}displayname']) ? (string)$p['{DAV:}displayname'] : '',
'status' => 1,
- 'readOnly' => (int) $row['access'] === self::ACCESS_READ,
+ 'readOnly' => (int)$row['access'] === self::ACCESS_READ,
'{http://owncloud.org/ns}principal' => (string)$row['principaluri'],
'{http://owncloud.org/ns}group-share' => isset($p['uri']) && str_starts_with($p['uri'], 'principals/groups')
];
diff --git a/apps/dav/lib/DAV/Sharing/Plugin.php b/apps/dav/lib/DAV/Sharing/Plugin.php
index 98d6883e826..c228d6993c2 100644
--- a/apps/dav/lib/DAV/Sharing/Plugin.php
+++ b/apps/dav/lib/DAV/Sharing/Plugin.php
@@ -110,7 +110,7 @@ class Plugin extends ServerPlugin {
$path = $request->getPath();
// Only handling xml
- $contentType = (string) $request->getHeader('Content-Type');
+ $contentType = (string)$request->getHeader('Content-Type');
if (!str_contains($contentType, 'application/xml') && !str_contains($contentType, 'text/xml')) {
return;
}
diff --git a/apps/dav/lib/DAV/ViewOnlyPlugin.php b/apps/dav/lib/DAV/ViewOnlyPlugin.php
index b6139638aa5..d8c8649b4b7 100644
--- a/apps/dav/lib/DAV/ViewOnlyPlugin.php
+++ b/apps/dav/lib/DAV/ViewOnlyPlugin.php
@@ -73,7 +73,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..d7cd46087c3 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');
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/Listener/CalendarShareUpdateListener.php b/apps/dav/lib/Listener/CalendarShareUpdateListener.php
index c2ce058825e..51a8968cac1 100644
--- a/apps/dav/lib/Listener/CalendarShareUpdateListener.php
+++ b/apps/dav/lib/Listener/CalendarShareUpdateListener.php
@@ -34,7 +34,7 @@ class CalendarShareUpdateListener implements IEventListener {
return;
}
- $this->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/Migration/BuildCalendarSearchIndex.php b/apps/dav/lib/Migration/BuildCalendarSearchIndex.php
index 222554a3732..592a6f85bdc 100644
--- a/apps/dav/lib/Migration/BuildCalendarSearchIndex.php
+++ b/apps/dav/lib/Migration/BuildCalendarSearchIndex.php
@@ -56,7 +56,7 @@ class BuildCalendarSearchIndex implements IRepairStep {
$query->select($query->createFunction('MAX(' . $query->getColumnName('id') . ')'))
->from('calendarobjects');
$result = $query->execute();
- $maxId = (int) $result->fetchOne();
+ $maxId = (int)$result->fetchOne();
$result->closeCursor();
$output->info('Add background job');
diff --git a/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php
index 251d79033f3..4c87e25c698 100644
--- a/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php
+++ b/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php
@@ -27,8 +27,8 @@ class BuildCalendarSearchIndexBackgroundJob extends QueuedJob {
}
public function run($arguments) {
- $offset = (int) $arguments['offset'];
- $stopAt = (int) $arguments['stopAt'];
+ $offset = (int)$arguments['offset'];
+ $stopAt = (int)$arguments['stopAt'];
$this->logger->info('Building calendar index (' . $offset .'/' . $stopAt . ')');
diff --git a/apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php b/apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php
index d3705ee1552..f9a12ecbfae 100644
--- a/apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php
+++ b/apps/dav/lib/Migration/RegisterBuildReminderIndexBackgroundJob.php
@@ -68,7 +68,7 @@ class RegisterBuildReminderIndexBackgroundJob implements IRepairStep {
$query->select($query->createFunction('MAX(' . $query->getColumnName('id') . ')'))
->from('calendarobjects');
$result = $query->execute();
- $maxId = (int) $result->fetchOne();
+ $maxId = (int)$result->fetchOne();
$result->closeCursor();
$output->info('Add background job');
diff --git a/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php b/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php
index 53e6deba1ca..0122ed37b06 100644
--- a/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php
+++ b/apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php
@@ -96,7 +96,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep {
while ($row = $result->fetch()) {
$username = $this->getPrincipal($row['principaluri']);
if (!$this->userManager->userExists($username)) {
- $this->orphanSubscriptionIds[] = (int) $row['id'];
+ $this->orphanSubscriptionIds[] = (int)$row['id'];
}
}
$result->closeCursor();
diff --git a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php b/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php
index 41ae4faf4c4..798fbad4018 100644
--- a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php
+++ b/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php
@@ -71,7 +71,7 @@ class RemoveOrphanEventsAndContacts implements IRepairStep {
$orphanItems = [];
while ($row = $result->fetch()) {
- $orphanItems[] = (int) $row['id'];
+ $orphanItems[] = (int)$row['id'];
}
$result->closeCursor();
diff --git a/apps/dav/lib/Migration/Version1004Date20170926103422.php b/apps/dav/lib/Migration/Version1004Date20170926103422.php
index 3bd5ba144c0..38506b0fc5d 100644
--- a/apps/dav/lib/Migration/Version1004Date20170926103422.php
+++ b/apps/dav/lib/Migration/Version1004Date20170926103422.php
@@ -14,7 +14,7 @@ class Version1004Date20170926103422 extends BigIntMigration {
/**
* @return array Returns an array with the following structure
- * ['table1' => ['column1', 'column2'], ...]
+ * ['table1' => ['column1', 'column2'], ...]
* @since 13.0.0
*/
protected function getColumnsByTable() {
diff --git a/apps/dav/lib/Migration/Version1025Date20240308063933.php b/apps/dav/lib/Migration/Version1025Date20240308063933.php
index 55ab387b69c..3a68760762b 100644
--- a/apps/dav/lib/Migration/Version1025Date20240308063933.php
+++ b/apps/dav/lib/Migration/Version1025Date20240308063933.php
@@ -57,7 +57,7 @@ class Version1025Date20240308063933 extends SimpleMigrationStep {
// The threshold is higher than the default of \OCA\DAV\BackgroundJob\PruneOutdatedSyncTokensJob
// but small enough to fit into a cluster transaction size.
// For a 50k users instance that would still keep 10 changes on average.
- $limit = max(1, (int) $this->appConfig->getAppValue('totalNumberOfSyncTokensToKeep', '500000'));
+ $limit = max(1, (int)$this->appConfig->getAppValue('totalNumberOfSyncTokensToKeep', '500000'));
foreach (['addressbookchanges', 'calendarchanges'] as $tableName) {
$thresholdSelect = $this->db->getQueryBuilder();
diff --git a/apps/dav/lib/Search/ACalendarSearchProvider.php b/apps/dav/lib/Search/ACalendarSearchProvider.php
index d0c164822a4..04e97f80cb1 100644
--- a/apps/dav/lib/Search/ACalendarSearchProvider.php
+++ b/apps/dav/lib/Search/ACalendarSearchProvider.php
@@ -64,7 +64,7 @@ abstract class ACalendarSearchProvider implements IProvider {
$calendars = $this->backend->getCalendarsForUser($principalUri);
$calendarsById = [];
foreach ($calendars as $calendar) {
- $calendarsById[(int) $calendar['id']] = $calendar;
+ $calendarsById[(int)$calendar['id']] = $calendar;
}
return $calendarsById;
@@ -81,7 +81,7 @@ abstract class ACalendarSearchProvider implements IProvider {
$subscriptions = $this->backend->getSubscriptionsForUser($principalUri);
$subscriptionsById = [];
foreach ($subscriptions as $subscription) {
- $subscriptionsById[(int) $subscription['id']] = $subscription;
+ $subscriptionsById[(int)$subscription['id']] = $subscription;
}
return $subscriptionsById;
diff --git a/apps/dav/lib/Search/ContactsSearchProvider.php b/apps/dav/lib/Search/ContactsSearchProvider.php
index b0f6f1a044c..158c0d0813e 100644
--- a/apps/dav/lib/Search/ContactsSearchProvider.php
+++ b/apps/dav/lib/Search/ContactsSearchProvider.php
@@ -81,7 +81,7 @@ class ContactsSearchProvider implements IFilteringProvider {
$addressBooks = $this->backend->getAddressBooksForUser($principalUri);
$addressBooksById = [];
foreach ($addressBooks as $addressBook) {
- $addressBooksById[(int) $addressBook['id']] = $addressBook;
+ $addressBooksById[(int)$addressBook['id']] = $addressBook;
}
$searchResults = $this->backend->searchPrincipalUri(
@@ -109,12 +109,12 @@ class ContactsSearchProvider implements IFilteringProvider {
$title = (string)$vCard->FN;
$subline = $this->generateSubline($vCard);
- $resourceUrl = $this->getDeepLinkToContactsApp($addressBook['uri'], (string) $vCard->UID);
+ $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);
diff --git a/apps/dav/lib/Search/EventsSearchProvider.php b/apps/dav/lib/Search/EventsSearchProvider.php
index 6c9fe5167c5..4747635bd7e 100644
--- a/apps/dav/lib/Search/EventsSearchProvider.php
+++ b/apps/dav/lib/Search/EventsSearchProvider.php
@@ -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/SystemTag/SystemTagsInUseCollection.php b/apps/dav/lib/SystemTag/SystemTagsInUseCollection.php
index 12a0ff00d3b..fbe393a7d97 100644
--- a/apps/dav/lib/SystemTag/SystemTagsInUseCollection.php
+++ b/apps/dav/lib/SystemTag/SystemTagsInUseCollection.php
@@ -82,8 +82,8 @@ class SystemTagsInUseCollection extends SimpleCollection {
$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']);
- $node->setReferenceFileId((int) $tagData['ref_file_id']);
+ $node->setNumberOfFiles((int)$tagData['number_files']);
+ $node->setReferenceFileId((int)$tagData['ref_file_id']);
$children[] = $node;
}
return $children;
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/BackgroundJob/PruneOutdatedSyncTokensJobTest.php b/apps/dav/tests/unit/BackgroundJob/PruneOutdatedSyncTokensJobTest.php
index 9cd75445232..d08d0fd4496 100644
--- a/apps/dav/tests/unit/BackgroundJob/PruneOutdatedSyncTokensJobTest.php
+++ b/apps/dav/tests/unit/BackgroundJob/PruneOutdatedSyncTokensJobTest.php
@@ -32,7 +32,7 @@ class PruneOutdatedSyncTokensJobTest extends TestCase {
/** @var IConfig|MockObject */
private $config;
- /** @var LoggerInterface|MockObject*/
+ /** @var LoggerInterface|MockObject */
private $logger;
private PruneOutdatedSyncTokensJob $backgroundJob;
diff --git a/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php b/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php
index e7de7d0a55e..89ef73ec134 100644
--- a/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php
+++ b/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php
@@ -24,7 +24,7 @@ class EnablePluginTest extends TestCase {
/** @var BirthdayService |\PHPUnit\Framework\MockObject\MockObject */
protected $birthdayService;
- /** @var IUser|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IUser|\PHPUnit\Framework\MockObject\MockObject */
protected $user;
/** @var \OCA\DAV\CalDAV\BirthdayCalendar\EnablePlugin $plugin */
diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
index 1656996408e..ac4045ea757 100644
--- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
@@ -733,7 +733,7 @@ EOS;
'last occurrence before unix epoch starts' => [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/CalendarImplTest.php b/apps/dav/tests/unit/CalDAV/CalendarImplTest.php
index 85545854918..a0b2965f223 100644
--- a/apps/dav/tests/unit/CalDAV/CalendarImplTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalendarImplTest.php
@@ -138,13 +138,13 @@ EOF;
->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())
diff --git a/apps/dav/tests/unit/CalDAV/CalendarTest.php b/apps/dav/tests/unit/CalDAV/CalendarTest.php
index ace2f808615..a2854823cbc 100644
--- a/apps/dav/tests/unit/CalDAV/CalendarTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalendarTest.php
@@ -25,7 +25,7 @@ class CalendarTest extends TestCase {
/** @var IConfig */
protected $config;
- /** @var MockObject|LoggerInterface */
+ /** @var MockObject|LoggerInterface */
protected $logger;
protected function setUp(): void {
@@ -418,7 +418,7 @@ EOD;
$l10n->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 23f0172131d..3c94147efb4 100644
--- a/apps/dav/tests/unit/CalDAV/EventReaderTest.php
+++ b/apps/dav/tests/unit/CalDAV/EventReaderTest.php
@@ -16,17 +16,17 @@ 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 $vCalendar2;
- /** @var VCalendar*/
+ /** @var VCalendar */
private $vCalendar3;
protected function setUp(): void {
diff --git a/apps/dav/tests/unit/CalDAV/PublicCalendarTest.php b/apps/dav/tests/unit/CalDAV/PublicCalendarTest.php
index 04b99b70124..0609892c279 100644
--- a/apps/dav/tests/unit/CalDAV/PublicCalendarTest.php
+++ b/apps/dav/tests/unit/CalDAV/PublicCalendarTest.php
@@ -46,7 +46,7 @@ class PublicCalendarTest extends CalendarTest {
];
/** @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);
$children = $c->getChildren();
@@ -134,7 +134,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/Reminder/BackendTest.php b/apps/dav/tests/unit/CalDAV/Reminder/BackendTest.php
index 9900c77bf54..75b058c0b84 100644
--- a/apps/dav/tests/unit/CalDAV/Reminder/BackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/Reminder/BackendTest.php
@@ -95,7 +95,7 @@ class BackendTest extends TestCase {
$this->assertCount(4, $rows);
- $this->reminderBackend->removeReminder((int) $rows[3]['id']);
+ $this->reminderBackend->removeReminder((int)$rows[3]['id']);
$query = self::$realDatabase->getQueryBuilder();
$rows = $query->select('*')
@@ -240,7 +240,7 @@ class BackendTest extends TestCase {
$this->assertEquals($rows[3]['notification_date'], 123600);
- $reminderId = (int) $rows[3]['id'];
+ $reminderId = (int)$rows[3]['id'];
$newNotificationDate = 123700;
$this->reminderBackend->updateReminder($reminderId, $newNotificationDate);
@@ -252,7 +252,7 @@ class BackendTest extends TestCase {
->execute()
->fetch();
- $this->assertEquals((int) $row['notification_date'], 123700);
+ $this->assertEquals((int)$row['notification_date'], 123700);
}
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/Schedule/IMipServiceTest.php b/apps/dav/tests/unit/CalDAV/Schedule/IMipServiceTest.php
index 667604f9b3e..ef5a0b17c6e 100644
--- a/apps/dav/tests/unit/CalDAV/Schedule/IMipServiceTest.php
+++ b/apps/dav/tests/unit/CalDAV/Schedule/IMipServiceTest.php
@@ -47,13 +47,13 @@ class IMipServiceTest extends TestCase {
/** @var IMipService */
private $service;
- /** @var VCalendar*/
+ /** @var VCalendar */
private $vCalendar1a;
- /** @var VCalendar*/
+ /** @var VCalendar */
private $vCalendar1b;
- /** @var VCalendar*/
+ /** @var VCalendar */
private $vCalendar2;
- /** @var VCalendar*/
+ /** @var VCalendar */
private $vCalendar3;
/** @var DateTime DateTime object that will be returned by DateTime() or DateTime('now') */
public static $datetimeNow;
@@ -156,9 +156,9 @@ class IMipServiceTest extends TestCase {
}
public function testGetFrom(): void {
- $senderName = "Detective McQueen";
- $default = "Twin Lakes Police Department - Darkside Division";
- $expected = "Detective McQueen via Twin Lakes Police Department - Darkside Division";
+ $senderName = 'Detective McQueen';
+ $default = 'Twin Lakes Police Department - Darkside Division';
+ $expected = 'Detective McQueen via Twin Lakes Police Department - Darkside Division';
$this->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 853094e4de2..aa2903b519f 100644
--- a/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php
+++ b/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php
@@ -41,7 +41,7 @@ class PluginTest extends TestCase {
/** @var Server|MockObject */
private $server;
- /** @var IConfig|MockObject */
+ /** @var IConfig|MockObject */
private $config;
/** @var LoggerInterface&MockObject */
@@ -347,10 +347,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->once())
->method('getCalDAVBackend')
diff --git a/apps/dav/tests/unit/CalDAV/WebcalCaching/ConnectionTest.php b/apps/dav/tests/unit/CalDAV/WebcalCaching/ConnectionTest.php
index 20f61120af7..ee903a5e0fa 100644
--- a/apps/dav/tests/unit/CalDAV/WebcalCaching/ConnectionTest.php
+++ b/apps/dav/tests/unit/CalDAV/WebcalCaching/ConnectionTest.php
@@ -67,7 +67,7 @@ class ConnectionTest extends TestCase {
->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, $mutation);
}
diff --git a/apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php b/apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php
index ed140fd76ff..b9b05be4471 100644
--- a/apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php
+++ b/apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php
@@ -20,9 +20,9 @@ use Sabre\VObject\Recur\NoInstancesException;
use Test\TestCase;
class RefreshWebcalServiceTest extends TestCase {
- private CalDavBackend | MockObject $caldavBackend;
- private Connection | MockObject $connection;
- private LoggerInterface | MockObject $logger;
+ private CalDavBackend|MockObject $caldavBackend;
+ private Connection|MockObject $connection;
+ private LoggerInterface|MockObject $logger;
private ITimeFactory|MockObject $time;
protected function setUp(): void {
@@ -248,7 +248,7 @@ class RefreshWebcalServiceTest extends TestCase {
$noInstanceException = new NoInstancesException("can't add calendar object");
$this->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/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
index fb12b5b0884..dff368b923c 100644
--- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
+++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
@@ -17,22 +17,22 @@ use Sabre\VObject\Property\Text;
use Test\TestCase;
class AddressBookImplTest extends TestCase {
- /** @var AddressBookImpl */
+ /** @var AddressBookImpl */
private $addressBookImpl;
- /** @var array */
+ /** @var array */
private $addressBookInfo;
- /** @var AddressBook | \PHPUnit\Framework\MockObject\MockObject */
+ /** @var AddressBook | \PHPUnit\Framework\MockObject\MockObject */
private $addressBook;
/** @var IURLGenerator | \PHPUnit\Framework\MockObject\MockObject */
private $urlGenerator;
- /** @var CardDavBackend | \PHPUnit\Framework\MockObject\MockObject */
+ /** @var CardDavBackend | \PHPUnit\Framework\MockObject\MockObject */
private $backend;
- /** @var VCard | \PHPUnit\Framework\MockObject\MockObject */
+ /** @var VCard | \PHPUnit\Framework\MockObject\MockObject */
private $vCard;
protected function setUp(): void {
diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
index 0e9aed1caaf..91d7cc5f49e 100644
--- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
+++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
@@ -59,7 +59,7 @@ class CardDavBackendTest extends TestCase {
/** @var IEventDispatcher|MockObject */
private $dispatcher;
private Backend $sharingBackend;
- /** @var IDBConnection */
+ /** @var IDBConnection */
private $db;
/** @var string */
@@ -237,8 +237,8 @@ class CardDavBackendTest extends TestCase {
public function testCardOperations(): void {
/** @var CardDavBackend | \PHPUnit\Framework\MockObject\MockObject $backend */
$backend = $this->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', []);
@@ -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,16 +799,16 @@ 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();
}
@@ -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..c29e0db5070 100644
--- a/apps/dav/tests/unit/CardDAV/ConverterTest.php
+++ b/apps/dav/tests/unit/CardDAV/ConverterTest.php
@@ -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..2640b4d966b 100644
--- a/apps/dav/tests/unit/Command/ListCalendarsTest.php
+++ b/apps/dav/tests/unit/Command/ListCalendarsTest.php
@@ -54,7 +54,7 @@ class ListCalendarsTest extends TestCase {
$commandTester->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 +72,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..892b00968f9 100644
--- a/apps/dav/tests/unit/Command/MoveCalendarTest.php
+++ b/apps/dav/tests/unit/Command/MoveCalendarTest.php
@@ -194,7 +194,7 @@ class MoveCalendarTest extends TestCase {
'destinationuid' => 'user2',
]);
- $this->assertStringContainsString("[OK] Calendar <personal> was moved from user <user> to <user2>", $commandTester->getDisplay());
+ $this->assertStringContainsString('[OK] Calendar <personal> was moved from user <user> to <user2>', $commandTester->getDisplay());
}
public function dataTestMoveWithDestinationNotPartOfGroup(): array {
@@ -240,7 +240,7 @@ class MoveCalendarTest extends TestCase {
]);
if ($shareWithGroupMembersOnly === true) {
$this->expectException(InvalidArgumentException::class);
- $this->expectExceptionMessage("User <user2> is not part of the group <nextclouders> with whom the calendar <personal> was shared. You may use -f to move the calendar while deleting this share.");
+ $this->expectExceptionMessage('User <user2> is not part of the group <nextclouders> with whom the calendar <personal> was shared. You may use -f to move the calendar while deleting this share.');
}
$commandTester = new CommandTester($this->command);
@@ -294,7 +294,7 @@ class MoveCalendarTest extends TestCase {
'destinationuid' => 'user2',
]);
- $this->assertStringContainsString("[OK] Calendar <personal> was moved from user <user> to <user2>", $commandTester->getDisplay());
+ $this->assertStringContainsString('[OK] Calendar <personal> was moved from user <user> to <user2>', $commandTester->getDisplay());
}
public function testMoveWithDestinationNotPartOfGroupAndForce(): void {
@@ -342,7 +342,7 @@ class MoveCalendarTest extends TestCase {
'--force' => true
]);
- $this->assertStringContainsString("[OK] Calendar <personal> was moved from user <user> to <user2>", $commandTester->getDisplay());
+ $this->assertStringContainsString('[OK] Calendar <personal> was moved from user <user> to <user2>', $commandTester->getDisplay());
}
public function dataTestMoveWithCalendarAlreadySharedToDestination(): array {
@@ -380,17 +380,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 <personal> is already shared to user <user2>.You may use -f to move the calendar while deleting this share.");
+ $this->expectExceptionMessage('The calendar <personal> is already shared to user <user2>.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/CommentsPropertiesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php
index c2167214451..1cda0e4dbdb 100644
--- a/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php
@@ -16,7 +16,7 @@ use Sabre\DAV\PropFind;
class CommentsPropertiesPluginTest extends \Test\TestCase {
- /** @var CommentPropertiesPluginImplementation */
+ /** @var CommentPropertiesPluginImplementation */
protected $plugin;
protected $commentsManager;
protected $userSession;
diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
index d2be66c13f5..fb180b7c65d 100644
--- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
@@ -72,9 +72,9 @@ class DirectoryTest extends \Test\TestCase {
$this->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 = <<<EOD
<?xml version="1.0" encoding="utf-8"?>
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 = <<<EOD
<?xml version="1.0" encoding="utf-8"?>
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..6f9a214fab9 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
],
@@ -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 f1460591a91..144b8af7659 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
@@ -99,8 +99,8 @@ class FilesPluginTest extends TestCase {
);
$response = $this->getMockBuilder(ResponseInterface::class)
- ->disableOriginalConstructor()
- ->getMock();
+ ->disableOriginalConstructor()
+ ->getMock();
$this->server->httpResponse = $response;
$this->server->xml = new Service();
@@ -536,8 +536,8 @@ class FilesPluginTest extends TestCase {
->disableOriginalConstructor()
->getMock();
$response = $this->getMockBuilder(ResponseInterface::class)
- ->disableOriginalConstructor()
- ->getMock();
+ ->disableOriginalConstructor()
+ ->getMock();
$request
->expects($this->once())
@@ -595,6 +595,6 @@ class FilesPluginTest extends TestCase {
$node
);
- $this->assertEquals("false", $propFind->get(self::HAS_PREVIEW_PROPERTYNAME));
+ $this->assertEquals('false', $propFind->get(self::HAS_PREVIEW_PROPERTYNAME));
}
}
diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php
index 97f21572945..95fd79fa5f1 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php
@@ -49,19 +49,19 @@ class FilesReportPluginTest extends \Test\TestCase {
private ITagManager|MockObject $privateTagManager;
- /** @var \OCP\IUserSession */
+ /** @var \OCP\IUserSession */
private $userSession;
/** @var FilesReportPluginImplementation */
private $plugin;
- /** @var View|MockObject **/
+ /** @var View|MockObject * */
private $view;
- /** @var IGroupManager|MockObject **/
+ /** @var IGroupManager|MockObject * */
private $groupManager;
- /** @var Folder|MockObject **/
+ /** @var Folder|MockObject * */
private $userFolder;
/** @var IPreview|MockObject * */
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..30e2c995d18 100644
--- a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
@@ -96,26 +96,26 @@ class PrincipalTest extends TestCase {
public function testGetPrincipalsByPrefixWithUsers(): void {
$fooUser = $this->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 +229,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 +851,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 +865,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 +912,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 +921,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/DAV/CustomPropertiesBackendTest.php b/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php
index 3c527e24363..6fc87437fe0 100644
--- a/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php
+++ b/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php
@@ -33,7 +33,7 @@ class CustomPropertiesBackendTest extends TestCase {
/** @var Tree | \PHPUnit\Framework\MockObject\MockObject */
private $tree;
- /** @var IDBConnection */
+ /** @var IDBConnection */
private $dbConnection;
/** @var IUser | \PHPUnit\Framework\MockObject\MockObject */
@@ -395,7 +395,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/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/MultipartRequestParserTest.php b/apps/dav/tests/unit/Files/MultipartRequestParserTest.php
index 3458708b23b..ebe2a0b172e 100644
--- a/apps/dav/tests/unit/Files/MultipartRequestParserTest.php
+++ b/apps/dav/tests/unit/Files/MultipartRequestParserTest.php
@@ -21,17 +21,17 @@ class MultipartRequestParserTest extends TestCase {
private function getValidBodyObject() {
return [
[
- "headers" => [
- "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 +43,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 +73,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 +100,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 +112,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 +126,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 +140,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 +154,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 +168,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/Settings/CalDAVSettingsTest.php b/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php
index ed497d006e1..9f2d2582884 100644
--- a/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php
+++ b/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php
@@ -42,14 +42,14 @@ class CalDAVSettingsTest extends TestCase {
public function testGetForm(): void {
$this->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/Upload/AssemblyStreamTest.php b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php
index 6c380fa3191..89ae0bc1fea 100644
--- a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php
+++ b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php
@@ -55,7 +55,7 @@ class AssemblyStreamTest extends \Test\TestCase {
$dataLess8k = $this->makeData(8191);
$tonofnodes = [];
- $tonofdata = "";
+ $tonofdata = '';
for ($i = 0; $i < 101; $i++) {
$thisdata = rand(0, 100); // variable length and content
$tonofdata .= $thisdata;
diff --git a/apps/encryption/lib/Command/FixEncryptedVersion.php b/apps/encryption/lib/Command/FixEncryptedVersion.php
index d2764036b39..6635bb6cba9 100644
--- a/apps/encryption/lib/Command/FixEncryptedVersion.php
+++ b/apps/encryption/lib/Command/FixEncryptedVersion.php
@@ -80,13 +80,13 @@ class FixEncryptedVersion extends Command {
$pathOption = \trim(($input->getOption('path') ?? ''), '/');
if (!$user && !$all) {
- $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 self::FAILURE;
}
if ($user) {
if ($all) {
- $output->writeln("Specifying a user id and --all are mutually exclusive");
+ $output->writeln('Specifying a user id and --all are mutually exclusive');
return self::FAILURE;
}
@@ -100,7 +100,7 @@ class FixEncryptedVersion extends Command {
$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;
});
@@ -109,7 +109,7 @@ class FixEncryptedVersion extends Command {
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("<info>Set the encrypted version to 0 (unencrypted)</info>");
+ $output->writeln('<info>Set the encrypted version to 0 (unencrypted)</info>');
if ($this->verifyFileContent($path, $output, false) === true) {
$output->writeln("<info>Fixed the file: \"$path\" with version 0 (unencrypted)</info>");
return true;
@@ -268,7 +268,7 @@ class FixEncryptedVersion extends Command {
$cache->put($fileCache->getPath(), $cacheInfo);
$output->writeln("<info>Decrement the encrypted version to $encryptedVersion</info>");
if ($this->verifyFileContent($path, $output, false) === true) {
- $output->writeln("<info>Fixed the file: \"$path\" with version " . $encryptedVersion . "</info>");
+ $output->writeln("<info>Fixed the file: \"$path\" with version " . $encryptedVersion . '</info>');
return true;
}
$encryptedVersion--;
@@ -291,7 +291,7 @@ class FixEncryptedVersion extends Command {
$cache->put($fileCache->getPath(), $cacheInfo);
$output->writeln("<info>Increment the encrypted version to $newEncryptedVersion</info>");
if ($this->verifyFileContent($path, $output, false) === true) {
- $output->writeln("<info>Fixed the file: \"$path\" with version " . $newEncryptedVersion . "</info>");
+ $output->writeln("<info>Fixed the file: \"$path\" with version " . $newEncryptedVersion . '</info>');
return true;
}
$increment++;
diff --git a/apps/encryption/lib/Command/FixKeyLocation.php b/apps/encryption/lib/Command/FixKeyLocation.php
index a8d30471e8f..da529a4be2f 100644
--- a/apps/encryption/lib/Command/FixKeyLocation.php
+++ b/apps/encryption/lib/Command/FixKeyLocation.php
@@ -42,7 +42,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;
@@ -57,7 +57,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 {
@@ -75,7 +75,7 @@ class FixKeyLocation extends Command {
foreach ($mounts as $mount) {
$mountRootFolder = $this->rootFolder->get($mount->getMountPoint());
if (!$mountRootFolder instanceof Folder) {
- $output->writeln("<error>System wide mount point is not a directory, skipping: " . $mount->getMountPoint() . "</error>");
+ $output->writeln('<error>System wide mount point is not a directory, skipping: ' . $mount->getMountPoint() . '</error>');
continue;
}
@@ -89,14 +89,14 @@ class FixKeyLocation extends Command {
// key was stored incorrectly as user key, migrate
if ($dryRun) {
- $output->writeln("<info>" . $file->getPath() . "</info> needs migration");
+ $output->writeln('<info>' . $file->getPath() . '</info> needs migration');
} else {
- $output->write("Migrating key for <info>" . $file->getPath() . "</info> ");
+ $output->write('Migrating key for <info>' . $file->getPath() . '</info> ');
if ($this->copyUserKeyToSystemAndValidate($user, $file)) {
- $output->writeln("<info>✓</info>");
+ $output->writeln('<info>✓</info>');
} else {
- $output->writeln("<fg=red>❌</>");
- $output->writeln(" Failed to validate key for <error>" . $file->getPath() . "</error>, key will not be migrated");
+ $output->writeln('<fg=red>❌</>');
+ $output->writeln(' Failed to validate key for <error>' . $file->getPath() . '</error>, key will not be migrated');
}
}
} else {
@@ -107,42 +107,42 @@ class FixKeyLocation extends Command {
if ($isActuallyEncrypted) {
if ($dryRun) {
if ($shouldBeEncrypted) {
- $output->write("<info>" . $file->getPath() . "</info> needs migration");
+ $output->write('<info>' . $file->getPath() . '</info> needs migration');
} else {
- $output->write("<info>" . $file->getPath() . "</info> needs decryption");
+ $output->write('<info>' . $file->getPath() . '</info> needs decryption');
}
$foundKey = $this->findUserKeyForSystemFile($user, $file);
if ($foundKey) {
- $output->writeln(", valid key found at <info>" . $foundKey . "</info>");
+ $output->writeln(', valid key found at <info>' . $foundKey . '</info>');
} else {
- $output->writeln(" <error>❌ No key found</error>");
+ $output->writeln(' <error>❌ No key found</error>');
}
} else {
if ($shouldBeEncrypted) {
- $output->write("<info>Migrating key for " . $file->getPath() . "</info>");
+ $output->write('<info>Migrating key for ' . $file->getPath() . '</info>');
} else {
- $output->write("<info>Decrypting " . $file->getPath() . "</info>");
+ $output->write('<info>Decrypting ' . $file->getPath() . '</info>');
}
$foundKey = $this->findUserKeyForSystemFile($user, $file);
if ($foundKey) {
if ($shouldBeEncrypted) {
$systemKeyPath = $this->getSystemKeyPath($file);
$this->rootView->copy($foundKey, $systemKeyPath);
- $output->writeln(" Migrated key from <info>" . $foundKey . "</info>");
+ $output->writeln(' Migrated key from <info>' . $foundKey . '</info>');
} else {
$this->decryptWithSystemKey($file, $foundKey);
- $output->writeln(" Decrypted with key from <info>" . $foundKey . "</info>");
+ $output->writeln(' Decrypted with key from <info>' . $foundKey . '</info>');
}
} else {
- $output->writeln(" <error>❌ No key found</error>");
+ $output->writeln(' <error>❌ No key found</error>');
}
}
} else {
if ($dryRun) {
- $output->writeln("<info>" . $file->getPath() . " needs to be marked as not encrypted</info>");
+ $output->writeln('<info>' . $file->getPath() . ' needs to be marked as not encrypted</info>');
} else {
$this->markAsUnEncrypted($file);
- $output->writeln("<info>" . $file->getPath() . " marked as not encrypted</info>");
+ $output->writeln('<info>' . $file->getPath() . ' marked as not encrypted</info>');
}
}
}
@@ -273,7 +273,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;
}
@@ -316,7 +316,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 != '.') {
@@ -366,7 +366,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);
@@ -386,7 +386,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/Controller/SettingsController.php b/apps/encryption/lib/Controller/SettingsController.php
index b21cdb0aacd..251f385127a 100644
--- a/apps/encryption/lib/Controller/SettingsController.php
+++ b/apps/encryption/lib/Controller/SettingsController.php
@@ -42,10 +42,10 @@ class SettingsController extends Controller {
/** @var Session */
private $session;
- /** @var ISession */
+ /** @var ISession */
private $ocSession;
- /** @var Util */
+ /** @var Util */
private $util;
/**
diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php
index 00611f294bf..92d6ed6a443 100644
--- a/apps/encryption/lib/Crypto/Crypt.php
+++ b/apps/encryption/lib/Crypto/Crypt.php
@@ -457,7 +457,7 @@ class Crypt {
if ($enforceSignature) {
throw new GenericEncryptionException('Bad Signature', $this->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..f5b6a40aecc 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);
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 = "<no-user-id-given>";
+ $userId = '<no-user-id-given>';
}
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 = "<no-user-id-given>";
+ $userId = '<no-user-id-given>';
}
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/Migration/SetMasterKeyStatus.php b/apps/encryption/lib/Migration/SetMasterKeyStatus.php
index 598f2dd516a..56dcd15dae4 100644
--- a/apps/encryption/lib/Migration/SetMasterKeyStatus.php
+++ b/apps/encryption/lib/Migration/SetMasterKeyStatus.php
@@ -17,7 +17,7 @@ use OCP\Migration\IRepairStep;
class SetMasterKeyStatus implements IRepairStep {
- /** @var IConfig */
+ /** @var IConfig */
private $config;
diff --git a/apps/encryption/lib/Settings/Admin.php b/apps/encryption/lib/Settings/Admin.php
index ea313225d82..4f695f61b1b 100644
--- a/apps/encryption/lib/Settings/Admin.php
+++ b/apps/encryption/lib/Settings/Admin.php
@@ -71,8 +71,8 @@ class Admin implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/encryption/lib/Settings/Personal.php b/apps/encryption/lib/Settings/Personal.php
index 93609acdd03..b544ea1dc3e 100644
--- a/apps/encryption/lib/Settings/Personal.php
+++ b/apps/encryption/lib/Settings/Personal.php
@@ -64,8 +64,8 @@ class Personal implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
* @since 9.1
diff --git a/apps/encryption/templates/settings-admin.php b/apps/encryption/templates/settings-admin.php
index 22b05f6efcf..6d06f28ffe7 100644
--- a/apps/encryption/templates/settings-admin.php
+++ b/apps/encryption/templates/settings-admin.php
@@ -11,9 +11,9 @@ script('encryption', 'settings-admin');
style('encryption', 'settings-admin');
?>
<form id="ocDefaultEncryptionModule" class="sub-section">
- <h3><?php p($l->t("Default encryption module")); ?></h3>
- <?php if (!$_["initStatus"] && $_['masterKeyEnabled'] === false): ?>
- <?php p($l->t("Encryption app is enabled but your keys are not initialized, please log-out and log-in again")); ?>
+ <h3><?php p($l->t('Default encryption module')); ?></h3>
+ <?php if (!$_['initStatus'] && $_['masterKeyEnabled'] === false): ?>
+ <?php p($l->t('Encryption app is enabled but your keys are not initialized, please log-out and log-in again')); ?>
<?php else: ?>
<p id="encryptHomeStorageSetting">
<input type="checkbox" class="checkbox" name="encrypt_home_storage" id="encryptHomeStorage"
@@ -21,61 +21,61 @@ style('encryption', 'settings-admin');
print_unescaped('checked="checked"');
} ?> />
<label for="encryptHomeStorage"><?php p($l->t('Encrypt the home storage'));?></label></br>
- <em><?php p($l->t("Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted")); ?></em>
+ <em><?php p($l->t('Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted')); ?></em>
</p>
<br />
<?php if ($_['masterKeyEnabled'] === false): ?>
<p id="encryptionSetRecoveryKey">
- <?php $_["recoveryEnabled"] === '0' ? p($l->t("Enable recovery key")) : p($l->t("Disable recovery key")); ?>
+ <?php $_['recoveryEnabled'] === '0' ? p($l->t('Enable recovery key')) : p($l->t('Disable recovery key')); ?>
<span class="msg"></span>
<br/>
<em>
- <?php p($l->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.")) ?>
+ <?php p($l->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.')) ?>
</em>
<br/>
<input type="password"
name="encryptionRecoveryPassword"
id="encryptionRecoveryPassword"
- placeholder="<?php p($l->t("Recovery key password")); ?>"/>
+ placeholder="<?php p($l->t('Recovery key password')); ?>"/>
<input type="password"
name="encryptionRecoveryPassword"
id="repeatEncryptionRecoveryPassword"
- placeholder="<?php p($l->t("Repeat recovery key password")); ?>"/>
+ placeholder="<?php p($l->t('Repeat recovery key password')); ?>"/>
<input type="button"
name="enableRecoveryKey"
id="enableRecoveryKey"
- status="<?php p($_["recoveryEnabled"]) ?>"
- value="<?php $_["recoveryEnabled"] === '0' ? p($l->t("Enable recovery key")) : p($l->t("Disable recovery key")); ?>"/>
+ status="<?php p($_['recoveryEnabled']) ?>"
+ value="<?php $_['recoveryEnabled'] === '0' ? p($l->t('Enable recovery key')) : p($l->t('Disable recovery key')); ?>"/>
</p>
<br/><br/>
<p name="changeRecoveryPasswordBlock" id="encryptionChangeRecoveryKey" <?php if ($_['recoveryEnabled'] === '0') {
print_unescaped('class="hidden"');
}?>>
- <?php p($l->t("Change recovery key password:")); ?>
+ <?php p($l->t('Change recovery key password:')); ?>
<span class="msg"></span>
<br/>
<input
type="password"
name="changeRecoveryPassword"
id="oldEncryptionRecoveryPassword"
- placeholder="<?php p($l->t("Old recovery key password")); ?>"/>
+ placeholder="<?php p($l->t('Old recovery key password')); ?>"/>
<br />
<input
type="password"
name="changeRecoveryPassword"
id="newEncryptionRecoveryPassword"
- placeholder="<?php p($l->t("New recovery key password")); ?>"/>
+ placeholder="<?php p($l->t('New recovery key password')); ?>"/>
<input
type="password"
name="changeRecoveryPassword"
id="repeatedNewEncryptionRecoveryPassword"
- placeholder="<?php p($l->t("Repeat new recovery key password")); ?>"/>
+ placeholder="<?php p($l->t('Repeat new recovery key password')); ?>"/>
<button
type="button"
name="submitChangeRecoveryKey">
- <?php p($l->t("Change Password")); ?>
+ <?php p($l->t('Change Password')); ?>
</button>
</p>
<?php endif; ?>
diff --git a/apps/encryption/templates/settings-personal.php b/apps/encryption/templates/settings-personal.php
index c125f1f4d31..5aa227e7354 100644
--- a/apps/encryption/templates/settings-personal.php
+++ b/apps/encryption/templates/settings-personal.php
@@ -12,19 +12,19 @@ script('encryption', 'settings-personal');
<form id="ocDefaultEncryptionModule" class="section">
<h2 data-anchor-name="basic-encryption-module"><?php p($l->t('Basic encryption module')); ?></h2>
- <?php if ($_["initialized"] === \OCA\Encryption\Session::NOT_INITIALIZED): ?>
+ <?php if ($_['initialized'] === \OCA\Encryption\Session::NOT_INITIALIZED): ?>
- <?php p($l->t("Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again.")); ?>
+ <?php p($l->t('Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again.')); ?>
- <?php elseif ($_["initialized"] === \OCA\Encryption\Session::INIT_EXECUTED): ?>
+ <?php elseif ($_['initialized'] === \OCA\Encryption\Session::INIT_EXECUTED): ?>
<p>
<a name="changePKPasswd" />
<label for="changePrivateKeyPasswd">
- <em><?php p($l->t("Your private key password no longer matches your log-in password.")); ?></em>
+ <em><?php p($l->t('Your private key password no longer matches your log-in password.')); ?></em>
</label>
<br />
- <?php p($l->t("Set your old private key password to your current log-in password:")); ?>
- <?php if ($_["recoveryEnabledForUser"]):
+ <?php p($l->t('Set your old private key password to your current log-in password:')); ?>
+ <?php if ($_['recoveryEnabledForUser']):
p($l->t(" If you don't remember your old password you can ask your administrator to recover your files."));
endif; ?>
<br />
@@ -32,29 +32,29 @@ script('encryption', 'settings-personal');
type="password"
name="changePrivateKeyPassword"
id="oldPrivateKeyPassword" />
- <label for="oldPrivateKeyPassword"><?php p($l->t("Old log-in password")); ?></label>
+ <label for="oldPrivateKeyPassword"><?php p($l->t('Old log-in password')); ?></label>
<br />
<input
type="password"
name="changePrivateKeyPassword"
id="newPrivateKeyPassword" />
- <label for="newRecoveryPassword"><?php p($l->t("Current log-in password")); ?></label>
+ <label for="newRecoveryPassword"><?php p($l->t('Current log-in password')); ?></label>
<br />
<button
type="button"
name="submitChangePrivateKeyPassword"
- disabled><?php p($l->t("Update Private Key Password")); ?>
+ disabled><?php p($l->t('Update Private Key Password')); ?>
</button>
<span class="msg"></span>
</p>
- <?php elseif ($_["recoveryEnabled"] && $_["privateKeySet"] && $_["initialized"] === \OCA\Encryption\Session::INIT_SUCCESSFUL): ?>
+ <?php elseif ($_['recoveryEnabled'] && $_['privateKeySet'] && $_['initialized'] === \OCA\Encryption\Session::INIT_SUCCESSFUL): ?>
<br />
<p id="userEnableRecovery">
- <label for="userEnableRecovery"><?php p($l->t("Enable password recovery:")); ?></label>
+ <label for="userEnableRecovery"><?php p($l->t('Enable password recovery:')); ?></label>
<span class="msg"></span>
<br />
- <em><?php p($l->t("Enabling this option will allow you to reobtain access to your encrypted files in case of password loss")); ?></em>
+ <em><?php p($l->t('Enabling this option will allow you to reobtain access to your encrypted files in case of password loss')); ?></em>
<br />
<input
type="radio"
@@ -62,8 +62,8 @@ script('encryption', 'settings-personal');
id="userEnableRecoveryCheckbox"
name="userEnableRecovery"
value="1"
- <?php echo($_["recoveryEnabledForUser"] ? 'checked="checked"' : ''); ?> />
- <label for="userEnableRecoveryCheckbox"><?php p($l->t("Enabled")); ?></label>
+ <?php echo($_['recoveryEnabledForUser'] ? 'checked="checked"' : ''); ?> />
+ <label for="userEnableRecoveryCheckbox"><?php p($l->t('Enabled')); ?></label>
<br />
<input
@@ -72,8 +72,8 @@ script('encryption', 'settings-personal');
id="userDisableRecoveryCheckbox"
name="userEnableRecovery"
value="0"
- <?php echo($_["recoveryEnabledForUser"] === false ? 'checked="checked"' : ''); ?> />
- <label for="userDisableRecoveryCheckbox"><?php p($l->t("Disabled")); ?></label>
+ <?php echo($_['recoveryEnabledForUser'] === false ? 'checked="checked"' : ''); ?> />
+ <label for="userDisableRecoveryCheckbox"><?php p($l->t('Disabled')); ?></label>
</p>
<?php endif; ?>
</form>
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 738dfe0a2a0..301ffaeaef3 100644
--- a/apps/encryption/tests/Crypto/CryptTest.php
+++ b/apps/encryption/tests/Crypto/CryptTest.php
@@ -126,9 +126,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/federatedfilesharing/lib/Controller/MountPublicLinkController.php b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php
index b5b5806d335..0cfc3dba262 100644
--- a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php
+++ b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php
@@ -64,6 +64,7 @@ class MountPublicLinkController extends Controller {
* @param string $token Token of the share
* @param string $password Password of the share
* @return JSONResponse<Http::STATUS_OK, array{remoteUrl: string}, array{}>|JSONResponse<Http::STATUS_BAD_REQUEST, array{message: string}, array{}>
+ *
* 200: Remote URL returned
* 400: Creating share is not possible
*/
diff --git a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
index 5edb80b016b..71661efa384 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 */
@@ -441,7 +441,7 @@ class RequestHandlerController extends OCSController {
throw new OCSException('Server does not support federated cloud sharing', 503);
}
- $newRemoteId = (string) ($remote_id ?? $id);
+ $newRemoteId = (string)($remote_id ?? $id);
$cloudId = $this->cloudIdManager->resolveCloudId($remote);
$qb = $this->connection->getQueryBuilder();
diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php
index eee60f06068..025a4c7d737 100644
--- a/apps/federatedfilesharing/lib/FederatedShareProvider.php
+++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php
@@ -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()) {
@@ -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();
diff --git a/apps/federatedfilesharing/lib/Notifications.php b/apps/federatedfilesharing/lib/Notifications.php
index 25900ca420d..e107065d0c1 100644
--- a/apps/federatedfilesharing/lib/Notifications.php
+++ b/apps/federatedfilesharing/lib/Notifications.php
@@ -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..8aa8ba67a2a 100644
--- a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
+++ b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
@@ -431,7 +431,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'])) {
diff --git a/apps/federatedfilesharing/lib/Settings/Admin.php b/apps/federatedfilesharing/lib/Settings/Admin.php
index bb41aede1c8..90ee9a8c748 100644
--- a/apps/federatedfilesharing/lib/Settings/Admin.php
+++ b/apps/federatedfilesharing/lib/Settings/Admin.php
@@ -64,8 +64,8 @@ class Admin implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/federatedfilesharing/lib/Settings/Personal.php b/apps/federatedfilesharing/lib/Settings/Personal.php
index 4eee4064740..bee6cc538c6 100644
--- a/apps/federatedfilesharing/lib/Settings/Personal.php
+++ b/apps/federatedfilesharing/lib/Settings/Personal.php
@@ -69,8 +69,8 @@ class Personal implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
* @since 9.1
diff --git a/apps/federatedfilesharing/lib/Settings/PersonalSection.php b/apps/federatedfilesharing/lib/Settings/PersonalSection.php
index 90f1f8ddee0..528c2b6c717 100644
--- a/apps/federatedfilesharing/lib/Settings/PersonalSection.php
+++ b/apps/federatedfilesharing/lib/Settings/PersonalSection.php
@@ -55,8 +55,8 @@ class PersonalSection implements IIconSection {
/**
* @return int whether the form should be rather on the top or bottom of
- * the settings navigation. The sections are arranged in ascending order of
- * the priority values. It is required to return a value between 0 and 99.
+ * the settings navigation. The sections are arranged in ascending order of
+ * the priority values. It is required to return a value between 0 and 99.
*
* E.g.: 70
* @since 9.1
diff --git a/apps/federatedfilesharing/tests/AddressHandlerTest.php b/apps/federatedfilesharing/tests/AddressHandlerTest.php
index dc89316746e..3fb2a938a66 100644
--- a/apps/federatedfilesharing/tests/AddressHandlerTest.php
+++ b/apps/federatedfilesharing/tests/AddressHandlerTest.php
@@ -20,13 +20,13 @@ class AddressHandlerTest extends \Test\TestCase {
/** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
protected $contactsManager;
- /** @var AddressHandler */
+ /** @var AddressHandler */
private $addressHandler;
- /** @var IURLGenerator | \PHPUnit\Framework\MockObject\MockObject */
+ /** @var IURLGenerator | \PHPUnit\Framework\MockObject\MockObject */
private $urlGenerator;
- /** @var IL10N | \PHPUnit\Framework\MockObject\MockObject */
+ /** @var IL10N | \PHPUnit\Framework\MockObject\MockObject */
private $il10n;
/** @var CloudIdManager */
diff --git a/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php b/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php
index ba3abb149b4..dc128021b28 100644
--- a/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php
+++ b/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php
@@ -39,22 +39,22 @@ class RequestHandlerControllerTest extends \Test\TestCase {
/** @var RequestHandlerController */
private $requestHandler;
- /** @var \OCA\FederatedFileSharing\FederatedShareProvider|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var \OCA\FederatedFileSharing\FederatedShareProvider|\PHPUnit\Framework\MockObject\MockObject */
private $federatedShareProvider;
- /** @var \OCA\FederatedFileSharing\Notifications|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var \OCA\FederatedFileSharing\Notifications|\PHPUnit\Framework\MockObject\MockObject */
private $notifications;
- /** @var \OCA\FederatedFileSharing\AddressHandler|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var \OCA\FederatedFileSharing\AddressHandler|\PHPUnit\Framework\MockObject\MockObject */
private $addressHandler;
- /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
private $userManager;
- /** @var IShare|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IShare|\PHPUnit\Framework\MockObject\MockObject */
private $share;
- /** @var ICloudIdManager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var ICloudIdManager|\PHPUnit\Framework\MockObject\MockObject */
private $cloudIdManager;
/** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
diff --git a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
index adba36fd88c..8f54207626f 100644
--- a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
+++ b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
@@ -50,11 +50,11 @@ class FederatedShareProviderTest extends \Test\TestCase {
protected $logger;
/** @var IRootFolder|MockObject */
protected $rootFolder;
- /** @var IConfig|MockObject */
+ /** @var IConfig|MockObject */
protected $config;
- /** @var IUserManager|MockObject */
+ /** @var IUserManager|MockObject */
protected $userManager;
- /** @var \OCP\GlobalScale\IConfig|MockObject */
+ /** @var \OCP\GlobalScale\IConfig|MockObject */
protected $gsConfig;
/** @var IManager */
@@ -64,7 +64,7 @@ class FederatedShareProviderTest extends \Test\TestCase {
/** @var IContactsManager|MockObject */
protected $contactsManager;
- /** @var ICloudIdManager */
+ /** @var ICloudIdManager */
private $cloudIdManager;
/** @var MockObject|ICloudFederationProviderManager */
diff --git a/apps/federatedfilesharing/tests/NotificationsTest.php b/apps/federatedfilesharing/tests/NotificationsTest.php
index 669e118fdd3..d0f5283e7a9 100644
--- a/apps/federatedfilesharing/tests/NotificationsTest.php
+++ b/apps/federatedfilesharing/tests/NotificationsTest.php
@@ -22,7 +22,7 @@ class NotificationsTest extends \Test\TestCase {
/** @var AddressHandler|MockObject */
private $addressHandler;
- /** @var IClientService|MockObject*/
+ /** @var IClientService|MockObject */
private $httpClientService;
/** @var IDiscoveryService|MockObject */
diff --git a/apps/federatedfilesharing/tests/TestCase.php b/apps/federatedfilesharing/tests/TestCase.php
index d2148770f73..9564cb7ec09 100644
--- a/apps/federatedfilesharing/tests/TestCase.php
+++ b/apps/federatedfilesharing/tests/TestCase.php
@@ -18,8 +18,8 @@ use OC\Group\Database;
* Base class for sharing tests.
*/
abstract class TestCase extends \Test\TestCase {
- public const TEST_FILES_SHARING_API_USER1 = "test-share-user1";
- public const TEST_FILES_SHARING_API_USER2 = "test-share-user2";
+ public const TEST_FILES_SHARING_API_USER1 = 'test-share-user1';
+ public const TEST_FILES_SHARING_API_USER2 = 'test-share-user2';
public static function setUpBeforeClass(): void {
parent::setUpBeforeClass();
diff --git a/apps/federatedfilesharing/tests/TokenHandlerTest.php b/apps/federatedfilesharing/tests/TokenHandlerTest.php
index fea13bf9d2d..f6b4a2fa9e9 100644
--- a/apps/federatedfilesharing/tests/TokenHandlerTest.php
+++ b/apps/federatedfilesharing/tests/TokenHandlerTest.php
@@ -12,10 +12,10 @@ use OCP\Security\ISecureRandom;
class TokenHandlerTest extends \Test\TestCase {
- /** @var TokenHandler */
+ /** @var TokenHandler */
private $tokenHandler;
- /** @var ISecureRandom | \PHPUnit\Framework\MockObject\MockObject */
+ /** @var ISecureRandom | \PHPUnit\Framework\MockObject\MockObject */
private $secureRandom;
/** @var int */
diff --git a/apps/federation/lib/DbHandler.php b/apps/federation/lib/DbHandler.php
index ca05417d768..8a189dc56f7 100644
--- a/apps/federation/lib/DbHandler.php
+++ b/apps/federation/lib/DbHandler.php
@@ -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,8 +221,8 @@ 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();
@@ -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..67078bd6eb1 100644
--- a/apps/federation/lib/Settings/Admin.php
+++ b/apps/federation/lib/Settings/Admin.php
@@ -39,8 +39,8 @@ class Admin implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
@@ -49,7 +49,7 @@ class Admin implements IDelegatedSettings {
}
public function getName(): ?string {
- return $this->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/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..df8cd36d8a8 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 {
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/SyncFederationAddressbooksTest.php b/apps/federation/tests/SyncFederationAddressbooksTest.php
index 1b53f238bfa..0f13dd0ec51 100644
--- a/apps/federation/tests/SyncFederationAddressbooksTest.php
+++ b/apps/federation/tests/SyncFederationAddressbooksTest.php
@@ -18,10 +18,10 @@ class SyncFederationAddressbooksTest extends \Test\TestCase {
/** @var array */
private $callBacks = [];
- /** @var MockObject | DiscoveryService */
+ /** @var MockObject | DiscoveryService */
private $discoveryService;
- /** @var MockObject|LoggerInterface */
+ /** @var MockObject|LoggerInterface */
private $logger;
protected function setUp(): void {
diff --git a/apps/federation/tests/TrustedServersTest.php b/apps/federation/tests/TrustedServersTest.php
index 52979cdc538..93c66ea8831 100644
--- a/apps/federation/tests/TrustedServersTest.php
+++ b/apps/federation/tests/TrustedServersTest.php
@@ -24,31 +24,31 @@ class TrustedServersTest extends TestCase {
/** @var \PHPUnit\Framework\MockObject\MockObject | TrustedServers */
private $trustedServers;
- /** @var \PHPUnit\Framework\MockObject\MockObject | DbHandler */
+ /** @var \PHPUnit\Framework\MockObject\MockObject | DbHandler */
private $dbHandler;
/** @var \PHPUnit\Framework\MockObject\MockObject | IClientService */
private $httpClientService;
- /** @var \PHPUnit\Framework\MockObject\MockObject | IClient */
+ /** @var \PHPUnit\Framework\MockObject\MockObject | IClient */
private $httpClient;
- /** @var \PHPUnit\Framework\MockObject\MockObject | IResponse */
+ /** @var \PHPUnit\Framework\MockObject\MockObject | IResponse */
private $response;
- /** @var \PHPUnit\Framework\MockObject\MockObject | LoggerInterface */
+ /** @var \PHPUnit\Framework\MockObject\MockObject | LoggerInterface */
private $logger;
- /** @var \PHPUnit\Framework\MockObject\MockObject | IJobList */
+ /** @var \PHPUnit\Framework\MockObject\MockObject | IJobList */
private $jobList;
- /** @var \PHPUnit\Framework\MockObject\MockObject | ISecureRandom */
+ /** @var \PHPUnit\Framework\MockObject\MockObject | ISecureRandom */
private $secureRandom;
- /** @var \PHPUnit\Framework\MockObject\MockObject | IConfig */
+ /** @var \PHPUnit\Framework\MockObject\MockObject | IConfig */
private $config;
- /** @var \PHPUnit\Framework\MockObject\MockObject | IEventDispatcher */
+ /** @var \PHPUnit\Framework\MockObject\MockObject | IEventDispatcher */
private $dispatcher;
/** @var \PHPUnit\Framework\MockObject\MockObject|ITimeFactory */
@@ -100,7 +100,7 @@ class TrustedServersTest extends TestCase {
->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/lib/Activity/Provider.php b/apps/files/lib/Activity/Provider.php
index 5c574337933..aa3ef062a16 100644
--- a/apps/files/lib/Activity/Provider.php
+++ b/apps/files/lib/Activity/Provider.php
@@ -351,7 +351,7 @@ class Provider implements IProvider {
protected function getFile($parameter, ?IEvent $event = null) {
if (is_array($parameter)) {
$path = reset($parameter);
- $id = (string) key($parameter);
+ $id = (string)key($parameter);
} elseif ($event !== null) {
// Legacy from before ownCloud 8.2
$path = $parameter;
diff --git a/apps/files/lib/Activity/Settings/FavoriteAction.php b/apps/files/lib/Activity/Settings/FavoriteAction.php
index 583edd5d9bc..b572a9546e0 100644
--- a/apps/files/lib/Activity/Settings/FavoriteAction.php
+++ b/apps/files/lib/Activity/Settings/FavoriteAction.php
@@ -24,8 +24,8 @@ class FavoriteAction extends FileActivitySettings {
/**
* @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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/files/lib/Activity/Settings/FileChanged.php b/apps/files/lib/Activity/Settings/FileChanged.php
index dfd6183e20b..5af87456550 100644
--- a/apps/files/lib/Activity/Settings/FileChanged.php
+++ b/apps/files/lib/Activity/Settings/FileChanged.php
@@ -24,8 +24,8 @@ class FileChanged extends FileActivitySettings {
/**
* @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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/files/lib/Activity/Settings/FileFavoriteChanged.php b/apps/files/lib/Activity/Settings/FileFavoriteChanged.php
index f1412331d30..e4ac572f3f3 100644
--- a/apps/files/lib/Activity/Settings/FileFavoriteChanged.php
+++ b/apps/files/lib/Activity/Settings/FileFavoriteChanged.php
@@ -24,8 +24,8 @@ class FileFavoriteChanged extends FileActivitySettings {
/**
* @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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/files/lib/Collaboration/Resources/ResourceProvider.php b/apps/files/lib/Collaboration/Resources/ResourceProvider.php
index 439d3baf7f6..0ac54afad7d 100644
--- a/apps/files/lib/Collaboration/Resources/ResourceProvider.php
+++ b/apps/files/lib/Collaboration/Resources/ResourceProvider.php
@@ -39,13 +39,13 @@ class ResourceProvider implements IProvider {
}
private function getNode(IResource $resource): ?Node {
- if (isset($this->nodes[(int) $resource->getId()])) {
- return $this->nodes[(int) $resource->getId()];
+ if (isset($this->nodes[(int)$resource->getId()])) {
+ return $this->nodes[(int)$resource->getId()];
}
- $node = $this->rootFolder->getFirstNodeById((int) $resource->getId());
+ $node = $this->rootFolder->getFirstNodeById((int)$resource->getId());
if ($node) {
- $this->nodes[(int) $resource->getId()] = $node;
- return $this->nodes[(int) $resource->getId()];
+ $this->nodes[(int)$resource->getId()] = $node;
+ return $this->nodes[(int)$resource->getId()];
}
return null;
}
@@ -56,8 +56,8 @@ class ResourceProvider implements IProvider {
* @since 16.0.0
*/
public function getResourceRichObject(IResource $resource): array {
- if (isset($this->nodes[(int) $resource->getId()])) {
- $node = $this->nodes[(int) $resource->getId()]->getPath();
+ if (isset($this->nodes[(int)$resource->getId()])) {
+ $node = $this->nodes[(int)$resource->getId()]->getPath();
} else {
$node = $this->getNode($resource);
}
@@ -95,10 +95,10 @@ class ResourceProvider implements IProvider {
}
$userFolder = $this->rootFolder->getUserFolder($user->getUID());
- $node = $userFolder->getById((int) $resource->getId());
+ $node = $userFolder->getById((int)$resource->getId());
if ($node) {
- $this->nodes[(int) $resource->getId()] = $node;
+ $this->nodes[(int)$resource->getId()] = $node;
return true;
}
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("<info>" . $targetInput . "</info> already exists, overwrite? [y/N] ", false);
+ $question = new ConfirmationQuestion('<info>' . $targetInput . '</info> 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..f59b636079b 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 . ":");
+ $output->writeln($user . ':');
foreach($filesByUser as $file) {
- $output->writeln(" - " . $file->getPath());
+ $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("<error>File cannot be deleted, insufficient permissions.</error>");
+ $output->writeln('<error>File cannot be deleted, insufficient permissions.</error>');
}
}
diff --git a/apps/files/lib/Command/DeleteOrphanedFiles.php b/apps/files/lib/Command/DeleteOrphanedFiles.php
index b7101c07258..50031da4f63 100644
--- a/apps/files/lib/Command/DeleteOrphanedFiles.php
+++ b/apps/files/lib/Command/DeleteOrphanedFiles.php
@@ -53,7 +53,7 @@ class DeleteOrphanedFiles extends Command {
$result = $query->execute();
while ($row = $result->fetch()) {
$deletedInLastChunk++;
- $deletedEntries += $deleteQuery->setParameter('objectid', (int) $row['fileid'])
+ $deletedEntries += $deleteQuery->setParameter('objectid', (int)$row['fileid'])
->execute();
}
$result->closeCursor();
@@ -120,7 +120,7 @@ class DeleteOrphanedFiles extends Command {
$result = $query->execute();
while ($row = $result->fetch()) {
$deletedInLastChunk++;
- $deletedEntries += $deleteQuery->setParameter('storageid', (int) $row['storage_id'])
+ $deletedEntries += $deleteQuery->setParameter('storageid', (int)$row['storage_id'])
->execute();
}
$result->closeCursor();
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([
- "<error>Warning: Binary output can mess up your terminal</error>",
+ '<error>Warning: Binary output can mess up your terminal</error>',
" Use <info>occ files:get $fileInput -</info> to output it to the terminal anyway",
" Or <info>occ files:get $fileInput <FILE></info> 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("<info>" . $targetInput . "</info> already exists, overwrite? [y/N] ", false);
+ $question = new ConfirmationQuestion('<info>' . $targetInput . '</info> 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("<error>Warning, object $object belongs to an existing file, deleting the object will lead to unexpected behavior if not replaced</error>");
$output->writeln(" Note: use <info>occ files:delete $fileId</info> to delete the file cleanly or <info>occ info:file $fileId</info> 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..c4ab59608fb 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("<error>Instance is not using primary object store</error>");
+ $output->writeln('<error>Instance is not using primary object store</error>');
return null;
}
if ($config['multibucket'] && !$bucket) {
- $output->writeln("<error>--bucket option required</error> because <info>multi bucket</info> is enabled.");
+ $output->writeln('<error>--bucket option required</error> because <info>multi bucket</info> 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;
}
diff --git a/apps/files/lib/Command/Object/Put.php b/apps/files/lib/Command/Object/Put.php
index 34e4ceb854b..8516eb51183 100644
--- a/apps/files/lib/Command/Object/Put.php
+++ b/apps/files/lib/Command/Object/Put.php
@@ -29,8 +29,8 @@ 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");
;
}
@@ -38,7 +38,7 @@ class Put extends Command {
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);
+ $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("<error>Warning, object $object belongs to an existing file, overwriting the object contents can lead to unexpected behavior.</error>");
$output->writeln("You can use <info>occ files:put $inputName $fileId</info> 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..622ccba48a3 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();
diff --git a/apps/files/lib/Command/ScanAppData.php b/apps/files/lib/Command/ScanAppData.php
index 61f4b6f3ba2..5360d38bdb6 100644
--- a/apps/files/lib/Command/ScanAppData.php
+++ b/apps/files/lib/Command/ScanAppData.php
@@ -210,7 +210,7 @@ class ScanAppData extends Base {
}
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("<error>Unknown source user " . $input->getArgument('source-user') . "</error>");
+ $output->writeln('<error>Unknown source user ' . $input->getArgument('source-user') . '</error>');
return self::FAILURE;
}
if (!$destinationUserObject instanceof IUser) {
- $output->writeln("<error>Unknown destination user " . $input->getArgument('destination-user') . "</error>");
+ $output->writeln('<error>Unknown destination user ' . $input->getArgument('destination-user') . '</error>');
return self::FAILURE;
}
@@ -105,7 +105,7 @@ class TransferOwnership extends Command {
}
break;
default:
- $output->writeln("<error>Option --transfer-incoming-shares: wrong usage. Transfer aborted.</error>");
+ $output->writeln('<error>Option --transfer-incoming-shares: wrong usage. Transfer aborted.</error>');
return self::FAILURE;
}
@@ -119,7 +119,7 @@ class TransferOwnership extends Command {
$includeIncoming
);
} catch (TransferOwnershipException $e) {
- $output->writeln("<error>" . $e->getMessage() . "</error>");
+ $output->writeln('<error>' . $e->getMessage() . '</error>');
return $e->getCode() !== 0 ? $e->getCode() : self::FAILURE;
}
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php
index 16d0c3ea1f0..aa9aa81a814 100644
--- a/apps/files/lib/Controller/ViewController.php
+++ b/apps/files/lib/Controller/ViewController.php
@@ -89,7 +89,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);
+ return $this->redirectToFile((int)$fileid);
} catch (NotFoundException $e) {
return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
}
@@ -134,7 +134,7 @@ class ViewController extends Controller {
public function index($dir = '', $view = '', $fileid = null, $fileNotFound = false) {
if ($fileid !== null && $view !== 'trashbin') {
try {
- return $this->redirectToFileIfInTrashbin((int) $fileid);
+ return $this->redirectToFileIfInTrashbin((int)$fileid);
} catch (NotFoundException $e) {
}
}
@@ -163,14 +163,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);
}
} else { // fileid does not exist anywhere
$fileNotFound = true;
diff --git a/apps/files/lib/Listener/DeclarativeSettingsSetValueEventListener.php b/apps/files/lib/Listener/DeclarativeSettingsSetValueEventListener.php
index 43d01563c26..a3be2b9141e 100644
--- a/apps/files/lib/Listener/DeclarativeSettingsSetValueEventListener.php
+++ b/apps/files/lib/Listener/DeclarativeSettingsSetValueEventListener.php
@@ -32,7 +32,7 @@ class DeclarativeSettingsSetValueEventListener implements IEventListener {
switch ($event->getFieldId()) {
case 'windows_support':
- $this->service->setFilesWindowsSupport((bool) $event->getValue());
+ $this->service->setFilesWindowsSupport((bool)$event->getValue());
$event->stopPropagation();
break;
}
diff --git a/apps/files/lib/Listener/SyncLivePhotosListener.php b/apps/files/lib/Listener/SyncLivePhotosListener.php
index c74a8370818..049d7319b64 100644
--- a/apps/files/lib/Listener/SyncLivePhotosListener.php
+++ b/apps/files/lib/Listener/SyncLivePhotosListener.php
@@ -100,7 +100,7 @@ class SyncLivePhotosListener implements IEventListener {
$peerFileExtension = $peerFile->getExtension();
$targetName = $targetFile->getName();
- if (!str_ends_with($targetName, "." . $sourceExtension)) {
+ if (!str_ends_with($targetName, '.' . $sourceExtension)) {
throw new AbortedEventException('Cannot change the extension of a Live Photo');
}
@@ -176,7 +176,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/Search/FilesSearchProvider.php b/apps/files/lib/Search/FilesSearchProvider.php
index 950c8b14ab6..4dfd9bc0d16 100644
--- a/apps/files/lib/Search/FilesSearchProvider.php
+++ b/apps/files/lib/Search/FilesSearchProvider.php
@@ -172,7 +172,7 @@ class FilesSearchProvider implements IFilteringProvider {
return new SearchQuery(
new SearchBinaryOperator(SearchBinaryOperator::OPERATOR_AND, $comparisons),
$query->getLimit(),
- (int) $query->getCursor(),
+ (int)$query->getCursor(),
$query->getSortOrder() === ISearchQuery::SORT_DATE_DESC
? [new SearchOrder(ISearchOrder::DIRECTION_DESCENDING, 'mtime')]
: [],
diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php
index a624df4a924..58595e4f0a9 100644
--- a/apps/files/lib/Service/OwnershipTransferService.php
+++ b/apps/files/lib/Service/OwnershipTransferService.php
@@ -78,7 +78,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
@@ -117,7 +117,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);
}
@@ -244,10 +244,10 @@ class OwnershipTransferService {
// no file is allowed to be encrypted
if (!empty($encryptedFiles)) {
- $output->writeln("<error>Some files are encrypted - please decrypt them first.</error>");
+ $output->writeln('<error>Some files are encrypted - please decrypt them first.</error>');
foreach ($encryptedFiles as $encryptedFile) {
/** @var FileInfo $encryptedFile */
- $output->writeln(" " . $encryptedFile->getPath());
+ $output->writeln(' ' . $encryptedFile->getPath());
}
throw new \Exception('Execution terminated.');
}
@@ -372,7 +372,7 @@ class OwnershipTransferService {
$finalTarget = $finalTarget . '/' . basename($sourcePath);
}
if ($view->rename($sourcePath, $finalTarget) === 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
@@ -391,7 +391,7 @@ class OwnershipTransferService {
array $shares,
OutputInterface $output,
):void {
- $output->writeln("Restoring shares ...");
+ $output->writeln('Restoring shares ...');
$progress = new ProgressBar($output, count($shares));
$rootFolder = \OCP\Server::get(IRootFolder::class);
@@ -459,7 +459,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/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php
index aade58da5a3..e3ac7737d00 100644
--- a/apps/files/tests/Controller/ViewControllerTest.php
+++ b/apps/files/tests/Controller/ViewControllerTest.php
@@ -111,10 +111,10 @@ class ViewControllerTest extends TestCase {
$this->viewConfig,
$filenameValidator,
])
- ->onlyMethods([
- 'getStorageInfo',
- ])
- ->getMock();
+ ->onlyMethods([
+ 'getStorageInfo',
+ ])
+ ->getMock();
}
public function testIndexWithRegularBrowser() {
diff --git a/apps/files_external/lib/Command/Import.php b/apps/files_external/lib/Command/Import.php
index 858a70b8c14..bf36bf5d5c1 100644
--- a/apps/files_external/lib/Command/Import.php
+++ b/apps/files_external/lib/Command/Import.php
@@ -59,7 +59,7 @@ class Import extends Base {
}
protected function execute(InputInterface $input, OutputInterface $output): int {
- $user = (string) $input->getOption('user');
+ $user = (string)$input->getOption('user');
$path = $input->getArgument('path');
if ($path === '-') {
$json = file_get_contents('php://stdin');
@@ -117,7 +117,7 @@ class Import extends Base {
$existingMount->getApplicableUsers() === $mount->getApplicableUsers() &&
$existingMount->getBackendOptions() === $mount->getBackendOptions()
) {
- $output->writeln("<error>Duplicate mount (" . $mount->getMountPoint() . ")</error>");
+ $output->writeln('<error>Duplicate mount (' . $mount->getMountPoint() . ')</error>');
return self::FAILURE;
}
}
diff --git a/apps/files_external/lib/Command/ListCommand.php b/apps/files_external/lib/Command/ListCommand.php
index fabcce67775..84c1b569e9d 100644
--- a/apps/files_external/lib/Command/ListCommand.php
+++ b/apps/files_external/lib/Command/ListCommand.php
@@ -85,11 +85,11 @@ class ListCommand extends Base {
$output->writeln('[]');
} else {
if ($userId === self::ALL) {
- $output->writeln("<info>No mounts configured</info>");
+ $output->writeln('<info>No mounts configured</info>');
} elseif ($userId) {
$output->writeln("<info>No mounts configured by $userId</info>");
} else {
- $output->writeln("<info>No admin mounts configured</info>");
+ $output->writeln('<info>No admin mounts configured</info>');
}
}
return;
diff --git a/apps/files_external/lib/Command/Notify.php b/apps/files_external/lib/Command/Notify.php
index a4e7edf0207..09be70ecd16 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) {
@@ -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/Controller/AjaxController.php b/apps/files_external/lib/Controller/AjaxController.php
index 9faba64416f..dab7e092f00 100644
--- a/apps/files_external/lib/Controller/AjaxController.php
+++ b/apps/files_external/lib/Controller/AjaxController.php
@@ -18,7 +18,7 @@ use OCP\IUserSession;
class AjaxController extends Controller {
/** @var RSA */
private $rsaMechanism;
- /** @var GlobalAuth */
+ /** @var GlobalAuth */
private $globalAuth;
/** @var IUserSession */
private $userSession;
diff --git a/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php b/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php
index 6fdd1a0e4ba..ea42b0275f7 100644
--- a/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php
+++ b/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php
@@ -100,7 +100,7 @@ class LoginCredentials extends AuthMechanism {
}
$credentials = $this->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/FrontendDefinitionTrait.php b/apps/files_external/lib/Lib/FrontendDefinitionTrait.php
index 65f46eb4dbc..5602345fe89 100644
--- a/apps/files_external/lib/Lib/FrontendDefinitionTrait.php
+++ b/apps/files_external/lib/Lib/FrontendDefinitionTrait.php
@@ -12,7 +12,7 @@ namespace OCA\Files_External\Lib;
trait FrontendDefinitionTrait {
/** @var string human-readable mechanism name */
- private string $text = "";
+ private string $text = '';
/** @var array<string, DefinitionParameter> parameters for mechanism */
private array $parameters = [];
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index 895bd00c462..43646ac681a 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -128,9 +128,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
}
- if (is_array($this->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];
}
@@ -766,7 +766,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..d1f67c5a741 100644
--- a/apps/files_external/lib/Lib/Storage/FTP.php
+++ b/apps/files_external/lib/Lib/Storage/FTP.php
@@ -66,11 +66,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 +219,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..a064bf9b100 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
diff --git a/apps/files_external/lib/Lib/Storage/OwnCloud.php b/apps/files_external/lib/Lib/Storage/OwnCloud.php
index d5562a3cb32..fb5c7207486 100644
--- a/apps/files_external/lib/Lib/Storage/OwnCloud.php
+++ b/apps/files_external/lib/Lib/Storage/OwnCloud.php
@@ -24,10 +24,10 @@ class OwnCloud extends \OC\Files\Storage\DAV implements IDisableEncryptionStorag
// (owncloud install path on host)
$host = $params['host'];
// strip protocol
- if (substr($host, 0, 8) === "https://") {
+ if (substr($host, 0, 8) === 'https://') {
$host = substr($host, 8);
$params['secure'] = true;
- } elseif (substr($host, 0, 7) === "http://") {
+ } elseif (substr($host, 0, 7) === 'http://') {
$host = substr($host, 7);
$params['secure'] = false;
}
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php
index 6046b7266f5..1fb6dec671d 100644
--- a/apps/files_external/lib/Lib/Storage/SFTP.php
+++ b/apps/files_external/lib/Lib/Storage/SFTP.php
@@ -239,7 +239,7 @@ class SFTP extends Common {
$lines = file($keyPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if ($lines) {
foreach ($lines as $line) {
- $hostKeyArray = explode("::", $line, 2);
+ $hostKeyArray = explode('::', $line, 2);
if (count($hostKeyArray) === 2) {
$hosts[] = $hostKeyArray[0];
$keys[] = $hostKeyArray[1];
@@ -311,11 +311,11 @@ class SFTP extends Common {
if (!is_array($stat) || !array_key_exists('type', $stat)) {
return false;
}
- if ((int) $stat['type'] === NET_SFTP_TYPE_REGULAR) {
+ if ((int)$stat['type'] === NET_SFTP_TYPE_REGULAR) {
return 'file';
}
- if ((int) $stat['type'] === NET_SFTP_TYPE_DIRECTORY) {
+ if ((int)$stat['type'] === NET_SFTP_TYPE_DIRECTORY) {
return 'dir';
}
} catch (\Exception $e) {
@@ -478,7 +478,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 */
@@ -486,11 +486,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 066d0d08f5b..bd871626bd9 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -111,7 +111,7 @@ class SMB extends Common implements INotifyStorage {
$this->root = rtrim($this->root, '/') . '/';
$this->showHidden = isset($params['show_hidden']) && $params['show_hidden'];
- $this->caseSensitive = (bool) ($params['case_sensitive'] ?? true);
+ $this->caseSensitive = (bool)($params['case_sensitive'] ?? true);
$this->checkAcl = isset($params['check_acl']) && $params['check_acl'];
$this->statCache = new CappedMemoryCache();
@@ -502,7 +502,7 @@ 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);
@@ -545,7 +545,7 @@ 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);
diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php
index f25c3cb304b..64b3179efef 100644
--- a/apps/files_external/lib/Lib/Storage/Swift.php
+++ b/apps/files_external/lib/Lib/Storage/Swift.php
@@ -88,7 +88,7 @@ class Swift extends \OC\Files\Storage\Common {
*
* @param string $path
* @return StorageObject|bool object
- * or false if the object did not exist
+ * or false if the object did not exist
* @throws \OCP\Files\StorageAuthException
* @throws \OCP\Files\StorageNotAvailableException
*/
@@ -134,7 +134,7 @@ class Swift extends \OC\Files\Storage\Common {
or (empty($params['user']) && empty($params['userid'])) or empty($params['bucket'])
or empty($params['region'])
) {
- throw new StorageBadConfigException("API Key or password, Login, Bucket and Region have to be configured.");
+ throw new StorageBadConfigException('API Key or password, Login, Bucket and Region have to be configured.');
}
$user = $params['user'];
diff --git a/apps/files_external/lib/Settings/Admin.php b/apps/files_external/lib/Settings/Admin.php
index f8235778b7c..63a420e749e 100644
--- a/apps/files_external/lib/Settings/Admin.php
+++ b/apps/files_external/lib/Settings/Admin.php
@@ -23,7 +23,7 @@ class Admin implements ISettings {
/** @var BackendService */
private $backendService;
- /** @var GlobalAuth */
+ /** @var GlobalAuth */
private $globalAuth;
public function __construct(
@@ -66,8 +66,8 @@ class Admin implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/files_external/lib/Settings/Personal.php b/apps/files_external/lib/Settings/Personal.php
index 4efa7af6060..ecd56e632a9 100644
--- a/apps/files_external/lib/Settings/Personal.php
+++ b/apps/files_external/lib/Settings/Personal.php
@@ -24,7 +24,7 @@ class Personal implements ISettings {
/** @var BackendService */
private $backendService;
- /** @var GlobalAuth */
+ /** @var GlobalAuth */
private $globalAuth;
/** @var IUserSession */
@@ -74,8 +74,8 @@ class Personal implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/files_external/lib/Settings/Section.php b/apps/files_external/lib/Settings/Section.php
index eae46471e94..9bf5c092e57 100644
--- a/apps/files_external/lib/Settings/Section.php
+++ b/apps/files_external/lib/Settings/Section.php
@@ -46,8 +46,8 @@ class Section implements IIconSection {
/**
* @return int whether the form should be rather on the top or bottom of
- * the settings navigation. The sections are arranged in ascending order of
- * the priority values. It is required to return a value between 0 and 99.
+ * the settings navigation. The sections are arranged in ascending order of
+ * the priority values. It is required to return a value between 0 and 99.
*
* E.g.: 70
*/
diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php
index 6b8969e9e4e..54407836d63 100644
--- a/apps/files_external/templates/settings.php
+++ b/apps/files_external/templates/settings.php
@@ -14,12 +14,12 @@ use OCA\Files_External\Service\BackendService;
$canCreateMounts = $_['visibilityType'] === BackendService::VISIBILITY_ADMIN || $_['allowUserMounting'];
-$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('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');
script('files_external', [
@@ -66,7 +66,7 @@ function writeParameterInput($parameter, $options, $classes = []) {
<?php
break;
case DefinitionParameter::VALUE_BOOLEAN: ?>
- <?php $checkboxId = uniqid("checkbox_"); ?>
+ <?php $checkboxId = uniqid('checkbox_'); ?>
<div>
<label>
<input type="checkbox"
@@ -166,7 +166,7 @@ uasort($sortedBackends, function ($a, $b) {
});
?>
<?php foreach ($sortedBackends as $backend): ?>
- <?php if ($backend->getDeprecateTo() || (!$canCreateNewLocalStorage && $backend->getIdentifier() == "local")) {
+ <?php if ($backend->getDeprecateTo() || (!$canCreateNewLocalStorage && $backend->getIdentifier() == 'local')) {
continue;
} // ignore deprecated backends?>
<option value="<?php p($backend->getIdentifier()); ?>"><?php p($backend->getText()); ?></option>
@@ -227,7 +227,7 @@ uasort($sortedBackends, function ($a, $b) {
<form autocomplete="false" action="#"
id="global_credentials" method="post"
class="<?php if (isset($_['visibilityType']) && $_['visibilityType'] === BackendService::VISIBILITY_PERSONAL) {
- print_unescaped("global_credentials__personal");
+ print_unescaped('global_credentials__personal');
} ?>">
<h2><?php p($l->t('Global credentials')); ?></h2>
<p class="settings-hint"><?php p($l->t('Global credentials can be used to authenticate with multiple external storages that have the same credentials.')); ?></p>
diff --git a/apps/files_external/tests/Service/StoragesServiceTest.php b/apps/files_external/tests/Service/StoragesServiceTest.php
index 705d5fa276f..0936912b221 100644
--- a/apps/files_external/tests/Service/StoragesServiceTest.php
+++ b/apps/files_external/tests/Service/StoragesServiceTest.php
@@ -62,7 +62,7 @@ abstract class StoragesServiceTest extends \Test\TestCase {
*/
protected $dataDir;
- /** @var CleaningDBConfig */
+ /** @var CleaningDBConfig */
protected $dbConfig;
/**
@@ -345,7 +345,7 @@ abstract class StoragesServiceTest extends \Test\TestCase {
$result = $storageCheckQuery->execute();
$storages = $result->fetchAll();
$result->closeCursor();
- $this->assertCount(0, $storages, "expected 0 storages, got " . json_encode($storages));
+ $this->assertCount(0, $storages, 'expected 0 storages, got ' . json_encode($storages));
}
protected function actualDeletedUnexistingStorageTest() {
diff --git a/apps/files_external/tests/sso-setup/apps.config.php b/apps/files_external/tests/sso-setup/apps.config.php
index 71190f44291..b3889956a53 100644
--- a/apps/files_external/tests/sso-setup/apps.config.php
+++ b/apps/files_external/tests/sso-setup/apps.config.php
@@ -5,16 +5,16 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
$CONFIG = [
- "apps_paths" => [
+ 'apps_paths' => [
[
- "path" => "/var/www/html/apps",
- "url" => "/apps",
- "writable" => false,
+ 'path' => '/var/www/html/apps',
+ 'url' => '/apps',
+ 'writable' => false,
],
[
- "path" => "/var/www/html/extra-apps",
- "url" => "/extra-apps",
- "writable" => true,
+ 'path' => '/var/www/html/extra-apps',
+ 'url' => '/extra-apps',
+ 'writable' => true,
],
],
];
diff --git a/apps/files_sharing/lib/Activity/Providers/Base.php b/apps/files_sharing/lib/Activity/Providers/Base.php
index b9d044952d9..5bf63b7e2af 100644
--- a/apps/files_sharing/lib/Activity/Providers/Base.php
+++ b/apps/files_sharing/lib/Activity/Providers/Base.php
@@ -119,7 +119,7 @@ abstract class Base implements IProvider {
protected function getFile($parameter, ?IEvent $event = null) {
if (is_array($parameter)) {
$path = reset($parameter);
- $id = (string) key($parameter);
+ $id = (string)key($parameter);
} elseif ($event !== null) {
// Legacy from before ownCloud 8.2
$path = $parameter;
diff --git a/apps/files_sharing/lib/Activity/Settings/PublicLinks.php b/apps/files_sharing/lib/Activity/Settings/PublicLinks.php
index 9a97893a190..12a543f1e7f 100644
--- a/apps/files_sharing/lib/Activity/Settings/PublicLinks.php
+++ b/apps/files_sharing/lib/Activity/Settings/PublicLinks.php
@@ -24,8 +24,8 @@ class PublicLinks extends ShareActivitySettings {
/**
* @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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/files_sharing/lib/Activity/Settings/PublicLinksUpload.php b/apps/files_sharing/lib/Activity/Settings/PublicLinksUpload.php
index 3c87cc08a39..bcdc4a4ff97 100644
--- a/apps/files_sharing/lib/Activity/Settings/PublicLinksUpload.php
+++ b/apps/files_sharing/lib/Activity/Settings/PublicLinksUpload.php
@@ -24,8 +24,8 @@ class PublicLinksUpload extends ShareActivitySettings {
/**
* @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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/files_sharing/lib/Activity/Settings/RemoteShare.php b/apps/files_sharing/lib/Activity/Settings/RemoteShare.php
index 2ff0c141bd3..339e634638b 100644
--- a/apps/files_sharing/lib/Activity/Settings/RemoteShare.php
+++ b/apps/files_sharing/lib/Activity/Settings/RemoteShare.php
@@ -24,8 +24,8 @@ class RemoteShare extends ShareActivitySettings {
/**
* @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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/files_sharing/lib/Activity/Settings/Shared.php b/apps/files_sharing/lib/Activity/Settings/Shared.php
index ada09d1e444..30b5e68b04c 100644
--- a/apps/files_sharing/lib/Activity/Settings/Shared.php
+++ b/apps/files_sharing/lib/Activity/Settings/Shared.php
@@ -24,8 +24,8 @@ class Shared extends ShareActivitySettings {
/**
* @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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/files_sharing/lib/Command/DeleteOrphanShares.php b/apps/files_sharing/lib/Command/DeleteOrphanShares.php
index 028738a4318..cd3ff5c08f8 100644
--- a/apps/files_sharing/lib/Command/DeleteOrphanShares.php
+++ b/apps/files_sharing/lib/Command/DeleteOrphanShares.php
@@ -49,7 +49,7 @@ class DeleteOrphanShares extends Base {
if ($exists) {
$output->writeln(" file still exists but the share owner lost access to it, run <info>occ info:file {$share['fileid']}</info> for more information about the file");
} else {
- $output->writeln(" file no longer exists");
+ $output->writeln(' file no longer exists');
}
}
}
@@ -57,14 +57,14 @@ class DeleteOrphanShares extends Base {
$count = count($orphans);
if ($count === 0) {
- $output->writeln("No orphan shares detected");
+ $output->writeln('No orphan shares detected');
return 0;
}
if ($force) {
$doDelete = true;
} else {
- $output->writeln("");
+ $output->writeln('');
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion("Delete <info>$count</info> orphan shares? [y/N] ", false);
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 10e9a033071..6808cf48ce1 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -516,7 +516,7 @@ class ShareAPIController extends OCSController {
* @param string $password Password for the share
* @param string|null $sendPasswordByTalk Send the password for the share over Talk
* @param ?string $expireDate The expiry date of the share in the user's timezone at 00:00.
- * If $expireDate is not supplied or set to `null`, the system default will be used.
+ * If $expireDate is not supplied or set to `null`, the system default will be used.
* @param string $note Note for the share
* @param string $label Label for the share (only used in link and email)
* @param string|null $attributes Additional attributes for the share
@@ -1005,7 +1005,7 @@ class ShareAPIController extends OCSController {
if (!$resharingRight && $this->shareProviderResharingRights($this->currentUser, $share, $node)) {
$resharingRight = true;
}
- } catch (InvalidPathException | NotFoundException $e) {
+ } catch (InvalidPathException|NotFoundException $e) {
}
}
@@ -1060,7 +1060,7 @@ class ShareAPIController extends OCSController {
// initiate real owner.
$owner = $node->getOwner()
- ->getUID();
+ ->getUID();
if (!$this->userManager->userExists($owner)) {
return new DataResponse([]);
}
@@ -1069,7 +1069,7 @@ class ShareAPIController extends OCSController {
$userFolder = $this->rootFolder->getUserFolder($owner);
if ($node->getId() !== $userFolder->getId() && !$userFolder->isSubNode($node)) {
$owner = $node->getOwner()
- ->getUID();
+ ->getUID();
$userFolder = $this->rootFolder->getUserFolder($owner);
$node = $userFolder->getFirstNodeById($node->getId());
}
@@ -1133,8 +1133,8 @@ class ShareAPIController extends OCSController {
* @param string|null $hideDownload New condition if the download should be hidden
* @param string|null $attributes New additional attributes
* @param string|null $sendMail if the share should be send by mail.
- * Considering the share already exists, no mail will be send after the share is updated.
- * You will have to use the sendMail action to send the mail.
+ * Considering the share already exists, no mail will be send after the share is updated.
+ * You will have to use the sendMail action to send the mail.
* @param string|null $shareWith New recipient for email shares
* @return DataResponse<Http::STATUS_OK, Files_SharingShare, array{}>
* @throws OCSBadRequestException Share could not be updated because the requested changes are invalid
@@ -1289,7 +1289,7 @@ class ShareAPIController extends OCSController {
if ($label !== null) {
if (strlen($label) > 255) {
- throw new OCSBadRequestException("Maximum label length is 255");
+ throw new OCSBadRequestException('Maximum label length is 255');
}
$share->setLabel($label);
}
@@ -1633,7 +1633,7 @@ class ShareAPIController extends OCSController {
*/
private function parseDate(string $expireDate): \DateTime {
try {
- $date = new \DateTime(trim($expireDate, "\""), $this->dateTimeZone->getTimeZone());
+ $date = new \DateTime(trim($expireDate, '"'), $this->dateTimeZone->getTimeZone());
// Make sure it expires at midnight in owner timezone
$date->setTime(0, 0, 0);
} catch (\Exception $e) {
@@ -1865,7 +1865,7 @@ class ShareAPIController extends OCSController {
if ($this->shareProviderResharingRights($viewer, $share, $node)) {
return true;
}
- } catch (InvalidPathException | NotFoundException $e) {
+ } catch (InvalidPathException|NotFoundException $e) {
}
}
}
@@ -2062,6 +2062,7 @@ class ShareAPIController extends OCSController {
* @throws OCSBadRequestException Invalid request or wrong password
* @throws OCSException Error while sending mail notification
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}>
+ *
* 200: The email notification was sent successfully
*/
#[NoAdminRequired]
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index 25af4862ca4..17b9c2a2196 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -205,7 +205,7 @@ class ShareController extends AuthPublicShareController {
* throws hooks when a share is attempted to be accessed
*
* @param \OCP\Share\IShare|string $share the Share instance if available,
- * otherwise token
+ * otherwise token
* @param int $errorCode
* @param string $errorMessage
*
diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php
index 13a420728ef..f177cb9d1ee 100644
--- a/apps/files_sharing/lib/Controller/ShareesAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php
@@ -174,7 +174,7 @@ class ShareesAPIController extends OCSController {
if ($shareType !== null && is_array($shareType)) {
$shareTypes = array_intersect($shareTypes, $shareType);
} elseif (is_numeric($shareType)) {
- $shareTypes = array_intersect($shareTypes, [(int) $shareType]);
+ $shareTypes = array_intersect($shareTypes, [(int)$shareType]);
}
sort($shareTypes);
@@ -344,7 +344,7 @@ class ShareesAPIController extends OCSController {
$shareTypes = array_intersect($shareTypes, $_GET['shareType']);
sort($shareTypes);
} elseif (is_numeric($shareType)) {
- $shareTypes = array_intersect($shareTypes, [(int) $shareType]);
+ $shareTypes = array_intersect($shareTypes, [(int)$shareType]);
sort($shareTypes);
}
diff --git a/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php b/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php
index 477bc9f82ce..56f7a7fb434 100644
--- a/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php
+++ b/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php
@@ -212,12 +212,12 @@ class DefaultPublicShareTemplateProvider implements IPublicShareTemplateProvider
$this->eventDispatcher->dispatchTyped(new LoadViewer());
}
// OpenGraph Support: http://ogp.me/
- Util::addHeader('meta', ['property' => "og:title", 'content' => $shareTmpl['filename']]);
- Util::addHeader('meta', ['property' => "og:description", 'content' => $this->defaults->getName() . ($this->defaults->getSlogan() !== '' ? ' - ' . $this->defaults->getSlogan() : '')]);
- Util::addHeader('meta', ['property' => "og:site_name", 'content' => $this->defaults->getName()]);
- Util::addHeader('meta', ['property' => "og:url", 'content' => $shareTmpl['shareUrl']]);
- Util::addHeader('meta', ['property' => "og:type", 'content' => "object"]);
- Util::addHeader('meta', ['property' => "og:image", 'content' => $ogPreview]);
+ Util::addHeader('meta', ['property' => 'og:title', 'content' => $shareTmpl['filename']]);
+ Util::addHeader('meta', ['property' => 'og:description', 'content' => $this->defaults->getName() . ($this->defaults->getSlogan() !== '' ? ' - ' . $this->defaults->getSlogan() : '')]);
+ Util::addHeader('meta', ['property' => 'og:site_name', 'content' => $this->defaults->getName()]);
+ Util::addHeader('meta', ['property' => 'og:url', 'content' => $shareTmpl['shareUrl']]);
+ Util::addHeader('meta', ['property' => 'og:type', 'content' => 'object']);
+ Util::addHeader('meta', ['property' => 'og:image', 'content' => $ogPreview]);
$this->eventDispatcher->dispatchTyped(new BeforeTemplateRenderedEvent($share));
diff --git a/apps/files_sharing/lib/DeleteOrphanedSharesJob.php b/apps/files_sharing/lib/DeleteOrphanedSharesJob.php
index 9a052b3d126..4cd4feb375a 100644
--- a/apps/files_sharing/lib/DeleteOrphanedSharesJob.php
+++ b/apps/files_sharing/lib/DeleteOrphanedSharesJob.php
@@ -88,7 +88,7 @@ class DeleteOrphanedSharesJob extends TimedJob {
$result->closeCursor();
$deleteQb->setParameter('ids', $ids, IQueryBuilder::PARAM_INT_ARRAY);
$deleted = $deleteQb->executeStatement();
- $this->logger->debug("{deleted} orphaned share(s) deleted", [
+ $this->logger->debug('{deleted} orphaned share(s) deleted', [
'app' => 'DeleteOrphanedSharesJob',
'deleted' => $deleted,
]);
diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php
index abddcde4dae..9d008170e68 100644
--- a/apps/files_sharing/lib/External/Manager.php
+++ b/apps/files_sharing/lib/External/Manager.php
@@ -706,12 +706,12 @@ class Manager {
$qb = $this->connection->getQueryBuilder();
// delete group share entry and matching sub-entries
$qb->delete('share_external')
- ->where(
- $qb->expr()->orX(
- $qb->expr()->eq('id', $qb->createParameter('share_id')),
- $qb->expr()->eq('parent', $qb->createParameter('share_parent_id'))
- )
- );
+ ->where(
+ $qb->expr()->orX(
+ $qb->expr()->eq('id', $qb->createParameter('share_id')),
+ $qb->expr()->eq('parent', $qb->createParameter('share_parent_id'))
+ )
+ );
foreach ($shares as $share) {
$qb->setParameter('share_id', $share['id']);
diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php
index 7af22beda52..36f4c0b8859 100644
--- a/apps/files_sharing/lib/External/Storage.php
+++ b/apps/files_sharing/lib/External/Storage.php
@@ -214,20 +214,20 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage,
// we remove the invalid storage
$this->manager->removeShare($this->mountPoint);
$this->manager->getMountManager()->removeMount($this->mountPoint);
- throw new StorageInvalidException("Remote share not found", 0, $e);
+ throw new StorageInvalidException('Remote share not found', 0, $e);
} else {
// Nextcloud instance is gone, likely to be a temporary server configuration error
- throw new StorageNotAvailableException("No nextcloud instance found at remote", 0, $e);
+ throw new StorageNotAvailableException('No nextcloud instance found at remote', 0, $e);
}
} catch (ForbiddenException $e) {
// auth error, remove share for now (provide a dialog in the future)
$this->manager->removeShare($this->mountPoint);
$this->manager->getMountManager()->removeMount($this->mountPoint);
- throw new StorageInvalidException("Auth error when getting remote share");
+ throw new StorageInvalidException('Auth error when getting remote share');
} catch (\GuzzleHttp\Exception\ConnectException $e) {
- throw new StorageNotAvailableException("Failed to connect to remote instance", 0, $e);
+ throw new StorageNotAvailableException('Failed to connect to remote instance', 0, $e);
} catch (\GuzzleHttp\Exception\RequestException $e) {
- throw new StorageNotAvailableException("Error while sending request to remote instance", 0, $e);
+ throw new StorageNotAvailableException('Error while sending request to remote instance', 0, $e);
}
}
@@ -424,6 +424,6 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage,
}
public function free_space($path) {
- return parent::free_space("");
+ return parent::free_space('');
}
}
diff --git a/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php b/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php
index 23a2ded0968..90a088506fc 100644
--- a/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php
+++ b/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php
@@ -21,7 +21,7 @@ class OwncloudGuestShareType implements IRepairStep {
/** @var IDBConnection */
private $connection;
- /** @var IConfig */
+ /** @var IConfig */
private $config;
diff --git a/apps/files_sharing/lib/Migration/SetAcceptedStatus.php b/apps/files_sharing/lib/Migration/SetAcceptedStatus.php
index d54c22d3d7d..43a3c4aad74 100644
--- a/apps/files_sharing/lib/Migration/SetAcceptedStatus.php
+++ b/apps/files_sharing/lib/Migration/SetAcceptedStatus.php
@@ -20,7 +20,7 @@ class SetAcceptedStatus implements IRepairStep {
/** @var IDBConnection */
private $connection;
- /** @var IConfig */
+ /** @var IConfig */
private $config;
diff --git a/apps/files_sharing/lib/Migration/SetPasswordColumn.php b/apps/files_sharing/lib/Migration/SetPasswordColumn.php
index 0ce1e276566..0185bfad435 100644
--- a/apps/files_sharing/lib/Migration/SetPasswordColumn.php
+++ b/apps/files_sharing/lib/Migration/SetPasswordColumn.php
@@ -21,7 +21,7 @@ class SetPasswordColumn implements IRepairStep {
/** @var IDBConnection */
private $connection;
- /** @var IConfig */
+ /** @var IConfig */
private $config;
diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php
index 8968f6fa4d1..64847bf5a5f 100644
--- a/apps/files_sharing/lib/MountProvider.php
+++ b/apps/files_sharing/lib/MountProvider.php
@@ -126,7 +126,7 @@ class MountProvider implements IMountProvider {
*
* @param \OCP\Share\IShare[] $shares
* @return \OCP\Share\IShare[][] array of grouped shares, each element in the
- * array is a group which itself is an array of shares
+ * array is a group which itself is an array of shares
*/
private function groupShares(array $shares) {
$tmp = [];
diff --git a/apps/files_sharing/lib/Notification/Notifier.php b/apps/files_sharing/lib/Notification/Notifier.php
index 3947e5aa5f2..dd09fb6e20e 100644
--- a/apps/files_sharing/lib/Notification/Notifier.php
+++ b/apps/files_sharing/lib/Notification/Notifier.php
@@ -34,9 +34,9 @@ class Notifier implements INotifier {
private $shareManager;
/** @var IRootFolder */
private $rootFolder;
- /** @var IGroupManager */
+ /** @var IGroupManager */
protected $groupManager;
- /** @var IUserManager */
+ /** @var IUserManager */
protected $userManager;
/** @var IURLGenerator */
protected $url;
diff --git a/apps/files_sharing/lib/ShareBackend/Folder.php b/apps/files_sharing/lib/ShareBackend/Folder.php
index 9908381ef1e..f64d44faefc 100644
--- a/apps/files_sharing/lib/ShareBackend/Folder.php
+++ b/apps/files_sharing/lib/ShareBackend/Folder.php
@@ -22,7 +22,7 @@ class Folder extends File implements \OCP\Share_Backend_Collection {
$result->closeCursor();
if ($row = $result->fetchRow()) {
- $mimetype = (int) $row['id'];
+ $mimetype = (int)$row['id'];
} else {
$mimetype = -1;
}
@@ -45,7 +45,7 @@ class Folder extends File implements \OCP\Share_Backend_Collection {
while ($file = $result->fetch()) {
$children[] = ['source' => $file['fileid'], 'file_path' => $file['name']];
// If a child folder is found look inside it
- if ((int) $file['mimetype'] === $mimetype) {
+ if ((int)$file['mimetype'] === $mimetype) {
$parents[] = $file['fileid'];
}
}
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php
index 386553a51ed..00f757d4734 100644
--- a/apps/files_sharing/lib/SharedStorage.php
+++ b/apps/files_sharing/lib/SharedStorage.php
@@ -60,7 +60,7 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements LegacyISha
private LoggerInterface $logger;
- /** @var IStorage */
+ /** @var IStorage */
private $nonMaskedStorage;
private array $mountOptions = [];
@@ -139,7 +139,7 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements LegacyISha
try {
if (self::$initDepth > 10) {
- throw new \Exception("Maximum share depth reached");
+ throw new \Exception('Maximum share depth reached');
}
/** @var IRootFolder $rootFolder */
@@ -561,7 +561,7 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements LegacyISha
* @psalm-suppress DocblockTypeContradiction
*/
if (!$this->storage) {
- $message = "no storage set after init for share " . $this->getShareId();
+ $message = 'no storage set after init for share ' . $this->getShareId();
$this->logger->error($message);
$this->storage = new FailedStorage(['exception' => new \Exception($message)]);
}
diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php
index 294f7a81d3c..3a3813287b9 100644
--- a/apps/files_sharing/lib/Updater.php
+++ b/apps/files_sharing/lib/Updater.php
@@ -42,7 +42,7 @@ class Updater {
}
$user = $userFolder->getOwner();
if (!$user) {
- throw new \Exception("user folder has no owner");
+ throw new \Exception('user folder has no owner');
}
$src = $userFolder->get($path);
diff --git a/apps/files_sharing/openapi.json b/apps/files_sharing/openapi.json
index 79462697883..b6a7628b86d 100644
--- a/apps/files_sharing/openapi.json
+++ b/apps/files_sharing/openapi.json
@@ -1755,7 +1755,7 @@
"expireDate": {
"type": "string",
"nullable": true,
- "description": "The expiry date of the share in the user's timezone at 00:00.\n If $expireDate is not supplied or set to `null`, the system default will be used."
+ "description": "The expiry date of the share in the user's timezone at 00:00.\n If $expireDate is not supplied or set to `null`, the system default will be used."
},
"note": {
"type": "string",
@@ -2271,7 +2271,7 @@
"sendMail": {
"type": "string",
"nullable": true,
- "description": "if the share should be send by mail.\n Considering the share already exists, no mail will be send after the share is updated.\n \t\t\t\t You will have to use the sendMail action to send the mail."
+ "description": "if the share should be send by mail.\n Considering the share already exists, no mail will be send after the share is updated.\n You will have to use the sendMail action to send the mail."
}
}
}
diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php
index 770ebd14f1e..9b95ac78770 100644
--- a/apps/files_sharing/tests/ApiTest.php
+++ b/apps/files_sharing/tests/ApiTest.php
@@ -1181,7 +1181,7 @@ class ApiTest extends TestCase {
self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
$view = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2 . '/files');
- $view->mkdir("localDir");
+ $view->mkdir('localDir');
// move mount point to the folder "localDir"
$result = $view->rename($this->folder, 'localDir/'.$this->folder);
diff --git a/apps/files_sharing/tests/CacheTest.php b/apps/files_sharing/tests/CacheTest.php
index 543a7e46495..9f4a4b9e2ea 100644
--- a/apps/files_sharing/tests/CacheTest.php
+++ b/apps/files_sharing/tests/CacheTest.php
@@ -561,7 +561,7 @@ class CacheTest extends TestCase {
/** @var SharedStorage $sharedStorage */
[$sharedStorage] = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/sub');
- $results = $sharedStorage->getCache()->search("foo.txt");
+ $results = $sharedStorage->getCache()->search('foo.txt');
$this->assertCount(1, $results);
}
}
diff --git a/apps/files_sharing/tests/Collaboration/ShareRecipientSorterTest.php b/apps/files_sharing/tests/Collaboration/ShareRecipientSorterTest.php
index 733b37811cd..309bb84d6df 100644
--- a/apps/files_sharing/tests/Collaboration/ShareRecipientSorterTest.php
+++ b/apps/files_sharing/tests/Collaboration/ShareRecipientSorterTest.php
@@ -15,13 +15,13 @@ use OCP\Share\IManager;
use Test\TestCase;
class ShareRecipientSorterTest extends TestCase {
- /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
protected $shareManager;
- /** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */
protected $rootFolder;
- /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */
protected $userSession;
- /** @var ShareRecipientSorter */
+ /** @var ShareRecipientSorter */
protected $sorter;
protected function setUp(): void {
diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
index c47bb6d4395..e9e35799d84 100644
--- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
@@ -733,28 +733,28 @@ class ShareAPIControllerTest extends TestCase {
public function testGetShare(\OCP\Share\IShare $share, array $result) {
/** @var ShareAPIController|\PHPUnit\Framework\MockObject\MockObject $ocs */
$ocs = $this->getMockBuilder(ShareAPIController::class)
- ->setConstructorArgs([
- $this->appName,
- $this->request,
- $this->shareManager,
- $this->groupManager,
- $this->userManager,
- $this->rootFolder,
- $this->urlGenerator,
- $this->l,
- $this->config,
- $this->appManager,
- $this->serverContainer,
- $this->userStatusManager,
- $this->previewManager,
- $this->dateTimeZone,
- $this->logger,
- $this->factory,
- $this->mailer,
- $this->currentUser,
-
- ])->setMethods(['canAccessShare'])
- ->getMock();
+ ->setConstructorArgs([
+ $this->appName,
+ $this->request,
+ $this->shareManager,
+ $this->groupManager,
+ $this->userManager,
+ $this->rootFolder,
+ $this->urlGenerator,
+ $this->l,
+ $this->config,
+ $this->appManager,
+ $this->serverContainer,
+ $this->userStatusManager,
+ $this->previewManager,
+ $this->dateTimeZone,
+ $this->logger,
+ $this->factory,
+ $this->mailer,
+ $this->currentUser,
+
+ ])->setMethods(['canAccessShare'])
+ ->getMock();
$ocs->expects($this->any())
->method('canAccessShare')
@@ -1627,15 +1627,15 @@ class ShareAPIControllerTest extends TestCase {
$userFolder = $this->getMockBuilder(Folder::class)->getMock();
$this->rootFolder->expects($this->once())
- ->method('getUserFolder')
- ->with('currentUser')
- ->willReturn($userFolder);
+ ->method('getUserFolder')
+ ->with('currentUser')
+ ->willReturn($userFolder);
$path = $this->getMockBuilder(File::class)->getMock();
$userFolder->expects($this->once())
- ->method('get')
- ->with('valid-path')
- ->willReturn($path);
+ ->method('get')
+ ->with('valid-path')
+ ->willReturn($path);
$userFolder->method('getById')
->willReturn([]);
@@ -1734,14 +1734,14 @@ class ShareAPIControllerTest extends TestCase {
[$userFolder, $path] = $this->getNonSharedUserFile();
$this->rootFolder->expects($this->exactly(2))
- ->method('getUserFolder')
- ->with('currentUser')
- ->willReturn($userFolder);
+ ->method('getUserFolder')
+ ->with('currentUser')
+ ->willReturn($userFolder);
$userFolder->expects($this->once())
- ->method('get')
- ->with('valid-path')
- ->willReturn($path);
+ ->method('get')
+ ->with('valid-path')
+ ->willReturn($path);
$userFolder->method('getById')
->willReturn([]);
@@ -1784,14 +1784,14 @@ class ShareAPIControllerTest extends TestCase {
[$userFolder, $path] = $this->getNonSharedUserFile();
$this->rootFolder->expects($this->exactly(2))
- ->method('getUserFolder')
- ->with('currentUser')
- ->willReturn($userFolder);
+ ->method('getUserFolder')
+ ->with('currentUser')
+ ->willReturn($userFolder);
$userFolder->expects($this->once())
- ->method('get')
- ->with('valid-path')
- ->willReturn($path);
+ ->method('get')
+ ->with('valid-path')
+ ->willReturn($path);
$userFolder->method('getById')
->willReturn([]);
@@ -2254,14 +2254,14 @@ class ShareAPIControllerTest extends TestCase {
[$userFolder, $path] = $this->getNonSharedUserFile();
$this->rootFolder->expects($this->exactly(2))
- ->method('getUserFolder')
- ->with('currentUser')
- ->willReturn($userFolder);
+ ->method('getUserFolder')
+ ->with('currentUser')
+ ->willReturn($userFolder);
$userFolder->expects($this->once())
- ->method('get')
- ->with('valid-path')
- ->willReturn($path);
+ ->method('get')
+ ->with('valid-path')
+ ->willReturn($path);
$userFolder->method('getById')
->willReturn([]);
@@ -2324,14 +2324,14 @@ class ShareAPIControllerTest extends TestCase {
[$userFolder, $path] = $this->getNonSharedUserFile();
$this->rootFolder->expects($this->exactly(2))
- ->method('getUserFolder')
- ->with('currentUser')
- ->willReturn($userFolder);
+ ->method('getUserFolder')
+ ->with('currentUser')
+ ->willReturn($userFolder);
$userFolder->expects($this->once())
- ->method('get')
- ->with('valid-path')
- ->willReturn($path);
+ ->method('get')
+ ->with('valid-path')
+ ->willReturn($path);
$userFolder->method('getById')
->willReturn([]);
@@ -2372,14 +2372,14 @@ class ShareAPIControllerTest extends TestCase {
[$userFolder, $path] = $this->getNonSharedUserFile();
$this->rootFolder->expects($this->exactly(2))
- ->method('getUserFolder')
- ->with('currentUser')
- ->willReturn($userFolder);
+ ->method('getUserFolder')
+ ->with('currentUser')
+ ->willReturn($userFolder);
$userFolder->expects($this->once())
- ->method('get')
- ->with('valid-path')
- ->willReturn($path);
+ ->method('get')
+ ->with('valid-path')
+ ->willReturn($path);
$userFolder->method('getById')
->willReturn([]);
@@ -2450,15 +2450,15 @@ class ShareAPIControllerTest extends TestCase {
[$userFolder, $path] = $this->getNonSharedUserFolder();
$this->rootFolder->expects($this->exactly(2))
- ->method('getUserFolder')
- ->with('currentUser')
- ->willReturn($userFolder);
+ ->method('getUserFolder')
+ ->with('currentUser')
+ ->willReturn($userFolder);
$path->method('getPath')->willReturn('valid-path');
$userFolder->expects($this->once())
- ->method('get')
- ->with('valid-path')
- ->willReturn($path);
+ ->method('get')
+ ->with('valid-path')
+ ->willReturn($path);
$userFolder->method('getById')
->willReturn([]);
@@ -2488,14 +2488,14 @@ class ShareAPIControllerTest extends TestCase {
[$userFolder, $path] = $this->getNonSharedUserFile();
$this->rootFolder->expects($this->exactly(2))
- ->method('getUserFolder')
- ->with('currentUser')
- ->willReturn($userFolder);
+ ->method('getUserFolder')
+ ->with('currentUser')
+ ->willReturn($userFolder);
$userFolder->expects($this->once())
- ->method('get')
- ->with('valid-path')
- ->willReturn($path);
+ ->method('get')
+ ->with('valid-path')
+ ->willReturn($path);
$userFolder->method('getById')
->willReturn([]);
@@ -2520,7 +2520,7 @@ class ShareAPIControllerTest extends TestCase {
''
)->willReturnCallback(
function ($share) {
- throw new OCSNotFoundException("Exception thrown by the helper");
+ throw new OCSNotFoundException('Exception thrown by the helper');
}
);
diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php
index 79b90d8a156..72a76147791 100644
--- a/apps/files_sharing/tests/Controller/ShareControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php
@@ -67,11 +67,11 @@ class ShareControllerTest extends \Test\TestCase {
private $previewManager;
/** @var \OCP\IConfig|MockObject */
private $config;
- /** @var \OC\Share20\Manager|MockObject */
+ /** @var \OC\Share20\Manager|MockObject */
private $shareManager;
/** @var IUserManager|MockObject */
private $userManager;
- /** @var FederatedShareProvider|MockObject */
+ /** @var FederatedShareProvider|MockObject */
private $federatedShareProvider;
/** @var IAccountManager|MockObject */
private $accountManager;
diff --git a/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
index 0a0a847f051..f787607f5a8 100644
--- a/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
@@ -39,7 +39,7 @@ class ShareesAPIControllerTest extends TestCase {
/** @var IManager|MockObject */
protected $shareManager;
- /** @var ISearch|MockObject */
+ /** @var ISearch|MockObject */
protected $collaboratorSearch;
/** @var IConfig|MockObject */
diff --git a/apps/files_sharing/tests/External/CacheTest.php b/apps/files_sharing/tests/External/CacheTest.php
index fa613b6de98..6259fc98e1f 100644
--- a/apps/files_sharing/tests/External/CacheTest.php
+++ b/apps/files_sharing/tests/External/CacheTest.php
@@ -41,7 +41,7 @@ class CacheTest extends TestCase {
*/
private $remoteUser;
- /** @var ICloudIdManager */
+ /** @var ICloudIdManager */
private $cloudIdManager;
protected function setUp(): void {
diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php
index de04550fc59..0687d567453 100644
--- a/apps/files_sharing/tests/External/ManagerTest.php
+++ b/apps/files_sharing/tests/External/ManagerTest.php
@@ -45,7 +45,7 @@ class ManagerTest extends TestCase {
/** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
protected $contactsManager;
- /** @var Manager|\PHPUnit\Framework\MockObject\MockObject **/
+ /** @var Manager|\PHPUnit\Framework\MockObject\MockObject * */
private $manager;
/** @var \OC\Files\Mount\Manager */
@@ -720,7 +720,7 @@ class ManagerTest extends TestCase {
$this->assertEquals($expected['token'], $actual['share_token'], 'Asserting token of a share #' . $share);
$this->assertEquals($expected['name'], $actual['name'], 'Asserting name of a share #' . $share);
$this->assertEquals($expected['owner'], $actual['owner'], 'Asserting owner of a share #' . $share);
- $this->assertEquals($expected['accepted'], (int) $actual['accepted'], 'Asserting accept of a share #' . $share);
+ $this->assertEquals($expected['accepted'], (int)$actual['accepted'], 'Asserting accept of a share #' . $share);
$this->assertEquals($targetEntity, $actual['user'], 'Asserting user of a share #' . $share);
$this->assertEquals($mountPoint, $actual['mountpoint'], 'Asserting mountpoint of a share #' . $share);
}
diff --git a/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php b/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php
index 672b65fd92e..580295a26ec 100644
--- a/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php
+++ b/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php
@@ -35,9 +35,9 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
private $controllerMock;
/** @var IControllerMethodReflector|\PHPUnit\Framework\MockObject\MockObject */
private $reflector;
- /** @var IManager | \PHPUnit\Framework\MockObject\MockObject */
+ /** @var IManager | \PHPUnit\Framework\MockObject\MockObject */
private $shareManager;
- /** @var IRequest | \PHPUnit\Framework\MockObject\MockObject */
+ /** @var IRequest | \PHPUnit\Framework\MockObject\MockObject */
private $request;
protected function setUp(): void {
diff --git a/apps/files_sharing/tests/SharedMountTest.php b/apps/files_sharing/tests/SharedMountTest.php
index 9bf9e1dc0ad..c8d42460b8b 100644
--- a/apps/files_sharing/tests/SharedMountTest.php
+++ b/apps/files_sharing/tests/SharedMountTest.php
@@ -371,7 +371,7 @@ class SharedMountTest extends TestCase {
// hack to overwrite the cache factory, we can't use the proper "overwriteService" since the mount provider is created before this test is called
$mountProvider = \OCP\Server::get(MountProvider::class);
$reflectionClass = new \ReflectionClass($mountProvider);
- $reflectionCacheFactory = $reflectionClass->getProperty("cacheFactory");
+ $reflectionCacheFactory = $reflectionClass->getProperty('cacheFactory');
$reflectionCacheFactory->setAccessible(true);
$reflectionCacheFactory->setValue($mountProvider, $cacheFactory);
diff --git a/apps/files_sharing/tests/SharedStorageTest.php b/apps/files_sharing/tests/SharedStorageTest.php
index f6557d1711d..521167f1d88 100644
--- a/apps/files_sharing/tests/SharedStorageTest.php
+++ b/apps/files_sharing/tests/SharedStorageTest.php
@@ -32,8 +32,8 @@ class SharedStorageTest extends TestCase {
$this->view->mkdir($this->folder);
// save file with content
- $this->view->file_put_contents($this->filename, "root file");
- $this->view->file_put_contents($this->folder . $this->filename, "file in subfolder");
+ $this->view->file_put_contents($this->filename, 'root file');
+ $this->view->file_put_contents($this->folder . $this->filename, 'file in subfolder');
}
protected function tearDown(): void {
diff --git a/apps/files_sharing/tests/TestCase.php b/apps/files_sharing/tests/TestCase.php
index 4aaeec1f765..a1c4710e30e 100644
--- a/apps/files_sharing/tests/TestCase.php
+++ b/apps/files_sharing/tests/TestCase.php
@@ -25,12 +25,12 @@ use Test\Traits\MountProviderTrait;
abstract class TestCase extends \Test\TestCase {
use MountProviderTrait;
- public const TEST_FILES_SHARING_API_USER1 = "test-share-user1";
- public const TEST_FILES_SHARING_API_USER2 = "test-share-user2";
- public const TEST_FILES_SHARING_API_USER3 = "test-share-user3";
- public const TEST_FILES_SHARING_API_USER4 = "test-share-user4";
+ public const TEST_FILES_SHARING_API_USER1 = 'test-share-user1';
+ public const TEST_FILES_SHARING_API_USER2 = 'test-share-user2';
+ public const TEST_FILES_SHARING_API_USER3 = 'test-share-user3';
+ public const TEST_FILES_SHARING_API_USER4 = 'test-share-user4';
- public const TEST_FILES_SHARING_API_GROUP1 = "test-share-group1";
+ public const TEST_FILES_SHARING_API_GROUP1 = 'test-share-group1';
public $filename;
public $data;
diff --git a/apps/files_trashbin/lib/Command/CleanUp.php b/apps/files_trashbin/lib/Command/CleanUp.php
index 405abd3015a..007e97123bf 100644
--- a/apps/files_trashbin/lib/Command/CleanUp.php
+++ b/apps/files_trashbin/lib/Command/CleanUp.php
@@ -108,11 +108,11 @@ class CleanUp extends Command {
$node = $this->rootFolder->get($path);
if ($verbose) {
- $output->writeln("Deleting <info>" . \OC_Helper::humanFileSize($node->getSize()) . "</info> in trash for <info>$uid</info>.");
+ $output->writeln('Deleting <info>' . \OC_Helper::humanFileSize($node->getSize()) . "</info> in trash for <info>$uid</info>.");
}
$node->delete();
if ($this->rootFolder->nodeExists($path)) {
- $output->writeln("<error>Trash folder sill exists after attempting to delete it</error>");
+ $output->writeln('<error>Trash folder sill exists after attempting to delete it</error>');
return;
}
$query = $this->dbConnection->getQueryBuilder();
diff --git a/apps/files_trashbin/lib/Command/ExpireTrash.php b/apps/files_trashbin/lib/Command/ExpireTrash.php
index be5bd15d5e6..2c2d9d58539 100644
--- a/apps/files_trashbin/lib/Command/ExpireTrash.php
+++ b/apps/files_trashbin/lib/Command/ExpireTrash.php
@@ -55,7 +55,7 @@ class ExpireTrash extends Command {
protected function execute(InputInterface $input, OutputInterface $output): int {
$maxAge = $this->expiration->getMaxAgeAsTimestamp();
if (!$maxAge) {
- $output->writeln("Auto expiration is configured - keeps files and folders in the trash bin for 30 days and automatically deletes anytime after that if space is needed (note: files may not be deleted if space is not needed)");
+ $output->writeln('Auto expiration is configured - keeps files and folders in the trash bin for 30 days and automatically deletes anytime after that if space is needed (note: files may not be deleted if space is not needed)');
return 1;
}
diff --git a/apps/files_trashbin/lib/Command/RestoreAllFiles.php b/apps/files_trashbin/lib/Command/RestoreAllFiles.php
index 103ada3f18f..cd86ede93cb 100644
--- a/apps/files_trashbin/lib/Command/RestoreAllFiles.php
+++ b/apps/files_trashbin/lib/Command/RestoreAllFiles.php
@@ -167,7 +167,7 @@ class RestoreAllFiles extends Base {
$trashCount = count($userTrashItems);
if ($trashCount == 0) {
- $output->writeln("User has no deleted files in the trashbin matching the given filters");
+ $output->writeln('User has no deleted files in the trashbin matching the given filters');
return;
}
$prepMsg = $dryRun ? 'Would restore' : 'Preparing to restore';
@@ -191,13 +191,13 @@ class RestoreAllFiles extends Base {
try {
$trashItem->getTrashBackend()->restoreItem($trashItem);
} catch (\Throwable $e) {
- $output->writeln(" <error>Failed: " . $e->getMessage() . "</error>");
- $output->writeln(" <error>" . $e->getTraceAsString() . "</error>", OutputInterface::VERBOSITY_VERY_VERBOSE);
+ $output->writeln(' <error>Failed: ' . $e->getMessage() . '</error>');
+ $output->writeln(' <error>' . $e->getTraceAsString() . '</error>', OutputInterface::VERBOSITY_VERY_VERBOSE);
continue;
}
$count++;
- $output->writeln(" <info>success</info>");
+ $output->writeln(' <info>success</info>');
}
if (!$dryRun) {
@@ -247,7 +247,7 @@ class RestoreAllFiles extends Base {
// Check scope with exact class name for locally deleted files
if ($scope === self::SCOPE_USER && $trashItemClass !== \OCA\Files_Trashbin\Trash\TrashItem::class) {
- $output->writeln("Skipping <info>" . $trashItem->getName() . "</info> because it is not a user trash item", OutputInterface::VERBOSITY_VERBOSE);
+ $output->writeln('Skipping <info>' . $trashItem->getName() . '</info> because it is not a user trash item', OutputInterface::VERBOSITY_VERBOSE);
continue;
}
@@ -257,19 +257,19 @@ class RestoreAllFiles extends Base {
* @psalm-suppress RedundantCondition
*/
if ($scope === self::SCOPE_GROUPFOLDERS && $trashItemClass !== 'OCA\GroupFolders\Trash\GroupTrashItem') {
- $output->writeln("Skipping <info>" . $trashItem->getName() . "</info> because it is not a groupfolders trash item", OutputInterface::VERBOSITY_VERBOSE);
+ $output->writeln('Skipping <info>' . $trashItem->getName() . '</info> because it is not a groupfolders trash item', OutputInterface::VERBOSITY_VERBOSE);
continue;
}
// Check left timestamp boundary
if ($since !== null && $trashItem->getDeletedTime() <= $since) {
- $output->writeln("Skipping <info>" . $trashItem->getName() . "</info> because it was deleted before the 'since' timestamp", OutputInterface::VERBOSITY_VERBOSE);
+ $output->writeln('Skipping <info>' . $trashItem->getName() . "</info> because it was deleted before the 'since' timestamp", OutputInterface::VERBOSITY_VERBOSE);
continue;
}
// Check right timestamp boundary
if ($until !== null && $trashItem->getDeletedTime() >= $until) {
- $output->writeln("Skipping <info>" . $trashItem->getName() . "</info> because it was deleted after the 'until' timestamp", OutputInterface::VERBOSITY_VERBOSE);
+ $output->writeln('Skipping <info>' . $trashItem->getName() . "</info> because it was deleted after the 'until' timestamp", OutputInterface::VERBOSITY_VERBOSE);
continue;
}
diff --git a/apps/files_trashbin/lib/Command/Size.php b/apps/files_trashbin/lib/Command/Size.php
index 6d0e745bf5c..48ee2ced6cb 100644
--- a/apps/files_trashbin/lib/Command/Size.php
+++ b/apps/files_trashbin/lib/Command/Size.php
@@ -55,7 +55,7 @@ class Size extends Base {
if ($size) {
$parsedSize = \OC_Helper::computerFileSize($size);
if ($parsedSize === false) {
- $output->writeln("<error>Failed to parse input size</error>");
+ $output->writeln('<error>Failed to parse input size</error>');
return -1;
}
if ($user) {
@@ -63,8 +63,8 @@ class Size extends Base {
$this->commandBus->push(new Expire($user));
} else {
$this->config->setAppValue('files_trashbin', 'trashbin_size', (string)$parsedSize);
- $output->writeln("<info>Warning: changing the default trashbin size will automatically trigger cleanup of existing trashbins,</info>");
- $output->writeln("<info>a users trashbin can exceed the configured size until they move a new file to the trashbin.</info>");
+ $output->writeln('<info>Warning: changing the default trashbin size will automatically trigger cleanup of existing trashbins,</info>');
+ $output->writeln('<info>a users trashbin can exceed the configured size until they move a new file to the trashbin.</info>');
}
} else {
$this->printTrashbinSize($input, $output, $user);
@@ -76,7 +76,7 @@ class Size extends Base {
private function printTrashbinSize(InputInterface $input, OutputInterface $output, ?string $user) {
$globalSize = (int)$this->config->getAppValue('files_trashbin', 'trashbin_size', '-1');
if ($globalSize < 0) {
- $globalHumanSize = "default (50% of available space)";
+ $globalHumanSize = 'default (50% of available space)';
} else {
$globalHumanSize = \OC_Helper::humanFileSize($globalSize);
}
@@ -110,14 +110,14 @@ class Size extends Base {
if ($input->getOption('output') == self::OUTPUT_FORMAT_PLAIN) {
$output->writeln("Default size: $globalHumanSize");
- $output->writeln("");
+ $output->writeln('');
if (count($userValues)) {
- $output->writeln("Per-user sizes:");
+ $output->writeln('Per-user sizes:');
$this->writeArrayInOutputFormat($input, $output, array_map(function ($size) {
return \OC_Helper::humanFileSize($size);
}, $userValues));
} else {
- $output->writeln("No per-user sizes configured");
+ $output->writeln('No per-user sizes configured');
}
} else {
$globalValue = ($globalSize < 0) ? 'default' : $globalSize;
diff --git a/apps/files_trashbin/lib/Helper.php b/apps/files_trashbin/lib/Helper.php
index e08753b1783..2e7916d9c6d 100644
--- a/apps/files_trashbin/lib/Helper.php
+++ b/apps/files_trashbin/lib/Helper.php
@@ -15,7 +15,7 @@ class Helper {
* Retrieves the contents of a trash bin directory.
*
* @param string $dir path to the directory inside the trashbin
- * or empty to retrieve the root of the trashbin
+ * or empty to retrieve the root of the trashbin
* @param string $user
* @param string $sortAttribute attribute to sort on or empty to disable sorting
* @param bool $sortDescending true for descending sort, false otherwise
diff --git a/apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php b/apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php
index cf76c8f3616..222e49e9712 100644
--- a/apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php
+++ b/apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php
@@ -76,7 +76,7 @@ class SyncLivePhotosListener implements IEventListener {
unset($this->pendingRestores[$peerFile->getId()]);
return;
} else {
- $event->abortOperation(new NotPermittedException("Cannot restore the video part of a live photo"));
+ $event->abortOperation(new NotPermittedException('Cannot restore the video part of a live photo'));
}
} else {
$user = $this->userSession?->getUser();
@@ -113,8 +113,8 @@ class SyncLivePhotosListener implements IEventListener {
*/
private function getTrashItem(array $trashFolder, string $path): ?ITrashItem {
foreach($trashFolder as $trashItem) {
- if (str_starts_with($path, "files_trashbin/files".$trashItem->getTrashPath())) {
- if ($path === "files_trashbin/files".$trashItem->getTrashPath()) {
+ if (str_starts_with($path, 'files_trashbin/files'.$trashItem->getTrashPath())) {
+ if ($path === 'files_trashbin/files'.$trashItem->getTrashPath()) {
return $trashItem;
}
diff --git a/apps/files_trashbin/lib/Sabre/TrashRoot.php b/apps/files_trashbin/lib/Sabre/TrashRoot.php
index ff2ea3aaa02..3421a56bd5a 100644
--- a/apps/files_trashbin/lib/Sabre/TrashRoot.php
+++ b/apps/files_trashbin/lib/Sabre/TrashRoot.php
@@ -21,7 +21,7 @@ class TrashRoot implements ICollection {
/** @var IUser */
private $user;
- /** @var ITrashManager */
+ /** @var ITrashManager */
private $trashManager;
public function __construct(IUser $user, ITrashManager $trashManager) {
diff --git a/apps/files_trashbin/lib/Storage.php b/apps/files_trashbin/lib/Storage.php
index 5cfa05dd5e5..d146f23d70a 100644
--- a/apps/files_trashbin/lib/Storage.php
+++ b/apps/files_trashbin/lib/Storage.php
@@ -69,7 +69,7 @@ class Storage extends Wrapper {
// in case of a encryption exception we delete the file right away
$this->logger->info(
"Can't move file " . $path .
- " to the trash bin, therefore it was deleted right away");
+ ' to the trash bin, therefore it was deleted right away');
return $this->storage->unlink($path);
}
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index f12c9bd76d0..c9863241045 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -441,7 +441,7 @@ class Trashbin {
* Restore a file or folder from trash bin
*
* @param string $file path to the deleted file/folder relative to "files_trashbin/files/",
- * including the timestamp suffix ".d12345678"
+ * including the timestamp suffix ".d12345678"
* @param string $filename name of the file/folder
* @param int $timestamp time when the file/folder was deleted
*
@@ -747,7 +747,7 @@ class Trashbin {
$query = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$query->delete('files_trash')
->where($query->expr()->eq('user', $query->createNamedParameter($uid)));
- return (bool) $query->executeStatement();
+ return (bool)$query->executeStatement();
}
/**
@@ -1043,9 +1043,9 @@ class Trashbin {
if ($view->file_exists('files' . $location . '/' . $filename)) {
$i = 2;
- $uniqueName = $name . " (" . $l->t("restored") . ")" . $ext;
+ $uniqueName = $name . ' (' . $l->t('restored') . ')' . $ext;
while ($view->file_exists('files' . $location . '/' . $uniqueName)) {
- $uniqueName = $name . " (" . $l->t("restored") . " " . $i . ")" . $ext;
+ $uniqueName = $name . ' (' . $l->t('restored') . ' ' . $i . ')' . $ext;
$i++;
}
diff --git a/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php b/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php
index b0eb1cda797..277c176d191 100644
--- a/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php
+++ b/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php
@@ -77,7 +77,7 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator {
if (!$trashbinFolder instanceof Folder) {
throw new UserMigrationException('/'.$uid.'/files_trashbin is not a folder');
}
- $output->writeln("Exporting trashbin files…");
+ $output->writeln('Exporting trashbin files…');
$exportDestination->copyFolder($trashbinFolder, static::PATH_FILES_FOLDER);
$originalLocations = [];
// TODO Export all extra data and bump migrator to v2
@@ -90,9 +90,9 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator {
}
$exportDestination->addFileContents(static::PATH_LOCATIONS_FILE, json_encode($originalLocations));
} catch (NotFoundException $e) {
- $output->writeln("No trashbin to export…");
+ $output->writeln('No trashbin to export…');
} catch (\Throwable $e) {
- throw new UserMigrationException("Could not export trashbin: ".$e->getMessage(), 0, $e);
+ throw new UserMigrationException('Could not export trashbin: '.$e->getMessage(), 0, $e);
}
}
@@ -118,11 +118,11 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator {
} catch (NotFoundException $e) {
$trashbinFolder = $this->root->newFolder('/'.$uid.'/files_trashbin');
}
- $output->writeln("Importing trashbin files…");
+ $output->writeln('Importing trashbin files…');
try {
$importSource->copyToFolder($trashbinFolder, static::PATH_FILES_FOLDER);
} catch (\Throwable $e) {
- throw new UserMigrationException("Could not import trashbin.", 0, $e);
+ throw new UserMigrationException('Could not import trashbin.', 0, $e);
}
$locations = json_decode($importSource->getFileContents(static::PATH_LOCATIONS_FILE), true, 512, JSON_THROW_ON_ERROR);
$qb = $this->dbc->getQueryBuilder();
@@ -145,7 +145,7 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator {
}
}
} else {
- $output->writeln("No trashbin to import…");
+ $output->writeln('No trashbin to import…');
}
}
diff --git a/apps/files_trashbin/tests/Command/CleanUpTest.php b/apps/files_trashbin/tests/Command/CleanUpTest.php
index 278f800e1b6..3ab11ba96aa 100644
--- a/apps/files_trashbin/tests/Command/CleanUpTest.php
+++ b/apps/files_trashbin/tests/Command/CleanUpTest.php
@@ -25,7 +25,7 @@ use Test\TestCase;
*/
class CleanUpTest extends TestCase {
- /** @var CleanUp */
+ /** @var CleanUp */
protected $cleanup;
/** @var \PHPUnit\Framework\MockObject\MockObject | Manager */
@@ -37,10 +37,10 @@ class CleanUpTest extends TestCase {
/** @var IDBConnection */
protected $dbConnection;
- /** @var string */
+ /** @var string */
protected $trashTable = 'files_trash';
- /** @var string */
+ /** @var string */
protected $user0 = 'user0';
protected function setUp(): void {
diff --git a/apps/files_trashbin/tests/StorageTest.php b/apps/files_trashbin/tests/StorageTest.php
index 18fe59f7f7d..76c9829cf9c 100644
--- a/apps/files_trashbin/tests/StorageTest.php
+++ b/apps/files_trashbin/tests/StorageTest.php
@@ -673,14 +673,14 @@ class StorageTest extends \Test\TestCase {
public function testMoveFromStoragePreserveFileId() {
if (!$this->userView->getMount('')->getStorage()->instanceOfStorage(Local::class)) {
- $this->markTestSkipped("Skipping on non-local users storage");
+ $this->markTestSkipped('Skipping on non-local users storage');
}
$this->userView->file_put_contents('test.txt', 'foo');
$fileId = $this->userView->getFileInfo('test.txt')->getId();
$externalStorage = new TemporaryNoCross([]);
$externalStorage->getScanner()->scan('');
- Filesystem::mount($externalStorage, [], "/" . $this->user . "/files/storage");
+ Filesystem::mount($externalStorage, [], '/' . $this->user . '/files/storage');
$this->assertTrue($this->userView->rename('test.txt', 'storage/test.txt'));
$this->assertTrue($externalStorage->file_exists('test.txt'));
diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php
index 6474021b92e..528dd86820f 100644
--- a/apps/files_trashbin/tests/TrashbinTest.php
+++ b/apps/files_trashbin/tests/TrashbinTest.php
@@ -16,8 +16,8 @@ use OCP\Share\IShare;
* @group DB
*/
class TrashbinTest extends \Test\TestCase {
- public const TEST_TRASHBIN_USER1 = "test-trashbin-user1";
- public const TEST_TRASHBIN_USER2 = "test-trashbin-user2";
+ public const TEST_TRASHBIN_USER1 = 'test-trashbin-user1';
+ public const TEST_TRASHBIN_USER2 = 'test-trashbin-user2';
private $trashRoot1;
private $trashRoot2;
@@ -200,7 +200,7 @@ class TrashbinTest extends \Test\TestCase {
*/
public function testExpireOldFilesShared() {
$currentTime = time();
- $folder = "trashTest-" . $currentTime . '/';
+ $folder = 'trashTest-' . $currentTime . '/';
$expiredDate = $currentTime - 3 * 24 * 60 * 60;
// create some files
@@ -235,7 +235,7 @@ class TrashbinTest extends \Test\TestCase {
// login as user2
self::loginHelper(self::TEST_TRASHBIN_USER2);
- $this->assertTrue(\OC\Files\Filesystem::file_exists($folder . "user1-4.txt"));
+ $this->assertTrue(\OC\Files\Filesystem::file_exists($folder . 'user1-4.txt'));
// create some files
\OC\Files\Filesystem::file_put_contents('user2-1.txt', 'file1');
diff --git a/apps/files_versions/appinfo/routes.php b/apps/files_versions/appinfo/routes.php
index bce2c8faead..cc853d31742 100644
--- a/apps/files_versions/appinfo/routes.php
+++ b/apps/files_versions/appinfo/routes.php
@@ -18,7 +18,7 @@ $application->registerRoutes($this, [
],
]);
-/** @var $this \OCP\Route\IRouter */
+/** @var \OCP\Route\IRouter $this */
$this->create('files_versions_download', 'apps/files_versions/download.php')
->actionInclude('files_versions/download.php');
$this->create('files_versions_ajax_getVersions', 'apps/files_versions/ajax/getVersions.php')
diff --git a/apps/files_versions/lib/Command/CleanUp.php b/apps/files_versions/lib/Command/CleanUp.php
index bf6dc6a7687..1cd3dccc4dd 100644
--- a/apps/files_versions/lib/Command/CleanUp.php
+++ b/apps/files_versions/lib/Command/CleanUp.php
@@ -49,7 +49,7 @@ class CleanUp extends Command {
$path = $input->getOption('path');
if ($path) {
if (!preg_match('#^/([^/]+)/files(/.*)?$#', $path, $pathMatches)) {
- $output->writeln("<error>Invalid path given</error>");
+ $output->writeln('<error>Invalid path given</error>');
return self::FAILURE;
}
diff --git a/apps/files_versions/lib/Command/ExpireVersions.php b/apps/files_versions/lib/Command/ExpireVersions.php
index 9492d0fbe7d..f8f4e7ce952 100644
--- a/apps/files_versions/lib/Command/ExpireVersions.php
+++ b/apps/files_versions/lib/Command/ExpireVersions.php
@@ -38,7 +38,7 @@ class ExpireVersions extends Command {
protected function execute(InputInterface $input, OutputInterface $output): int {
$maxAge = $this->expiration->getMaxAgeAsTimestamp();
if (!$maxAge) {
- $output->writeln("Auto expiration is configured - expiration will be handled automatically according to the expiration patterns detailed at the following link https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/file_versioning.html.");
+ $output->writeln('Auto expiration is configured - expiration will be handled automatically according to the expiration patterns detailed at the following link https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/file_versioning.html.');
return self::FAILURE;
}
diff --git a/apps/files_versions/lib/Db/VersionsMapper.php b/apps/files_versions/lib/Db/VersionsMapper.php
index 289e5ce7b7e..318dd8f0d82 100644
--- a/apps/files_versions/lib/Db/VersionsMapper.php
+++ b/apps/files_versions/lib/Db/VersionsMapper.php
@@ -28,8 +28,8 @@ class VersionsMapper extends QBMapper {
$qb = $this->db->getQueryBuilder();
$qb->select('*')
- ->from($this->getTableName())
- ->where($qb->expr()->eq('file_id', $qb->createNamedParameter($fileId)));
+ ->from($this->getTableName())
+ ->where($qb->expr()->eq('file_id', $qb->createNamedParameter($fileId)));
return $this->findEntities($qb);
}
@@ -41,10 +41,10 @@ class VersionsMapper extends QBMapper {
$qb = $this->db->getQueryBuilder();
$qb->select('*')
- ->from($this->getTableName())
- ->where($qb->expr()->eq('file_id', $qb->createNamedParameter($fileId)))
- ->orderBy('timestamp', 'DESC')
- ->setMaxResults(1);
+ ->from($this->getTableName())
+ ->where($qb->expr()->eq('file_id', $qb->createNamedParameter($fileId)))
+ ->orderBy('timestamp', 'DESC')
+ ->setMaxResults(1);
return $this->findEntity($qb);
}
@@ -53,9 +53,9 @@ class VersionsMapper extends QBMapper {
$qb = $this->db->getQueryBuilder();
$qb->select('*')
- ->from($this->getTableName())
- ->where($qb->expr()->eq('file_id', $qb->createNamedParameter($fileId)))
- ->andWhere($qb->expr()->eq('timestamp', $qb->createNamedParameter($timestamp)));
+ ->from($this->getTableName())
+ ->where($qb->expr()->eq('file_id', $qb->createNamedParameter($fileId)))
+ ->andWhere($qb->expr()->eq('timestamp', $qb->createNamedParameter($timestamp)));
return $this->findEntity($qb);
}
@@ -64,8 +64,8 @@ class VersionsMapper extends QBMapper {
$qb = $this->db->getQueryBuilder();
return $qb->delete($this->getTableName())
- ->where($qb->expr()->eq('file_id', $qb->createNamedParameter($fileId)))
- ->executeStatement();
+ ->where($qb->expr()->eq('file_id', $qb->createNamedParameter($fileId)))
+ ->executeStatement();
}
public function deleteAllVersionsForUser(int $storageId, ?string $path = null): void {
diff --git a/apps/files_versions/lib/Listener/VersionStorageMoveListener.php b/apps/files_versions/lib/Listener/VersionStorageMoveListener.php
index b4b00108e43..0f7dad29fe2 100644
--- a/apps/files_versions/lib/Listener/VersionStorageMoveListener.php
+++ b/apps/files_versions/lib/Listener/VersionStorageMoveListener.php
@@ -64,7 +64,7 @@ class VersionStorageMoveListener implements IEventListener {
$user = $this->userSession->getUser() ?? $source->getOwner();
if ($user === null) {
- throw new Exception("Cannot move versions across storages without a user.");
+ throw new Exception('Cannot move versions across storages without a user.');
}
if ($event instanceof BeforeNodeRenamedEvent) {
diff --git a/apps/files_versions/lib/Migration/Version1020Date20221114144058.php b/apps/files_versions/lib/Migration/Version1020Date20221114144058.php
index 71bfeab0a02..77c8c2201f3 100644
--- a/apps/files_versions/lib/Migration/Version1020Date20221114144058.php
+++ b/apps/files_versions/lib/Migration/Version1020Date20221114144058.php
@@ -29,11 +29,11 @@ class Version1020Date20221114144058 extends SimpleMigrationStep {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
- if ($schema->hasTable("files_versions")) {
+ if ($schema->hasTable('files_versions')) {
return null;
}
- $table = $schema->createTable("files_versions");
+ $table = $schema->createTable('files_versions');
$table->addColumn('id', Types::BIGINT, [
'autoincrement' => true,
'notnull' => true,
diff --git a/apps/files_versions/lib/Sabre/Plugin.php b/apps/files_versions/lib/Sabre/Plugin.php
index c2ffcdebe47..10a1896773d 100644
--- a/apps/files_versions/lib/Sabre/Plugin.php
+++ b/apps/files_versions/lib/Sabre/Plugin.php
@@ -77,7 +77,7 @@ class Plugin extends ServerPlugin {
public function propFind(PropFind $propFind, INode $node): void {
if ($node instanceof VersionFile) {
$propFind->handle(self::VERSION_LABEL, fn () => $node->getMetadataValue('label'));
- $propFind->handle(self::VERSION_AUTHOR, fn () => $node->getMetadataValue("author"));
+ $propFind->handle(self::VERSION_AUTHOR, fn () => $node->getMetadataValue('author'));
$propFind->handle(FilesPlugin::HAS_PREVIEW_PROPERTYNAME, fn () => $this->previewManager->isMimeSupported($node->getContentType()));
}
}
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php
index d3e080b9dd2..41f04b5a1d1 100644
--- a/apps/files_versions/lib/Storage.php
+++ b/apps/files_versions/lib/Storage.php
@@ -276,9 +276,9 @@ class Storage {
* Rename or copy versions of a file of the given paths
*
* @param string $sourcePath source path of the file to move, relative to
- * the currently logged in user's "files" folder
+ * the currently logged in user's "files" folder
* @param string $targetPath target path of the file to move, relative to
- * the currently logged in user's "files" folder
+ * the currently logged in user's "files" folder
* @param string $operation can be 'copy' or 'rename'
*/
public static function renameOrCopy($sourcePath, $targetPath, $operation) {
@@ -572,7 +572,7 @@ class Storage {
} catch (NotFoundException $e) {
// Original node not found, delete the version
return true;
- } catch (StorageNotAvailableException | StorageInvalidException $e) {
+ } catch (StorageNotAvailableException|StorageInvalidException $e) {
// Storage can't be used, but it might only be temporary so we can't always delete the version
// since we can't determine if the version is named we take the safe route and don't expire
return false;
@@ -613,19 +613,19 @@ class Storage {
$diff = time() - $timestamp;
if ($diff < 60) { // first minute
- return $diff . " seconds ago";
+ return $diff . ' seconds ago';
} elseif ($diff < 3600) { //first hour
- return round($diff / 60) . " minutes ago";
+ return round($diff / 60) . ' minutes ago';
} elseif ($diff < 86400) { // first day
- return round($diff / 3600) . " hours ago";
+ return round($diff / 3600) . ' hours ago';
} elseif ($diff < 604800) { //first week
- return round($diff / 86400) . " days ago";
+ return round($diff / 86400) . ' days ago';
} elseif ($diff < 2419200) { //first month
- return round($diff / 604800) . " weeks ago";
+ return round($diff / 604800) . ' weeks ago';
} elseif ($diff < 29030400) { // first year
- return round($diff / 2419200) . " months ago";
+ return round($diff / 2419200) . ' months ago';
} else {
- return round($diff / 29030400) . " years ago";
+ return round($diff / 29030400) . ' years ago';
}
}
@@ -753,7 +753,7 @@ class Storage {
//distance between two version too small, mark to delete
$toDelete[$key] = $version['path'] . '.v' . $version['version'];
$size += $version['size'];
- \OC::$server->get(LoggerInterface::class)->info('Mark to expire '. $version['path'] .' next version should be ' . $nextVersion . " or smaller. (prevTimestamp: " . $prevTimestamp . "; step: " . $step, ['app' => 'files_versions']);
+ \OC::$server->get(LoggerInterface::class)->info('Mark to expire '. $version['path'] .' next version should be ' . $nextVersion . ' or smaller. (prevTimestamp: ' . $prevTimestamp . '; step: ' . $step, ['app' => 'files_versions']);
} else {
$nextVersion = $version['version'] - $step;
$prevTimestamp = $version['version'];
@@ -946,13 +946,13 @@ class Storage {
* that match the given path to a file.
*
* @param string $filename $path to a file, relative to the user's
- * "files" folder
+ * "files" folder
* @param View $view view on data/user/
*/
public static function createMissingDirectories($filename, $view) {
$dirname = Filesystem::normalizePath(dirname($filename));
$dirParts = explode('/', $dirname);
- $dir = "/files_versions";
+ $dir = '/files_versions';
foreach ($dirParts as $part) {
$dir = $dir . '/' . $part;
if (!$view->file_exists($dir)) {
diff --git a/apps/files_versions/lib/Versions/LegacyVersionsBackend.php b/apps/files_versions/lib/Versions/LegacyVersionsBackend.php
index 90e521abfb4..fc37ecead95 100644
--- a/apps/files_versions/lib/Versions/LegacyVersionsBackend.php
+++ b/apps/files_versions/lib/Versions/LegacyVersionsBackend.php
@@ -65,7 +65,7 @@ class LegacyVersionsBackend implements IVersionBackend, IDeletableVersionBackend
$file = $userFolder->getFirstNodeById($fileId);
if (!$file) {
- throw new NotFoundException("version file not found for share owner");
+ throw new NotFoundException('version file not found for share owner');
}
} else {
$userFolder = $this->rootFolder->getUserFolder($user->getUID());
@@ -276,7 +276,7 @@ class LegacyVersionsBackend implements IVersionBackend, IDeletableVersionBackend
$currentUserId = $this->userSession->getUser()?->getUID();
if ($currentUserId === null) {
- throw new NotFoundException("No user logged in");
+ throw new NotFoundException('No user logged in');
}
if ($sourceFile->getOwner()?->getUID() === $currentUserId) {
@@ -286,7 +286,7 @@ class LegacyVersionsBackend implements IVersionBackend, IDeletableVersionBackend
$nodes = $this->rootFolder->getUserFolder($currentUserId)->getById($sourceFile->getId());
if (count($nodes) === 0) {
- throw new NotFoundException("Version file not accessible by current user");
+ throw new NotFoundException('Version file not accessible by current user');
}
foreach ($nodes as $node) {
@@ -366,7 +366,7 @@ class LegacyVersionsBackend implements IVersionBackend, IDeletableVersionBackend
$relativePath = $userFolder->getRelativePath($source->getPath());
if ($relativePath === null) {
- throw new Exception("Relative path not found for node with path: " . $source->getPath());
+ throw new Exception('Relative path not found for node with path: ' . $source->getPath());
}
$versions = Storage::getVersions($user->getUID(), $relativePath);
diff --git a/apps/files_versions/lib/Versions/VersionManager.php b/apps/files_versions/lib/Versions/VersionManager.php
index c666192f3c0..0b8e066baeb 100644
--- a/apps/files_versions/lib/Versions/VersionManager.php
+++ b/apps/files_versions/lib/Versions/VersionManager.php
@@ -167,8 +167,8 @@ class VersionManager implements IVersionManager, IDeletableVersionBackend, INeed
try {
return $callback();
} catch (ManuallyLockedException $e) {
- $owner = (string) $e->getOwner();
- $appsThatHandleUpdates = ["text", "richdocuments"];
+ $owner = (string)$e->getOwner();
+ $appsThatHandleUpdates = ['text', 'richdocuments'];
if (!in_array($owner, $appsThatHandleUpdates)) {
throw $e;
}
diff --git a/apps/files_versions/tests/Command/CleanupTest.php b/apps/files_versions/tests/Command/CleanupTest.php
index 3b834ed974b..cd397e4a098 100644
--- a/apps/files_versions/tests/Command/CleanupTest.php
+++ b/apps/files_versions/tests/Command/CleanupTest.php
@@ -23,7 +23,7 @@ use Test\TestCase;
*/
class CleanupTest extends TestCase {
- /** @var CleanUp */
+ /** @var CleanUp */
protected $cleanup;
/** @var \PHPUnit\Framework\MockObject\MockObject | Manager */
@@ -164,8 +164,8 @@ class CleanupTest extends TestCase {
->disableOriginalConstructor()->getMock();
$this->userManager->expects($this->once())
- ->method('getBackends')
- ->willReturn([$backend]);
+ ->method('getBackends')
+ ->willReturn([$backend]);
$this->invokePrivate($instance, 'execute', [$inputInterface, $outputInterface]);
}
diff --git a/apps/files_versions/tests/VersioningTest.php b/apps/files_versions/tests/VersioningTest.php
index 1560dc984f7..4b6820750a2 100644
--- a/apps/files_versions/tests/VersioningTest.php
+++ b/apps/files_versions/tests/VersioningTest.php
@@ -137,12 +137,12 @@ class VersioningTest extends \Test\TestCase {
// the deleted array should only contain versions which should be deleted
foreach ($deleted as $key => $path) {
unset($versions[$key]);
- $this->assertEquals("delete", substr($path, 0, strlen("delete")));
+ $this->assertEquals('delete', substr($path, 0, strlen('delete')));
}
// the versions array should only contain versions which should be kept
foreach ($versions as $version) {
- $this->assertEquals("keep", $version['path']);
+ $this->assertEquals('keep', $version['path']);
}
}
@@ -152,46 +152,46 @@ class VersioningTest extends \Test\TestCase {
[
[
// first slice (10sec) keep one version every 2 seconds
- ["version" => 4999999, "path" => "keep", "size" => 1],
- ["version" => 4999998, "path" => "delete", "size" => 1],
- ["version" => 4999997, "path" => "keep", "size" => 1],
- ["version" => 4999995, "path" => "keep", "size" => 1],
- ["version" => 4999994, "path" => "delete", "size" => 1],
+ ['version' => 4999999, 'path' => 'keep', 'size' => 1],
+ ['version' => 4999998, 'path' => 'delete', 'size' => 1],
+ ['version' => 4999997, 'path' => 'keep', 'size' => 1],
+ ['version' => 4999995, 'path' => 'keep', 'size' => 1],
+ ['version' => 4999994, 'path' => 'delete', 'size' => 1],
//next slice (60sec) starts at 4999990 keep one version every 10 secons
- ["version" => 4999988, "path" => "keep", "size" => 1],
- ["version" => 4999978, "path" => "keep", "size" => 1],
- ["version" => 4999975, "path" => "delete", "size" => 1],
- ["version" => 4999972, "path" => "delete", "size" => 1],
- ["version" => 4999967, "path" => "keep", "size" => 1],
- ["version" => 4999958, "path" => "delete", "size" => 1],
- ["version" => 4999957, "path" => "keep", "size" => 1],
+ ['version' => 4999988, 'path' => 'keep', 'size' => 1],
+ ['version' => 4999978, 'path' => 'keep', 'size' => 1],
+ ['version' => 4999975, 'path' => 'delete', 'size' => 1],
+ ['version' => 4999972, 'path' => 'delete', 'size' => 1],
+ ['version' => 4999967, 'path' => 'keep', 'size' => 1],
+ ['version' => 4999958, 'path' => 'delete', 'size' => 1],
+ ['version' => 4999957, 'path' => 'keep', 'size' => 1],
//next slice (3600sec) start at 4999940 keep one version every 60 seconds
- ["version" => 4999900, "path" => "keep", "size" => 1],
- ["version" => 4999841, "path" => "delete", "size" => 1],
- ["version" => 4999840, "path" => "keep", "size" => 1],
- ["version" => 4999780, "path" => "keep", "size" => 1],
- ["version" => 4996401, "path" => "keep", "size" => 1],
+ ['version' => 4999900, 'path' => 'keep', 'size' => 1],
+ ['version' => 4999841, 'path' => 'delete', 'size' => 1],
+ ['version' => 4999840, 'path' => 'keep', 'size' => 1],
+ ['version' => 4999780, 'path' => 'keep', 'size' => 1],
+ ['version' => 4996401, 'path' => 'keep', 'size' => 1],
// next slice (86400sec) start at 4996400 keep one version every 3600 seconds
- ["version" => 4996350, "path" => "delete", "size" => 1],
- ["version" => 4992800, "path" => "keep", "size" => 1],
- ["version" => 4989800, "path" => "delete", "size" => 1],
- ["version" => 4989700, "path" => "delete", "size" => 1],
- ["version" => 4989200, "path" => "keep", "size" => 1],
+ ['version' => 4996350, 'path' => 'delete', 'size' => 1],
+ ['version' => 4992800, 'path' => 'keep', 'size' => 1],
+ ['version' => 4989800, 'path' => 'delete', 'size' => 1],
+ ['version' => 4989700, 'path' => 'delete', 'size' => 1],
+ ['version' => 4989200, 'path' => 'keep', 'size' => 1],
// next slice (2592000sec) start at 4913600 keep one version every 86400 seconds
- ["version" => 4913600, "path" => "keep", "size" => 1],
- ["version" => 4852800, "path" => "delete", "size" => 1],
- ["version" => 4827201, "path" => "delete", "size" => 1],
- ["version" => 4827200, "path" => "keep", "size" => 1],
- ["version" => 4777201, "path" => "delete", "size" => 1],
- ["version" => 4777501, "path" => "delete", "size" => 1],
- ["version" => 4740000, "path" => "keep", "size" => 1],
+ ['version' => 4913600, 'path' => 'keep', 'size' => 1],
+ ['version' => 4852800, 'path' => 'delete', 'size' => 1],
+ ['version' => 4827201, 'path' => 'delete', 'size' => 1],
+ ['version' => 4827200, 'path' => 'keep', 'size' => 1],
+ ['version' => 4777201, 'path' => 'delete', 'size' => 1],
+ ['version' => 4777501, 'path' => 'delete', 'size' => 1],
+ ['version' => 4740000, 'path' => 'keep', 'size' => 1],
// final slice starts at 2408000 keep one version every 604800 secons
- ["version" => 2408000, "path" => "keep", "size" => 1],
- ["version" => 1803201, "path" => "delete", "size" => 1],
- ["version" => 1803200, "path" => "keep", "size" => 1],
- ["version" => 1800199, "path" => "delete", "size" => 1],
- ["version" => 1800100, "path" => "delete", "size" => 1],
- ["version" => 1198300, "path" => "keep", "size" => 1],
+ ['version' => 2408000, 'path' => 'keep', 'size' => 1],
+ ['version' => 1803201, 'path' => 'delete', 'size' => 1],
+ ['version' => 1803200, 'path' => 'keep', 'size' => 1],
+ ['version' => 1800199, 'path' => 'delete', 'size' => 1],
+ ['version' => 1800100, 'path' => 'delete', 'size' => 1],
+ ['version' => 1198300, 'path' => 'keep', 'size' => 1],
],
16 // size of all deleted files (every file has the size 1)
],
@@ -202,28 +202,28 @@ class VersioningTest extends \Test\TestCase {
// next slice (60sec) starts at 4999990 keep one version every 10 secons
// next slice (3600sec) start at 4999940 keep one version every 60 seconds
// next slice (86400sec) start at 4996400 keep one version every 3600 seconds
- ["version" => 4996400, "path" => "keep", "size" => 1],
- ["version" => 4996350, "path" => "delete", "size" => 1],
- ["version" => 4996350, "path" => "delete", "size" => 1],
- ["version" => 4992800, "path" => "keep", "size" => 1],
- ["version" => 4989800, "path" => "delete", "size" => 1],
- ["version" => 4989700, "path" => "delete", "size" => 1],
- ["version" => 4989200, "path" => "keep", "size" => 1],
+ ['version' => 4996400, 'path' => 'keep', 'size' => 1],
+ ['version' => 4996350, 'path' => 'delete', 'size' => 1],
+ ['version' => 4996350, 'path' => 'delete', 'size' => 1],
+ ['version' => 4992800, 'path' => 'keep', 'size' => 1],
+ ['version' => 4989800, 'path' => 'delete', 'size' => 1],
+ ['version' => 4989700, 'path' => 'delete', 'size' => 1],
+ ['version' => 4989200, 'path' => 'keep', 'size' => 1],
// next slice (2592000sec) start at 4913600 keep one version every 86400 seconds
- ["version" => 4913600, "path" => "keep", "size" => 1],
- ["version" => 4852800, "path" => "delete", "size" => 1],
- ["version" => 4827201, "path" => "delete", "size" => 1],
- ["version" => 4827200, "path" => "keep", "size" => 1],
- ["version" => 4777201, "path" => "delete", "size" => 1],
- ["version" => 4777501, "path" => "delete", "size" => 1],
- ["version" => 4740000, "path" => "keep", "size" => 1],
+ ['version' => 4913600, 'path' => 'keep', 'size' => 1],
+ ['version' => 4852800, 'path' => 'delete', 'size' => 1],
+ ['version' => 4827201, 'path' => 'delete', 'size' => 1],
+ ['version' => 4827200, 'path' => 'keep', 'size' => 1],
+ ['version' => 4777201, 'path' => 'delete', 'size' => 1],
+ ['version' => 4777501, 'path' => 'delete', 'size' => 1],
+ ['version' => 4740000, 'path' => 'keep', 'size' => 1],
// final slice starts at 2408000 keep one version every 604800 secons
- ["version" => 2408000, "path" => "keep", "size" => 1],
- ["version" => 1803201, "path" => "delete", "size" => 1],
- ["version" => 1803200, "path" => "keep", "size" => 1],
- ["version" => 1800199, "path" => "delete", "size" => 1],
- ["version" => 1800100, "path" => "delete", "size" => 1],
- ["version" => 1198300, "path" => "keep", "size" => 1],
+ ['version' => 2408000, 'path' => 'keep', 'size' => 1],
+ ['version' => 1803201, 'path' => 'delete', 'size' => 1],
+ ['version' => 1803200, 'path' => 'keep', 'size' => 1],
+ ['version' => 1800199, 'path' => 'delete', 'size' => 1],
+ ['version' => 1800100, 'path' => 'delete', 'size' => 1],
+ ['version' => 1198300, 'path' => 'keep', 'size' => 1],
],
11 // size of all deleted files (every file has the size 1)
],
@@ -231,32 +231,32 @@ class VersioningTest extends \Test\TestCase {
[
[
// first slice (10sec) keep one version every 2 seconds
- ["version" => 4999999, "path" => "keep", "size" => 1],
- ["version" => 4999998, "path" => "delete", "size" => 1],
- ["version" => 4999997, "path" => "keep", "size" => 1],
- ["version" => 4999995, "path" => "keep", "size" => 1],
- ["version" => 4999994, "path" => "delete", "size" => 1],
+ ['version' => 4999999, 'path' => 'keep', 'size' => 1],
+ ['version' => 4999998, 'path' => 'delete', 'size' => 1],
+ ['version' => 4999997, 'path' => 'keep', 'size' => 1],
+ ['version' => 4999995, 'path' => 'keep', 'size' => 1],
+ ['version' => 4999994, 'path' => 'delete', 'size' => 1],
//next slice (60sec) starts at 4999990 keep one version every 10 secons
- ["version" => 4999988, "path" => "keep", "size" => 1],
- ["version" => 4999978, "path" => "keep", "size" => 1],
+ ['version' => 4999988, 'path' => 'keep', 'size' => 1],
+ ['version' => 4999978, 'path' => 'keep', 'size' => 1],
//next slice (3600sec) start at 4999940 keep one version every 60 seconds
// next slice (86400sec) start at 4996400 keep one version every 3600 seconds
- ["version" => 4989200, "path" => "keep", "size" => 1],
+ ['version' => 4989200, 'path' => 'keep', 'size' => 1],
// next slice (2592000sec) start at 4913600 keep one version every 86400 seconds
- ["version" => 4913600, "path" => "keep", "size" => 1],
- ["version" => 4852800, "path" => "delete", "size" => 1],
- ["version" => 4827201, "path" => "delete", "size" => 1],
- ["version" => 4827200, "path" => "keep", "size" => 1],
- ["version" => 4777201, "path" => "delete", "size" => 1],
- ["version" => 4777501, "path" => "delete", "size" => 1],
- ["version" => 4740000, "path" => "keep", "size" => 1],
+ ['version' => 4913600, 'path' => 'keep', 'size' => 1],
+ ['version' => 4852800, 'path' => 'delete', 'size' => 1],
+ ['version' => 4827201, 'path' => 'delete', 'size' => 1],
+ ['version' => 4827200, 'path' => 'keep', 'size' => 1],
+ ['version' => 4777201, 'path' => 'delete', 'size' => 1],
+ ['version' => 4777501, 'path' => 'delete', 'size' => 1],
+ ['version' => 4740000, 'path' => 'keep', 'size' => 1],
// final slice starts at 2408000 keep one version every 604800 secons
- ["version" => 2408000, "path" => "keep", "size" => 1],
- ["version" => 1803201, "path" => "delete", "size" => 1],
- ["version" => 1803200, "path" => "keep", "size" => 1],
- ["version" => 1800199, "path" => "delete", "size" => 1],
- ["version" => 1800100, "path" => "delete", "size" => 1],
- ["version" => 1198300, "path" => "keep", "size" => 1],
+ ['version' => 2408000, 'path' => 'keep', 'size' => 1],
+ ['version' => 1803201, 'path' => 'delete', 'size' => 1],
+ ['version' => 1803200, 'path' => 'keep', 'size' => 1],
+ ['version' => 1800199, 'path' => 'delete', 'size' => 1],
+ ['version' => 1800100, 'path' => 'delete', 'size' => 1],
+ ['version' => 1198300, 'path' => 'keep', 'size' => 1],
],
9 // size of all deleted files (every file has the size 1)
],
@@ -270,7 +270,7 @@ class VersioningTest extends \Test\TestCase {
}
public function testRename() {
- \OC\Files\Filesystem::file_put_contents("test.txt", "test file");
+ \OC\Files\Filesystem::file_put_contents('test.txt', 'test file');
$t1 = time();
// second version is two weeks older, this way we make sure that no
@@ -287,7 +287,7 @@ class VersioningTest extends \Test\TestCase {
$this->rootView->file_put_contents($v2, 'version2');
// execute rename hook of versions app
- \OC\Files\Filesystem::rename("test.txt", "test2.txt");
+ \OC\Files\Filesystem::rename('test.txt', 'test2.txt');
$this->runCommands();
@@ -301,7 +301,7 @@ class VersioningTest extends \Test\TestCase {
public function testRenameInSharedFolder() {
\OC\Files\Filesystem::mkdir('folder1');
\OC\Files\Filesystem::mkdir('folder1/folder2');
- \OC\Files\Filesystem::file_put_contents("folder1/test.txt", "test file");
+ \OC\Files\Filesystem::file_put_contents('folder1/test.txt', 'test file');
$t1 = time();
// second version is two weeks older, this way we make sure that no
@@ -483,7 +483,7 @@ class VersioningTest extends \Test\TestCase {
}
public function testRenameSharedFile() {
- \OC\Files\Filesystem::file_put_contents("test.txt", "test file");
+ \OC\Files\Filesystem::file_put_contents('test.txt', 'test file');
$t1 = time();
// second version is two weeks older, this way we make sure that no
@@ -532,7 +532,7 @@ class VersioningTest extends \Test\TestCase {
}
public function testCopy() {
- \OC\Files\Filesystem::file_put_contents("test.txt", "test file");
+ \OC\Files\Filesystem::file_put_contents('test.txt', 'test file');
$t1 = time();
// second version is two weeks older, this way we make sure that no
@@ -549,7 +549,7 @@ class VersioningTest extends \Test\TestCase {
$this->rootView->file_put_contents($v2, 'version2');
// execute copy hook of versions app
- \OC\Files\Filesystem::copy("test.txt", "test2.txt");
+ \OC\Files\Filesystem::copy('test.txt', 'test2.txt');
$this->runCommands();
@@ -621,7 +621,7 @@ class VersioningTest extends \Test\TestCase {
$this->logout();
// needed to have a FS setup (the background job does this)
\OC_Util::setupFS(self::TEST_VERSIONS_USER);
- \OC\Files\Filesystem::file_put_contents("test.txt", "test file");
+ \OC\Files\Filesystem::file_put_contents('test.txt', 'test file');
$this->assertFalse(\OCA\Files_Versions\Storage::expire('test.txt', 'unexist'));
}
@@ -694,7 +694,7 @@ class VersioningTest extends \Test\TestCase {
$shareManager = \OC::$server->getShareManager();
$shareManager->acceptShare($share, self::TEST_VERSIONS_USER2);
- $share->setTarget("subfolder/folder");
+ $share->setTarget('subfolder/folder');
$shareManager->moveShare($share, self::TEST_VERSIONS_USER2);
$versions = $this->createAndCheckVersions(
diff --git a/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php b/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php
index 1958e666503..fd2a76b4773 100644
--- a/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php
+++ b/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php
@@ -66,7 +66,7 @@ class RetryJob extends Job {
return;
}
- $this->retries = (int) $this->config->getUserValue($this->argument['userId'], 'lookup_server_connector', 'update_retries', '0');
+ $this->retries = (int)$this->config->getUserValue($this->argument['userId'], 'lookup_server_connector', 'update_retries', '0');
if ($this->shouldRemoveBackgroundJob()) {
$jobList->remove($this, $this->argument);
diff --git a/apps/provisioning_api/lib/Controller/AUserData.php b/apps/provisioning_api/lib/Controller/AUserData.php
index 8879672c561..44087a91791 100644
--- a/apps/provisioning_api/lib/Controller/AUserData.php
+++ b/apps/provisioning_api/lib/Controller/AUserData.php
@@ -262,7 +262,7 @@ abstract class AUserData extends OCSController {
];
} catch (\Exception $e) {
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error(
- "Could not load storage info for {user}",
+ 'Could not load storage info for {user}',
[
'app' => 'provisioning_api',
'user' => $userId,
diff --git a/apps/provisioning_api/lib/Controller/AppConfigController.php b/apps/provisioning_api/lib/Controller/AppConfigController.php
index 2ff82213997..5061a0ffc8f 100644
--- a/apps/provisioning_api/lib/Controller/AppConfigController.php
+++ b/apps/provisioning_api/lib/Controller/AppConfigController.php
@@ -113,7 +113,7 @@ class AppConfigController extends OCSController {
public function setValue(string $app, string $key, string $value): DataResponse {
$user = $this->userSession->getUser();
if ($user === null) {
- throw new \Exception("User is not logged in."); // Should not happen, since method is guarded by middleware
+ throw new \Exception('User is not logged in.'); // Should not happen, since method is guarded by middleware
}
if (!$this->isAllowedToChangedKey($user, $app, $key)) {
diff --git a/apps/provisioning_api/lib/Controller/PreferencesController.php b/apps/provisioning_api/lib/Controller/PreferencesController.php
index affacb4fb32..2a31e076c83 100644
--- a/apps/provisioning_api/lib/Controller/PreferencesController.php
+++ b/apps/provisioning_api/lib/Controller/PreferencesController.php
@@ -134,6 +134,7 @@ class PreferencesController extends OCSController {
* @param string[] $configKeys Keys to delete
*
* @return DataResponse<Http::STATUS_OK|Http::STATUS_BAD_REQUEST, array<empty>, array{}>
+ *
* 200: Preferences deleted successfully
* 400: Preference invalid
*/
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index b0ddd4329af..4cab2341b00 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -167,7 +167,7 @@ class UsersController extends AUserData {
$usersDetails = [];
foreach ($users as $userId) {
- $userId = (string) $userId;
+ $userId = (string)$userId;
try {
$userData = $this->getUserData($userId);
} catch (OCSNotFoundException $e) {
@@ -360,7 +360,7 @@ class UsersController extends AUserData {
foreach ($phoneNumbers as $phone) {
$normalizedNumber = $this->phoneNumberUtil->convertToStandardFormat($phone, $location);
if ($normalizedNumber !== null) {
- $normalizedNumberToKey[$normalizedNumber] = (string) $key;
+ $normalizedNumberToKey[$normalizedNumber] = (string)$key;
}
if ($defaultPhoneRegion !== '' && $defaultPhoneRegion !== $location && str_starts_with($phone, '0')) {
@@ -369,7 +369,7 @@ class UsersController extends AUserData {
// when it's different to the user's given region.
$normalizedNumber = $this->phoneNumberUtil->convertToStandardFormat($phone, $defaultPhoneRegion);
if ($normalizedNumber !== null) {
- $normalizedNumberToKey[$normalizedNumber] = (string) $key;
+ $normalizedNumberToKey[$normalizedNumber] = (string)$key;
}
}
}
@@ -1023,7 +1023,7 @@ class UsersController extends AUserData {
$quota = $value;
if ($quota !== 'none' && $quota !== 'default') {
if (is_numeric($quota)) {
- $quota = (float) $quota;
+ $quota = (float)$quota;
} else {
$quota = \OCP\Util::computerFileSize($quota);
}
@@ -1033,7 +1033,7 @@ class UsersController extends AUserData {
if ($quota === -1) {
$quota = 'none';
} else {
- $maxQuota = (int) $this->config->getAppValue('files', 'max_quota', '-1');
+ $maxQuota = (int)$this->config->getAppValue('files', 'max_quota', '-1');
if ($maxQuota !== -1 && $quota > $maxQuota) {
throw new OCSException($this->l10n->t('Invalid quota value. %1$s is exceeding the maximum quota', [$value]), 102);
}
diff --git a/apps/provisioning_api/tests/CapabilitiesTest.php b/apps/provisioning_api/tests/CapabilitiesTest.php
index 389dd37301d..8b4215063b7 100644
--- a/apps/provisioning_api/tests/CapabilitiesTest.php
+++ b/apps/provisioning_api/tests/CapabilitiesTest.php
@@ -64,8 +64,8 @@ class CapabilitiesTest extends TestCase {
$this->overwriteService(FederatedShareProvider::class, $federatedShareProvider);
$federatedShareProvider->expects($this->any())
- ->method('isLookupServerUploadEnabled')
- ->willReturn($lookupServerEnabled);
+ ->method('isLookupServerUploadEnabled')
+ ->willReturn($lookupServerEnabled);
$expected = [
'provisioning_api' => [
diff --git a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php
index 6a66df3a7d2..f0f38bcac9b 100644
--- a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php
@@ -38,7 +38,7 @@ class GroupsControllerTest extends \Test\TestCase {
protected $l10nFactory;
/** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
protected $logger;
- /** @var SubAdmin|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var SubAdmin|\PHPUnit\Framework\MockObject\MockObject */
protected $subAdminManager;
/** @var GroupsController|\PHPUnit\Framework\MockObject\MockObject */
@@ -60,8 +60,8 @@ class GroupsControllerTest extends \Test\TestCase {
$this->subAdminManager = $this->createMock(SubAdmin::class);
$this->groupManager
- ->method('getSubAdmin')
- ->willReturn($this->subAdminManager);
+ ->method('getSubAdmin')
+ ->willReturn($this->subAdminManager);
$this->api = $this->getMockBuilder(GroupsController::class)
->setConstructorArgs([
diff --git a/apps/settings/lib/Activity/GroupSetting.php b/apps/settings/lib/Activity/GroupSetting.php
index e50e59a0916..30a4b6a6aeb 100644
--- a/apps/settings/lib/Activity/GroupSetting.php
+++ b/apps/settings/lib/Activity/GroupSetting.php
@@ -38,8 +38,8 @@ class GroupSetting implements ISetting {
/**
* @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.
* @since 11.0.0
*/
public function getPriority(): int {
diff --git a/apps/settings/lib/Activity/Setting.php b/apps/settings/lib/Activity/Setting.php
index d627a70b766..ace10546f82 100644
--- a/apps/settings/lib/Activity/Setting.php
+++ b/apps/settings/lib/Activity/Setting.php
@@ -38,8 +38,8 @@ class Setting implements ISetting {
/**
* @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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/settings/lib/BackgroundJobs/VerifyUserData.php b/apps/settings/lib/BackgroundJobs/VerifyUserData.php
index 728fe9febf5..62b7c44c8ef 100644
--- a/apps/settings/lib/BackgroundJobs/VerifyUserData.php
+++ b/apps/settings/lib/BackgroundJobs/VerifyUserData.php
@@ -20,7 +20,7 @@ use OCP\IUserManager;
use Psr\Log\LoggerInterface;
class VerifyUserData extends Job {
- /** @var bool */
+ /** @var bool */
private bool $retainJob = true;
/** @var int max number of attempts to send the request */
diff --git a/apps/settings/lib/Command/AdminDelegation/Add.php b/apps/settings/lib/Command/AdminDelegation/Add.php
index 4ec6510f205..26a13b2cd6e 100644
--- a/apps/settings/lib/Command/AdminDelegation/Add.php
+++ b/apps/settings/lib/Command/AdminDelegation/Add.php
@@ -39,7 +39,7 @@ class Add extends Base {
protected function execute(InputInterface $input, OutputInterface $output): int {
$io = new SymfonyStyle($input, $output);
$settingClass = $input->getArgument('settingClass');
- if (!in_array(IDelegatedSettings::class, (array) class_implements($settingClass), true)) {
+ if (!in_array(IDelegatedSettings::class, (array)class_implements($settingClass), true)) {
$io->error('The specified class isn’t a valid delegated setting.');
return 2;
}
diff --git a/apps/settings/lib/Controller/UsersController.php b/apps/settings/lib/Controller/UsersController.php
index b677147b162..4ee359b6fe9 100644
--- a/apps/settings/lib/Controller/UsersController.php
+++ b/apps/settings/lib/Controller/UsersController.php
@@ -423,7 +423,7 @@ class UsersController extends Controller {
],
Http::STATUS_OK
);
- } catch (ForbiddenException | InvalidArgumentException | PropertyDoesNotExistException $e) {
+ } catch (ForbiddenException|InvalidArgumentException|PropertyDoesNotExistException $e) {
return new DataResponse([
'status' => 'error',
'data' => [
diff --git a/apps/settings/lib/Service/AuthorizedGroupService.php b/apps/settings/lib/Service/AuthorizedGroupService.php
index 9dea37b0c2e..31ffc765f32 100644
--- a/apps/settings/lib/Service/AuthorizedGroupService.php
+++ b/apps/settings/lib/Service/AuthorizedGroupService.php
@@ -46,7 +46,7 @@ class AuthorizedGroupService {
private function handleException(\Exception $e): void {
if ($e instanceof DoesNotExistException ||
$e instanceof MultipleObjectsReturnedException) {
- throw new NotFoundException("AuthorizedGroup not found");
+ throw new NotFoundException('AuthorizedGroup not found');
} else {
throw $e;
}
diff --git a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php
index 57cd555f1f2..31945e3830b 100644
--- a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php
+++ b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php
@@ -176,8 +176,8 @@ class ArtificialIntelligence implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/settings/lib/Settings/Admin/Mail.php b/apps/settings/lib/Settings/Admin/Mail.php
index e455f0d3bc0..0775b50aaa1 100644
--- a/apps/settings/lib/Settings/Admin/Mail.php
+++ b/apps/settings/lib/Settings/Admin/Mail.php
@@ -32,7 +32,7 @@ class Mail implements IDelegatedSettings {
public function getForm() {
$parameters = [
// Mail
- 'sendmail_is_available' => (bool) \OC_Helper::findBinaryPath('sendmail'),
+ 'sendmail_is_available' => (bool)\OC_Helper::findBinaryPath('sendmail'),
'mail_domain' => $this->config->getSystemValue('mail_domain', ''),
'mail_from_address' => $this->config->getSystemValue('mail_from_address', ''),
'mail_smtpmode' => $this->config->getSystemValue('mail_smtpmode', ''),
@@ -65,8 +65,8 @@ class Mail implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/settings/lib/Settings/Admin/Overview.php b/apps/settings/lib/Settings/Admin/Overview.php
index ac581cfb4c5..d796f91f83d 100644
--- a/apps/settings/lib/Settings/Admin/Overview.php
+++ b/apps/settings/lib/Settings/Admin/Overview.php
@@ -14,7 +14,7 @@ class Overview implements IDelegatedSettings {
/** @var IConfig */
private $config;
- /** @var IL10N $l*/
+ /** @var IL10N $l */
private $l;
public function __construct(IConfig $config, IL10N $l) {
@@ -42,8 +42,8 @@ class Overview implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/settings/lib/Settings/Admin/Security.php b/apps/settings/lib/Settings/Admin/Security.php
index 5e4366511eb..8f01626789f 100644
--- a/apps/settings/lib/Settings/Admin/Security.php
+++ b/apps/settings/lib/Settings/Admin/Security.php
@@ -67,8 +67,8 @@ class Security implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/settings/lib/Settings/Admin/Server.php b/apps/settings/lib/Settings/Admin/Server.php
index d96228e6ec6..0f253ddf6b1 100644
--- a/apps/settings/lib/Settings/Admin/Server.php
+++ b/apps/settings/lib/Settings/Admin/Server.php
@@ -67,7 +67,7 @@ class Server implements IDelegatedSettings {
$result = $query->execute();
if ($row = $result->fetch()) {
- $maxAge = (int) $row['last_checked'];
+ $maxAge = (int)$row['last_checked'];
} else {
$maxAge = $this->timeFactory->getTime();
}
@@ -85,8 +85,8 @@ class Server implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/settings/lib/Settings/Admin/Sharing.php b/apps/settings/lib/Settings/Admin/Sharing.php
index df13eb9de22..9fc6e1fe4c5 100644
--- a/apps/settings/lib/Settings/Admin/Sharing.php
+++ b/apps/settings/lib/Settings/Admin/Sharing.php
@@ -97,8 +97,8 @@ class Sharing implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/settings/lib/Settings/Admin/Users.php b/apps/settings/lib/Settings/Admin/Users.php
index 3af018e0cf1..c569890a0dc 100644
--- a/apps/settings/lib/Settings/Admin/Users.php
+++ b/apps/settings/lib/Settings/Admin/Users.php
@@ -42,8 +42,8 @@ class Users implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/settings/lib/Settings/Personal/Additional.php b/apps/settings/lib/Settings/Personal/Additional.php
index 96de4f20c51..c8b3fc66450 100644
--- a/apps/settings/lib/Settings/Personal/Additional.php
+++ b/apps/settings/lib/Settings/Personal/Additional.php
@@ -28,8 +28,8 @@ class Additional implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
* @since 9.1
diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php
index f79f7d52665..bfac996de2f 100644
--- a/apps/settings/lib/Settings/Personal/PersonalInfo.php
+++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php
@@ -197,8 +197,8 @@ class PersonalInfo implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
* @since 9.1
diff --git a/apps/settings/lib/Settings/Personal/ServerDevNotice.php b/apps/settings/lib/Settings/Personal/ServerDevNotice.php
index 702daf08494..5a2901e4af9 100644
--- a/apps/settings/lib/Settings/Personal/ServerDevNotice.php
+++ b/apps/settings/lib/Settings/Personal/ServerDevNotice.php
@@ -89,8 +89,8 @@ class ServerDevNotice implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php b/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php
index 734ac1ff223..a77e0d87f27 100644
--- a/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php
+++ b/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php
@@ -60,12 +60,12 @@ trait CheckServerResponseTrait {
* @param string $method The HTTP method to use
* @param string $url The relative URL to check
* @param array{ignoreSSL?: bool, httpErrors?: bool, options?: array} $options Additional options, like
- * [
- * // Ignore invalid SSL certificates (e.g. self signed)
- * 'ignoreSSL' => true,
- * // Ignore requests with HTTP errors (will not yield if request has a 4xx or 5xx response)
- * 'httpErrors' => true,
- * ]
+ * [
+ * // Ignore invalid SSL certificates (e.g. self signed)
+ * 'ignoreSSL' => true,
+ * // Ignore requests with HTTP errors (will not yield if request has a 4xx or 5xx response)
+ * 'httpErrors' => true,
+ * ]
*
* @return Generator<int, IResponse>
*/
diff --git a/apps/settings/lib/SetupChecks/DatabaseHasMissingIndices.php b/apps/settings/lib/SetupChecks/DatabaseHasMissingIndices.php
index 49e3106b017..9854a039dd1 100644
--- a/apps/settings/lib/SetupChecks/DatabaseHasMissingIndices.php
+++ b/apps/settings/lib/SetupChecks/DatabaseHasMissingIndices.php
@@ -81,7 +81,7 @@ class DatabaseHasMissingIndices implements ISetupCheck {
$processed++;
$list .= "\n " . $this->l10n->t('"%s" in table "%s"', [$missingIndex['indexName'], $missingIndex['tableName']]);
if (count($missingIndices) > $processed) {
- $list .= ", ";
+ $list .= ', ';
}
}
return SetupResult::warning(
diff --git a/apps/settings/lib/SetupChecks/MaintenanceWindowStart.php b/apps/settings/lib/SetupChecks/MaintenanceWindowStart.php
index 48e5fa2dc49..ca8df039b1e 100644
--- a/apps/settings/lib/SetupChecks/MaintenanceWindowStart.php
+++ b/apps/settings/lib/SetupChecks/MaintenanceWindowStart.php
@@ -40,7 +40,7 @@ class MaintenanceWindowStart implements ISetupCheck {
);
}
- $startValue = (int) $configValue;
+ $startValue = (int)$configValue;
$endValue = ($startValue + 6) % 24;
return SetupResult::success(
str_replace(
diff --git a/apps/settings/lib/SetupChecks/PushService.php b/apps/settings/lib/SetupChecks/PushService.php
index a3ac921caef..1f03404d80e 100644
--- a/apps/settings/lib/SetupChecks/PushService.php
+++ b/apps/settings/lib/SetupChecks/PushService.php
@@ -38,7 +38,7 @@ class PushService implements ISetupCheck {
* Check if is fair use of free push service
*/
private function isFairUseOfFreePushService(): bool {
- $rateLimitReached = (int) $this->config->getAppValue('notifications', 'rate_limit_reached', '0');
+ $rateLimitReached = (int)$this->config->getAppValue('notifications', 'rate_limit_reached', '0');
if ($rateLimitReached >= ($this->timeFactory->now()->getTimestamp() - 7 * 24 * 3600)) {
// Notifications app is showing a message already
return true;
diff --git a/apps/settings/lib/SetupChecks/SecurityHeaders.php b/apps/settings/lib/SetupChecks/SecurityHeaders.php
index f00e92ef496..a6dbc631b5c 100644
--- a/apps/settings/lib/SetupChecks/SecurityHeaders.php
+++ b/apps/settings/lib/SetupChecks/SecurityHeaders.php
@@ -131,7 +131,7 @@ class SecurityHeaders implements ISetupCheck {
// Otherwise if we fail we can abort here
if ($works === false) {
return SetupResult::warning(
- $this->l10n->t("Could not check that your web server serves security headers correctly, unable to query `%s`", [$url]),
+ $this->l10n->t('Could not check that your web server serves security headers correctly, unable to query `%s`', [$url]),
$this->urlGenerator->linkToDocs('admin-security'),
);
}
diff --git a/apps/settings/lib/WellKnown/SecurityTxtHandler.php b/apps/settings/lib/WellKnown/SecurityTxtHandler.php
index 46452ceb42c..e52f946e1ad 100644
--- a/apps/settings/lib/WellKnown/SecurityTxtHandler.php
+++ b/apps/settings/lib/WellKnown/SecurityTxtHandler.php
@@ -21,13 +21,13 @@ class SecurityTxtHandler implements IHandler {
return $previousResponse;
}
- $response = "Contact: https://hackerone.com/nextcloud
+ $response = 'Contact: https://hackerone.com/nextcloud
Expires: 2025-02-28T23:00:00.000Z
Acknowledgments: https://hackerone.com/nextcloud/thanks
Acknowledgments: https://github.com/nextcloud/security-advisories/security/advisories
Policy: https://hackerone.com/nextcloud
Preferred-Languages: en
-";
+';
return new GenericResponse(new TextPlainResponse($response, 200));
}
diff --git a/apps/settings/tests/Controller/AuthSettingsControllerTest.php b/apps/settings/tests/Controller/AuthSettingsControllerTest.php
index 4cc8be641c2..a054d5e306c 100644
--- a/apps/settings/tests/Controller/AuthSettingsControllerTest.php
+++ b/apps/settings/tests/Controller/AuthSettingsControllerTest.php
@@ -37,7 +37,7 @@ class AuthSettingsControllerTest extends TestCase {
private $tokenProvider;
/** @var ISession|MockObject */
private $session;
- /**@var IUserSession|MockObject */
+ /** @var IUserSession|MockObject */
private $userSession;
/** @var ISecureRandom|MockObject */
private $secureRandom;
diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php
index cb9ca57fe65..fde13cfee31 100644
--- a/apps/settings/tests/Controller/CheckSetupControllerTest.php
+++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php
@@ -63,7 +63,7 @@ class CheckSetupControllerTest extends TestCase {
return vsprintf($message, $replace);
});
$this->checker = $this->getMockBuilder('\OC\IntegrityCheck\Checker')
- ->disableOriginalConstructor()->getMock();
+ ->disableOriginalConstructor()->getMock();
$this->logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
$this->setupCheckManager = $this->createMock(ISetupCheckManager::class);
$this->checkSetupController = $this->getMockBuilder(CheckSetupController::class)
@@ -193,9 +193,9 @@ class CheckSetupControllerTest extends TestCase {
->method('isCodeCheckEnforced')
->willReturn(true);
$this->checker
- ->expects($this->once())
- ->method('getResults')
- ->willReturn([ 'core' => [ 'EXTRA_FILE' => ['/testfile' => []], 'INVALID_HASH' => [ '/.idea/workspace.xml' => [ 'expected' => 'f1c5e2630d784bc9cb02d5a28f55d6f24d06dae2a0fee685f3c2521b050955d9d452769f61454c9ddfa9c308146ade10546cfa829794448eaffbc9a04a29d216', 'current' => 'ce08bf30bcbb879a18b49239a9bec6b8702f52452f88a9d32142cad8d2494d5735e6bfa0d8642b2762c62ca5be49f9bf4ec231d4a230559d4f3e2c471d3ea094', ], '/lib/private/integritycheck/checker.php' => [ 'expected' => 'c5a03bacae8dedf8b239997901ba1fffd2fe51271d13a00cc4b34b09cca5176397a89fc27381cbb1f72855fa18b69b6f87d7d5685c3b45aee373b09be54742ea', 'current' => '88a3a92c11db91dec1ac3be0e1c87f862c95ba6ffaaaa3f2c3b8f682187c66f07af3a3b557a868342ef4a271218fe1c1e300c478e6c156c5955ed53c40d06585', ], '/settings/controller/checksetupcontroller.php' => [ 'expected' => '3e1de26ce93c7bfe0ede7c19cb6c93cadc010340225b375607a7178812e9de163179b0dc33809f451e01f491d93f6f5aaca7929685d21594cccf8bda732327c4', 'current' => '09563164f9904a837f9ca0b5f626db56c838e5098e0ccc1d8b935f68fa03a25c5ec6f6b2d9e44a868e8b85764dafd1605522b4af8db0ae269d73432e9a01e63a', ], ], ], 'bookmarks' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'dav' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'encryption' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'external' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'federation' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_antivirus' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_drop' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_external' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_pdfviewer' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_sharing' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_trashbin' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_versions' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_videoviewer' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'firstrunwizard' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'gitsmart' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'logreader' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature could not get verified.', ], ], 'password_policy' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'provisioning_api' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'sketch' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'threatblock' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'two_factor_auth' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'user_ldap' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'user_shibboleth' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], ]);
+ ->expects($this->once())
+ ->method('getResults')
+ ->willReturn([ 'core' => [ 'EXTRA_FILE' => ['/testfile' => []], 'INVALID_HASH' => [ '/.idea/workspace.xml' => [ 'expected' => 'f1c5e2630d784bc9cb02d5a28f55d6f24d06dae2a0fee685f3c2521b050955d9d452769f61454c9ddfa9c308146ade10546cfa829794448eaffbc9a04a29d216', 'current' => 'ce08bf30bcbb879a18b49239a9bec6b8702f52452f88a9d32142cad8d2494d5735e6bfa0d8642b2762c62ca5be49f9bf4ec231d4a230559d4f3e2c471d3ea094', ], '/lib/private/integritycheck/checker.php' => [ 'expected' => 'c5a03bacae8dedf8b239997901ba1fffd2fe51271d13a00cc4b34b09cca5176397a89fc27381cbb1f72855fa18b69b6f87d7d5685c3b45aee373b09be54742ea', 'current' => '88a3a92c11db91dec1ac3be0e1c87f862c95ba6ffaaaa3f2c3b8f682187c66f07af3a3b557a868342ef4a271218fe1c1e300c478e6c156c5955ed53c40d06585', ], '/settings/controller/checksetupcontroller.php' => [ 'expected' => '3e1de26ce93c7bfe0ede7c19cb6c93cadc010340225b375607a7178812e9de163179b0dc33809f451e01f491d93f6f5aaca7929685d21594cccf8bda732327c4', 'current' => '09563164f9904a837f9ca0b5f626db56c838e5098e0ccc1d8b935f68fa03a25c5ec6f6b2d9e44a868e8b85764dafd1605522b4af8db0ae269d73432e9a01e63a', ], ], ], 'bookmarks' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'dav' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'encryption' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'external' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'federation' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_antivirus' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_drop' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_external' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_pdfviewer' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_sharing' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_trashbin' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_versions' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_videoviewer' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'firstrunwizard' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'gitsmart' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'logreader' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature could not get verified.', ], ], 'password_policy' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'provisioning_api' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'sketch' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'threatblock' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'two_factor_auth' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'user_ldap' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'user_shibboleth' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], ]);
$expected = new DataDisplayResponse(
'Technical information
diff --git a/apps/settings/tests/Controller/UsersControllerTest.php b/apps/settings/tests/Controller/UsersControllerTest.php
index d27b06007e3..e1407cb1b55 100644
--- a/apps/settings/tests/Controller/UsersControllerTest.php
+++ b/apps/settings/tests/Controller/UsersControllerTest.php
@@ -58,19 +58,19 @@ class UsersControllerTest extends \Test\TestCase {
private $l;
/** @var AccountManager|\PHPUnit\Framework\MockObject\MockObject */
private $accountManager;
- /** @var IJobList | \PHPUnit\Framework\MockObject\MockObject */
+ /** @var IJobList | \PHPUnit\Framework\MockObject\MockObject */
private $jobList;
- /** @var \OC\Security\IdentityProof\Manager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var \OC\Security\IdentityProof\Manager|\PHPUnit\Framework\MockObject\MockObject */
private $securityManager;
- /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
private $encryptionManager;
/** @var KnownUserService|\PHPUnit\Framework\MockObject\MockObject */
private $knownUserService;
- /** @var IEncryptionModule|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IEncryptionModule|\PHPUnit\Framework\MockObject\MockObject */
private $encryptionModule;
/** @var IEventDispatcher|\PHPUnit\Framework\MockObject\MockObject */
private $dispatcher;
- /** @var IInitialState|\PHPUnit\Framework\MockObject\MockObject*/
+ /** @var IInitialState|\PHPUnit\Framework\MockObject\MockObject */
private $initialState;
protected function setUp(): void {
@@ -563,7 +563,7 @@ class UsersControllerTest extends \Test\TestCase {
if (!empty($email)) {
$this->mailer->expects($this->once())->method('validateMailAddress')
- ->willReturn(true);
+ ->willReturn(true);
}
$controller->expects($this->once())
diff --git a/apps/settings/tests/Settings/Admin/MailTest.php b/apps/settings/tests/Settings/Admin/MailTest.php
index f63952c288c..cab0596ad44 100644
--- a/apps/settings/tests/Settings/Admin/MailTest.php
+++ b/apps/settings/tests/Settings/Admin/MailTest.php
@@ -51,7 +51,7 @@ class MailTest extends TestCase {
'settings',
'settings/admin/additional-mail',
[
- 'sendmail_is_available' => (bool) \OC_Helper::findBinaryPath('sendmail'),
+ 'sendmail_is_available' => (bool)\OC_Helper::findBinaryPath('sendmail'),
'mail_domain' => 'mx.nextcloud.com',
'mail_from_address' => 'no-reply@nextcloud.com',
'mail_smtpmode' => 'smtp',
diff --git a/apps/settings/tests/Settings/Admin/SharingTest.php b/apps/settings/tests/Settings/Admin/SharingTest.php
index 0225de87ad0..d988ed15aed 100644
--- a/apps/settings/tests/Settings/Admin/SharingTest.php
+++ b/apps/settings/tests/Settings/Admin/SharingTest.php
@@ -22,13 +22,13 @@ class SharingTest extends TestCase {
private $admin;
/** @var IConfig */
private $config;
- /** @var IL10N|MockObject */
+ /** @var IL10N|MockObject */
private $l10n;
- /** @var IManager|MockObject */
+ /** @var IManager|MockObject */
private $shareManager;
/** @var IAppManager|MockObject */
private $appManager;
- /** @var IURLGenerator|MockObject */
+ /** @var IURLGenerator|MockObject */
private $urlGenerator;
/** @var IInitialState|MockObject */
private $initialState;
@@ -56,7 +56,7 @@ class SharingTest extends TestCase {
$this->appManager,
$this->urlGenerator,
$this->initialState,
- "settings",
+ 'settings',
);
}
diff --git a/apps/sharebymail/lib/Settings/Admin.php b/apps/sharebymail/lib/Settings/Admin.php
index b39eced3c86..5fdf633bea1 100644
--- a/apps/sharebymail/lib/Settings/Admin.php
+++ b/apps/sharebymail/lib/Settings/Admin.php
@@ -40,8 +40,8 @@ class Admin implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index d4f7189a3cc..e6bda058aaa 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -128,7 +128,7 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider
if ($initiatorEMailAddress === null && !$allowPasswordByMail) {
throw new \Exception(
- $this->l->t("We cannot send you the auto-generated password. Please set a valid email address in your personal settings and try again.")
+ $this->l->t('We cannot send you the auto-generated password. Please set a valid email address in your personal settings and try again.')
);
}
@@ -154,7 +154,7 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider
[$userFolder->getRelativePath($share->getNode()->getPath()), $share->getSharedWith()],
$share->getSharedBy(),
$share->getNode()->getId(),
- (string) $userFolder->getRelativePath($share->getNode()->getPath())
+ (string)$userFolder->getRelativePath($share->getNode()->getPath())
);
if ($share->getShareOwner() !== $share->getSharedBy()) {
@@ -167,7 +167,7 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider
[$ownerFolder->getRelativePath($ownerPath), $share->getSharedWith(), $share->getSharedBy()],
$share->getShareOwner(),
$fileId,
- (string) $ownerFolder->getRelativePath($ownerPath)
+ (string)$ownerFolder->getRelativePath($ownerPath)
);
}
}
@@ -184,7 +184,7 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider
[$userFolder->getRelativePath($share->getNode()->getPath())],
$share->getSharedBy(),
$share->getNode()->getId(),
- (string) $userFolder->getRelativePath($share->getNode()->getPath())
+ (string)$userFolder->getRelativePath($share->getNode()->getPath())
);
} else {
$this->publishActivity(
@@ -192,7 +192,7 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider
[$userFolder->getRelativePath($share->getNode()->getPath()), $sharedWith],
$share->getSharedBy(),
$share->getNode()->getId(),
- (string) $userFolder->getRelativePath($share->getNode()->getPath())
+ (string)$userFolder->getRelativePath($share->getNode()->getPath())
);
}
}
@@ -576,7 +576,7 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider
if ($initiatorEMailAddress === null) {
throw new \Exception(
- $this->l->t("We cannot send you the auto-generated password. Please set a valid email address in your personal settings and try again.")
+ $this->l->t('We cannot send you the auto-generated password. Please set a valid email address in your personal settings and try again.')
);
}
diff --git a/apps/sharebymail/tests/ShareByMailProviderTest.php b/apps/sharebymail/tests/ShareByMailProviderTest.php
index 382a65154eb..cad8dc49e34 100644
--- a/apps/sharebymail/tests/ShareByMailProviderTest.php
+++ b/apps/sharebymail/tests/ShareByMailProviderTest.php
@@ -863,7 +863,7 @@ class ShareByMailProviderTest extends TestCase {
$permissions = 1;
$token = 'token';
- $this->createDummyShare($itemType, $itemSource, $shareWith, "user1wrong", "user2wrong", $permissions, $token);
+ $this->createDummyShare($itemType, $itemSource, $shareWith, 'user1wrong', 'user2wrong', $permissions, $token);
$id2 = $this->createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, $token);
$instance->expects($this->once())->method('createShareObject')
@@ -980,7 +980,7 @@ class ShareByMailProviderTest extends TestCase {
$instance = $this->getInstance(['createShareObject']);
$idMail = $this->createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, $token);
- $idPublic = $this->createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, "token2", '', IShare::TYPE_LINK);
+ $idPublic = $this->createDummyShare($itemType, $itemSource, $shareWith, $sharedBy, $uidOwner, $permissions, 'token2', '', IShare::TYPE_LINK);
$this->assertTrue($idMail !== $idPublic);
diff --git a/apps/systemtags/lib/Activity/Listener.php b/apps/systemtags/lib/Activity/Listener.php
index c2e39fa9f70..7ab00787a76 100644
--- a/apps/systemtags/lib/Activity/Listener.php
+++ b/apps/systemtags/lib/Activity/Listener.php
@@ -182,7 +182,7 @@ class Listener {
$activity->setApp('systemtags')
->setType('systemtags')
->setAuthor($actor)
- ->setObject($event->getObjectType(), (int) $event->getObjectId());
+ ->setObject($event->getObjectType(), (int)$event->getObjectId());
foreach ($users as $user => $path) {
$user = (string)$user; // numerical ids could be ints which are not accepted everywhere
diff --git a/apps/systemtags/lib/Activity/Provider.php b/apps/systemtags/lib/Activity/Provider.php
index e555fc56a50..b3685990ffd 100644
--- a/apps/systemtags/lib/Activity/Provider.php
+++ b/apps/systemtags/lib/Activity/Provider.php
@@ -262,19 +262,19 @@ class Provider implements IProvider {
case self::CREATE_TAG:
case self::DELETE_TAG:
return [
- 'actor' => $this->getUserParameter((string) $parameters[0]),
+ 'actor' => $this->getUserParameter((string)$parameters[0]),
'systemtag' => $this->getSystemTagParameter($parameters[1]),
];
case self::UPDATE_TAG:
return [
- 'actor' => $this->getUserParameter((string) $parameters[0]),
+ 'actor' => $this->getUserParameter((string)$parameters[0]),
'newsystemtag' => $this->getSystemTagParameter($parameters[1]),
'oldsystemtag' => $this->getSystemTagParameter($parameters[2]),
];
case self::ASSIGN_TAG:
case self::UNASSIGN_TAG:
return [
- 'actor' => $this->getUserParameter((string) $parameters[0]),
+ 'actor' => $this->getUserParameter((string)$parameters[0]),
'file' => $this->getFileParameter($event->getObjectId(), $parameters[1]),
'systemtag' => $this->getSystemTagParameter($parameters[2]),
];
@@ -305,7 +305,7 @@ class Provider implements IProvider {
return [
'type' => 'systemtag',
- 'id' => (int) $tagData['id'],
+ 'id' => (int)$tagData['id'],
'name' => $tagData['name'],
'assignable' => $tagData['assignable'] ? '1' : '0',
'visibility' => $tagData['visible'] ? '1' : '0',
diff --git a/apps/systemtags/lib/Activity/Setting.php b/apps/systemtags/lib/Activity/Setting.php
index 5f03d348235..c65cf3d404a 100644
--- a/apps/systemtags/lib/Activity/Setting.php
+++ b/apps/systemtags/lib/Activity/Setting.php
@@ -46,8 +46,8 @@ class Setting extends ActivitySettings {
/**
* @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.
* @since 11.0.0
*/
public function getPriority() {
diff --git a/apps/systemtags/lib/Controller/LastUsedController.php b/apps/systemtags/lib/Controller/LastUsedController.php
index 0dff3fa68de..ccdeddd9270 100644
--- a/apps/systemtags/lib/Controller/LastUsedController.php
+++ b/apps/systemtags/lib/Controller/LastUsedController.php
@@ -37,7 +37,7 @@ class LastUsedController extends Controller {
$lastUsed = $this->config->getUserValue($this->userSession->getUser()->getUID(), 'systemtags', 'last_used', '[]');
$tagIds = json_decode($lastUsed, true);
return new DataResponse(array_map(function ($id) {
- return (string) $id;
+ return (string)$id;
}, $tagIds));
}
}
diff --git a/apps/systemtags/lib/Settings/Admin.php b/apps/systemtags/lib/Settings/Admin.php
index 641c6c96626..544138316df 100644
--- a/apps/systemtags/lib/Settings/Admin.php
+++ b/apps/systemtags/lib/Settings/Admin.php
@@ -27,8 +27,8 @@ class Admin implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php
index a10e7442c46..844146724a5 100644
--- a/apps/theming/lib/IconBuilder.php
+++ b/apps/theming/lib/IconBuilder.php
@@ -44,12 +44,12 @@ class IconBuilder {
}
try {
$favicon = new Imagick();
- $favicon->setFormat("ico");
+ $favicon->setFormat('ico');
$icon = $this->renderAppIcon($app, 128);
if ($icon === false) {
return false;
}
- $icon->setImageFormat("png32");
+ $icon->setImageFormat('png32');
$clone = clone $icon;
$clone->scaleImage(16, 0);
@@ -87,7 +87,7 @@ class IconBuilder {
if ($icon === false) {
return false;
}
- $icon->setImageFormat("png32");
+ $icon->setImageFormat('png32');
$data = $icon->getImageBlob();
$icon->destroy();
return $data;
@@ -117,7 +117,7 @@ class IconBuilder {
$mime = mime_content_type($appIcon);
}
- if ($appIconContent === false || $appIconContent === "") {
+ if ($appIconContent === false || $appIconContent === '') {
return false;
}
@@ -129,9 +129,9 @@ class IconBuilder {
'<rect x="0" y="0" rx="100" ry="100" width="512" height="512" style="fill:' . $color . ';" />' .
'</svg>';
// resize svg magic as this seems broken in Imagemagick
- if ($mime === "image/svg+xml" || substr($appIconContent, 0, 4) === "<svg") {
- if (substr($appIconContent, 0, 5) !== "<?xml") {
- $svg = "<?xml version=\"1.0\"?>".$appIconContent;
+ if ($mime === 'image/svg+xml' || substr($appIconContent, 0, 4) === '<svg') {
+ if (substr($appIconContent, 0, 5) !== '<?xml') {
+ $svg = '<?xml version="1.0"?>'.$appIconContent;
} else {
$svg = $appIconContent;
}
@@ -162,7 +162,7 @@ class IconBuilder {
*/
if ($this->util->isBrightColor($color)
&& !$appIcon instanceof ISimpleFile
- && $app !== "core"
+ && $app !== 'core'
) {
$appIconFile->negateImage(false);
}
@@ -187,10 +187,10 @@ class IconBuilder {
$finalIconFile->setBackgroundColor(new ImagickPixel('transparent'));
$finalIconFile->readImageBlob($background);
$finalIconFile->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_TRANSPARENT);
- $finalIconFile->setImageArtifact('compose:args', "1,0,-0.5,0.5");
+ $finalIconFile->setImageArtifact('compose:args', '1,0,-0.5,0.5');
$finalIconFile->compositeImage($appIconFile, Imagick::COMPOSITE_ATOP, $offset_w, $offset_h);
$finalIconFile->setImageFormat('png24');
- if (defined("Imagick::INTERPOLATE_BICUBIC") === true) {
+ if (defined('Imagick::INTERPOLATE_BICUBIC') === true) {
$filter = Imagick::INTERPOLATE_BICUBIC;
} else {
$filter = Imagick::FILTER_LANCZOS;
@@ -208,11 +208,11 @@ class IconBuilder {
*/
public function colorSvg($app, $image) {
$imageFile = $this->util->getAppImage($app, $image);
- if ($imageFile === false || $imageFile === "") {
+ if ($imageFile === false || $imageFile === '') {
return false;
}
$svg = file_get_contents($imageFile);
- if ($svg !== false && $svg !== "") {
+ if ($svg !== false && $svg !== '') {
$color = $this->util->elementColor($this->themingDefaults->getColorPrimary());
$svg = $this->util->colorizeSvg($svg, $color);
return $svg;
diff --git a/apps/theming/lib/Service/BackgroundService.php b/apps/theming/lib/Service/BackgroundService.php
index bd87bc1aa21..60723f3a8fe 100644
--- a/apps/theming/lib/Service/BackgroundService.php
+++ b/apps/theming/lib/Service/BackgroundService.php
@@ -280,7 +280,7 @@ class BackgroundService {
if ($background === self::BACKGROUND_CUSTOM) {
try {
return $this->getAppDataFolder()->getFile('background.jpg');
- } catch (NotFoundException | NotPermittedException $e) {
+ } catch (NotFoundException|NotPermittedException $e) {
return null;
}
}
diff --git a/apps/theming/lib/Settings/Admin.php b/apps/theming/lib/Settings/Admin.php
index 8a7b47a44a0..640a2a8346d 100644
--- a/apps/theming/lib/Settings/Admin.php
+++ b/apps/theming/lib/Settings/Admin.php
@@ -87,8 +87,8 @@ class Admin implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/theming/lib/Settings/AdminSection.php b/apps/theming/lib/Settings/AdminSection.php
index 3170a826310..696c62672b9 100644
--- a/apps/theming/lib/Settings/AdminSection.php
+++ b/apps/theming/lib/Settings/AdminSection.php
@@ -42,8 +42,8 @@ class AdminSection implements IIconSection {
/**
* @return int whether the form should be rather on the top or bottom of
- * the settings navigation. The sections are arranged in ascending order of
- * the priority values. It is required to return a value between 0 and 99.
+ * the settings navigation. The sections are arranged in ascending order of
+ * the priority values. It is required to return a value between 0 and 99.
*
* E.g.: 70
*/
diff --git a/apps/theming/lib/Settings/Personal.php b/apps/theming/lib/Settings/Personal.php
index 43156515acd..3dc64141dc3 100644
--- a/apps/theming/lib/Settings/Personal.php
+++ b/apps/theming/lib/Settings/Personal.php
@@ -96,8 +96,8 @@ class Personal implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
* @since 9.1
diff --git a/apps/theming/lib/Settings/PersonalSection.php b/apps/theming/lib/Settings/PersonalSection.php
index 4411f605903..91121b32a6e 100644
--- a/apps/theming/lib/Settings/PersonalSection.php
+++ b/apps/theming/lib/Settings/PersonalSection.php
@@ -70,8 +70,8 @@ class PersonalSection implements IIconSection {
/**
* @return int whether the form should be rather on the top or bottom of
- * the settings navigation. The sections are arranged in ascending order of
- * the priority values. It is required to return a value between 0 and 99.
+ * the settings navigation. The sections are arranged in ascending order of
+ * the priority values. It is required to return a value between 0 and 99.
*
* E.g.: 70
* @since 9.1
diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php
index 47a54eb0e1a..7aa0096123b 100644
--- a/apps/theming/lib/Themes/DefaultTheme.php
+++ b/apps/theming/lib/Themes/DefaultTheme.php
@@ -152,7 +152,7 @@ class DefaultTheme implements ITheme {
'--color-loading-dark' => '#444444',
'--color-box-shadow-rgb' => $colorBoxShadowRGB,
- '--color-box-shadow' => "rgba(var(--color-box-shadow-rgb), 0.5)",
+ '--color-box-shadow' => 'rgba(var(--color-box-shadow-rgb), 0.5)',
'--color-border' => $this->util->darken($colorMainBackground, 7),
'--color-border-dark' => $this->util->darken($colorMainBackground, 14),
diff --git a/apps/theming/lib/Util.php b/apps/theming/lib/Util.php
index 3ed359f7e07..809ff53f5e1 100644
--- a/apps/theming/lib/Util.php
+++ b/apps/theming/lib/Util.php
@@ -232,7 +232,7 @@ class Util {
public function getAppImage($app, $image) {
$app = str_replace(['\0', '/', '\\', '..'], '', $app);
$image = str_replace(['\0', '\\', '..'], '', $image);
- if ($app === "core") {
+ if ($app === 'core') {
$icon = \OC::$SERVERROOT . '/core/img/' . $image;
if (file_exists($icon)) {
return $icon;
diff --git a/apps/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php
index eb56287fede..81ea8a5ead3 100644
--- a/apps/theming/tests/IconBuilderTest.php
+++ b/apps/theming/tests/IconBuilderTest.php
@@ -84,7 +84,7 @@ class IconBuilderTest extends TestCase {
->with('global/images')
->willThrowException(new NotFoundException());
- $expectedIcon = new \Imagick(realpath(dirname(__FILE__)). "/data/" . $file);
+ $expectedIcon = new \Imagick(realpath(dirname(__FILE__)). '/data/' . $file);
$icon = $this->iconBuilder->renderAppIcon($app, 512);
$this->assertEquals(true, $icon->valid());
@@ -113,7 +113,7 @@ class IconBuilderTest extends TestCase {
->with('global/images')
->willThrowException(new NotFoundException());
- $expectedIcon = new \Imagick(realpath(dirname(__FILE__)). "/data/" . $file);
+ $expectedIcon = new \Imagick(realpath(dirname(__FILE__)). '/data/' . $file);
$icon = new \Imagick();
$icon->readImageBlob($this->iconBuilder->getTouchIcon($app));
@@ -146,7 +146,7 @@ class IconBuilderTest extends TestCase {
->with('global/images')
->willThrowException(new NotFoundException());
- $expectedIcon = new \Imagick(realpath(dirname(__FILE__)). "/data/" . $file);
+ $expectedIcon = new \Imagick(realpath(dirname(__FILE__)). '/data/' . $file);
$actualIcon = $this->iconBuilder->getFavicon($app);
$icon = new \Imagick();
diff --git a/apps/theming/tests/UtilTest.php b/apps/theming/tests/UtilTest.php
index d9085e523f0..4c9f9f10c97 100644
--- a/apps/theming/tests/UtilTest.php
+++ b/apps/theming/tests/UtilTest.php
@@ -103,22 +103,22 @@ class UtilTest extends TestCase {
}
public function testElementColorDefaultBlack() {
- $elementColor = $this->util->elementColor("#000000");
+ $elementColor = $this->util->elementColor('#000000');
$this->assertEquals('#4d4d4d', $elementColor);
}
public function testElementColorDefaultWhite() {
- $elementColor = $this->util->elementColor("#ffffff");
+ $elementColor = $this->util->elementColor('#ffffff');
$this->assertEquals('#b3b3b3', $elementColor);
}
public function testElementColorBlackOnDarkBackground() {
- $elementColor = $this->util->elementColor("#000000", false);
+ $elementColor = $this->util->elementColor('#000000', false);
$this->assertEquals('#4d4d4d', $elementColor);
}
public function testElementColorBlackOnBrightBackground() {
- $elementColor = $this->util->elementColor("#000000", true);
+ $elementColor = $this->util->elementColor('#000000', true);
$this->assertEquals('#000000', $elementColor);
}
@@ -206,8 +206,8 @@ class UtilTest extends TestCase {
}
public function testColorizeSvg() {
- $input = "#0082c9 #0082C9 #000000 #FFFFFF";
- $expected = "#AAAAAA #AAAAAA #000000 #FFFFFF";
+ $input = '#0082c9 #0082C9 #000000 #FFFFFF';
+ $expected = '#AAAAAA #AAAAAA #000000 #FFFFFF';
$result = $this->util->colorizeSvg($input, '#AAAAAA');
$this->assertEquals($expected, $result);
}
diff --git a/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170926101419.php b/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170926101419.php
index d8ac73def1e..d19fda49182 100644
--- a/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170926101419.php
+++ b/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170926101419.php
@@ -17,7 +17,7 @@ class Version1002Date20170926101419 extends BigIntMigration {
/**
* @return array Returns an array with the following structure
- * ['table1' => ['column1', 'column2'], ...]
+ * ['table1' => ['column1', 'column2'], ...]
* @since 13.0.0
*/
protected function getColumnsByTable() {
diff --git a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php
index b8a44d64a74..8b2714227cd 100644
--- a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php
@@ -21,10 +21,10 @@ use Test\TestCase;
class RememberBackupCodesJobTest extends TestCase {
- /** @var IRegistry|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IRegistry|\PHPUnit\Framework\MockObject\MockObject */
private $registry;
- /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
private $userManager;
/** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */
diff --git a/apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php b/apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php
index f64f5735d77..ffeb5fd1e15 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php
@@ -40,7 +40,7 @@ class BackupCodesProviderTest extends TestCase {
protected function setUp(): void {
parent::setUp();
- $this->appName = "twofactor_backupcodes";
+ $this->appName = 'twofactor_backupcodes';
$this->storage = $this->createMock(BackupCodeStorage::class);
$this->l10n = $this->createMock(IL10N::class);
$this->appManager = $this->createMock(AppManager::class);
diff --git a/apps/updatenotification/lib/Notification/Notifier.php b/apps/updatenotification/lib/Notification/Notifier.php
index 6f1e8514b11..ce7d2a6a62b 100644
--- a/apps/updatenotification/lib/Notification/Notifier.php
+++ b/apps/updatenotification/lib/Notification/Notifier.php
@@ -103,7 +103,7 @@ class Notifier implements INotifier {
$l = $this->l10NFactory->get('updatenotification', $languageCode);
if ($notification->getSubject() === 'connection_error') {
- $errors = (int) $this->config->getAppValue('updatenotification', 'update_check_errors', '0');
+ $errors = (int)$this->config->getAppValue('updatenotification', 'update_check_errors', '0');
if ($errors === 0) {
throw new AlreadyProcessedException();
}
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index b8bee8a3ef7..b97079610b4 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -121,10 +121,10 @@ class Access extends LDAPUtility {
*
* @param string $dn the record in question
* @param string $attr the attribute that shall be retrieved
- * if empty, just check the record's existence
+ * if empty, just check the record's existence
* @param string $filter
* @return array|false an array of values on success or an empty
- * array if $attr is empty, false otherwise
+ * array if $attr is empty, false otherwise
* @throws ServerNotAvailableException
*/
public function readAttribute(string $dn, string $attr, string $filter = 'objectClass=*') {
@@ -729,7 +729,7 @@ class Access extends LDAPUtility {
* "Developers"
*/
private function _createAltInternalOwnCloudNameForGroups(string $name) {
- $usedNames = $this->getGroupMapper()->getNamesBySearch($name, "", '_%');
+ $usedNames = $this->getGroupMapper()->getNamesBySearch($name, '', '_%');
if (count($usedNames) === 0) {
$lastNo = 1; //will become name_2
} else {
@@ -1035,7 +1035,7 @@ class Access extends LDAPUtility {
* @param int|null $limit optional, maximum results to be counted
* @param int|null $offset optional, a starting point
* @return array|false array with the search result as first value and pagedSearchOK as
- * second | false if not successful
+ * second | false if not successful
* @throws ServerNotAvailableException
*/
private function executeSearch(
@@ -1074,7 +1074,7 @@ class Access extends LDAPUtility {
* @param int $limit maximum results to be counted
* @param bool $pagedSearchOK whether a paged search has been executed
* @param bool $skipHandling required for paged search when cookies to
- * prior results need to be gained
+ * prior results need to be gained
* @return bool cookie validity, true if we have more pages, false otherwise.
* @throws ServerNotAvailableException
*/
@@ -1124,11 +1124,11 @@ class Access extends LDAPUtility {
* @param string $filter the LDAP filter for the search
* @param array $bases an array containing the LDAP subtree(s) that shall be searched
* @param ?string[] $attr optional, array, one or more attributes that shall be
- * retrieved. Results will according to the order in the array.
+ * retrieved. Results will according to the order in the array.
* @param int $limit maximum results to be counted, 0 means no limit
* @param int $offset a starting point, defaults to 0
* @param bool $skipHandling indicates whether the pages search operation is
- * completed
+ * completed
* @return int|false Integer or false if the search could not be initialized
* @throws ServerNotAvailableException
*/
@@ -1374,7 +1374,7 @@ class Access extends LDAPUtility {
*
* @param string[] $filters the filters to connect
* @return string the combined filter
- * Combines Filter arguments with OR
+ * Combines Filter arguments with OR
*/
public function combineFilterWithOr($filters) {
return $this->combineFilter($filters, '|');
@@ -1429,7 +1429,7 @@ class Access extends LDAPUtility {
*
* @param string $search the search term
* @param string[]|null|'' $searchAttributes needs to have at least two attributes,
- * otherwise it does not make sense :)
+ * otherwise it does not make sense :)
* @return string the final filter part to use in LDAP searches
* @throws DomainException
*/
@@ -1457,7 +1457,7 @@ class Access extends LDAPUtility {
* @param string $search the search term
* @param string[]|null|'' $searchAttributes
* @param string $fallbackAttribute a fallback attribute in case the user
- * did not define search attributes. Typically the display name attribute.
+ * did not define search attributes. Typically the display name attribute.
* @return string the final filter part to use in LDAP searches
*/
private function getFilterPartForSearch(string $search, $searchAttributes, string $fallbackAttribute): string {
diff --git a/apps/user_ldap/lib/Command/SetConfig.php b/apps/user_ldap/lib/Command/SetConfig.php
index 66a79d8c439..3a2bc4437e3 100644
--- a/apps/user_ldap/lib/Command/SetConfig.php
+++ b/apps/user_ldap/lib/Command/SetConfig.php
@@ -44,7 +44,7 @@ class SetConfig extends Command {
$availableConfigs = $helper->getServerConfigurationPrefixes();
$configID = $input->getArgument('configID');
if (!in_array($configID, $availableConfigs)) {
- $output->writeln("Invalid configID");
+ $output->writeln('Invalid configID');
return self::FAILURE;
}
diff --git a/apps/user_ldap/lib/Command/ShowConfig.php b/apps/user_ldap/lib/Command/ShowConfig.php
index 933d1129d42..fa021192ac4 100644
--- a/apps/user_ldap/lib/Command/ShowConfig.php
+++ b/apps/user_ldap/lib/Command/ShowConfig.php
@@ -54,7 +54,7 @@ class ShowConfig extends Base {
if (!is_null($configID)) {
$configIDs[] = $configID;
if (!in_array($configIDs[0], $availableConfigs)) {
- $output->writeln("Invalid configID");
+ $output->writeln('Invalid configID');
return self::FAILURE;
}
} else {
diff --git a/apps/user_ldap/lib/Command/UpdateUUID.php b/apps/user_ldap/lib/Command/UpdateUUID.php
index acf4acbe7d5..93dcc37bada 100644
--- a/apps/user_ldap/lib/Command/UpdateUUID.php
+++ b/apps/user_ldap/lib/Command/UpdateUUID.php
@@ -266,7 +266,7 @@ class UpdateUUID extends Command {
protected function handleMappingBasedUpdates(bool $invalidatedOnly): \Generator {
$limit = 1000;
- /** @var AbstractMapping $mapping*/
+ /** @var AbstractMapping $mapping */
foreach ([$this->userMapping, $this->groupMapping] as $mapping) {
$offset = 0;
do {
diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php
index 612a46d618e..29dd2afc0b3 100644
--- a/apps/user_ldap/lib/Configuration.php
+++ b/apps/user_ldap/lib/Configuration.php
@@ -216,7 +216,7 @@ class Configuration {
* from configuration. It does not save the configuration! To do so, you
* must call saveConfiguration afterwards.
* @param array $config array that holds the config parameters in an associated
- * array
+ * array
* @param array &$applied optional; array where the set fields will be given to
*/
public function setConfiguration(array $config, ?array &$applied = null): void {
@@ -463,7 +463,7 @@ class Configuration {
/**
* @return array an associative array with the default values. Keys are correspond
- * to config-value entries in the database table
+ * to config-value entries in the database table
*/
public function getDefaults(): array {
return [
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index c36229f59e5..d0ec1e447cc 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -112,7 +112,7 @@ class Connection extends LDAPUtility {
*/
protected $cache = null;
- /** @var Configuration settings handler **/
+ /** @var Configuration settings handler * */
protected $configuration;
/**
@@ -313,7 +313,7 @@ class Connection extends LDAPUtility {
/**
* Caches the general LDAP configuration.
* @param bool $force optional. true, if the re-read should be forced. defaults
- * to false.
+ * to false.
*/
private function readConfiguration(bool $force = false): void {
if ((!$this->configured || $force) && !is_null($this->configID)) {
diff --git a/apps/user_ldap/lib/Controller/RenewPasswordController.php b/apps/user_ldap/lib/Controller/RenewPasswordController.php
index 574e85b4fde..2b76858d127 100644
--- a/apps/user_ldap/lib/Controller/RenewPasswordController.php
+++ b/apps/user_ldap/lib/Controller/RenewPasswordController.php
@@ -127,7 +127,7 @@ class RenewPasswordController extends Controller {
try {
if (!is_null($newPassword) && \OC_User::setPassword($user, $newPassword)) {
$this->session->set('loginMessages', [
- [], [$this->l10n->t("Please login with the new password")]
+ [], [$this->l10n->t('Please login with the new password')]
]);
$this->config->setUserValue($user, 'user_ldap', 'needsPasswordReset', 'false');
return new RedirectResponse($this->urlGenerator->linkToRoute('core.login.showLoginForm', $args));
diff --git a/apps/user_ldap/lib/GroupPluginManager.php b/apps/user_ldap/lib/GroupPluginManager.php
index 16fdcc5228c..fca9f37d092 100644
--- a/apps/user_ldap/lib/GroupPluginManager.php
+++ b/apps/user_ldap/lib/GroupPluginManager.php
@@ -41,7 +41,7 @@ class GroupPluginManager {
foreach ($this->which as $action => $v) {
if ((bool)($respondToActions & $action)) {
$this->which[$action] = $plugin;
- \OCP\Server::get(LoggerInterface::class)->debug("Registered action ".$action." to plugin ".get_class($plugin), ['app' => 'user_ldap']);
+ \OCP\Server::get(LoggerInterface::class)->debug('Registered action '.$action.' to plugin '.get_class($plugin), ['app' => 'user_ldap']);
}
}
}
diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php
index ba75df02111..d4d67b546d6 100644
--- a/apps/user_ldap/lib/Group_LDAP.php
+++ b/apps/user_ldap/lib/Group_LDAP.php
@@ -1258,7 +1258,7 @@ class Group_LDAP extends ABackend implements GroupInterface, IGroupLDAP, IGetDis
if ($ret = $this->groupPluginManager->deleteGroup($gid)) {
// Delete group in nextcloud internal db
$this->access->getGroupMapper()->unmap($gid);
- $this->access->connection->writeToCache("groupExists" . $gid, false);
+ $this->access->connection->writeToCache('groupExists' . $gid, false);
}
return $ret;
}
@@ -1272,7 +1272,7 @@ class Group_LDAP extends ABackend implements GroupInterface, IGroupLDAP, IGetDis
if (!$this->groupExists($gid)) {
// The group does not exist in the LDAP, remove the mapping
$this->access->getGroupMapper()->unmap($gid);
- $this->access->connection->writeToCache("groupExists" . $gid, false);
+ $this->access->connection->writeToCache('groupExists' . $gid, false);
return true;
}
diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php
index cd35f86db77..1a78a65e61e 100644
--- a/apps/user_ldap/lib/Group_Proxy.php
+++ b/apps/user_ldap/lib/Group_Proxy.php
@@ -252,7 +252,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
*/
public function getGroupsDetails(array $gids): array {
if (!($this instanceof IGroupDetailsBackend || $this->implementsActions(GroupInterface::GROUP_DETAILS))) {
- throw new \Exception("Should not have been called");
+ throw new \Exception('Should not have been called');
}
$groupData = [];
diff --git a/apps/user_ldap/lib/Helper.php b/apps/user_ldap/lib/Helper.php
index c9d0cd1773d..9bca3eec26b 100644
--- a/apps/user_ldap/lib/Helper.php
+++ b/apps/user_ldap/lib/Helper.php
@@ -29,7 +29,7 @@ class Helper {
* returns prefixes for each saved LDAP/AD server configuration.
*
* @param bool $activeConfigurations optional, whether only active configuration shall be
- * retrieved, defaults to false
+ * retrieved, defaults to false
* @return array with a list of the available prefixes
*
* Configuration prefixes are used to set up configurations for n LDAP or
diff --git a/apps/user_ldap/lib/Jobs/Sync.php b/apps/user_ldap/lib/Jobs/Sync.php
index f0122733b62..b8b79218144 100644
--- a/apps/user_ldap/lib/Jobs/Sync.php
+++ b/apps/user_ldap/lib/Jobs/Sync.php
@@ -24,23 +24,23 @@ use Psr\Log\LoggerInterface;
class Sync extends TimedJob {
public const MAX_INTERVAL = 12 * 60 * 60; // 12h
public const MIN_INTERVAL = 30 * 60; // 30min
- /** @var Helper */
+ /** @var Helper */
protected $ldapHelper;
- /** @var LDAP */
+ /** @var LDAP */
protected $ldap;
/** @var UserMapping */
protected $mapper;
- /** @var IConfig */
+ /** @var IConfig */
protected $config;
- /** @var IAvatarManager */
+ /** @var IAvatarManager */
protected $avatarManager;
- /** @var IDBConnection */
+ /** @var IDBConnection */
protected $dbc;
- /** @var IUserManager */
+ /** @var IUserManager */
protected $ncUserManager;
- /** @var LoggerInterface */
+ /** @var LoggerInterface */
protected $logger;
- /** @var IManager */
+ /** @var IManager */
protected $notificationManager;
/** @var ConnectionFactory */
protected $connectionFactory;
@@ -101,7 +101,7 @@ class Sync extends TimedJob {
$this->setArgument($argument);
$isBackgroundJobModeAjax = $this->config
- ->getAppValue('core', 'backgroundjobs_mode', 'ajax') === 'ajax';
+ ->getAppValue('core', 'backgroundjobs_mode', 'ajax') === 'ajax';
if ($isBackgroundJobModeAjax) {
return;
}
diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php
index c29b8857e51..048dba732d5 100644
--- a/apps/user_ldap/lib/LDAP.php
+++ b/apps/user_ldap/lib/LDAP.php
@@ -312,8 +312,8 @@ class LDAP implements ILDAPWrapper {
if ($this->isResource($item)) {
return '(resource)';
}
- if (isset($item[0]['value']['cookie']) && $item[0]['value']['cookie'] !== "") {
- $item[0]['value']['cookie'] = "*opaque cookie*";
+ if (isset($item[0]['value']['cookie']) && $item[0]['value']['cookie'] !== '') {
+ $item[0]['value']['cookie'] = '*opaque cookie*';
}
return $item;
}, $this->curArgs);
diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php
index 79d23b8d618..94ac3c985ca 100644
--- a/apps/user_ldap/lib/Mapping/AbstractMapping.php
+++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php
@@ -259,7 +259,7 @@ abstract class AbstractMapping {
*
* @return string[]
*/
- public function getNamesBySearch(string $search, string $prefixMatch = "", string $postfixMatch = ""): array {
+ public function getNamesBySearch(string $search, string $prefixMatch = '', string $postfixMatch = ''): array {
$statement = $this->dbc->prepare('
SELECT `owncloud_name`
FROM `' . $this->getTableName() . '`
@@ -406,7 +406,7 @@ abstract class AbstractMapping {
* @param callable $preCallback
* @param callable $postCallback
* @return bool true on success, false when at least one row was not
- * deleted
+ * deleted
*/
public function clearCb(callable $preCallback, callable $postCallback): bool {
$picker = $this->dbc->getQueryBuilder();
diff --git a/apps/user_ldap/lib/Notification/Notifier.php b/apps/user_ldap/lib/Notification/Notifier.php
index ca0fa6f0335..23ad77f75f2 100644
--- a/apps/user_ldap/lib/Notification/Notifier.php
+++ b/apps/user_ldap/lib/Notification/Notifier.php
@@ -61,7 +61,7 @@ class Notifier implements INotifier {
// Deal with known subjects
case 'pwd_exp_warn_days':
$params = $notification->getSubjectParameters();
- $days = (int) $params[0];
+ $days = (int)$params[0];
if ($days === 2) {
$notification->setParsedSubject($l->t('Your password will expire tomorrow.'));
} elseif ($days === 1) {
diff --git a/apps/user_ldap/lib/Settings/Admin.php b/apps/user_ldap/lib/Settings/Admin.php
index a1de0a65362..71532846b91 100644
--- a/apps/user_ldap/lib/Settings/Admin.php
+++ b/apps/user_ldap/lib/Settings/Admin.php
@@ -70,8 +70,8 @@ class Admin implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/user_ldap/lib/Settings/Section.php b/apps/user_ldap/lib/Settings/Section.php
index 2c8871db9ce..e26d85d8771 100644
--- a/apps/user_ldap/lib/Settings/Section.php
+++ b/apps/user_ldap/lib/Settings/Section.php
@@ -46,8 +46,8 @@ class Section implements IIconSection {
/**
* @return int whether the form should be rather on the top or bottom of
- * the settings navigation. The sections are arranged in ascending order of
- * the priority values. It is required to return a value between 0 and 99.
+ * the settings navigation. The sections are arranged in ascending order of
+ * the priority values. It is required to return a value between 0 and 99.
*
* E.g.: 70
*/
diff --git a/apps/user_ldap/lib/User/Manager.php b/apps/user_ldap/lib/User/Manager.php
index c76f217a95a..c2365f55432 100644
--- a/apps/user_ldap/lib/User/Manager.php
+++ b/apps/user_ldap/lib/User/Manager.php
@@ -119,7 +119,7 @@ class Manager {
* email, displayname, or others.
*
* @param bool $minimal - optional, set to true to skip attributes with big
- * payload
+ * payload
* @return string[]
*/
public function getAttributes($minimal = false) {
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index 53e2e2a983d..b500c72ca98 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -229,12 +229,12 @@ class User {
$attr = strtolower($this->connection->ldapAttributePhone);
if (!empty($attr)) { // attribute configured
$profileValues[\OCP\Accounts\IAccountManager::PROPERTY_PHONE]
- = $ldapEntry[$attr][0] ?? "";
+ = $ldapEntry[$attr][0] ?? '';
}
//User Profile Field - website
$attr = strtolower($this->connection->ldapAttributeWebsite);
if (isset($ldapEntry[$attr])) {
- $cutPosition = strpos($ldapEntry[$attr][0], " ");
+ $cutPosition = strpos($ldapEntry[$attr][0], ' ');
if ($cutPosition) {
// drop appended label
$profileValues[\OCP\Accounts\IAccountManager::PROPERTY_WEBSITE]
@@ -244,7 +244,7 @@ class User {
= $ldapEntry[$attr][0];
}
} elseif (!empty($attr)) { // configured, but not defined
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_WEBSITE] = "";
+ $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_WEBSITE] = '';
}
//User Profile Field - Address
$attr = strtolower($this->connection->ldapAttributeAddress);
@@ -252,43 +252,43 @@ class User {
if (str_contains($ldapEntry[$attr][0], '$')) {
// basic format conversion from postalAddress syntax to commata delimited
$profileValues[\OCP\Accounts\IAccountManager::PROPERTY_ADDRESS]
- = str_replace('$', ", ", $ldapEntry[$attr][0]);
+ = str_replace('$', ', ', $ldapEntry[$attr][0]);
} else {
$profileValues[\OCP\Accounts\IAccountManager::PROPERTY_ADDRESS]
= $ldapEntry[$attr][0];
}
} elseif (!empty($attr)) { // configured, but not defined
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_ADDRESS] = "";
+ $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_ADDRESS] = '';
}
//User Profile Field - Twitter
$attr = strtolower($this->connection->ldapAttributeTwitter);
if (!empty($attr)) {
$profileValues[\OCP\Accounts\IAccountManager::PROPERTY_TWITTER]
- = $ldapEntry[$attr][0] ?? "";
+ = $ldapEntry[$attr][0] ?? '';
}
//User Profile Field - fediverse
$attr = strtolower($this->connection->ldapAttributeFediverse);
if (!empty($attr)) {
$profileValues[\OCP\Accounts\IAccountManager::PROPERTY_FEDIVERSE]
- = $ldapEntry[$attr][0] ?? "";
+ = $ldapEntry[$attr][0] ?? '';
}
//User Profile Field - organisation
$attr = strtolower($this->connection->ldapAttributeOrganisation);
if (!empty($attr)) {
$profileValues[\OCP\Accounts\IAccountManager::PROPERTY_ORGANISATION]
- = $ldapEntry[$attr][0] ?? "";
+ = $ldapEntry[$attr][0] ?? '';
}
//User Profile Field - role
$attr = strtolower($this->connection->ldapAttributeRole);
if (!empty($attr)) {
$profileValues[\OCP\Accounts\IAccountManager::PROPERTY_ROLE]
- = $ldapEntry[$attr][0] ?? "";
+ = $ldapEntry[$attr][0] ?? '';
}
//User Profile Field - headline
$attr = strtolower($this->connection->ldapAttributeHeadline);
if (!empty($attr)) {
$profileValues[\OCP\Accounts\IAccountManager::PROPERTY_HEADLINE]
- = $ldapEntry[$attr][0] ?? "";
+ = $ldapEntry[$attr][0] ?? '';
}
//User Profile Field - biography
$attr = strtolower($this->connection->ldapAttributeBiography);
@@ -302,7 +302,7 @@ class User {
= $ldapEntry[$attr][0];
}
} elseif (!empty($attr)) { // configured, but not defined
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_BIOGRAPHY] = "";
+ $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_BIOGRAPHY] = '';
}
//User Profile Field - birthday
$attr = strtolower($this->connection->ldapAttributeBirthDate);
@@ -311,7 +311,7 @@ class User {
try {
$birthdate = $this->birthdateParser->parseBirthdate($value);
$profileValues[\OCP\Accounts\IAccountManager::PROPERTY_BIRTHDATE]
- = $birthdate->format("Y-m-d");
+ = $birthdate->format('Y-m-d');
} catch (InvalidArgumentException $e) {
// Invalid date -> just skip the property
$this->logger->info("Failed to parse user's birthdate from LDAP: $value", [
@@ -330,11 +330,11 @@ class User {
$this->updateProfile($profileValues);
$this->logger->info("updated profile uid=$username", ['app' => 'user_ldap']);
} else {
- $this->logger->debug("profile data from LDAP unchanged", ['app' => 'user_ldap', 'uid' => $username]);
+ $this->logger->debug('profile data from LDAP unchanged', ['app' => 'user_ldap', 'uid' => $username]);
}
unset($attr);
} elseif ($profileCached !== null) { // message delayed, to declutter log
- $this->logger->debug("skipping profile check, while cached data exist", ['app' => 'user_ldap', 'uid' => $username]);
+ $this->logger->debug('skipping profile check, while cached data exist', ['app' => 'user_ldap', 'uid' => $username]);
}
//Avatar
@@ -570,7 +570,7 @@ class User {
*
* fetches the quota from LDAP and stores it as Nextcloud user value
* @param ?string $valueFromLDAP the quota attribute's value can be passed,
- * to save the readAttribute request
+ * to save the readAttribute request
* @return void
*/
public function updateQuota($valueFromLDAP = null) {
@@ -880,7 +880,7 @@ class User {
->setUser($uid)
->setDateTime($currentDateTime)
->setObject('pwd_exp_warn', $uid)
- ->setSubject('pwd_exp_warn_days', [(int) ceil($secondsToExpiry / 60 / 60 / 24)])
+ ->setSubject('pwd_exp_warn_days', [(int)ceil($secondsToExpiry / 60 / 60 / 24)])
;
$this->notificationManager->notify($notification);
}
diff --git a/apps/user_ldap/lib/UserPluginManager.php b/apps/user_ldap/lib/UserPluginManager.php
index 70e477946b8..ddf23ddfe3e 100644
--- a/apps/user_ldap/lib/UserPluginManager.php
+++ b/apps/user_ldap/lib/UserPluginManager.php
@@ -43,12 +43,12 @@ class UserPluginManager {
foreach ($this->which as $action => $v) {
if (is_int($action) && (bool)($respondToActions & $action)) {
$this->which[$action] = $plugin;
- \OCP\Server::get(LoggerInterface::class)->debug("Registered action ".$action." to plugin ".get_class($plugin), ['app' => 'user_ldap']);
+ \OCP\Server::get(LoggerInterface::class)->debug('Registered action '.$action.' to plugin '.get_class($plugin), ['app' => 'user_ldap']);
}
}
if (method_exists($plugin, 'deleteUser')) {
$this->which['deleteUser'] = $plugin;
- \OCP\Server::get(LoggerInterface::class)->debug("Registered action deleteUser to plugin ".get_class($plugin), ['app' => 'user_ldap']);
+ \OCP\Server::get(LoggerInterface::class)->debug('Registered action deleteUser to plugin '.get_class($plugin), ['app' => 'user_ldap']);
}
}
diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php
index 7d4cd7ca634..8d29d7c7588 100644
--- a/apps/user_ldap/lib/User_LDAP.php
+++ b/apps/user_ldap/lib/User_LDAP.php
@@ -259,7 +259,7 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I
* checks whether a user is still available on LDAP
*
* @param string|\OCA\User_LDAP\User\User $user either the Nextcloud user
- * name or an instance of that user
+ * name or an instance of that user
* @throws \Exception
* @throws \OC\ServerNotAvailableException
*/
@@ -464,7 +464,7 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I
$this->access->connection->writeToCache($cacheKey, $displayName);
}
if ($user instanceof OfflineUser) {
- /** @var OfflineUser $user*/
+ /** @var OfflineUser $user */
$displayName = $user->getDisplayName();
}
return $displayName;
@@ -622,10 +622,10 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I
);
}
} else {
- throw new \UnexpectedValueException("LDAP Plugin: Method createUser changed to return the user DN instead of boolean.");
+ throw new \UnexpectedValueException('LDAP Plugin: Method createUser changed to return the user DN instead of boolean.');
}
}
- return (bool) $dn;
+ return (bool)$dn;
}
return false;
}
diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php
index d3197296d7c..0cb0e6e6cde 100644
--- a/apps/user_ldap/lib/User_Proxy.php
+++ b/apps/user_ldap/lib/User_Proxy.php
@@ -221,7 +221,7 @@ class User_Proxy extends Proxy implements IUserBackend, UserInterface, IUserLDAP
* check if a user exists on LDAP
*
* @param string|\OCA\User_LDAP\User\User $user either the Nextcloud user
- * name or an instance of that user
+ * name or an instance of that user
*/
public function userExistsOnLDAP($user, bool $ignoreCache = false): bool {
$id = ($user instanceof User) ? $user->getUsername() : $user;
diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php
index 3720b509068..fd5f12ce0cf 100644
--- a/apps/user_ldap/lib/Wizard.php
+++ b/apps/user_ldap/lib/Wizard.php
@@ -858,8 +858,8 @@ class Wizard extends LDAPUtility {
/**
* creates an LDAP Filter from given configuration
* @param int $filterType int, for which use case the filter shall be created
- * can be any of self::LFILTER_USER_LIST, self::LFILTER_LOGIN or
- * self::LFILTER_GROUP_LIST
+ * can be any of self::LFILTER_USER_LIST, self::LFILTER_LOGIN or
+ * self::LFILTER_GROUP_LIST
* @throws \Exception
*/
private function composeLdapFilter(int $filterType): string {
@@ -1114,9 +1114,9 @@ class Wizard extends LDAPUtility {
* @param string[] $filters array, the filters that shall be used in the search
* @param string $attr the attribute of which a list of values shall be returned
* @param int $dnReadLimit the amount of how many DNs should be analyzed.
- * The lower, the faster
+ * The lower, the faster
* @param string $maxF string. if not null, this variable will have the filter that
- * yields most result entries
+ * yields most result entries
* @return array|false an array with the values on success, false otherwise
*/
public function cumulativeSearchOnAttribute(array $filters, string $attr, int $dnReadLimit = 3, ?string &$maxF = null) {
@@ -1190,9 +1190,9 @@ class Wizard extends LDAPUtility {
* @param string $attr the attribute to look for
* @param string $dbkey the dbkey of the setting the feature is connected to
* @param string $confkey the confkey counterpart for the $dbkey as used in the
- * Configuration class
+ * Configuration class
* @param bool $po whether the objectClass with most result entries
- * shall be pre-selected via the result
+ * shall be pre-selected via the result
* @return array list of found items.
* @throws \Exception
*/
@@ -1244,7 +1244,7 @@ class Wizard extends LDAPUtility {
* @param string $attribute the attribute values to look for
* @param array &$known new values will be appended here
* @return int state on of the class constants LRESULT_PROCESSED_OK,
- * LRESULT_PROCESSED_INVALID or LRESULT_PROCESSED_SKIP
+ * LRESULT_PROCESSED_INVALID or LRESULT_PROCESSED_SKIP
*/
private function getAttributeValuesFromEntry(array $result, string $attribute, array &$known): int {
if (!isset($result['count'])
diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php
index 941aa51fc31..01219fb9f81 100644
--- a/apps/user_ldap/tests/AccessTest.php
+++ b/apps/user_ldap/tests/AccessTest.php
@@ -51,7 +51,7 @@ class AccessTest extends TestCase {
private $userManager;
/** @var Helper|\PHPUnit\Framework\MockObject\MockObject */
private $helper;
- /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
private $config;
/** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
private $ncUserManager;
diff --git a/apps/user_ldap/tests/ConnectionTest.php b/apps/user_ldap/tests/ConnectionTest.php
index 1054448198b..dfa3cf6beda 100644
--- a/apps/user_ldap/tests/ConnectionTest.php
+++ b/apps/user_ldap/tests/ConnectionTest.php
@@ -18,10 +18,10 @@ use OCA\User_LDAP\ILDAPWrapper;
* @package OCA\User_LDAP\Tests
*/
class ConnectionTest extends \Test\TestCase {
- /** @var \OCA\User_LDAP\ILDAPWrapper|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var \OCA\User_LDAP\ILDAPWrapper|\PHPUnit\Framework\MockObject\MockObject */
protected $ldap;
- /** @var Connection */
+ /** @var Connection */
protected $connection;
protected function setUp(): void {
diff --git a/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php
index ef84beb8f56..fd24fe8a891 100644
--- a/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php
+++ b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php
@@ -20,10 +20,10 @@ use OCP\Share\IManager;
use Psr\Log\LoggerInterface;
abstract class AbstractIntegrationTest {
- /** @var LDAP */
+ /** @var LDAP */
protected $ldap;
- /** @var Connection */
+ /** @var Connection */
protected $connection;
/** @var Access */
@@ -35,7 +35,7 @@ abstract class AbstractIntegrationTest {
/** @var Helper */
protected $helper;
- /** @var string */
+ /** @var string */
protected $base;
/** @var string[] */
diff --git a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php
index 7dc2aa00065..f42c6d4bccd 100644
--- a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php
+++ b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php
@@ -21,28 +21,28 @@ use OCA\User_LDAP\LDAP;
*
*/
class ExceptionOnLostConnection {
- /** @var string */
+ /** @var string */
private $toxiProxyHost;
- /** @var string */
+ /** @var string */
private $toxiProxyName;
- /** @var string */
+ /** @var string */
private $ldapBase;
- /** @var string|null */
+ /** @var string|null */
private $ldapBindDN;
- /** @var string|null */
+ /** @var string|null */
private $ldapBindPwd;
- /** @var string */
+ /** @var string */
private $ldapHost;
- /** @var \OCA\User_LDAP\LDAP */
+ /** @var \OCA\User_LDAP\LDAP */
private $ldap;
- /** @var bool */
+ /** @var bool */
private $originalProxyState;
/**
@@ -117,10 +117,10 @@ class ExceptionOnLostConnection {
try {
$this->ldap->search($cr, $this->ldapBase, 'objectClass=*', ['dn'], true, 5);
} catch (ServerNotAvailableException $e) {
- print("Test PASSED" . PHP_EOL);
+ print('Test PASSED' . PHP_EOL);
exit(0);
}
- print("Test FAILED" . PHP_EOL);
+ print('Test FAILED' . PHP_EOL);
exit(1);
}
diff --git a/apps/user_ldap/tests/Integration/Lib/IntegrationTestFetchUsersByLoginName.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestFetchUsersByLoginName.php
index 2a8ff26865d..fe7a3d2226a 100644
--- a/apps/user_ldap/tests/Integration/Lib/IntegrationTestFetchUsersByLoginName.php
+++ b/apps/user_ldap/tests/Integration/Lib/IntegrationTestFetchUsersByLoginName.php
@@ -17,7 +17,7 @@ use Psr\Log\LoggerInterface;
require_once __DIR__ . '/../Bootstrap.php';
class IntegrationTestFetchUsersByLoginName extends AbstractIntegrationTest {
- /** @var UserMapping */
+ /** @var UserMapping */
protected $mapping;
/** @var User_LDAP */
diff --git a/apps/user_ldap/tests/Integration/Lib/IntegrationTestPaging.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestPaging.php
index 56095a2da8b..e7b68735f6e 100644
--- a/apps/user_ldap/tests/Integration/Lib/IntegrationTestPaging.php
+++ b/apps/user_ldap/tests/Integration/Lib/IntegrationTestPaging.php
@@ -17,7 +17,7 @@ use Psr\Log\LoggerInterface;
require_once __DIR__ . '/../Bootstrap.php';
class IntegrationTestPaging extends AbstractIntegrationTest {
- /** @var UserMapping */
+ /** @var UserMapping */
protected $mapping;
/** @var User_LDAP */
diff --git a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php
index df7dfe6b099..082c8ee46d4 100644
--- a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php
+++ b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php
@@ -22,7 +22,7 @@ use Psr\Log\LoggerInterface;
require_once __DIR__ . '/../../Bootstrap.php';
class IntegrationTestUserAvatar extends AbstractIntegrationTest {
- /** @var UserMapping */
+ /** @var UserMapping */
protected $mapping;
/**
diff --git a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserCleanUp.php b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserCleanUp.php
index a1fc56dc47d..ed637155e5a 100644
--- a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserCleanUp.php
+++ b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserCleanUp.php
@@ -18,7 +18,7 @@ use Psr\Log\LoggerInterface;
require_once __DIR__ . '/../../Bootstrap.php';
class IntegrationTestUserCleanUp extends AbstractIntegrationTest {
- /** @var UserMapping */
+ /** @var UserMapping */
protected $mapping;
/**
diff --git a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserDisplayName.php b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserDisplayName.php
index 846d9d803f4..e8f94dac419 100644
--- a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserDisplayName.php
+++ b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserDisplayName.php
@@ -17,7 +17,7 @@ use Psr\Log\LoggerInterface;
require_once __DIR__ . '/../../Bootstrap.php';
class IntegrationTestUserDisplayName extends AbstractIntegrationTest {
- /** @var UserMapping */
+ /** @var UserMapping */
protected $mapping;
/**
diff --git a/apps/user_ldap/tests/Jobs/SyncTest.php b/apps/user_ldap/tests/Jobs/SyncTest.php
index 850e1ed42a4..0f5f045ac7f 100644
--- a/apps/user_ldap/tests/Jobs/SyncTest.php
+++ b/apps/user_ldap/tests/Jobs/SyncTest.php
@@ -23,27 +23,27 @@ use OCP\Notification\IManager;
use Test\TestCase;
class SyncTest extends TestCase {
- /** @var array */
+ /** @var array */
protected $arguments;
- /** @var Helper|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var Helper|\PHPUnit\Framework\MockObject\MockObject */
protected $helper;
- /** @var LDAP|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LDAP|\PHPUnit\Framework\MockObject\MockObject */
protected $ldapWrapper;
- /** @var Manager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var Manager|\PHPUnit\Framework\MockObject\MockObject */
protected $userManager;
- /** @var UserMapping|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var UserMapping|\PHPUnit\Framework\MockObject\MockObject */
protected $mapper;
- /** @var Sync */
+ /** @var Sync */
protected $sync;
- /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
protected $config;
- /** @var IAvatarManager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IAvatarManager|\PHPUnit\Framework\MockObject\MockObject */
protected $avatarManager;
- /** @var IDBConnection|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IDBConnection|\PHPUnit\Framework\MockObject\MockObject */
protected $dbc;
- /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
protected $ncUserManager;
- /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
protected $notificationManager;
/** @var ConnectionFactory|\PHPUnit\Framework\MockObject\MockObject */
protected $connectionFactory;
diff --git a/apps/user_ldap/tests/LDAPProviderTest.php b/apps/user_ldap/tests/LDAPProviderTest.php
index 6e6c62157b3..d240b6d65c5 100644
--- a/apps/user_ldap/tests/LDAPProviderTest.php
+++ b/apps/user_ldap/tests/LDAPProviderTest.php
@@ -31,9 +31,9 @@ class LDAPProviderTest extends \Test\TestCase {
private function getServerMock(IUserLDAP $userBackend, IGroupLDAP $groupBackend) {
$server = $this->getMockBuilder('OC\Server')
- ->setMethods(['getUserManager', 'getBackends', 'getGroupManager'])
- ->setConstructorArgs(['', new \OC\Config(\OC::$configDir)])
- ->getMock();
+ ->setMethods(['getUserManager', 'getBackends', 'getGroupManager'])
+ ->setConstructorArgs(['', new \OC\Config(\OC::$configDir)])
+ ->getMock();
$server->expects($this->any())
->method('getUserManager')
->willReturn($this->getUserManagerMock($userBackend));
@@ -92,9 +92,9 @@ class LDAPProviderTest extends \Test\TestCase {
$this->expectExceptionMessage('User id not found in LDAP');
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods(['userExists'])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods(['userExists'])
+ ->disableOriginalConstructor()
+ ->getMock();
$userBackend->expects($this->any())->method('userExists')->willReturn(false);
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
@@ -105,9 +105,9 @@ class LDAPProviderTest extends \Test\TestCase {
public function testGetUserDN() {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods(['userExists', 'getLDAPAccess', 'username2dn'])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods(['userExists', 'getLDAPAccess', 'username2dn'])
+ ->disableOriginalConstructor()
+ ->getMock();
$userBackend->expects($this->once())
->method('userExists')
->willReturn(true);
@@ -177,9 +177,9 @@ class LDAPProviderTest extends \Test\TestCase {
public function testGetUserName() {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods(['dn2UserName'])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods(['dn2UserName'])
+ ->disableOriginalConstructor()
+ ->getMock();
$userBackend->expects($this->any())
->method('dn2UserName')
->willReturn('existing_user');
@@ -193,9 +193,9 @@ class LDAPProviderTest extends \Test\TestCase {
public function testDNasBaseParameter() {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods([])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods([])
+ ->disableOriginalConstructor()
+ ->getMock();
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
@@ -209,9 +209,9 @@ class LDAPProviderTest extends \Test\TestCase {
public function testSanitizeDN() {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods([])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods([])
+ ->disableOriginalConstructor()
+ ->getMock();
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
@@ -229,9 +229,9 @@ class LDAPProviderTest extends \Test\TestCase {
$this->expectExceptionMessage('User id not found in LDAP');
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods(['userExists'])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods(['userExists'])
+ ->disableOriginalConstructor()
+ ->getMock();
$userBackend->expects($this->any())->method('userExists')->willReturn(false);
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
@@ -242,9 +242,9 @@ class LDAPProviderTest extends \Test\TestCase {
public function testGetLDAPConnection() {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods(['userExists', 'getNewLDAPConnection'])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods(['userExists', 'getNewLDAPConnection'])
+ ->disableOriginalConstructor()
+ ->getMock();
$userBackend->expects($this->any())
->method('userExists')
->willReturn(true);
@@ -312,9 +312,9 @@ class LDAPProviderTest extends \Test\TestCase {
$this->expectExceptionMessage('User id not found in LDAP');
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods(['userExists'])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods(['userExists'])
+ ->disableOriginalConstructor()
+ ->getMock();
$userBackend->expects($this->any())->method('userExists')->willReturn(false);
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
@@ -353,9 +353,9 @@ class LDAPProviderTest extends \Test\TestCase {
->willReturn($dn);
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration'])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration'])
+ ->disableOriginalConstructor()
+ ->getMock();
$userBackend->expects($this->atLeastOnce())
->method('userExists')
->willReturn(true);
@@ -375,9 +375,9 @@ class LDAPProviderTest extends \Test\TestCase {
$this->expectExceptionMessage('User id not found in LDAP');
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods(['userExists'])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods(['userExists'])
+ ->disableOriginalConstructor()
+ ->getMock();
$userBackend->expects($this->any())->method('userExists')->willReturn(false);
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
@@ -409,9 +409,9 @@ class LDAPProviderTest extends \Test\TestCase {
->willReturn($connection);
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration'])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration'])
+ ->disableOriginalConstructor()
+ ->getMock();
$userBackend->expects($this->any())
->method('userExists')
->willReturn(true);
@@ -431,9 +431,9 @@ class LDAPProviderTest extends \Test\TestCase {
$this->expectExceptionMessage('User id not found in LDAP');
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods(['userExists'])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods(['userExists'])
+ ->disableOriginalConstructor()
+ ->getMock();
$userBackend->expects($this->any())->method('userExists')->willReturn(false);
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
@@ -444,9 +444,9 @@ class LDAPProviderTest extends \Test\TestCase {
public function testClearCache() {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'clearCache'])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'clearCache'])
+ ->disableOriginalConstructor()
+ ->getMock();
$userBackend->expects($this->once())
->method('userExists')
->willReturn(true);
@@ -511,9 +511,9 @@ class LDAPProviderTest extends \Test\TestCase {
public function testDnExists() {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods(['dn2UserName'])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods(['dn2UserName'])
+ ->disableOriginalConstructor()
+ ->getMock();
$userBackend->expects($this->any())
->method('dn2UserName')
->willReturn('existing_user');
@@ -526,9 +526,9 @@ class LDAPProviderTest extends \Test\TestCase {
public function testFlagRecord() {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods([])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods([])
+ ->disableOriginalConstructor()
+ ->getMock();
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
@@ -539,9 +539,9 @@ class LDAPProviderTest extends \Test\TestCase {
public function testUnflagRecord() {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
- ->setMethods([])
- ->disableOriginalConstructor()
- ->getMock();
+ ->setMethods([])
+ ->disableOriginalConstructor()
+ ->getMock();
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
diff --git a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
index 7de3825a323..478e5ea0395 100644
--- a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
+++ b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
@@ -67,7 +67,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
* test objects. Preparing environment means that all mappings are cleared
* first and then filled with test entries.
* @return array 0 = \OCA\User_LDAP\Mapping\AbstractMapping, 1 = array of
- * users or groups
+ * users or groups
*/
private function initTest() {
$dbc = \OC::$server->getDatabaseConnection();
diff --git a/apps/user_ldap/tests/Migration/UUIDFixInsertTest.php b/apps/user_ldap/tests/Migration/UUIDFixInsertTest.php
index e3ce332577d..78d119bf566 100644
--- a/apps/user_ldap/tests/Migration/UUIDFixInsertTest.php
+++ b/apps/user_ldap/tests/Migration/UUIDFixInsertTest.php
@@ -14,19 +14,19 @@ use OCP\Migration\IOutput;
use Test\TestCase;
class UUIDFixInsertTest extends TestCase {
- /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
protected $config;
- /** @var UserMapping|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var UserMapping|\PHPUnit\Framework\MockObject\MockObject */
protected $userMapper;
- /** @var GroupMapping|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var GroupMapping|\PHPUnit\Framework\MockObject\MockObject */
protected $groupMapper;
- /** @var IJobList|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IJobList|\PHPUnit\Framework\MockObject\MockObject */
protected $jobList;
- /** @var UUIDFixInsert */
+ /** @var UUIDFixInsert */
protected $job;
protected function setUp(): void {
diff --git a/apps/user_ldap/tests/Service/UpdateGroupsServiceTest.php b/apps/user_ldap/tests/Service/UpdateGroupsServiceTest.php
index 38556ec312f..b80d761b5c6 100644
--- a/apps/user_ldap/tests/Service/UpdateGroupsServiceTest.php
+++ b/apps/user_ldap/tests/Service/UpdateGroupsServiceTest.php
@@ -26,17 +26,17 @@ use Psr\Log\LoggerInterface;
use Test\TestCase;
class UpdateGroupsServiceTest extends TestCase {
- /** @var Group_Proxy|MockObject */
+ /** @var Group_Proxy|MockObject */
protected $groupBackend;
- /** @var IEventDispatcher|MockObject */
+ /** @var IEventDispatcher|MockObject */
protected $dispatcher;
- /** @var IGroupManager|MockObject */
+ /** @var IGroupManager|MockObject */
protected $groupManager;
/** @var IUserManager|MockObject */
protected $userManager;
/** @var LoggerInterface|MockObject */
protected $logger;
- /** @var GroupMembershipMapper|MockObject */
+ /** @var GroupMembershipMapper|MockObject */
protected $groupMembershipMapper;
/** @var IConfig|MockObject */
protected $config;
diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php
index ec5cf03f402..1d4aeb619b6 100644
--- a/apps/user_ldap/tests/User/UserTest.php
+++ b/apps/user_ldap/tests/User/UserTest.php
@@ -29,9 +29,9 @@ use Psr\Log\LoggerInterface;
* @package OCA\User_LDAP\Tests\User
*/
class UserTest extends \Test\TestCase {
- /** @var Access|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var Access|\PHPUnit\Framework\MockObject\MockObject */
protected $access;
- /** @var Connection|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var Connection|\PHPUnit\Framework\MockObject\MockObject */
protected $connection;
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
protected $config;
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php
index 227f13e8538..8424cf912cb 100644
--- a/apps/user_ldap/tests/User_LDAPTest.php
+++ b/apps/user_ldap/tests/User_LDAPTest.php
@@ -38,7 +38,7 @@ class User_LDAPTest extends TestCase {
protected $backend;
/** @var Access|MockObject */
protected $access;
- /** @var OfflineUser|MockObject */
+ /** @var OfflineUser|MockObject */
protected $offlineUser;
/** @var INotificationManager|MockObject */
protected $notificationManager;
@@ -84,25 +84,25 @@ class User_LDAPTest extends TestCase {
private function prepareMockForUserExists() {
$this->access->expects($this->any())
- ->method('username2dn')
- ->willReturnCallback(function ($uid) {
- switch ($uid) {
- case 'gunslinger':
- return 'dnOfRoland,dc=test';
- break;
- case 'formerUser':
- return 'dnOfFormerUser,dc=test';
- break;
- case 'newyorker':
- return 'dnOfNewYorker,dc=test';
- break;
- case 'ladyofshadows':
- return 'dnOfLadyOfShadows,dc=test';
- break;
- default:
- return false;
- }
- });
+ ->method('username2dn')
+ ->willReturnCallback(function ($uid) {
+ switch ($uid) {
+ case 'gunslinger':
+ return 'dnOfRoland,dc=test';
+ break;
+ case 'formerUser':
+ return 'dnOfFormerUser,dc=test';
+ break;
+ case 'newyorker':
+ return 'dnOfNewYorker,dc=test';
+ break;
+ case 'ladyofshadows':
+ return 'dnOfLadyOfShadows,dc=test';
+ break;
+ default:
+ return false;
+ }
+ });
$this->access->method('fetchUsersByLoginName')
->willReturn([]);
@@ -115,22 +115,22 @@ class User_LDAPTest extends TestCase {
*/
private function prepareAccessForCheckPassword($noDisplayName = false) {
$this->connection->expects($this->any())
- ->method('__get')
- ->willReturnCallback(function ($name) {
- if ($name === 'ldapLoginFilter') {
- return '%uid';
- }
- return null;
- });
+ ->method('__get')
+ ->willReturnCallback(function ($name) {
+ if ($name === 'ldapLoginFilter') {
+ return '%uid';
+ }
+ return null;
+ });
$this->access->expects($this->any())
- ->method('fetchListOfUsers')
- ->willReturnCallback(function ($filter) {
- if ($filter === 'roland') {
- return [['dn' => ['dnOfRoland,dc=test']]];
- }
- return [];
- });
+ ->method('fetchListOfUsers')
+ ->willReturnCallback(function ($filter) {
+ if ($filter === 'roland') {
+ return [['dn' => ['dnOfRoland,dc=test']]];
+ }
+ return [];
+ });
$this->access->expects($this->any())
->method('fetchUsersByLoginName')
->willReturnCallback(function ($uid) {
@@ -145,25 +145,25 @@ class User_LDAPTest extends TestCase {
$retVal = false;
}
$this->access->expects($this->any())
- ->method('dn2username')
- ->with($this->equalTo('dnOfRoland,dc=test'))
- ->willReturn($retVal);
+ ->method('dn2username')
+ ->with($this->equalTo('dnOfRoland,dc=test'))
+ ->willReturn($retVal);
$this->access->expects($this->any())
- ->method('username2dn')
- ->with($this->equalTo('gunslinger'))
- ->willReturn('dnOfRoland,dc=test');
+ ->method('username2dn')
+ ->with($this->equalTo('gunslinger'))
+ ->willReturn('dnOfRoland,dc=test');
$this->access->expects($this->any())
- ->method('stringResemblesDN')
- ->with($this->equalTo('dnOfRoland,dc=test'))
- ->willReturn(true);
+ ->method('stringResemblesDN')
+ ->with($this->equalTo('dnOfRoland,dc=test'))
+ ->willReturn(true);
$this->access->expects($this->any())
- ->method('areCredentialsValid')
- ->willReturnCallback(function ($dn, $pwd) {
- if ($pwd === 'dt19') {
- return true;
- }
- return false;
- });
+ ->method('areCredentialsValid')
+ ->willReturnCallback(function ($dn, $pwd) {
+ if ($pwd === 'dt19') {
+ return true;
+ }
+ return false;
+ });
$this->userManager->expects($this->any())
->method('getAttributes')
@@ -292,9 +292,9 @@ class User_LDAPTest extends TestCase {
->willReturn(ldap_connect('ldap://example.com'));
$this->deletedUsersIndex->expects($this->once())
- ->method('isUserMarked')
- ->with($uid)
- ->willReturn(true);
+ ->method('isUserMarked')
+ ->with($uid)
+ ->willReturn(true);
$offlineUser = $this->createMock(OfflineUser::class);
$offlineUser->expects($this->once())
@@ -322,9 +322,9 @@ class User_LDAPTest extends TestCase {
->willReturn(true);
$this->deletedUsersIndex->expects($this->once())
- ->method('isUserMarked')
- ->with('uid')
- ->willReturn(true);
+ ->method('isUserMarked')
+ ->with('uid')
+ ->willReturn(true);
$mapper = $this->createMock(UserMapping::class);
$mapper->expects($this->once())
@@ -347,42 +347,42 @@ class User_LDAPTest extends TestCase {
*/
private function prepareAccessForGetUsers() {
$this->access->expects($this->once())
- ->method('escapeFilterPart')
- ->willReturnCallback(function ($search) {
- return $search;
- });
+ ->method('escapeFilterPart')
+ ->willReturnCallback(function ($search) {
+ return $search;
+ });
$this->access->expects($this->any())
- ->method('getFilterPartForUserSearch')
- ->willReturnCallback(function ($search) {
- return $search;
- });
+ ->method('getFilterPartForUserSearch')
+ ->willReturnCallback(function ($search) {
+ return $search;
+ });
$this->access->expects($this->any())
- ->method('combineFilterWithAnd')
- ->willReturnCallback(function ($param) {
- return $param[2];
- });
+ ->method('combineFilterWithAnd')
+ ->willReturnCallback(function ($param) {
+ return $param[2];
+ });
$this->access->expects($this->any())
- ->method('fetchListOfUsers')
- ->willReturnCallback(function ($search, $a, $l, $o) {
- $users = ['gunslinger', 'newyorker', 'ladyofshadows'];
- if (empty($search)) {
- $result = $users;
- } else {
- $result = [];
- foreach ($users as $user) {
- if (stripos($user, $search) !== false) {
- $result[] = $user;
- }
- }
- }
- if (!is_null($l) || !is_null($o)) {
- $result = array_slice($result, $o, $l);
- }
- return $result;
- });
+ ->method('fetchListOfUsers')
+ ->willReturnCallback(function ($search, $a, $l, $o) {
+ $users = ['gunslinger', 'newyorker', 'ladyofshadows'];
+ if (empty($search)) {
+ $result = $users;
+ } else {
+ $result = [];
+ foreach ($users as $user) {
+ if (stripos($user, $search) !== false) {
+ $result[] = $user;
+ }
+ }
+ }
+ if (!is_null($l) || !is_null($o)) {
+ $result = array_slice($result, $o, $l);
+ }
+ return $result;
+ });
$this->access->expects($this->any())
- ->method('nextcloudUserNames')
- ->willReturnArgument(0);
+ ->method('nextcloudUserNames')
+ ->willReturnArgument(0);
$this->access->method('fetchUsersByLoginName')
->willReturn([]);
@@ -740,23 +740,23 @@ class User_LDAPTest extends TestCase {
$this->prepareMockForUserExists();
$this->connection->expects($this->any())
- ->method('__get')
- ->willReturnCallback(function ($name) {
- if ($name === 'homeFolderNamingRule') {
- return 'attr:testAttribute';
- }
- return null;
- });
+ ->method('__get')
+ ->willReturnCallback(function ($name) {
+ if ($name === 'homeFolderNamingRule') {
+ return 'attr:testAttribute';
+ }
+ return null;
+ });
$this->access->expects($this->any())
- ->method('readAttribute')
- ->willReturn([]);
+ ->method('readAttribute')
+ ->willReturn([]);
$userMapper = $this->createMock(UserMapping::class);
$this->access->expects($this->any())
- ->method('getUserMapper')
- ->willReturn($userMapper);
+ ->method('getUserMapper')
+ ->willReturn($userMapper);
$offlineUser = $this->createMock(OfflineUser::class);
$offlineUser->expects($this->atLeastOnce())
@@ -804,20 +804,20 @@ class User_LDAPTest extends TestCase {
});
$this->access->expects($this->any())
- ->method('readAttribute')
- ->willReturnCallback(function ($dn, $attr) {
- switch ($dn) {
- case 'dnOfRoland,dc=test':
- if ($attr === 'displayname') {
- return ['Roland Deschain'];
- }
- return [];
- break;
-
- default:
- return false;
- }
- });
+ ->method('readAttribute')
+ ->willReturnCallback(function ($dn, $attr) {
+ switch ($dn) {
+ case 'dnOfRoland,dc=test':
+ if ($attr === 'displayname') {
+ return ['Roland Deschain'];
+ }
+ return [];
+ break;
+
+ default:
+ return false;
+ }
+ });
$this->access->method('fetchUsersByLoginName')
->willReturn([]);
}
@@ -984,8 +984,8 @@ class User_LDAPTest extends TestCase {
public function testCountUsers() {
$this->access->expects($this->once())
- ->method('countUsers')
- ->willReturn(5);
+ ->method('countUsers')
+ ->willReturn(5);
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
@@ -995,8 +995,8 @@ class User_LDAPTest extends TestCase {
public function testCountUsersFailing() {
$this->access->expects($this->once())
- ->method('countUsers')
- ->willReturn(false);
+ ->method('countUsers')
+ ->willReturn(false);
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
@@ -1139,33 +1139,33 @@ class User_LDAPTest extends TestCase {
*/
private function prepareAccessForSetPassword($enablePasswordChange = true) {
$this->connection->expects($this->any())
- ->method('__get')
- ->willReturnCallback(function ($name) use (&$enablePasswordChange) {
- if ($name === 'ldapLoginFilter') {
- return '%uid';
- }
- if ($name === 'turnOnPasswordChange') {
- return $enablePasswordChange?1:0;
- }
- return null;
- });
+ ->method('__get')
+ ->willReturnCallback(function ($name) use (&$enablePasswordChange) {
+ if ($name === 'ldapLoginFilter') {
+ return '%uid';
+ }
+ if ($name === 'turnOnPasswordChange') {
+ return $enablePasswordChange?1:0;
+ }
+ return null;
+ });
$this->connection->expects($this->any())
- ->method('getFromCache')
- ->willReturnCallback(function ($uid) {
- if ($uid === 'userExists'.'roland') {
- return true;
- }
- return null;
- });
+ ->method('getFromCache')
+ ->willReturnCallback(function ($uid) {
+ if ($uid === 'userExists'.'roland') {
+ return true;
+ }
+ return null;
+ });
$this->access->expects($this->any())
- ->method('fetchListOfUsers')
- ->willReturnCallback(function ($filter) {
- if ($filter === 'roland') {
- return [['dn' => ['dnOfRoland,dc=test']]];
- }
- return [];
- });
+ ->method('fetchListOfUsers')
+ ->willReturnCallback(function ($filter) {
+ if ($filter === 'roland') {
+ return [['dn' => ['dnOfRoland,dc=test']]];
+ }
+ return [];
+ });
$this->access->expects($this->any())
->method('fetchUsersByLoginName')
->willReturnCallback(function ($uid) {
@@ -1175,21 +1175,21 @@ class User_LDAPTest extends TestCase {
return [];
});
$this->access->expects($this->any())
- ->method('dn2username')
- ->with($this->equalTo('dnOfRoland,dc=test'))
- ->willReturn('roland');
+ ->method('dn2username')
+ ->with($this->equalTo('dnOfRoland,dc=test'))
+ ->willReturn('roland');
$this->access->expects($this->any())
- ->method('stringResemblesDN')
- ->with($this->equalTo('dnOfRoland,dc=test'))
- ->willReturn(true);
+ ->method('stringResemblesDN')
+ ->with($this->equalTo('dnOfRoland,dc=test'))
+ ->willReturn(true);
$this->access->expects($this->any())
- ->method('setPassword')
- ->willReturnCallback(function ($uid, $password) {
- if (strlen($password) <= 5) {
- throw new HintException('Password fails quality checking policy', '', 19);
- }
- return true;
- });
+ ->method('setPassword')
+ ->willReturnCallback(function ($uid, $password) {
+ if (strlen($password) <= 5) {
+ throw new HintException('Password fails quality checking policy', '', 19);
+ }
+ return true;
+ });
}
diff --git a/apps/user_status/lib/Controller/HeartbeatController.php b/apps/user_status/lib/Controller/HeartbeatController.php
index 65fdda75eec..11170f39b25 100644
--- a/apps/user_status/lib/Controller/HeartbeatController.php
+++ b/apps/user_status/lib/Controller/HeartbeatController.php
@@ -59,6 +59,7 @@ class HeartbeatController extends OCSController {
* @param string $status Only online, away
*
* @return DataResponse<Http::STATUS_OK, UserStatusPrivate, array{}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_INTERNAL_SERVER_ERROR|Http::STATUS_NO_CONTENT, array<empty>, array{}>
+ *
* 200: Status successfully updated
* 204: User has no status to keep alive
* 400: Invalid status to update
diff --git a/apps/user_status/lib/Dashboard/UserStatusWidget.php b/apps/user_status/lib/Dashboard/UserStatusWidget.php
index 71f5145e283..cc1ce887e83 100644
--- a/apps/user_status/lib/Dashboard/UserStatusWidget.php
+++ b/apps/user_status/lib/Dashboard/UserStatusWidget.php
@@ -124,7 +124,7 @@ class UserStatusWidget implements IAPIWidget, IAPIWidgetV2, IIconWidget, IOption
$this->service->findAllRecentStatusChanges($limit + 1, 0),
static function (UserStatus $status) use ($userId, $since): bool {
return $status->getUserId() !== $userId
- && ($since === null || $status->getStatusTimestamp() > (int) $since);
+ && ($since === null || $status->getStatusTimestamp() > (int)$since);
}
),
0,
@@ -168,7 +168,7 @@ class UserStatusWidget implements IAPIWidget, IAPIWidgetV2, IIconWidget, IOption
$this->urlGenerator->getAbsoluteURL(
$this->urlGenerator->linkToRoute('core.avatar.getAvatar', ['userId' => $widgetData['userId'], 'size' => 44])
),
- (string) $widgetData['timestamp']
+ (string)$widgetData['timestamp']
);
}, $widgetItemsData);
}
diff --git a/apps/user_status/tests/Unit/Service/StatusServiceTest.php b/apps/user_status/tests/Unit/Service/StatusServiceTest.php
index 710b3081b17..801d0cea0fc 100644
--- a/apps/user_status/tests/Unit/Service/StatusServiceTest.php
+++ b/apps/user_status/tests/Unit/Service/StatusServiceTest.php
@@ -47,10 +47,10 @@ class StatusServiceTest extends TestCase {
/** @var IConfig|MockObject */
private $config;
- /** @var IUserManager|MockObject */
+ /** @var IUserManager|MockObject */
private $userManager;
- /** @var LoggerInterface|MockObject */
+ /** @var LoggerInterface|MockObject */
private $logger;
private StatusService $service;
diff --git a/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php b/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php
index f7c111f41e8..efc9401f44f 100644
--- a/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php
+++ b/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php
@@ -56,14 +56,14 @@ class WebhookCall extends QueuedJob {
}
$webhookUri = $webhookListener->getUri();
$exAppId = $webhookListener->getAppId();
- if ($exAppId !== null && str_starts_with($webhookUri, "/")) {
+ if ($exAppId !== null && str_starts_with($webhookUri, '/')) {
// ExApp is awaiting a direct request to itself using AppAPI
if (!$this->appManager->isInstalled('app_api')) {
throw new RuntimeException('AppAPI is disabled or not installed.');
}
try {
$appApiFunctions = \OCP\Server::get(\OCA\AppAPI\PublicFunctions::class);
- } catch (ContainerExceptionInterface | NotFoundExceptionInterface) {
+ } catch (ContainerExceptionInterface|NotFoundExceptionInterface) {
throw new RuntimeException('Could not get AppAPI public functions.');
}
$exApp = $appApiFunctions->getExApp($exAppId);
diff --git a/apps/webhook_listeners/lib/Db/WebhookListener.php b/apps/webhook_listeners/lib/Db/WebhookListener.php
index 2e194261d64..fd592fda169 100644
--- a/apps/webhook_listeners/lib/Db/WebhookListener.php
+++ b/apps/webhook_listeners/lib/Db/WebhookListener.php
@@ -62,7 +62,7 @@ class WebhookListener extends Entity implements \JsonSerializable {
/**
* @var ?string
- * If not empty, id of the user that needs to be connected for the webhook to trigger
+ * If not empty, id of the user that needs to be connected for the webhook to trigger
* @psalm-suppress PropertyNotSetInConstructor
*/
protected $userIdFilter;
diff --git a/apps/webhook_listeners/lib/Service/PHPMongoQuery.php b/apps/webhook_listeners/lib/Service/PHPMongoQuery.php
index e8e52615008..451488ea22b 100644
--- a/apps/webhook_listeners/lib/Service/PHPMongoQuery.php
+++ b/apps/webhook_listeners/lib/Service/PHPMongoQuery.php
@@ -19,12 +19,12 @@ abstract class PHPMongoQuery {
/**
* Execute a mongo query on a set of documents and return the documents that pass the query
*
- * @param array $query A boolean value or an array defining a query
- * @param array $documents The document to query
- * @param array $options Any options:
- * 'debug' - boolean - debug mode, verbose logging
- * 'logger' - \Psr\LoggerInterface - A logger instance that implements {@link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#3-psrlogloggerinterface PSR-3}
- * 'unknownOperatorCallback' - a callback to be called if an operator can't be found. The function definition is function($operator, $operatorValue, $field, $document). return true or false.
+ * @param array $query A boolean value or an array defining a query
+ * @param array $documents The document to query
+ * @param array $options Any options:
+ * 'debug' - boolean - debug mode, verbose logging
+ * 'logger' - \Psr\LoggerInterface - A logger instance that implements {@link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#3-psrlogloggerinterface PSR-3}
+ * 'unknownOperatorCallback' - a callback to be called if an operator can't be found. The function definition is function($operator, $operatorValue, $field, $document). return true or false.
* @throws Exception
*/
public static function find(array $query, array $documents, array $options = []): array {
@@ -45,12 +45,12 @@ abstract class PHPMongoQuery {
/**
* Execute a Mongo query on a document
*
- * @param mixed $query A boolean value or an array defining a query
- * @param array $document The document to query
- * @param array $options Any options:
- * 'debug' - boolean - debug mode, verbose logging
- * 'logger' - \Psr\LoggerInterface - A logger instance that implements {@link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#3-psrlogloggerinterface PSR-3}
- * 'unknownOperatorCallback' - a callback to be called if an operator can't be found. The function definition is function($operator, $operatorValue, $field, $document). return true or false.
+ * @param mixed $query A boolean value or an array defining a query
+ * @param array $document The document to query
+ * @param array $options Any options:
+ * 'debug' - boolean - debug mode, verbose logging
+ * 'logger' - \Psr\LoggerInterface - A logger instance that implements {@link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#3-psrlogloggerinterface PSR-3}
+ * 'unknownOperatorCallback' - a callback to be called if an operator can't be found. The function definition is function($operator, $operatorValue, $field, $document). return true or false.
* @throws Exception
*/
public static function executeQuery($query, array &$document, array $options = []): bool {
@@ -188,12 +188,12 @@ abstract class PHPMongoQuery {
/**
* Execute a Mongo Operator on an element
*
- * @param string $operator The operator to perform
- * @param mixed $operatorValue The value to provide the operator
- * @param string $element The target element. Can be an object path eg price.shoes
- * @param array $document The document in which to find the element
- * @param array $options Options
- * @throws Exception Exceptions on invalid operators, invalid unknown operator callback, and invalid operator values
+ * @param string $operator The operator to perform
+ * @param mixed $operatorValue The value to provide the operator
+ * @param string $element The target element. Can be an object path eg price.shoes
+ * @param array $document The document in which to find the element
+ * @param array $options Options
+ * @throws Exception Exceptions on invalid operators, invalid unknown operator callback, and invalid operator values
*/
private static function _executeOperatorOnElement(string $operator, $operatorValue, string $element, array &$document, array $options = []): bool {
if($options['_debug'] && $options['_shouldLog']) {
@@ -322,7 +322,7 @@ abstract class PHPMongoQuery {
* Get the fields this query depends on
*
* @param array query The query to analyse
- * @return array An array of fields this query depends on
+ * @return array An array of fields this query depends on
*/
public static function getDependentFields(array $query) {
$fields = [];
diff --git a/apps/webhook_listeners/lib/Settings/Admin.php b/apps/webhook_listeners/lib/Settings/Admin.php
index 5ef7656ca3e..64ed53426f9 100644
--- a/apps/webhook_listeners/lib/Settings/Admin.php
+++ b/apps/webhook_listeners/lib/Settings/Admin.php
@@ -43,8 +43,8 @@ class Admin implements IDelegatedSettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php
index 8cd52f4cd64..fdde06bdbd6 100644
--- a/apps/workflowengine/lib/Manager.php
+++ b/apps/workflowengine/lib/Manager.php
@@ -151,7 +151,7 @@ class Manager implements IManager {
while ($row = $result->fetch()) {
$scope = new ScopeContext($row['type'], $row['value']);
- if (!$operation->isAvailableForScope((int) $row['type'])) {
+ if (!$operation->isAvailableForScope((int)$row['type'])) {
continue;
}
@@ -191,7 +191,7 @@ class Manager implements IManager {
continue;
}
- if (!$operation->isAvailableForScope((int) $row['scope_type'])) {
+ if (!$operation->isAvailableForScope((int)$row['scope_type'])) {
continue;
}
@@ -540,8 +540,8 @@ class Manager implements IManager {
$result = $query->execute();
while ($row = $result->fetch()) {
- $this->checks[(int) $row['id']] = $row;
- $checks[(int) $row['id']] = $row;
+ $this->checks[(int)$row['id']] = $row;
+ $checks[(int)$row['id']] = $row;
}
$result->closeCursor();
@@ -572,7 +572,7 @@ class Manager implements IManager {
if ($row = $result->fetch()) {
$result->closeCursor();
- return (int) $row['id'];
+ return (int)$row['id'];
}
$query = $this->connection->getQueryBuilder();
diff --git a/apps/workflowengine/lib/Settings/ASettings.php b/apps/workflowengine/lib/Settings/ASettings.php
index 1cf03376e9f..390682a2f06 100644
--- a/apps/workflowengine/lib/Settings/ASettings.php
+++ b/apps/workflowengine/lib/Settings/ASettings.php
@@ -110,8 +110,8 @@ abstract class ASettings implements ISettings {
/**
* @return int whether the form should be rather on the top or bottom of
- * the admin section. The forms are arranged in ascending order of the
- * priority values. It is required to return a value between 0 and 100.
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
diff --git a/apps/workflowengine/tests/ManagerTest.php b/apps/workflowengine/tests/ManagerTest.php
index d0c04ba1e09..4a547f5c8bf 100644
--- a/apps/workflowengine/tests/ManagerTest.php
+++ b/apps/workflowengine/tests/ManagerTest.php
@@ -58,7 +58,7 @@ class ManagerTest extends TestCase {
protected $dispatcher;
/** @var MockObject|IConfig */
protected $config;
- /** @var MockObject|ICacheFactory */
+ /** @var MockObject|ICacheFactory */
protected $cacheFactory;
protected function setUp(): void {