From 773e4ee44b76287925bba322a0744a24fff1f1de Mon Sep 17 00:00:00 2001 From: provokateurin Date: Thu, 19 Sep 2024 11:10:31 +0200 Subject: [PATCH] chore(deps): Update nextcloud/coding-standard to v1.3.1 Signed-off-by: provokateurin --- apps/admin_audit/lib/Actions/Action.php | 4 +- apps/admin_audit/lib/Actions/Files.php | 16 +- .../lib/Listener/FileEventListener.php | 2 +- .../Controller/RequestHandlerController.php | 2 +- .../Controller/NotificationsController.php | 2 +- apps/comments/lib/Notification/Listener.php | 2 +- apps/comments/lib/Notification/Notifier.php | 2 +- .../BuildReminderIndexBackgroundJob.php | 2 +- .../BackgroundJob/UserStatusAutomation.php | 6 +- apps/dav/lib/BulkUpload/BulkUploadPlugin.php | 2 +- .../lib/BulkUpload/MultipartRequestParser.php | 4 +- .../CalDAV/BirthdayCalendar/EnablePlugin.php | 2 +- apps/dav/lib/CalDAV/BirthdayService.php | 6 +- .../dav/lib/CalDAV/CachedSubscriptionImpl.php | 2 +- .../lib/CalDAV/CachedSubscriptionProvider.php | 2 +- apps/dav/lib/CalDAV/CalDavBackend.php | 18 +- apps/dav/lib/CalDAV/Calendar.php | 4 +- apps/dav/lib/CalDAV/CalendarHome.php | 2 +- apps/dav/lib/CalDAV/CalendarRoot.php | 2 +- apps/dav/lib/CalDAV/EventReader.php | 14 +- apps/dav/lib/CalDAV/EventReaderRDate.php | 6 +- apps/dav/lib/CalDAV/EventReaderRRule.php | 6 +- .../lib/CalDAV/Publishing/PublishPlugin.php | 10 +- .../lib/CalDAV/Reminder/ReminderService.php | 2 +- apps/dav/lib/CalDAV/Sharing/Backend.php | 3 +- apps/dav/lib/CalDAV/Sharing/Service.php | 4 +- apps/dav/lib/CalDAV/Status/StatusService.php | 6 +- apps/dav/lib/CalDAV/TimezoneService.php | 6 +- .../CalDAV/Trashbin/DeletedCalendarObject.php | 2 +- apps/dav/lib/CalDAV/UpcomingEvent.php | 6 +- apps/dav/lib/CalDAV/UpcomingEventsService.php | 6 +- .../Validation/CalDavValidatePlugin.php | 2 +- .../lib/CalDAV/WebcalCaching/Connection.php | 6 +- .../WebcalCaching/RefreshWebcalService.php | 6 +- .../Security/CardDavRateLimitingPlugin.php | 6 +- apps/dav/lib/CardDAV/Sharing/Backend.php | 3 +- apps/dav/lib/CardDAV/Sharing/Service.php | 4 +- .../Validation/CardDavValidatePlugin.php | 2 +- apps/dav/lib/Command/DeleteCalendar.php | 2 +- .../lib/Command/FixCalendarSyncCommand.php | 6 +- apps/dav/lib/Comments/CommentNode.php | 4 +- apps/dav/lib/Comments/CommentsPlugin.php | 2 +- apps/dav/lib/Comments/EntityCollection.php | 2 +- .../dav/lib/Comments/EntityTypeCollection.php | 2 +- .../Sabre/CommentPropertiesPlugin.php | 2 +- .../lib/Connector/Sabre/FilesReportPlugin.php | 2 +- apps/dav/lib/Connector/Sabre/Node.php | 4 +- .../dav/lib/Connector/Sabre/ServerFactory.php | 2 +- apps/dav/lib/Connector/Sabre/SharesPlugin.php | 2 +- apps/dav/lib/Connector/Sabre/TagsPlugin.php | 2 +- apps/dav/lib/Controller/DirectController.php | 2 +- .../lib/Controller/OutOfOfficeController.php | 2 +- apps/dav/lib/DAV/GroupPrincipalBackend.php | 2 +- apps/dav/lib/DAV/Sharing/Backend.php | 3 +- apps/dav/lib/DAV/Sharing/SharingMapper.php | 4 +- apps/dav/lib/DAV/Sharing/SharingService.php | 4 +- apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php | 2 +- apps/dav/lib/Direct/DirectHome.php | 2 +- apps/dav/lib/Listener/OutOfOfficeListener.php | 2 +- .../BuildCalendarSearchIndexBackgroundJob.php | 4 +- .../BuildSocialSearchIndexBackgroundJob.php | 2 +- .../lib/Migration/DeleteSchedulingObjects.php | 5 +- .../Version1027Date20230504122946.php | 6 +- .../Apple/AppleProvisioningPlugin.php | 2 +- apps/dav/lib/Search/EventsSearchProvider.php | 2 +- .../dav/lib/Settings/AvailabilitySettings.php | 6 +- apps/dav/lib/SystemTag/SystemTagPlugin.php | 2 +- .../SystemTag/SystemTagsByIdCollection.php | 2 +- .../SystemTag/SystemTagsInUseCollection.php | 2 +- .../lib/UserMigration/CalendarMigrator.php | 2 +- .../lib/UserMigration/ContactsMigrator.php | 2 +- .../tests/unit/CalDAV/Schedule/PluginTest.php | 4 +- .../tests/unit/CardDAV/CardDavBackendTest.php | 48 +-- .../tests/unit/Command/DeleteCalendarTest.php | 2 +- .../unit/Connector/Sabre/ObjectTreeTest.php | 2 +- .../unit/Controller/DirectControllerTest.php | 2 +- .../dav/tests/unit/DAV/GroupPrincipalTest.php | 2 +- .../unit/Files/MultipartRequestParserTest.php | 10 +- .../Search/ContactsSearchProviderTest.php | 28 +- .../unit/Search/EventsSearchProviderTest.php | 312 +++++++++--------- .../unit/Search/TasksSearchProviderTest.php | 98 +++--- apps/dav/tests/unit/bootstrap.php | 2 +- .../lib/Command/DropLegacyFileKey.php | 4 +- .../lib/Controller/SettingsController.php | 2 +- .../lib/Controller/StatusController.php | 2 +- apps/encryption/lib/Crypto/Crypt.php | 6 +- apps/encryption/lib/Crypto/DecryptAll.php | 2 +- apps/encryption/lib/Crypto/EncryptAll.php | 2 +- apps/encryption/lib/KeyManager.php | 2 +- apps/encryption/lib/Settings/Admin.php | 2 +- .../tests/Command/FixEncryptedVersionTest.php | 2 +- .../lib/AddressHandler.php | 2 +- .../Controller/RequestHandlerController.php | 2 +- .../lib/Settings/Admin.php | 2 +- .../lib/Settings/Personal.php | 2 +- .../MountPublicLinkControllerTest.php | 2 +- .../tests/NotificationsTest.php | 2 +- .../lib/BackgroundJob/GetSharedSecret.php | 2 +- .../lib/Controller/OCSAuthAPIController.php | 4 +- .../lib/Controller/SettingsController.php | 2 +- apps/federation/lib/DbHandler.php | 2 +- .../lib/SyncFederationAddressBooks.php | 2 +- apps/federation/lib/TrustedServers.php | 2 +- .../DeleteExpiredOpenLocalEditor.php | 2 +- apps/files/lib/BackgroundJob/ScanFiles.php | 2 +- apps/files/lib/Command/ScanAppData.php | 2 +- apps/files/lib/Controller/ApiController.php | 3 +- .../Controller/DirectEditingController.php | 2 +- .../Controller/OpenLocalEditorController.php | 2 +- .../lib/Controller/TemplateController.php | 2 +- .../lib/BackgroundJob/CredentialsCleanup.php | 2 +- apps/files_external/lib/Command/Scan.php | 2 +- .../lib/Controller/ApiController.php | 2 +- .../Controller/GlobalStoragesController.php | 6 +- .../lib/Controller/StoragesController.php | 4 +- .../UserGlobalStoragesController.php | 4 +- .../lib/Controller/UserStoragesController.php | 6 +- .../Lib/Auth/Password/LoginCredentials.php | 2 +- apps/files_external/lib/Lib/PersonalMount.php | 2 +- apps/files_external/lib/MountConfig.php | 2 +- .../lib/Service/BackendService.php | 2 +- .../lib/Service/LegacyStoragesService.php | 2 +- .../lib/Service/StoragesService.php | 4 +- .../lib/Service/UserGlobalStoragesService.php | 2 +- .../lib/Service/UserStoragesService.php | 2 +- apps/files_external/lib/Settings/Admin.php | 2 +- apps/files_external/lib/Settings/Personal.php | 2 +- .../lib/Settings/PersonalSection.php | 2 +- apps/files_external/templates/settings.php | 4 +- .../Controller/StoragesControllerTest.php | 4 +- .../tests/Service/BackendServiceTest.php | 8 +- .../Service/UserGlobalStoragesServiceTest.php | 2 +- apps/files_sharing/lib/Cache.php | 2 +- .../Controller/PublicPreviewController.php | 2 +- .../lib/Controller/ShareAPIController.php | 8 +- .../lib/DeleteOrphanedSharesJob.php | 2 +- apps/files_sharing/lib/External/Manager.php | 2 +- apps/files_sharing/lib/Helper.php | 4 +- .../lib/Listener/LoadSidebarListener.php | 5 +- .../lib/Middleware/SharingCheckMiddleware.php | 2 +- apps/files_sharing/lib/MountProvider.php | 2 +- .../lib/Notification/Listener.php | 2 +- apps/files_sharing/lib/OrphanHelper.php | 2 +- apps/files_sharing/lib/SharedMount.php | 4 +- apps/files_sharing/lib/SharesReminderJob.php | 2 +- apps/files_sharing/tests/ApiTest.php | 32 +- apps/files_sharing/tests/CacheTest.php | 2 +- .../Controller/ShareAPIControllerTest.php | 2 +- apps/files_sharing/tests/ShareTest.php | 4 +- .../tests/SharesReminderJobTest.php | 2 +- apps/files_sharing/tests/UpdaterTest.php | 6 +- .../lib/BackgroundJob/ExpireTrash.php | 2 +- apps/files_trashbin/lib/Command/Size.php | 2 +- .../lib/Controller/PreviewController.php | 2 +- .../lib/Events/BeforeNodeRestoredEvent.php | 6 +- .../lib/Listeners/SyncLivePhotosListener.php | 4 +- .../lib/Sabre/RootCollection.php | 2 +- apps/files_trashbin/lib/Sabre/TrashHome.php | 2 +- .../lib/Sabre/TrashbinPlugin.php | 2 +- apps/files_trashbin/lib/Storage.php | 2 +- apps/files_trashbin/lib/Trashbin.php | 2 +- .../lib/UserMigration/TrashbinMigrator.php | 20 +- .../tests/Command/CleanUpTest.php | 4 +- apps/files_versions/lib/Capabilities.php | 2 +- .../lib/Controller/PreviewController.php | 4 +- .../lib/Sabre/RootCollection.php | 2 +- apps/files_versions/lib/Sabre/VersionFile.php | 2 +- apps/files_versions/lib/Storage.php | 34 +- .../CleanupExpiredAuthorizationCode.php | 1 - .../lib/Controller/OauthApiController.php | 2 +- .../lib/Controller/SettingsController.php | 2 +- apps/oauth2/lib/Db/ClientMapper.php | 4 +- .../Controller/OauthApiControllerTest.php | 6 +- .../lib/Controller/AppsController.php | 2 +- .../lib/Controller/PreferencesController.php | 2 +- .../lib/Controller/UsersController.php | 2 +- .../lib/Controller/VerificationController.php | 2 +- .../tests/Controller/GroupsControllerTest.php | 2 +- .../lib/Command/AdminDelegation/Add.php | 2 +- .../lib/Command/AdminDelegation/Remove.php | 4 +- .../lib/Command/AdminDelegation/Show.php | 2 +- .../lib/Controller/AppSettingsController.php | 2 +- .../lib/Controller/UsersController.php | 2 +- .../UserAddedToGroupActivityListener.php | 2 +- .../UserRemovedFromGroupActivityListener.php | 2 +- .../lib/Settings/Admin/Delegation.php | 2 +- .../lib/Settings/Personal/PersonalInfo.php | 2 +- apps/settings/lib/SetupChecks/CronErrors.php | 2 +- .../SetupChecks/DatabaseHasMissingColumns.php | 4 +- .../DatabaseHasMissingPrimaryKeys.php | 4 +- .../DatabasePendingBigIntConversions.php | 2 +- .../settings/lib/SetupChecks/OcxProviders.php | 2 +- apps/settings/lib/SetupChecks/PhpModules.php | 2 +- .../lib/SetupChecks/SecurityHeaders.php | 16 +- .../lib/SetupChecks/TempSpaceAvailable.php | 2 +- .../lib/UserMigration/AccountMigrator.php | 2 +- .../tests/Controller/UsersControllerTest.php | 4 +- .../tests/SetupChecks/SecurityHeadersTest.php | 2 +- apps/sharebymail/lib/ShareByMailProvider.php | 2 +- apps/systemtags/lib/Activity/Setting.php | 4 +- .../lib/Search/TagSearchProvider.php | 4 +- .../GetDeclarativeSettingsValueListener.php | 4 +- .../SetDeclarativeSettingsValueListener.php | 4 +- .../lib/Locking/FakeDBLockingProvider.php | 2 +- .../theming/lib/Controller/IconController.php | 2 +- apps/theming/lib/IconBuilder.php | 6 +- .../lib/Jobs/MigrateBackgroundImages.php | 4 +- .../lib/Jobs/RestoreBackgroundImageColor.php | 6 +- .../BeforeTemplateRenderedListener.php | 2 +- .../theming/lib/Service/BackgroundService.php | 4 +- apps/theming/lib/Service/ThemesService.php | 3 +- apps/theming/lib/ThemingDefaults.php | 10 +- apps/theming/lib/Util.php | 2 +- .../Controller/ThemingControllerTest.php | 6 +- apps/theming/tests/IconBuilderTest.php | 6 +- apps/updatenotification/lib/Command/Check.php | 2 +- apps/updatenotification/lib/Manager.php | 6 +- .../updatenotification/lib/Settings/Admin.php | 2 +- .../ajax/getNewServerConfigPrefix.php | 2 +- apps/user_ldap/ajax/wizard.php | 2 +- apps/user_ldap/lib/Access.php | 12 +- apps/user_ldap/lib/AppInfo/Application.php | 2 +- apps/user_ldap/lib/Command/CheckGroup.php | 8 +- apps/user_ldap/lib/Command/CheckUser.php | 2 +- apps/user_ldap/lib/Command/PromoteGroup.php | 2 +- apps/user_ldap/lib/Command/Search.php | 2 +- apps/user_ldap/lib/Configuration.php | 6 +- apps/user_ldap/lib/Connection.php | 14 +- .../lib/Controller/ConfigAPIController.php | 2 +- apps/user_ldap/lib/GroupPluginManager.php | 2 +- apps/user_ldap/lib/Group_LDAP.php | 12 +- apps/user_ldap/lib/Jobs/CleanUp.php | 2 +- apps/user_ldap/lib/LDAPProvider.php | 4 +- apps/user_ldap/lib/Proxy.php | 2 +- apps/user_ldap/lib/Settings/Admin.php | 2 +- .../lib/SetupChecks/LdapConnection.php | 6 +- apps/user_ldap/lib/User/DeletedUsersIndex.php | 2 +- apps/user_ldap/lib/User/Manager.php | 2 +- apps/user_ldap/lib/User/OfflineUser.php | 2 +- apps/user_ldap/lib/User/User.php | 32 +- apps/user_ldap/lib/UserPluginManager.php | 4 +- apps/user_ldap/lib/User_LDAP.php | 24 +- apps/user_ldap/lib/Wizard.php | 22 +- .../templates/part.wizard-server.php | 2 +- apps/user_ldap/templates/settings.php | 2 +- apps/user_ldap/tests/AccessTest.php | 2 +- apps/user_ldap/tests/Group_LDAPTest.php | 4 +- .../user_ldap/tests/Integration/Bootstrap.php | 2 +- .../Integration/ExceptionOnLostConnection.php | 2 +- apps/user_ldap/tests/Settings/AdminTest.php | 2 +- apps/user_ldap/tests/User/UserTest.php | 4 +- apps/user_ldap/tests/User_LDAPTest.php | 20 +- .../lib/ContactsMenu/StatusProvider.php | 4 +- .../BeforeTemplateRenderedListener.php | 2 +- .../Listener/OutOfOfficeStatusListener.php | 6 +- .../lib/Listener/UserLiveStatusListener.php | 6 +- .../Version1008Date20230921144701.php | 4 +- apps/user_status/tests/bootstrap.php | 2 +- .../lib/Service/WeatherStatusService.php | 2 +- .../lib/BackgroundJobs/WebhookCall.php | 6 +- .../lib/Db/WebhookListener.php | 2 +- .../lib/Db/WebhookListenerMapper.php | 2 +- .../lib/Service/PHPMongoQuery.php | 10 +- .../lib/Check/FileSystemTags.php | 2 +- .../lib/Controller/AWorkflowController.php | 6 +- .../Controller/UserWorkflowsController.php | 2 +- apps/workflowengine/lib/Entity/File.php | 2 +- apps/workflowengine/lib/Manager.php | 6 +- apps/workflowengine/lib/Service/Logger.php | 2 +- .../lib/Service/RuleMatcher.php | 2 +- .../workflowengine/lib/Settings/ASettings.php | 2 +- .../features/bootstrap/CalDavContext.php | 6 +- .../features/bootstrap/CardDavContext.php | 10 +- .../features/bootstrap/ChecksumsContext.php | 10 +- .../features/bootstrap/FakeSMTPHelper.php | 14 +- .../integration/features/bootstrap/WebDav.php | 34 +- build/license.php | 6 +- core/Command/Background/JobBase.php | 2 +- core/Command/Background/ListCommand.php | 2 +- core/Command/Config/Import.php | 2 +- core/Command/Db/ConvertType.php | 6 +- core/Command/Info/File.php | 8 +- core/Command/Integrity/SignApp.php | 4 +- core/Command/L10n/CreateJs.php | 2 +- core/Command/Log/File.php | 10 +- core/Command/Log/Manage.php | 8 +- core/Command/Maintenance/Install.php | 6 +- .../Mimetype/GenerateMimetypeFileBuilder.php | 4 +- .../Command/Maintenance/Mimetype/UpdateDB.php | 8 +- .../Command/Maintenance/Mimetype/UpdateJS.php | 2 +- core/Command/SetupChecks.php | 10 +- core/Command/SystemTag/Add.php | 2 +- core/Command/SystemTag/Edit.php | 4 +- core/Command/Upgrade.php | 2 +- core/Command/User/AuthTokens/Add.php | 2 +- core/Command/User/SyncAccountDataCommand.php | 2 +- core/Command/User/Welcome.php | 2 +- core/Controller/AppPasswordController.php | 4 +- core/Controller/ClientFlowLoginController.php | 6 +- .../ClientFlowLoginV2Controller.php | 2 +- core/Controller/CssController.php | 4 +- core/Controller/JsController.php | 4 +- core/Controller/OCMController.php | 2 +- core/Controller/SetupController.php | 2 +- .../TaskProcessingApiController.php | 2 +- .../BeforeMessageLoggedEventListener.php | 14 +- core/Service/LoginFlowV2Service.php | 6 +- core/templates/installation.php | 2 +- core/templates/layout.public.php | 2 +- core/templates/layout.user.php | 6 +- cron.php | 2 +- lib/base.php | 16 +- .../Activity/ActivitySettingsAdapter.php | 2 +- lib/private/AllConfig.php | 2 +- .../AppStore/Fetcher/AppDiscoverFetcher.php | 2 +- .../App/AppStore/Fetcher/AppFetcher.php | 3 +- lib/private/AppConfig.php | 24 +- lib/private/AppFramework/Http/Request.php | 4 +- .../PublicShare/PublicShareMiddleware.php | 2 +- .../Middleware/Security/CORSMiddleware.php | 5 +- .../PasswordConfirmationMiddleware.php | 3 +- .../AppFramework/Services/AppConfig.php | 10 +- lib/private/Archive/Archive.php | 6 +- lib/private/Archive/ZIP.php | 8 +- lib/private/Authentication/Login/Chain.php | 2 +- .../Authentication/Login/WebAuthnChain.php | 2 +- .../Authentication/WebAuthn/Manager.php | 2 +- lib/private/Avatar/Avatar.php | 2 +- lib/private/Avatar/UserAvatar.php | 2 +- lib/private/BackgroundJob/JobList.php | 2 +- .../Collaborators/LookupPlugin.php | 2 +- .../Collaboration/Resources/Collection.php | 2 +- .../Collaboration/Resources/Resource.php | 2 +- lib/private/Comments/Comment.php | 2 +- lib/private/Comments/Manager.php | 10 +- lib/private/Config.php | 6 +- lib/private/Console/Application.php | 2 +- .../Contacts/ContactsMenu/ContactsStore.php | 2 +- lib/private/DB/Adapter.php | 2 +- lib/private/DB/AdapterMySQL.php | 2 +- lib/private/DB/AdapterSqlite.php | 2 +- lib/private/DB/Connection.php | 8 +- lib/private/DB/DbDataCollector.php | 2 +- lib/private/DB/MigrationService.php | 2 +- lib/private/DB/MigratorExecuteSqlEvent.php | 2 +- .../DB/QueryBuilder/CompositeExpression.php | 2 +- .../FunctionBuilder/OCIFunctionBuilder.php | 2 +- .../Partitioned/PartitionedResult.php | 2 +- .../Sharded/CrossShardMoveHelper.php | 2 +- lib/private/DirectEditing/Manager.php | 2 +- lib/private/Encryption/DecryptAll.php | 2 +- lib/private/Encryption/EncryptionWrapper.php | 2 +- .../EncryptionHeaderKeyExistsException.php | 2 +- lib/private/Encryption/Keys/Storage.php | 4 +- lib/private/Encryption/Update.php | 2 +- lib/private/EventSource.php | 4 +- .../CloudFederationProviderManager.php | 2 +- .../Federation/CloudFederationShare.php | 2 +- lib/private/Federation/CloudIdManager.php | 2 +- lib/private/Files/Cache/QuerySearchHelper.php | 2 +- lib/private/Files/Cache/Scanner.php | 2 +- lib/private/Files/Cache/SearchBuilder.php | 8 +- .../Files/Config/CachedMountFileInfo.php | 2 +- lib/private/Files/Config/CachedMountInfo.php | 2 +- .../Files/Config/MountProviderCollection.php | 2 +- lib/private/Files/Config/UserMountCache.php | 2 +- lib/private/Files/Mount/HomeMountPoint.php | 2 +- lib/private/Files/Mount/Manager.php | 2 +- lib/private/Files/Mount/MountPoint.php | 2 +- lib/private/Files/Node/HookConnector.php | 2 +- .../Files/ObjectStore/ObjectStoreStorage.php | 4 +- lib/private/Files/ObjectStore/S3Signature.php | 8 +- lib/private/Files/Search/SearchComparison.php | 2 +- lib/private/Files/Search/SearchOrder.php | 2 +- lib/private/Files/Search/SearchQuery.php | 2 +- lib/private/Files/SetupManager.php | 6 +- lib/private/Files/Storage/CommonTest.php | 2 +- lib/private/Files/Storage/DAV.php | 4 +- .../Files/Storage/Wrapper/Encryption.php | 10 +- .../Files/Template/TemplateManager.php | 2 +- .../FilesMetadata/FilesMetadataManager.php | 6 +- .../Job/UpdateSingleMetadata.php | 2 +- .../FilesMetadata/Listener/MetadataDelete.php | 2 +- .../FilesMetadata/Listener/MetadataUpdate.php | 2 +- lib/private/FilesMetadata/MetadataQuery.php | 2 +- .../FilesMetadata/Model/FilesMetadata.php | 2 +- .../Service/IndexRequestService.php | 2 +- .../Service/MetadataRequestService.php | 2 +- lib/private/Group/Manager.php | 2 +- lib/private/Group/MetaData.php | 2 +- lib/private/Http/Client/Client.php | 4 +- lib/private/Http/Client/DnsPinMiddleware.php | 6 +- lib/private/InitialStateService.php | 4 +- lib/private/Installer.php | 20 +- lib/private/IntegrityCheck/Checker.php | 4 +- lib/private/L10N/Factory.php | 2 +- lib/private/Lock/AbstractLockingProvider.php | 4 +- lib/private/Lock/DBLockingProvider.php | 2 +- lib/private/Log.php | 2 +- lib/private/Log/Errorlog.php | 2 +- lib/private/Log/File.php | 6 +- lib/private/Log/LogFactory.php | 2 +- lib/private/Log/Rotate.php | 2 +- lib/private/Log/Systemdlog.php | 4 +- lib/private/Mail/Attachment.php | 2 +- lib/private/Mail/Provider/Manager.php | 6 +- lib/private/Memcache/Factory.php | 2 +- lib/private/MemoryInfo.php | 2 +- lib/private/Migration/MetadataManager.php | 2 +- lib/private/NaturalSort.php | 2 +- lib/private/NavigationManager.php | 2 +- lib/private/OCS/DiscoveryService.php | 2 +- lib/private/OCS/Provider.php | 6 +- lib/private/Preview/BackgroundCleanupJob.php | 2 +- lib/private/Preview/Generator.php | 2 +- lib/private/Preview/MimeIconProvider.php | 4 +- lib/private/PreviewManager.php | 2 +- lib/private/Profiler/FileProfilerStorage.php | 14 +- lib/private/Repair.php | 2 +- lib/private/Repair/Collation.php | 2 +- .../Repair/Events/RepairAdvanceEvent.php | 2 +- .../Repair/Events/RepairErrorEvent.php | 2 +- lib/private/Repair/Events/RepairInfoEvent.php | 2 +- .../Repair/Events/RepairStartEvent.php | 2 +- lib/private/Repair/Events/RepairStepEvent.php | 2 +- .../Repair/Events/RepairWarningEvent.php | 2 +- lib/private/Repair/RepairDavShares.php | 2 +- lib/private/Repair/RepairMimeTypes.php | 2 +- lib/private/RichObjectStrings/Validator.php | 2 +- lib/private/Route/Router.php | 2 +- lib/private/Search/Filter/BooleanFilter.php | 2 +- lib/private/Search/Filter/DateTimeFilter.php | 2 +- lib/private/Search/Filter/FloatFilter.php | 2 +- lib/private/Search/Filter/GroupFilter.php | 2 +- lib/private/Search/Filter/IntegerFilter.php | 2 +- lib/private/Search/Filter/UserFilter.php | 2 +- lib/private/Search/FilterFactory.php | 2 +- lib/private/Search/SearchComposer.php | 10 +- lib/private/Search/UnsupportedFilter.php | 2 +- .../Bruteforce/Backend/MemoryCacheBackend.php | 2 +- .../CSP/ContentSecurityPolicyManager.php | 6 +- lib/private/Security/Crypto.php | 4 +- lib/private/Security/Hasher.php | 2 +- lib/private/Security/Normalizer/IpAddress.php | 6 +- .../RateLimiting/Backend/DatabaseBackend.php | 4 +- .../VerificationToken/VerificationToken.php | 10 +- lib/private/Settings/Manager.php | 2 +- lib/private/Setup.php | 8 +- lib/private/Setup/AbstractDatabase.php | 2 +- lib/private/Setup/MySQL.php | 2 +- lib/private/SetupCheck/SetupCheckManager.php | 4 +- lib/private/Share/Share.php | 4 +- lib/private/Share20/Manager.php | 4 +- lib/private/SystemTag/SystemTagManager.php | 8 +- .../SystemTag/SystemTagsInFilesDetector.php | 2 +- lib/private/Tags.php | 4 +- lib/private/TaskProcessing/Db/Task.php | 2 +- lib/private/TaskProcessing/Manager.php | 8 +- lib/private/Teams/TeamManager.php | 2 +- lib/private/Template/Base.php | 14 +- lib/private/Template/CSSResourceLocator.php | 14 +- lib/private/Template/JSConfigHelper.php | 2 +- lib/private/Template/JSResourceLocator.php | 30 +- lib/private/Template/ResourceLocator.php | 2 +- lib/private/Template/TemplateFileLocator.php | 4 +- lib/private/TemplateLayout.php | 8 +- lib/private/TextProcessing/Db/Task.php | 2 +- lib/private/TextProcessing/Manager.php | 4 +- .../RemoveOldTasksBackgroundJob.php | 1 - lib/private/TextToImage/Db/Task.php | 2 +- lib/private/TextToImage/Db/TaskMapper.php | 2 +- lib/private/TextToImage/Manager.php | 6 +- lib/private/URLGenerator.php | 8 +- lib/private/Updater.php | 22 +- lib/private/User/Manager.php | 2 +- lib/private/User/OutOfOfficeData.php | 6 +- lib/private/User/User.php | 2 +- lib/private/legacy/OC_App.php | 2 +- lib/private/legacy/OC_Defaults.php | 4 +- lib/private/legacy/OC_Files.php | 12 +- lib/private/legacy/OC_Helper.php | 2 +- lib/private/legacy/OC_JSON.php | 2 +- lib/private/legacy/OC_Response.php | 4 +- lib/private/legacy/OC_Template.php | 10 +- lib/private/legacy/OC_Util.php | 4 +- lib/private/legacy/template/functions.php | 14 +- lib/public/App/IAppManager.php | 2 +- .../AuthPublicShareController.php | 2 +- lib/public/AppFramework/Controller.php | 2 +- lib/public/AppFramework/Db/QBMapper.php | 2 +- .../Http/Attribute/AuthorizedAdminSetting.php | 2 +- .../Http/Attribute/BruteForceProtection.php | 2 +- .../Http/EmptyContentSecurityPolicy.php | 2 +- .../BeforeLoginTemplateRenderedEvent.php | 4 +- lib/public/AppFramework/Http/Response.php | 2 +- .../TwoFactorProviderChallengeFailed.php | 3 +- .../TwoFactorProviderChallengePassed.php | 3 +- lib/public/AutoloadNotAllowedException.php | 2 +- lib/public/Comments/ICommentsManager.php | 8 +- .../Files/Events/Node/AbstractNodeEvent.php | 2 +- .../Files/Events/Node/AbstractNodesEvent.php | 2 +- lib/public/Files/Lock/LockContext.php | 2 +- lib/public/Files/Template/Field.php | 2 +- lib/public/Files/Template/FieldFactory.php | 2 +- .../Template/RegisterTemplateCreatorEvent.php | 2 +- .../Files/Template/TemplateFileCreator.php | 2 +- lib/public/FilesMetadata/AMetadataEvent.php | 2 +- .../Event/MetadataNamedEvent.php | 2 +- .../FilesMetadata/IFilesMetadataManager.php | 4 +- lib/public/INavigationManager.php | 2 +- lib/public/Log/RotationTrait.php | 2 +- lib/public/Mail/Provider/Address.php | 6 +- lib/public/Mail/Provider/Attachment.php | 8 +- lib/public/Mail/Provider/IAddress.php | 4 +- lib/public/Mail/Provider/IAttachment.php | 6 +- lib/public/Mail/Provider/IManager.php | 6 +- lib/public/Mail/Provider/IMessage.php | 12 +- lib/public/Mail/Provider/IProvider.php | 4 +- lib/public/Mail/Provider/Message.php | 12 +- .../Attributes/GenericMigrationAttribute.php | 2 +- lib/public/Preview/IMimeIconProvider.php | 2 +- .../DeclarativeSettingsRegisterFormEvent.php | 4 +- lib/public/Share/IShare.php | 2 +- .../Events/AbstractTaskProcessingEvent.php | 2 +- lib/public/TaskProcessing/IManager.php | 2 +- lib/public/Teams/Team.php | 6 +- .../Events/AbstractTextProcessingEvent.php | 2 +- .../Events/AbstractTextToImageEvent.php | 2 +- lib/public/Translation/LanguageTuple.php | 2 +- .../User/Events/OutOfOfficeChangedEvent.php | 4 +- .../User/Events/OutOfOfficeClearedEvent.php | 4 +- .../User/Events/OutOfOfficeEndedEvent.php | 4 +- .../User/Events/OutOfOfficeScheduledEvent.php | 4 +- .../User/Events/OutOfOfficeStartedEvent.php | 4 +- lib/public/UserMigration/IMigrator.php | 6 +- .../TMigratorBasicVersionHandling.php | 2 +- lib/public/Util.php | 4 +- ocs/providers.php | 2 +- ocs/v1.php | 6 +- public.php | 2 +- remote.php | 6 +- tests/Core/Command/Log/FileTest.php | 2 +- tests/Core/Command/Maintenance/ModeTest.php | 2 +- tests/Core/Command/SystemTag/AddTest.php | 2 +- tests/Core/Command/SystemTag/EditTest.php | 6 +- .../Controller/AppPasswordControllerTest.php | 4 +- .../Core/Controller/AvatarControllerTest.php | 26 +- .../ClientFlowLoginControllerTest.php | 8 +- .../ClientFlowLoginV2ControllerTest.php | 2 +- .../Service/LoginFlowV2ServiceUnitTest.php | 2 +- tests/enable_all.php | 2 +- tests/lib/AllConfigTest.php | 2 +- tests/lib/App/AppManagerTest.php | 2 +- .../Fetcher/AppDiscoverFetcherTest.php | 2 +- tests/lib/App/InfoParserTest.php | 2 +- tests/lib/AppConfigTest.php | 4 +- .../Http/DownloadResponseTest.php | 2 +- .../lib/AppFramework/Routing/RoutingTest.php | 2 +- tests/lib/AppTest.php | 4 +- tests/lib/Archive/TestBase.php | 44 +-- tests/lib/Archive/ZIPTest.php | 2 +- .../Token/PublicKeyTokenProviderTest.php | 8 +- .../Collaborators/GroupPluginTest.php | 2 +- .../Collaborators/SearchTest.php | 2 +- .../Collaborators/UserPluginTest.php | 2 +- tests/lib/Comments/FakeManager.php | 6 +- tests/lib/ConfigTest.php | 4 +- tests/lib/ErrorHandlerTest.php | 2 +- tests/lib/Files/Config/UserMountCacheTest.php | 2 +- .../ObjectStore/ObjectStoreStorageTest.php | 4 +- tests/lib/Files/Storage/StoragesTest.php | 8 +- .../Files/Storage/Wrapper/EncodingTest.php | 2 +- .../Files/Storage/Wrapper/EncryptionTest.php | 2 +- tests/lib/Files/ViewTest.php | 4 +- tests/lib/Http/Client/ClientTest.php | 6 +- tests/lib/ImageTest.php | 94 +++--- tests/lib/InfoXmlTest.php | 2 +- tests/lib/IntegrityCheck/CheckerTest.php | 66 ++-- tests/lib/L10N/L10nTest.php | 12 +- tests/lib/Log/LogFactoryTest.php | 6 +- tests/lib/NavigationManagerTest.php | 2 +- .../lib/Preview/BackgroundCleanupJobTest.php | 2 +- tests/lib/Route/RouterTest.php | 2 +- tests/lib/Security/CertificateManagerTest.php | 2 +- tests/lib/Security/CertificateTest.php | 2 +- tests/lib/Security/SecureRandomTest.php | 2 +- tests/lib/Share/Backend.php | 4 +- .../lib/Share20/DefaultShareProviderTest.php | 40 +-- tests/lib/SubAdminTest.php | 4 +- .../lib/TaskProcessing/TaskProcessingTest.php | 4 +- tests/lib/TestCase.php | 2 +- tests/lib/Updater/VersionCheckTest.php | 2 +- tests/preseed-config.php | 2 +- vendor-bin/cs-fixer/composer.json | 2 +- vendor-bin/cs-fixer/composer.lock | 73 +++- 595 files changed, 1654 insertions(+), 1523 deletions(-) diff --git a/apps/admin_audit/lib/Actions/Action.php b/apps/admin_audit/lib/Actions/Action.php index 5d06cf4fbf515..2566025a8ce57 100644 --- a/apps/admin_audit/lib/Actions/Action.php +++ b/apps/admin_audit/lib/Actions/Action.php @@ -32,13 +32,13 @@ public function log(string $text, if (!isset($params[$element])) { if ($obfuscateParameters) { $this->logger->critical( - '$params["'.$element.'"] was missing.', + '$params["' . $element . '"] was missing.', ['app' => 'admin_audit'] ); } else { $this->logger->critical( sprintf( - '$params["'.$element.'"] was missing. Transferred value: %s', + '$params["' . $element . '"] was missing. Transferred value: %s', print_r($params, true) ), ['app' => 'admin_audit'] diff --git a/apps/admin_audit/lib/Actions/Files.php b/apps/admin_audit/lib/Actions/Files.php index 5c08640d2d2af..86eba871ea7cd 100644 --- a/apps/admin_audit/lib/Actions/Files.php +++ b/apps/admin_audit/lib/Actions/Files.php @@ -42,7 +42,7 @@ public function read(BeforeNodeReadEvent $event): void { ]; } 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; } @@ -64,7 +64,7 @@ public function beforeRename(BeforeNodeRenamedEvent $event): void { $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; } @@ -86,7 +86,7 @@ public function afterRename(NodeRenamedEvent $event): void { ]; } 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; } @@ -112,7 +112,7 @@ public function create(NodeCreatedEvent $event): void { ]; } 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; } @@ -141,7 +141,7 @@ public function copy(NodeCopiedEvent $event): void { ]; } 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; } @@ -166,7 +166,7 @@ public function write(BeforeNodeWrittenEvent $event): void { ]; } 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; } @@ -194,7 +194,7 @@ public function update(NodeWrittenEvent $event): void { ]; } 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; } @@ -218,7 +218,7 @@ public function delete(NodeDeletedEvent $event): void { ]; } 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; } diff --git a/apps/admin_audit/lib/Listener/FileEventListener.php b/apps/admin_audit/lib/Listener/FileEventListener.php index 74bb2ac836c52..369f97239d7fa 100644 --- a/apps/admin_audit/lib/Listener/FileEventListener.php +++ b/apps/admin_audit/lib/Listener/FileEventListener.php @@ -48,7 +48,7 @@ private function beforePreviewFetched(BeforePreviewFetchedEvent $event): void { ); } 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/Controller/RequestHandlerController.php b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php index a49d70b693088..733f02434cd14 100644 --- a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php +++ b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php @@ -50,7 +50,7 @@ public function __construct( private ICloudFederationProviderManager $cloudFederationProviderManager, private Config $config, private ICloudFederationFactory $factory, - private ICloudIdManager $cloudIdManager + private ICloudIdManager $cloudIdManager, ) { parent::__construct($appName, $request); } diff --git a/apps/comments/lib/Controller/NotificationsController.php b/apps/comments/lib/Controller/NotificationsController.php index a3228247884ae..2dc94b2e66367 100644 --- a/apps/comments/lib/Controller/NotificationsController.php +++ b/apps/comments/lib/Controller/NotificationsController.php @@ -33,7 +33,7 @@ public function __construct( protected IRootFolder $rootFolder, protected IURLGenerator $urlGenerator, protected IManager $notificationManager, - protected IUserSession $userSession + protected IUserSession $userSession, ) { parent::__construct($appName, $request); } diff --git a/apps/comments/lib/Notification/Listener.php b/apps/comments/lib/Notification/Listener.php index 44fb8fe3f4c4b..43922f85e59c4 100644 --- a/apps/comments/lib/Notification/Listener.php +++ b/apps/comments/lib/Notification/Listener.php @@ -16,7 +16,7 @@ class Listener { public function __construct( protected IManager $notificationManager, - protected IUserManager $userManager + protected IUserManager $userManager, ) { } diff --git a/apps/comments/lib/Notification/Notifier.php b/apps/comments/lib/Notification/Notifier.php index d5563ef7d8557..62562bf42aaca 100644 --- a/apps/comments/lib/Notification/Notifier.php +++ b/apps/comments/lib/Notification/Notifier.php @@ -25,7 +25,7 @@ public function __construct( protected IRootFolder $rootFolder, protected ICommentsManager $commentsManager, protected IURLGenerator $url, - protected IUserManager $userManager + protected IUserManager $userManager, ) { } diff --git a/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php b/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php index c214f8950cb88..abf12f7d58793 100644 --- a/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php +++ b/apps/dav/lib/BackgroundJob/BuildReminderIndexBackgroundJob.php @@ -56,7 +56,7 @@ public function run($argument) { $offset = (int)$argument['offset']; $stopAt = (int)$argument['stopAt']; - $this->logger->info('Building calendar reminder index (' . $offset .'/' . $stopAt . ')'); + $this->logger->info('Building calendar reminder index (' . $offset . '/' . $stopAt . ')'); $offset = $this->buildIndex($offset, $stopAt); diff --git a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php index f9c4d8dcd74be..7cc56698a9fc1 100644 --- a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php +++ b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php @@ -28,14 +28,16 @@ use Sabre\VObject\Recur\RRuleIterator; class UserStatusAutomation extends TimedJob { - public function __construct(private ITimeFactory $timeFactory, + public function __construct( + private ITimeFactory $timeFactory, private IDBConnection $connection, private IJobList $jobList, private LoggerInterface $logger, private IManager $manager, private IConfig $config, private IAvailabilityCoordinator $coordinator, - private IUserManager $userManager) { + private IUserManager $userManager, + ) { parent::__construct($timeFactory); // Interval 0 might look weird, but the last_checked is always moved diff --git a/apps/dav/lib/BulkUpload/BulkUploadPlugin.php b/apps/dav/lib/BulkUpload/BulkUploadPlugin.php index 8a99beaec6a9a..381f6aa9e3350 100644 --- a/apps/dav/lib/BulkUpload/BulkUploadPlugin.php +++ b/apps/dav/lib/BulkUpload/BulkUploadPlugin.php @@ -22,7 +22,7 @@ class BulkUploadPlugin extends ServerPlugin { public function __construct( Folder $userFolder, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->userFolder = $userFolder; $this->logger = $logger; diff --git a/apps/dav/lib/BulkUpload/MultipartRequestParser.php b/apps/dav/lib/BulkUpload/MultipartRequestParser.php index 97aa0597b34ea..107c67ea691b6 100644 --- a/apps/dav/lib/BulkUpload/MultipartRequestParser.php +++ b/apps/dav/lib/BulkUpload/MultipartRequestParser.php @@ -45,8 +45,8 @@ public function __construct( $this->stream = $stream; $boundary = $this->parseBoundaryFromHeaders($contentType); - $this->boundary = '--'.$boundary."\r\n"; - $this->lastBoundary = '--'.$boundary."--\r\n"; + $this->boundary = '--' . $boundary . "\r\n"; + $this->lastBoundary = '--' . $boundary . "--\r\n"; } /** diff --git a/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php b/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php index de5b1139880e0..933679436d45f 100644 --- a/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php +++ b/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php @@ -110,7 +110,7 @@ public function httpPost(RequestInterface $request, ResponseInterface $response) $requestBody = $request->getBodyAsString(); $this->server->xml->parse($requestBody, $request->getUrl(), $documentType); - if ($documentType !== '{'.self::NS_Nextcloud.'}enable-birthday-calendar') { + if ($documentType !== '{' . self::NS_Nextcloud . '}enable-birthday-calendar') { return; } diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index a10d73c4aa005..9a717b96d638a 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -108,7 +108,7 @@ public function onCardDeleted(int $addressBookId, $calendar = $this->ensureCalendarExists($principalUri); foreach (['', '-death', '-anniversary'] as $tag) { - $objectUri = $book['uri'] . '-' . $cardUri . $tag .'.ics'; + $objectUri = $book['uri'] . '-' . $cardUri . $tag . '.ics'; $this->calDavBackEnd->deleteCalendarObject($calendar['id'], $objectUri, CalDavBackend::CALENDAR_TYPE_CALENDAR, true); } } @@ -264,7 +264,7 @@ public function buildDateFromContact(string $cardData, * @param string $user */ public function resetForUser(string $user):void { - $principal = 'principals/users/'.$user; + $principal = 'principals/users/' . $user; $calendar = $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI); if (!$calendar) { return; // The user's birthday calendar doesn't exist, no need to purge it @@ -281,7 +281,7 @@ public function resetForUser(string $user):void { * @throws \Sabre\DAV\Exception\BadRequest */ public function syncUser(string $user):void { - $principal = 'principals/users/'.$user; + $principal = 'principals/users/' . $user; $this->ensureCalendarExists($principal); $books = $this->cardDavBackEnd->getAddressBooksForUser($principal); foreach ($books as $book) { diff --git a/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php b/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php index 17e6f4389cc59..1301fdb600091 100644 --- a/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php +++ b/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php @@ -20,7 +20,7 @@ class CachedSubscriptionImpl implements ICalendar { public function __construct( CachedSubscription $calendar, array $calendarInfo, - CalDavBackend $backend + CalDavBackend $backend, ) { $this->calendar = $calendar; $this->calendarInfo = $calendarInfo; diff --git a/apps/dav/lib/CalDAV/CachedSubscriptionProvider.php b/apps/dav/lib/CalDAV/CachedSubscriptionProvider.php index 73fde0b71a066..d64f039d05b79 100644 --- a/apps/dav/lib/CalDAV/CachedSubscriptionProvider.php +++ b/apps/dav/lib/CalDAV/CachedSubscriptionProvider.php @@ -13,7 +13,7 @@ class CachedSubscriptionProvider implements ICalendarProvider { public function __construct( - private CalDavBackend $calDavBackend + private CalDavBackend $calDavBackend, ) { } diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 8b619712b8253..b8dfe762e35d7 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -354,7 +354,7 @@ public function getCalendarsForUser($principalUri) { $fields = array_column($this->propertyMap, 0); $fields = array_map(function (string $field) { - return 'a.'.$field; + return 'a.' . $field; }, $fields); $fields[] = 'a.id'; $fields[] = 'a.uri'; @@ -1713,19 +1713,19 @@ public function calendarQuery($calendarId, array $filters, $calendarType = self: try { $matches = $this->validateFilterForObject($row, $filters); } catch (ParseException $ex) { - $this->logger->error('Caught parsing exception for calendar data. This usually indicates invalid calendar data. calendar-id:'.$calendarId.' uri:'.$row['uri'], [ + $this->logger->error('Caught parsing exception for calendar data. This usually indicates invalid calendar data. calendar-id:' . $calendarId . ' uri:' . $row['uri'], [ 'app' => 'dav', 'exception' => $ex, ]); continue; } catch (InvalidDataException $ex) { - $this->logger->error('Caught invalid data exception for calendar data. This usually indicates invalid calendar data. calendar-id:'.$calendarId.' uri:'.$row['uri'], [ + $this->logger->error('Caught invalid data exception for calendar data. This usually indicates invalid calendar data. calendar-id:' . $calendarId . ' uri:' . $row['uri'], [ 'app' => 'dav', 'exception' => $ex, ]); continue; } catch (MaxInstancesExceededException $ex) { - $this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: '.$row['uri'], [ + $this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: ' . $row['uri'], [ 'app' => 'dav', 'exception' => $ex, ]); @@ -1848,7 +1848,7 @@ public function calendarSearch($principalUri, array $filters, $limit = null, $of ->andWhere($compExpr) ->andWhere($propParamExpr) ->andWhere($query->expr()->iLike('i.value', - $query->createNamedParameter('%'.$this->db->escapeLikeParameter($filters['search-term']).'%'))) + $query->createNamedParameter('%' . $this->db->escapeLikeParameter($filters['search-term']) . '%'))) ->andWhere($query->expr()->isNull('deleted_at')); if ($offset) { @@ -1890,7 +1890,7 @@ public function search( array $searchProperties, array $options, $limit, - $offset + $offset, ) { $outerQuery = $this->db->getQueryBuilder(); $innerQuery = $this->db->getQueryBuilder(); @@ -2066,7 +2066,7 @@ public function search( return $calendarObjects; } - private function searchCalendarObjects(IQueryBuilder $query, DateTimeInterface|null $start, DateTimeInterface|null $end): array { + private function searchCalendarObjects(IQueryBuilder $query, ?DateTimeInterface $start, ?DateTimeInterface $end): array { $calendarObjects = []; $filterByTimeRange = ($start instanceof DateTimeInterface) || ($end instanceof DateTimeInterface); @@ -2099,7 +2099,7 @@ private function searchCalendarObjects(IQueryBuilder $query, DateTimeInterface|n 'time-range' => null, ]); } catch (MaxInstancesExceededException $ex) { - $this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: '.$row['uri'], [ + $this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: ' . $row['uri'], [ 'app' => 'dav', 'exception' => $ex, ]); @@ -2196,7 +2196,7 @@ public function searchPrincipalUri(string $principalUri, array $componentTypes, array $searchProperties, array $searchParameters, - array $options = [] + array $options = [], ): array { return $this->atomic(function () use ($principalUri, $pattern, $componentTypes, $searchProperties, $searchParameters, $options) { $escapePattern = !\array_key_exists('escape_like_param', $options) || $options['escape_like_param'] !== false; diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php index 28267921a6f35..d3e0b3b222662 100644 --- a/apps/dav/lib/CalDAV/Calendar.php +++ b/apps/dav/lib/CalDAV/Calendar.php @@ -189,8 +189,8 @@ public function getACL() { $acl = $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl); $allowedPrincipals = [ $this->getOwner(), - $this->getOwner(). '/calendar-proxy-read', - $this->getOwner(). '/calendar-proxy-write', + $this->getOwner() . '/calendar-proxy-read', + $this->getOwner() . '/calendar-proxy-write', parent::getOwner(), 'principals/system/public' ]; diff --git a/apps/dav/lib/CalDAV/CalendarHome.php b/apps/dav/lib/CalDAV/CalendarHome.php index 59a976ca6bc3d..4ac00578969ac 100644 --- a/apps/dav/lib/CalDAV/CalendarHome.php +++ b/apps/dav/lib/CalDAV/CalendarHome.php @@ -42,7 +42,7 @@ public function __construct( BackendInterface $caldavBackend, array $principalInfo, LoggerInterface $logger, - private bool $returnCachedSubscriptions + private bool $returnCachedSubscriptions, ) { parent::__construct($caldavBackend, $principalInfo); $this->l10n = \OC::$server->getL10N('dav'); diff --git a/apps/dav/lib/CalDAV/CalendarRoot.php b/apps/dav/lib/CalDAV/CalendarRoot.php index 7e57b70c48144..9ab3a4dd43f1e 100644 --- a/apps/dav/lib/CalDAV/CalendarRoot.php +++ b/apps/dav/lib/CalDAV/CalendarRoot.php @@ -20,7 +20,7 @@ public function __construct( PrincipalBackend\BackendInterface $principalBackend, Backend\BackendInterface $caldavBackend, $principalPrefix, - LoggerInterface $logger + LoggerInterface $logger, ) { parent::__construct($principalBackend, $caldavBackend, $principalPrefix); $this->logger = $logger; diff --git a/apps/dav/lib/CalDAV/EventReader.php b/apps/dav/lib/CalDAV/EventReader.php index bdceb184fb01b..6e845c596ae0d 100644 --- a/apps/dav/lib/CalDAV/EventReader.php +++ b/apps/dav/lib/CalDAV/EventReader.php @@ -89,7 +89,7 @@ public function __construct(VCalendar|VEvent|array|string $input, ?string $uid = $events = $input->getByUID($uid); // evaluate if any event where found if (count($events) === 0) { - throw new InvalidArgumentException('This VCALENDAR did not have an event with UID: '.$uid); + throw new InvalidArgumentException('This VCALENDAR did not have an event with UID: ' . $uid); } // extract calendar timezone if (isset($input->VTIMEZONE) && isset($input->VTIMEZONE->TZID)) { @@ -297,7 +297,7 @@ public function recurs(): bool { * * @return string|null R - Relative or A - Absolute */ - public function recurringPattern(): string|null { + public function recurringPattern(): ?string { if ($this->rruleIterator === null && $this->rdateIterator === null) { return null; } @@ -314,7 +314,7 @@ public function recurringPattern(): string|null { * * @return string|null daily, weekly, monthly, yearly, fixed */ - public function recurringPrecision(): string|null { + public function recurringPrecision(): ?string { if ($this->rruleIterator !== null) { return $this->rruleIterator->precision(); } @@ -331,7 +331,7 @@ public function recurringPrecision(): string|null { * * @return int|null */ - public function recurringInterval(): int|null { + public function recurringInterval(): ?int { return $this->rruleIterator?->interval(); } @@ -374,7 +374,7 @@ public function recurringConcludes(): bool { * * @return int|null */ - public function recurringConcludesAfter(): int|null { + public function recurringConcludesAfter(): ?int { // construct count place holder $count = 0; @@ -399,7 +399,7 @@ public function recurringConcludesAfter(): int|null { * * @return DateTime|null */ - public function recurringConcludesOn(): DateTime|null { + public function recurringConcludesOn(): ?DateTime { if ($this->rruleIterator !== null) { // retrieve rrule conclusion date @@ -626,7 +626,7 @@ public function recurringRelativePositionNamed(): array { * * @return DateTime */ - public function recurrenceDate(): DateTime|null { + public function recurrenceDate(): ?DateTime { if ($this->recurrenceCurrentDate !== null) { return DateTime::createFromInterface($this->recurrenceCurrentDate); } else { diff --git a/apps/dav/lib/CalDAV/EventReaderRDate.php b/apps/dav/lib/CalDAV/EventReaderRDate.php index 9d9669dc0f346..20234d06c00d5 100644 --- a/apps/dav/lib/CalDAV/EventReaderRDate.php +++ b/apps/dav/lib/CalDAV/EventReaderRDate.php @@ -13,15 +13,15 @@ class EventReaderRDate extends \Sabre\VObject\Recur\RDateIterator { - public function concludes(): DateTime|null { + public function concludes(): ?DateTime { return $this->concludesOn(); } - public function concludesAfter(): int|null { + public function concludesAfter(): ?int { return !empty($this->dates) ? count($this->dates) : null; } - public function concludesOn(): DateTime|null { + public function concludesOn(): ?DateTime { 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 fc229ddcd4464..d2b4968c47940 100644 --- a/apps/dav/lib/CalDAV/EventReaderRRule.php +++ b/apps/dav/lib/CalDAV/EventReaderRRule.php @@ -22,7 +22,7 @@ public function interval(): int { return $this->interval; } - public function concludes(): DateTime|null { + public function concludes(): ?DateTime { // evaluate if until value is a date if ($this->until instanceof DateTimeInterface) { return DateTime::createFromInterface($this->until); @@ -48,11 +48,11 @@ public function concludes(): DateTime|null { return null; } - public function concludesAfter(): int|null { + public function concludesAfter(): ?int { return !empty($this->count) ? $this->count : null; } - public function concludesOn(): DateTime|null { + public function concludesOn(): ?DateTime { 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 1b30884cf12f9..6f8746283d124 100644 --- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php +++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php @@ -97,17 +97,17 @@ public function initialize(Server $server) { public function propFind(PropFind $propFind, INode $node) { if ($node instanceof Calendar) { - $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node) { + $propFind->handle('{' . self::NS_CALENDARSERVER . '}publish-url', function () use ($node) { if ($node->getPublishStatus()) { // We return the publish-url only if the calendar is published. $token = $node->getPublishStatus(); - $publishUrl = $this->urlGenerator->getAbsoluteURL($this->server->getBaseUri().'public-calendars/').$token; + $publishUrl = $this->urlGenerator->getAbsoluteURL($this->server->getBaseUri() . 'public-calendars/') . $token; return new Publisher($publishUrl, true); } }); - $propFind->handle('{'.self::NS_CALENDARSERVER.'}allowed-sharing-modes', function () use ($node) { + $propFind->handle('{' . self::NS_CALENDARSERVER . '}allowed-sharing-modes', function () use ($node) { $canShare = (!$node->isSubscription() && $node->canWrite()); $canPublish = (!$node->isSubscription() && $node->canWrite()); @@ -160,7 +160,7 @@ public function httpPost(RequestInterface $request, ResponseInterface $response) switch ($documentType) { - case '{'.self::NS_CALENDARSERVER.'}publish-calendar': + case '{' . self::NS_CALENDARSERVER . '}publish-calendar': // We can only deal with IShareableCalendar objects if (!$node instanceof Calendar) { @@ -195,7 +195,7 @@ public function httpPost(RequestInterface $request, ResponseInterface $response) // Breaking the event chain return false; - case '{'.self::NS_CALENDARSERVER.'}unpublish-calendar': + case '{' . self::NS_CALENDARSERVER . '}unpublish-calendar': // We can only deal with IShareableCalendar objects if (!$node instanceof Calendar) { diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php index b6032e733d991..293ce6a8788f5 100644 --- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php +++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php @@ -446,7 +446,7 @@ private function getRemindersForVAlarm(VAlarm $valarm, private function writeRemindersToDatabase(array $reminders): void { $uniqueReminders = []; foreach ($reminders as $reminder) { - $key = $reminder['notification_date']. $reminder['event_hash'].$reminder['type']; + $key = $reminder['notification_date'] . $reminder['event_hash'] . $reminder['type']; if (!isset($uniqueReminders[$key])) { $uniqueReminders[$key] = $reminder; } diff --git a/apps/dav/lib/CalDAV/Sharing/Backend.php b/apps/dav/lib/CalDAV/Sharing/Backend.php index 40fb7e03e5f2f..fc5d65b5994b4 100644 --- a/apps/dav/lib/CalDAV/Sharing/Backend.php +++ b/apps/dav/lib/CalDAV/Sharing/Backend.php @@ -17,7 +17,8 @@ class Backend extends SharingBackend { - public function __construct(private IUserManager $userManager, + public function __construct( + private IUserManager $userManager, private IGroupManager $groupManager, private Principal $principalBackend, private ICacheFactory $cacheFactory, diff --git a/apps/dav/lib/CalDAV/Sharing/Service.php b/apps/dav/lib/CalDAV/Sharing/Service.php index 7867b8d1adb9f..4f0554f09bd22 100644 --- a/apps/dav/lib/CalDAV/Sharing/Service.php +++ b/apps/dav/lib/CalDAV/Sharing/Service.php @@ -13,7 +13,9 @@ class Service extends SharingService { protected string $resourceType = 'calendar'; - public function __construct(protected SharingMapper $mapper) { + public function __construct( + protected SharingMapper $mapper, + ) { parent::__construct($mapper); } } diff --git a/apps/dav/lib/CalDAV/Status/StatusService.php b/apps/dav/lib/CalDAV/Status/StatusService.php index 56eec5007b8a3..de19174de58da 100644 --- a/apps/dav/lib/CalDAV/Status/StatusService.php +++ b/apps/dav/lib/CalDAV/Status/StatusService.php @@ -27,13 +27,15 @@ class StatusService { private ICache $cache; - public function __construct(private ITimeFactory $timeFactory, + public function __construct( + private ITimeFactory $timeFactory, private IManager $calendarManager, private IUserManager $userManager, private UserStatusService $userStatusService, private IAvailabilityCoordinator $availabilityCoordinator, private ICacheFactory $cacheFactory, - private LoggerInterface $logger) { + private LoggerInterface $logger, + ) { $this->cache = $cacheFactory->createLocal('CalendarStatusService'); } diff --git a/apps/dav/lib/CalDAV/TimezoneService.php b/apps/dav/lib/CalDAV/TimezoneService.php index 93f19be1b55d1..a7709bde0f9e4 100644 --- a/apps/dav/lib/CalDAV/TimezoneService.php +++ b/apps/dav/lib/CalDAV/TimezoneService.php @@ -20,9 +20,11 @@ class TimezoneService { - public function __construct(private IConfig $config, + public function __construct( + private IConfig $config, private PropertyMapper $propertyMapper, - private IManager $calendarManager) { + private IManager $calendarManager, + ) { } public function getUserTimezone(string $userId): ?string { diff --git a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php index 1326a42399b3f..06f4a153bf9b1 100644 --- a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php +++ b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php @@ -72,7 +72,7 @@ public function get() { public function getContentType() { $mime = 'text/calendar; charset=utf-8'; if (isset($this->objectData['component']) && $this->objectData['component']) { - $mime .= '; component='.$this->objectData['component']; + $mime .= '; component=' . $this->objectData['component']; } return $mime; diff --git a/apps/dav/lib/CalDAV/UpcomingEvent.php b/apps/dav/lib/CalDAV/UpcomingEvent.php index 26760ffedd5c7..e8b604f460a26 100644 --- a/apps/dav/lib/CalDAV/UpcomingEvent.php +++ b/apps/dav/lib/CalDAV/UpcomingEvent.php @@ -13,13 +13,15 @@ use OCA\DAV\ResponseDefinitions; class UpcomingEvent implements JsonSerializable { - public function __construct(private string $uri, + public function __construct( + private string $uri, private ?int $recurrenceId, private string $calendarUri, private ?int $start, private ?string $summary, private ?string $location, - private ?string $calendarAppUrl) { + private ?string $calendarAppUrl, + ) { } public function getUri(): string { diff --git a/apps/dav/lib/CalDAV/UpcomingEventsService.php b/apps/dav/lib/CalDAV/UpcomingEventsService.php index 04ab1be19b462..9c054deb4e014 100644 --- a/apps/dav/lib/CalDAV/UpcomingEventsService.php +++ b/apps/dav/lib/CalDAV/UpcomingEventsService.php @@ -17,11 +17,13 @@ use function array_map; class UpcomingEventsService { - public function __construct(private IManager $calendarManager, + public function __construct( + private IManager $calendarManager, private ITimeFactory $timeFactory, private IUserManager $userManager, private IAppManager $appManager, - private IURLGenerator $urlGenerator) { + private IURLGenerator $urlGenerator, + ) { } /** diff --git a/apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php b/apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php index 4a9721d00eca0..b647e63e67b6c 100644 --- a/apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php +++ b/apps/dav/lib/CalDAV/Validation/CalDavValidatePlugin.php @@ -19,7 +19,7 @@ class CalDavValidatePlugin extends ServerPlugin { public function __construct( - private IAppConfig $config + private IAppConfig $config, ) { } diff --git a/apps/dav/lib/CalDAV/WebcalCaching/Connection.php b/apps/dav/lib/CalDAV/WebcalCaching/Connection.php index 9d626f2db6dd6..51d8cff2ed37d 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/Connection.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/Connection.php @@ -21,9 +21,11 @@ use Sabre\VObject\Reader; class Connection { - public function __construct(private IClientService $clientService, + public function __construct( + private IClientService $clientService, private IAppConfig $config, - private LoggerInterface $logger) { + private LoggerInterface $logger, + ) { } /** diff --git a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php index 47fd785d632ca..348a4e5ddbd2f 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/RefreshWebcalService.php @@ -30,10 +30,12 @@ class RefreshWebcalService { public const STRIP_ATTACHMENTS = '{http://calendarserver.org/ns/}subscribed-strip-attachments'; public const STRIP_TODOS = '{http://calendarserver.org/ns/}subscribed-strip-todos'; - public function __construct(private CalDavBackend $calDavBackend, + public function __construct( + private CalDavBackend $calDavBackend, private LoggerInterface $logger, private Connection $connection, - private ITimeFactory $time) { + private ITimeFactory $time, + ) { } public function refreshSubscription(string $principalUri, string $uri) { diff --git a/apps/dav/lib/CardDAV/Security/CardDavRateLimitingPlugin.php b/apps/dav/lib/CardDAV/Security/CardDavRateLimitingPlugin.php index 7f0f1e2862325..256d8481ee359 100644 --- a/apps/dav/lib/CardDAV/Security/CardDavRateLimitingPlugin.php +++ b/apps/dav/lib/CardDAV/Security/CardDavRateLimitingPlugin.php @@ -25,12 +25,14 @@ class CardDavRateLimitingPlugin extends ServerPlugin { private ?string $userId; - public function __construct(private Limiter $limiter, + public function __construct( + private Limiter $limiter, private IUserManager $userManager, private CardDavBackend $cardDavBackend, private LoggerInterface $logger, private IAppConfig $config, - ?string $userId) { + ?string $userId, + ) { $this->limiter = $limiter; $this->userManager = $userManager; $this->cardDavBackend = $cardDavBackend; diff --git a/apps/dav/lib/CardDAV/Sharing/Backend.php b/apps/dav/lib/CardDAV/Sharing/Backend.php index 5e03f7699fa7a..557115762fc2c 100644 --- a/apps/dav/lib/CardDAV/Sharing/Backend.php +++ b/apps/dav/lib/CardDAV/Sharing/Backend.php @@ -16,7 +16,8 @@ use Psr\Log\LoggerInterface; class Backend extends SharingBackend { - public function __construct(private IUserManager $userManager, + public function __construct( + private IUserManager $userManager, private IGroupManager $groupManager, private Principal $principalBackend, private ICacheFactory $cacheFactory, diff --git a/apps/dav/lib/CardDAV/Sharing/Service.php b/apps/dav/lib/CardDAV/Sharing/Service.php index 69bcecde227a7..1ab208f7ec3a1 100644 --- a/apps/dav/lib/CardDAV/Sharing/Service.php +++ b/apps/dav/lib/CardDAV/Sharing/Service.php @@ -13,7 +13,9 @@ class Service extends SharingService { protected string $resourceType = 'addressbook'; - public function __construct(protected SharingMapper $mapper) { + public function __construct( + protected SharingMapper $mapper, + ) { parent::__construct($mapper); } } diff --git a/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php b/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php index 7e76b9dac92f2..a5fd80ec124e2 100644 --- a/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php +++ b/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php @@ -19,7 +19,7 @@ class CardDavValidatePlugin extends ServerPlugin { public function __construct( - private IAppConfig $config + private IAppConfig $config, ) { } diff --git a/apps/dav/lib/Command/DeleteCalendar.php b/apps/dav/lib/Command/DeleteCalendar.php index 53cabcfc5ce2e..f6dbed856e69a 100644 --- a/apps/dav/lib/Command/DeleteCalendar.php +++ b/apps/dav/lib/Command/DeleteCalendar.php @@ -54,7 +54,7 @@ protected function configure(): void { protected function execute( InputInterface $input, - OutputInterface $output + OutputInterface $output, ): int { /** @var string $user */ $user = $input->getArgument('uid'); diff --git a/apps/dav/lib/Command/FixCalendarSyncCommand.php b/apps/dav/lib/Command/FixCalendarSyncCommand.php index e94e1dc9c4af3..c10ee7e3da6d2 100644 --- a/apps/dav/lib/Command/FixCalendarSyncCommand.php +++ b/apps/dav/lib/Command/FixCalendarSyncCommand.php @@ -20,8 +20,10 @@ class FixCalendarSyncCommand extends Command { - public function __construct(private IUserManager $userManager, - private CalDavBackend $calDavBackend) { + public function __construct( + private IUserManager $userManager, + private CalDavBackend $calDavBackend, + ) { parent::__construct('dav:fix-missing-caldav-changes'); } diff --git a/apps/dav/lib/Comments/CommentNode.php b/apps/dav/lib/Comments/CommentNode.php index a257611dd1520..d0f0d585888f8 100644 --- a/apps/dav/lib/Comments/CommentNode.php +++ b/apps/dav/lib/Comments/CommentNode.php @@ -55,7 +55,7 @@ public function __construct( IComment $comment, IUserManager $userManager, IUserSession $userSession, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->commentsManager = $commentsManager; $this->comment = $comment; @@ -69,7 +69,7 @@ public function __construct( if ($getter === 'getMentions') { continue; // special treatment } - $name = '{'.self::NS_OWNCLOUD.'}' . lcfirst(substr($getter, 3)); + $name = '{' . self::NS_OWNCLOUD . '}' . lcfirst(substr($getter, 3)); $this->properties[$name] = $getter; } $this->userManager = $userManager; diff --git a/apps/dav/lib/Comments/CommentsPlugin.php b/apps/dav/lib/Comments/CommentsPlugin.php index 3be87460d2167..52e48ec0ed114 100644 --- a/apps/dav/lib/Comments/CommentsPlugin.php +++ b/apps/dav/lib/Comments/CommentsPlugin.php @@ -216,7 +216,7 @@ private function createComment($objectType, $objectId, $data, $contentType = 'ap } } if (is_null($actorId)) { - throw new BadRequest('Invalid actor "' . $actorType .'"'); + throw new BadRequest('Invalid actor "' . $actorType . '"'); } try { diff --git a/apps/dav/lib/Comments/EntityCollection.php b/apps/dav/lib/Comments/EntityCollection.php index 19af2d9c23401..3135449641cea 100644 --- a/apps/dav/lib/Comments/EntityCollection.php +++ b/apps/dav/lib/Comments/EntityCollection.php @@ -46,7 +46,7 @@ public function __construct( ICommentsManager $commentsManager, IUserManager $userManager, IUserSession $userSession, - LoggerInterface $logger + LoggerInterface $logger, ) { foreach (['id', 'name'] as $property) { $$property = trim($$property); diff --git a/apps/dav/lib/Comments/EntityTypeCollection.php b/apps/dav/lib/Comments/EntityTypeCollection.php index da5a18e78c89f..b326805542d39 100644 --- a/apps/dav/lib/Comments/EntityTypeCollection.php +++ b/apps/dav/lib/Comments/EntityTypeCollection.php @@ -38,7 +38,7 @@ public function __construct( IUserManager $userManager, IUserSession $userSession, LoggerInterface $logger, - \Closure $childExistsFunction + \Closure $childExistsFunction, ) { $name = trim($name); if (empty($name)) { diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php index f2da3782def39..65e77cea2850a 100644 --- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php @@ -80,7 +80,7 @@ private function cacheDirectory(Directory $directory): void { */ public function handleGetProperties( PropFind $propFind, - \Sabre\DAV\INode $node + \Sabre\DAV\INode $node, ) { if (!($node instanceof File) && !($node instanceof Directory)) { return; diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php index 581adfa418440..b82fee957bc24 100644 --- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php @@ -106,7 +106,7 @@ public function __construct(Tree $tree, IUserSession $userSession, IGroupManager $groupManager, Folder $userFolder, - IAppManager $appManager + IAppManager $appManager, ) { $this->tree = $tree; $this->fileView = $view; diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php index 3ca542fee73ed..ac5514e11e140 100644 --- a/apps/dav/lib/Connector/Sabre/Node.php +++ b/apps/dav/lib/Connector/Sabre/Node.php @@ -79,7 +79,7 @@ public function __construct(View $view, FileInfo $info, ?IManager $shareManager protected function refreshInfo(): void { $info = $this->fileView->getFileInfo($this->path); if ($info === false) { - throw new \Sabre\DAV\Exception('Failed to get fileinfo for '. $this->path); + throw new \Sabre\DAV\Exception('Failed to get fileinfo for ' . $this->path); } $this->info = $info; $root = \OC::$server->get(IRootFolder::class); @@ -131,7 +131,7 @@ public function setName($name) { $this->verifyPath($newPath); if (!$this->fileView->rename($this->path, $newPath)) { - throw new \Sabre\DAV\Exception('Failed to rename '. $this->path . ' to ' . $newPath); + throw new \Sabre\DAV\Exception('Failed to rename ' . $this->path . ' to ' . $newPath); } $this->path = $newPath; diff --git a/apps/dav/lib/Connector/Sabre/ServerFactory.php b/apps/dav/lib/Connector/Sabre/ServerFactory.php index 42d3ce1818ace..106b425b121aa 100644 --- a/apps/dav/lib/Connector/Sabre/ServerFactory.php +++ b/apps/dav/lib/Connector/Sabre/ServerFactory.php @@ -49,7 +49,7 @@ public function __construct( IRequest $request, IPreview $previewManager, IEventDispatcher $eventDispatcher, - IL10N $l10n + IL10N $l10n, ) { $this->config = $config; $this->logger = $logger; diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php index 20e94e9aedeb0..088cf33d85fa8 100644 --- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php @@ -164,7 +164,7 @@ private function getShares(DavNode $sabreNode): array { */ public function handleGetProperties( PropFind $propFind, - \Sabre\DAV\INode $sabreNode + \Sabre\DAV\INode $sabreNode, ) { if (!($sabreNode instanceof DavNode)) { return; diff --git a/apps/dav/lib/Connector/Sabre/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php index 3f5268f513705..a3f2847ee1ac0 100644 --- a/apps/dav/lib/Connector/Sabre/TagsPlugin.php +++ b/apps/dav/lib/Connector/Sabre/TagsPlugin.php @@ -189,7 +189,7 @@ private function updateTags($fileId, $tags) { */ public function handleGetProperties( PropFind $propFind, - \Sabre\DAV\INode $node + \Sabre\DAV\INode $node, ) { if (!($node instanceof \OCA\DAV\Connector\Sabre\Node)) { return; diff --git a/apps/dav/lib/Controller/DirectController.php b/apps/dav/lib/Controller/DirectController.php index 77f5b8f541900..80e00e93ca7c7 100644 --- a/apps/dav/lib/Controller/DirectController.php +++ b/apps/dav/lib/Controller/DirectController.php @@ -117,7 +117,7 @@ public function getUrl(int $fileId, int $expirationTime = 60 * 60 * 8): DataResp $this->mapper->insert($direct); - $url = $this->urlGenerator->getAbsoluteURL('remote.php/direct/'.$token); + $url = $this->urlGenerator->getAbsoluteURL('remote.php/direct/' . $token); return new DataResponse([ 'url' => $url, diff --git a/apps/dav/lib/Controller/OutOfOfficeController.php b/apps/dav/lib/Controller/OutOfOfficeController.php index 4978fb87737c3..e86989929495a 100644 --- a/apps/dav/lib/Controller/OutOfOfficeController.php +++ b/apps/dav/lib/Controller/OutOfOfficeController.php @@ -121,7 +121,7 @@ public function setOutOfOffice( string $status, string $message, ?string $replacementUserId, - ?string $replacementUserDisplayName + ?string $replacementUserDisplayName, ): DataResponse { $user = $this->userSession?->getUser(); diff --git a/apps/dav/lib/DAV/GroupPrincipalBackend.php b/apps/dav/lib/DAV/GroupPrincipalBackend.php index 7ccc3f02594a7..887f3b2d7e9e7 100644 --- a/apps/dav/lib/DAV/GroupPrincipalBackend.php +++ b/apps/dav/lib/DAV/GroupPrincipalBackend.php @@ -40,7 +40,7 @@ public function __construct( IGroupManager $IGroupManager, IUserSession $userSession, IShareManager $shareManager, - IConfig $config + IConfig $config, ) { $this->groupManager = $IGroupManager; $this->userSession = $userSession; diff --git a/apps/dav/lib/DAV/Sharing/Backend.php b/apps/dav/lib/DAV/Sharing/Backend.php index 5630336df4276..06a082628d3eb 100644 --- a/apps/dav/lib/DAV/Sharing/Backend.php +++ b/apps/dav/lib/DAV/Sharing/Backend.php @@ -27,7 +27,8 @@ abstract class Backend { private ICache $shareCache; - public function __construct(private IUserManager $userManager, + public function __construct( + private IUserManager $userManager, private IGroupManager $groupManager, private Principal $principalBackend, private ICacheFactory $cacheFactory, diff --git a/apps/dav/lib/DAV/Sharing/SharingMapper.php b/apps/dav/lib/DAV/Sharing/SharingMapper.php index 59483ac9471a9..0aec5b7fe81d1 100644 --- a/apps/dav/lib/DAV/Sharing/SharingMapper.php +++ b/apps/dav/lib/DAV/Sharing/SharingMapper.php @@ -11,7 +11,9 @@ use OCP\IDBConnection; class SharingMapper { - public function __construct(private IDBConnection $db) { + public function __construct( + private IDBConnection $db, + ) { } protected function getSharesForIdByAccess(int $resourceId, string $resourceType, bool $sharesWithAccess): array { diff --git a/apps/dav/lib/DAV/Sharing/SharingService.php b/apps/dav/lib/DAV/Sharing/SharingService.php index de280d2c34712..b9ac36ea066fa 100644 --- a/apps/dav/lib/DAV/Sharing/SharingService.php +++ b/apps/dav/lib/DAV/Sharing/SharingService.php @@ -9,7 +9,9 @@ abstract class SharingService { protected string $resourceType = ''; - public function __construct(protected SharingMapper $mapper) { + public function __construct( + protected SharingMapper $mapper, + ) { } public function getResourceType(): string { diff --git a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php index ca9602fb8c200..aa3a880df6b1c 100644 --- a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php +++ b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php @@ -29,7 +29,7 @@ public function __construct(array $set, array $remove) { public static function xmlDeserialize(Reader $reader) { $elements = $reader->parseInnerTree([ - '{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue', + '{' . Plugin::NS_OWNCLOUD . '}set' => 'Sabre\\Xml\\Element\\KeyValue', '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', ]); diff --git a/apps/dav/lib/Direct/DirectHome.php b/apps/dav/lib/Direct/DirectHome.php index 36ff8b213cb80..66fe6f0f3d437 100644 --- a/apps/dav/lib/Direct/DirectHome.php +++ b/apps/dav/lib/Direct/DirectHome.php @@ -46,7 +46,7 @@ public function __construct( ITimeFactory $timeFactory, IThrottler $throttler, IRequest $request, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { $this->rootFolder = $rootFolder; $this->mapper = $mapper; diff --git a/apps/dav/lib/Listener/OutOfOfficeListener.php b/apps/dav/lib/Listener/OutOfOfficeListener.php index e0997e8182b67..45728aa35d31d 100644 --- a/apps/dav/lib/Listener/OutOfOfficeListener.php +++ b/apps/dav/lib/Listener/OutOfOfficeListener.php @@ -39,7 +39,7 @@ public function __construct( private ServerFactory $serverFactory, private IConfig $appConfig, private TimezoneService $timezoneService, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php index 4c87e25c6986d..da8f31e7d3d59 100644 --- a/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php @@ -21,7 +21,7 @@ public function __construct( private CalDavBackend $calDavBackend, private LoggerInterface $logger, private IJobList $jobList, - ITimeFactory $timeFactory + ITimeFactory $timeFactory, ) { parent::__construct($timeFactory); } @@ -30,7 +30,7 @@ public function run($arguments) { $offset = (int)$arguments['offset']; $stopAt = (int)$arguments['stopAt']; - $this->logger->info('Building calendar index (' . $offset .'/' . $stopAt . ')'); + $this->logger->info('Building calendar index (' . $offset . '/' . $stopAt . ')'); $startTime = $this->time->getTime(); while (($this->time->getTime() - $startTime) < 15) { diff --git a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php index 138f764f1e6c0..072a4feacc62e 100644 --- a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php @@ -31,7 +31,7 @@ public function run($arguments) { $offset = $arguments['offset']; $stopAt = $arguments['stopAt']; - $this->logger->info('Indexing social profile data (' . $offset .'/' . $stopAt . ')'); + $this->logger->info('Indexing social profile data (' . $offset . '/' . $stopAt . ')'); $offset = $this->buildIndex($offset, $stopAt); diff --git a/apps/dav/lib/Migration/DeleteSchedulingObjects.php b/apps/dav/lib/Migration/DeleteSchedulingObjects.php index 3919236788bb3..3cb3c9c9b109b 100644 --- a/apps/dav/lib/Migration/DeleteSchedulingObjects.php +++ b/apps/dav/lib/Migration/DeleteSchedulingObjects.php @@ -16,9 +16,10 @@ use OCP\Migration\IRepairStep; class DeleteSchedulingObjects implements IRepairStep { - public function __construct(private IJobList $jobList, + public function __construct( + private IJobList $jobList, private ITimeFactory $time, - private CalDavBackend $calDavBackend + private CalDavBackend $calDavBackend, ) { } diff --git a/apps/dav/lib/Migration/Version1027Date20230504122946.php b/apps/dav/lib/Migration/Version1027Date20230504122946.php index 9e1d1701934d1..f294cf192c267 100644 --- a/apps/dav/lib/Migration/Version1027Date20230504122946.php +++ b/apps/dav/lib/Migration/Version1027Date20230504122946.php @@ -20,10 +20,12 @@ use Throwable; class Version1027Date20230504122946 extends SimpleMigrationStep { - public function __construct(private SyncService $syncService, + public function __construct( + private SyncService $syncService, private LoggerInterface $logger, private IUserManager $userManager, - private IConfig $config) { + private IConfig $config, + ) { } /** * @param IOutput $output diff --git a/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php b/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php index 54818a890f393..1a02457d65370 100644 --- a/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php +++ b/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php @@ -59,7 +59,7 @@ public function __construct( \OC_Defaults $themingDefaults, IRequest $request, IL10N $l10n, - \Closure $uuidClosure + \Closure $uuidClosure, ) { $this->userSession = $userSession; $this->urlGenerator = $urlGenerator; diff --git a/apps/dav/lib/Search/EventsSearchProvider.php b/apps/dav/lib/Search/EventsSearchProvider.php index 4747635bd7ea4..55fba40918a1b 100644 --- a/apps/dav/lib/Search/EventsSearchProvider.php +++ b/apps/dav/lib/Search/EventsSearchProvider.php @@ -194,7 +194,7 @@ protected function getDeepLinkToCalendarApp( protected function getDavUrlForCalendarObject( string $principalUri, string $calendarUri, - string $calendarObjectUri + string $calendarObjectUri, ): string { [,, $principalId] = explode('/', $principalUri, 3); diff --git a/apps/dav/lib/Settings/AvailabilitySettings.php b/apps/dav/lib/Settings/AvailabilitySettings.php index dba4662a5cea2..6afb03bda8ddd 100644 --- a/apps/dav/lib/Settings/AvailabilitySettings.php +++ b/apps/dav/lib/Settings/AvailabilitySettings.php @@ -24,12 +24,14 @@ class AvailabilitySettings implements ISettings { protected IInitialState $initialState; protected ?string $userId; - public function __construct(IConfig $config, + public function __construct( + IConfig $config, IInitialState $initialState, ?string $userId, private LoggerInterface $logger, private IAvailabilityCoordinator $coordinator, - private AbsenceMapper $absenceMapper) { + private AbsenceMapper $absenceMapper, + ) { $this->config = $config; $this->initialState = $initialState; $this->userId = $userId; diff --git a/apps/dav/lib/SystemTag/SystemTagPlugin.php b/apps/dav/lib/SystemTag/SystemTagPlugin.php index ec2014163b376..bf7e5e00053f6 100644 --- a/apps/dav/lib/SystemTag/SystemTagPlugin.php +++ b/apps/dav/lib/SystemTag/SystemTagPlugin.php @@ -216,7 +216,7 @@ private function createTag($data, $contentType = 'application/json') { */ public function handleGetProperties( PropFind $propFind, - \Sabre\DAV\INode $node + \Sabre\DAV\INode $node, ) { if ($node instanceof Node) { $this->propfindForFile($propFind, $node); diff --git a/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php b/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php index c591001179f26..13e79c99b65a8 100644 --- a/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php @@ -44,7 +44,7 @@ class SystemTagsByIdCollection implements ICollection { public function __construct( ISystemTagManager $tagManager, IUserSession $userSession, - IGroupManager $groupManager + IGroupManager $groupManager, ) { $this->tagManager = $tagManager; $this->userSession = $userSession; diff --git a/apps/dav/lib/SystemTag/SystemTagsInUseCollection.php b/apps/dav/lib/SystemTag/SystemTagsInUseCollection.php index fbe393a7d97b6..0431acc553af8 100644 --- a/apps/dav/lib/SystemTag/SystemTagsInUseCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsInUseCollection.php @@ -33,7 +33,7 @@ public function __construct( IRootFolder $rootFolder, ISystemTagManager $systemTagManager, SystemTagsInFilesDetector $systemTagsInFilesDetector, - string $mediaType = '' + string $mediaType = '', ) { $this->userSession = $userSession; $this->rootFolder = $rootFolder; diff --git a/apps/dav/lib/UserMigration/CalendarMigrator.php b/apps/dav/lib/UserMigration/CalendarMigrator.php index 80b564e24eebe..7e5bdcd789076 100644 --- a/apps/dav/lib/UserMigration/CalendarMigrator.php +++ b/apps/dav/lib/UserMigration/CalendarMigrator.php @@ -67,7 +67,7 @@ public function __construct( ICalendarManager $calendarManager, ICSExportPlugin $icsExportPlugin, Defaults $defaults, - IL10N $l10n + IL10N $l10n, ) { $this->calDavBackend = $calDavBackend; $this->calendarManager = $calendarManager; diff --git a/apps/dav/lib/UserMigration/ContactsMigrator.php b/apps/dav/lib/UserMigration/ContactsMigrator.php index a14d3bc5e1ccd..50787dc4e5dc4 100644 --- a/apps/dav/lib/UserMigration/ContactsMigrator.php +++ b/apps/dav/lib/UserMigration/ContactsMigrator.php @@ -55,7 +55,7 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator { public function __construct( CardDavBackend $cardDavBackend, - IL10N $l10n + IL10N $l10n, ) { $this->cardDavBackend = $cardDavBackend; $this->l10n = $l10n; diff --git a/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php b/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php index 8d98a765fc1bd..06261ca6fa5ae 100644 --- a/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php +++ b/apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php @@ -380,7 +380,7 @@ public function testPropFindDefaultCalendarUrl(string $principalUri, ?string $ca $this->server->expects($this->once()) ->method('getPropertiesForPath') - ->with($calendarHome .'/' . $calendarUri, [], 1) + ->with($calendarHome . '/' . $calendarUri, [], 1) ->willReturn($properties); $this->plugin->propFindDefaultCalendarUrl($propFind, $node); @@ -392,7 +392,7 @@ public function testPropFindDefaultCalendarUrl(string $principalUri, ?string $ca /** @var LocalHref $result */ $result = $propFind->get(Plugin::SCHEDULE_DEFAULT_CALENDAR_URL); - $this->assertEquals('/remote.php/dav/'. $calendarHome . '/' . $calendarUri, $result->getHref()); + $this->assertEquals('/remote.php/dav/' . $calendarHome . '/' . $calendarUri, $result->getHref()); } /** diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php index 91d7cc5f49e86..96968909d1cc6 100644 --- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php +++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php @@ -72,35 +72,35 @@ class CardDavBackendTest extends TestCase { public const UNIT_TEST_USER1 = 'principals/users/carddav-unit-test1'; public const UNIT_TEST_GROUP = 'principals/groups/carddav-unit-test-group'; - private $vcardTest0 = 'BEGIN:VCARD'.PHP_EOL. - 'VERSION:3.0'.PHP_EOL. - 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL. - 'UID:Test'.PHP_EOL. - 'FN:Test'.PHP_EOL. - 'N:Test;;;;'.PHP_EOL. + private $vcardTest0 = 'BEGIN:VCARD' . PHP_EOL . + 'VERSION:3.0' . PHP_EOL . + 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . + 'UID:Test' . PHP_EOL . + 'FN:Test' . PHP_EOL . + 'N:Test;;;;' . PHP_EOL . 'END:VCARD'; - private $vcardTest1 = 'BEGIN:VCARD'.PHP_EOL. - 'VERSION:3.0'.PHP_EOL. - 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL. - 'UID:Test2'.PHP_EOL. - 'FN:Test2'.PHP_EOL. - 'N:Test2;;;;'.PHP_EOL. + private $vcardTest1 = 'BEGIN:VCARD' . PHP_EOL . + 'VERSION:3.0' . PHP_EOL . + 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . + 'UID:Test2' . PHP_EOL . + 'FN:Test2' . PHP_EOL . + 'N:Test2;;;;' . PHP_EOL . 'END:VCARD'; - private $vcardTest2 = 'BEGIN:VCARD'.PHP_EOL. - 'VERSION:3.0'.PHP_EOL. - 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL. - 'UID:Test3'.PHP_EOL. - 'FN:Test3'.PHP_EOL. - 'N:Test3;;;;'.PHP_EOL. + private $vcardTest2 = 'BEGIN:VCARD' . PHP_EOL . + 'VERSION:3.0' . PHP_EOL . + 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . + 'UID:Test3' . PHP_EOL . + 'FN:Test3' . PHP_EOL . + 'N:Test3;;;;' . PHP_EOL . 'END:VCARD'; - private $vcardTestNoUID = 'BEGIN:VCARD'.PHP_EOL. - 'VERSION:3.0'.PHP_EOL. - 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL. - 'FN:TestNoUID'.PHP_EOL. - 'N:TestNoUID;;;;'.PHP_EOL. + private $vcardTestNoUID = 'BEGIN:VCARD' . PHP_EOL . + 'VERSION:3.0' . PHP_EOL . + 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . + 'FN:TestNoUID' . PHP_EOL . + 'N:TestNoUID;;;;' . PHP_EOL . 'END:VCARD'; protected function setUp(): void { @@ -332,7 +332,7 @@ public function testMultiCard(): void { $this->assertArrayHasKey('lastmodified', $card); $this->assertArrayHasKey('etag', $card); $this->assertArrayHasKey('size', $card); - $this->assertEquals($this->{ 'vcardTest'.($index + 1) }, $card['carddata']); + $this->assertEquals($this->{ 'vcardTest' . ($index + 1) }, $card['carddata']); } // delete the card diff --git a/apps/dav/tests/unit/Command/DeleteCalendarTest.php b/apps/dav/tests/unit/Command/DeleteCalendarTest.php index 583673c9d3086..b621e6737d546 100644 --- a/apps/dav/tests/unit/Command/DeleteCalendarTest.php +++ b/apps/dav/tests/unit/Command/DeleteCalendarTest.php @@ -100,7 +100,7 @@ public function testNoCalendarName(): void { public function testInvalidCalendar(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage( - 'User <' . self::USER . '> has no calendar named <' . self::NAME . '>.'); + 'User <' . self::USER . '> has no calendar named <' . self::NAME . '>.'); $this->userManager->expects($this->once()) ->method('userExists') diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php index 5010f7698b5cd..4f2e5174325db 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php @@ -127,7 +127,7 @@ public function testGetNodeForPath( $inputFileName, $fileInfoQueryPath, $outputFileName, - $type + $type, ): void { $rootNode = $this->getMockBuilder(Directory::class) ->disableOriginalConstructor() diff --git a/apps/dav/tests/unit/Controller/DirectControllerTest.php b/apps/dav/tests/unit/Controller/DirectControllerTest.php index 2476681251c70..faaf67d266b24 100644 --- a/apps/dav/tests/unit/Controller/DirectControllerTest.php +++ b/apps/dav/tests/unit/Controller/DirectControllerTest.php @@ -136,7 +136,7 @@ public function testGetUrlValid(): void { $this->urlGenerator->method('getAbsoluteURL') ->willReturnCallback(function (string $url) { - return 'https://my.nextcloud/'.$url; + return 'https://my.nextcloud/' . $url; }); $result = $this->controller->getUrl(101); diff --git a/apps/dav/tests/unit/DAV/GroupPrincipalTest.php b/apps/dav/tests/unit/DAV/GroupPrincipalTest.php index 92c89fc62f83b..bfc4c5b24930b 100644 --- a/apps/dav/tests/unit/DAV/GroupPrincipalTest.php +++ b/apps/dav/tests/unit/DAV/GroupPrincipalTest.php @@ -349,7 +349,7 @@ private function mockGroup($gid) { $fooGroup ->expects($this->exactly(1)) ->method('getDisplayName') - ->willReturn('Group '.$gid); + ->willReturn('Group ' . $gid); return $fooGroup; } } diff --git a/apps/dav/tests/unit/Files/MultipartRequestParserTest.php b/apps/dav/tests/unit/Files/MultipartRequestParserTest.php index ebe2a0b172e87..e6325ab8ad1e0 100644 --- a/apps/dav/tests/unit/Files/MultipartRequestParserTest.php +++ b/apps/dav/tests/unit/Files/MultipartRequestParserTest.php @@ -36,7 +36,7 @@ private function getMultipartParser(array $parts, array $headers = [], string $b ->disableOriginalConstructor() ->getMock(); - $headers = array_merge(['Content-Type' => 'multipart/related; boundary='.$boundary], $headers); + $headers = array_merge(['Content-Type' => 'multipart/related; boundary=' . $boundary], $headers); $request->expects($this->any()) ->method('getHeader') ->willReturnCallback(function (string $key) use (&$headers) { @@ -45,17 +45,17 @@ private function getMultipartParser(array $parts, array $headers = [], string $b $body = ''; foreach ($parts as $part) { - $body .= '--'.$boundary."\r\n"; + $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 .= $part['content'] . "\r\n"; } - $body .= '--'.$boundary.'--'; + $body .= '--' . $boundary . '--'; $stream = fopen('php://temp', 'r+'); fwrite($stream, $body); diff --git a/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php b/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php index bfc57dc61d70c..0a83d238f0f5d 100644 --- a/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php +++ b/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php @@ -37,22 +37,22 @@ class ContactsSearchProviderTest extends TestCase { /** @var ContactsSearchProvider */ private $provider; - private $vcardTest0 = 'BEGIN:VCARD'.PHP_EOL. - 'VERSION:3.0'.PHP_EOL. - 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL. - 'UID:Test'.PHP_EOL. - 'FN:FN of Test'.PHP_EOL. - 'N:Test;;;;'.PHP_EOL. - 'EMAIL:forrestgump@example.com'.PHP_EOL. + private $vcardTest0 = 'BEGIN:VCARD' . PHP_EOL . + 'VERSION:3.0' . PHP_EOL . + 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . + 'UID:Test' . PHP_EOL . + 'FN:FN of Test' . PHP_EOL . + 'N:Test;;;;' . PHP_EOL . + 'EMAIL:forrestgump@example.com' . PHP_EOL . 'END:VCARD'; - private $vcardTest1 = 'BEGIN:VCARD'.PHP_EOL. - 'VERSION:3.0'.PHP_EOL. - 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL. - 'PHOTO;ENCODING=b;TYPE=image/jpeg:'.PHP_EOL. - 'UID:Test2'.PHP_EOL. - 'FN:FN of Test2'.PHP_EOL. - 'N:Test2;;;;'.PHP_EOL. + private $vcardTest1 = 'BEGIN:VCARD' . PHP_EOL . + 'VERSION:3.0' . PHP_EOL . + 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . + 'PHOTO;ENCODING=b;TYPE=image/jpeg:' . PHP_EOL . + 'UID:Test2' . PHP_EOL . + 'FN:FN of Test2' . PHP_EOL . + 'N:Test2;;;;' . PHP_EOL . 'END:VCARD'; protected function setUp(): void { diff --git a/apps/dav/tests/unit/Search/EventsSearchProviderTest.php b/apps/dav/tests/unit/Search/EventsSearchProviderTest.php index d194b7fa7c659..0eafe0782e5a9 100644 --- a/apps/dav/tests/unit/Search/EventsSearchProviderTest.php +++ b/apps/dav/tests/unit/Search/EventsSearchProviderTest.php @@ -38,183 +38,183 @@ class EventsSearchProviderTest extends TestCase { private $provider; // NO SUMMARY - private $vEvent0 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20161004T144433Z'.PHP_EOL. - 'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL. - 'DTEND;VALUE=DATE:20161008'.PHP_EOL. - 'TRANSP:TRANSPARENT'.PHP_EOL. - 'DTSTART;VALUE=DATE:20161005'.PHP_EOL. - 'DTSTAMP:20161004T144437Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent0 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20161004T144433Z' . PHP_EOL . + 'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL . + 'DTEND;VALUE=DATE:20161008' . PHP_EOL . + 'TRANSP:TRANSPARENT' . PHP_EOL . + 'DTSTART;VALUE=DATE:20161005' . PHP_EOL . + 'DTSTAMP:20161004T144437Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // TIMED SAME DAY - private $vEvent1 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Tests//'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VTIMEZONE'.PHP_EOL. - 'TZID:Europe/Berlin'.PHP_EOL. - 'BEGIN:DAYLIGHT'.PHP_EOL. - 'TZOFFSETFROM:+0100'.PHP_EOL. - 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU'.PHP_EOL. - 'DTSTART:19810329T020000'.PHP_EOL. - 'TZNAME:GMT+2'.PHP_EOL. - 'TZOFFSETTO:+0200'.PHP_EOL. - 'END:DAYLIGHT'.PHP_EOL. - 'BEGIN:STANDARD'.PHP_EOL. - 'TZOFFSETFROM:+0200'.PHP_EOL. - 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU'.PHP_EOL. - 'DTSTART:19961027T030000'.PHP_EOL. - 'TZNAME:GMT+1'.PHP_EOL. - 'TZOFFSETTO:+0100'.PHP_EOL. - 'END:STANDARD'.PHP_EOL. - 'END:VTIMEZONE'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20160809T163629Z'.PHP_EOL. - 'UID:0AD16F58-01B3-463B-A215-FD09FC729A02'.PHP_EOL. - 'DTEND;TZID=Europe/Berlin:20160816T100000'.PHP_EOL. - 'TRANSP:OPAQUE'.PHP_EOL. - 'SUMMARY:Test Europe Berlin'.PHP_EOL. - 'DTSTART;TZID=Europe/Berlin:20160816T090000'.PHP_EOL. - 'DTSTAMP:20160809T163632Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent1 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Tests//' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VTIMEZONE' . PHP_EOL . + 'TZID:Europe/Berlin' . PHP_EOL . + 'BEGIN:DAYLIGHT' . PHP_EOL . + 'TZOFFSETFROM:+0100' . PHP_EOL . + 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU' . PHP_EOL . + 'DTSTART:19810329T020000' . PHP_EOL . + 'TZNAME:GMT+2' . PHP_EOL . + 'TZOFFSETTO:+0200' . PHP_EOL . + 'END:DAYLIGHT' . PHP_EOL . + 'BEGIN:STANDARD' . PHP_EOL . + 'TZOFFSETFROM:+0200' . PHP_EOL . + 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU' . PHP_EOL . + 'DTSTART:19961027T030000' . PHP_EOL . + 'TZNAME:GMT+1' . PHP_EOL . + 'TZOFFSETTO:+0100' . PHP_EOL . + 'END:STANDARD' . PHP_EOL . + 'END:VTIMEZONE' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20160809T163629Z' . PHP_EOL . + 'UID:0AD16F58-01B3-463B-A215-FD09FC729A02' . PHP_EOL . + 'DTEND;TZID=Europe/Berlin:20160816T100000' . PHP_EOL . + 'TRANSP:OPAQUE' . PHP_EOL . + 'SUMMARY:Test Europe Berlin' . PHP_EOL . + 'DTSTART;TZID=Europe/Berlin:20160816T090000' . PHP_EOL . + 'DTSTAMP:20160809T163632Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // TIMED DIFFERENT DAY - private $vEvent2 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Tests//'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VTIMEZONE'.PHP_EOL. - 'TZID:Europe/Berlin'.PHP_EOL. - 'BEGIN:DAYLIGHT'.PHP_EOL. - 'TZOFFSETFROM:+0100'.PHP_EOL. - 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU'.PHP_EOL. - 'DTSTART:19810329T020000'.PHP_EOL. - 'TZNAME:GMT+2'.PHP_EOL. - 'TZOFFSETTO:+0200'.PHP_EOL. - 'END:DAYLIGHT'.PHP_EOL. - 'BEGIN:STANDARD'.PHP_EOL. - 'TZOFFSETFROM:+0200'.PHP_EOL. - 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU'.PHP_EOL. - 'DTSTART:19961027T030000'.PHP_EOL. - 'TZNAME:GMT+1'.PHP_EOL. - 'TZOFFSETTO:+0100'.PHP_EOL. - 'END:STANDARD'.PHP_EOL. - 'END:VTIMEZONE'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20160809T163629Z'.PHP_EOL. - 'UID:0AD16F58-01B3-463B-A215-FD09FC729A02'.PHP_EOL. - 'DTEND;TZID=Europe/Berlin:20160817T100000'.PHP_EOL. - 'TRANSP:OPAQUE'.PHP_EOL. - 'SUMMARY:Test Europe Berlin'.PHP_EOL. - 'DTSTART;TZID=Europe/Berlin:20160816T090000'.PHP_EOL. - 'DTSTAMP:20160809T163632Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent2 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Tests//' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VTIMEZONE' . PHP_EOL . + 'TZID:Europe/Berlin' . PHP_EOL . + 'BEGIN:DAYLIGHT' . PHP_EOL . + 'TZOFFSETFROM:+0100' . PHP_EOL . + 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU' . PHP_EOL . + 'DTSTART:19810329T020000' . PHP_EOL . + 'TZNAME:GMT+2' . PHP_EOL . + 'TZOFFSETTO:+0200' . PHP_EOL . + 'END:DAYLIGHT' . PHP_EOL . + 'BEGIN:STANDARD' . PHP_EOL . + 'TZOFFSETFROM:+0200' . PHP_EOL . + 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU' . PHP_EOL . + 'DTSTART:19961027T030000' . PHP_EOL . + 'TZNAME:GMT+1' . PHP_EOL . + 'TZOFFSETTO:+0100' . PHP_EOL . + 'END:STANDARD' . PHP_EOL . + 'END:VTIMEZONE' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20160809T163629Z' . PHP_EOL . + 'UID:0AD16F58-01B3-463B-A215-FD09FC729A02' . PHP_EOL . + 'DTEND;TZID=Europe/Berlin:20160817T100000' . PHP_EOL . + 'TRANSP:OPAQUE' . PHP_EOL . + 'SUMMARY:Test Europe Berlin' . PHP_EOL . + 'DTSTART;TZID=Europe/Berlin:20160816T090000' . PHP_EOL . + 'DTSTAMP:20160809T163632Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // ALL-DAY ONE-DAY - private $vEvent3 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20161004T144433Z'.PHP_EOL. - 'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL. - 'DTEND;VALUE=DATE:20161006'.PHP_EOL. - 'TRANSP:TRANSPARENT'.PHP_EOL. - 'DTSTART;VALUE=DATE:20161005'.PHP_EOL. - 'DTSTAMP:20161004T144437Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent3 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20161004T144433Z' . PHP_EOL . + 'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL . + 'DTEND;VALUE=DATE:20161006' . PHP_EOL . + 'TRANSP:TRANSPARENT' . PHP_EOL . + 'DTSTART;VALUE=DATE:20161005' . PHP_EOL . + 'DTSTAMP:20161004T144437Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // ALL-DAY MULTIPLE DAYS - private $vEvent4 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20161004T144433Z'.PHP_EOL. - 'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL. - 'DTEND;VALUE=DATE:20161008'.PHP_EOL. - 'TRANSP:TRANSPARENT'.PHP_EOL. - 'DTSTART;VALUE=DATE:20161005'.PHP_EOL. - 'DTSTAMP:20161004T144437Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent4 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20161004T144433Z' . PHP_EOL . + 'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL . + 'DTEND;VALUE=DATE:20161008' . PHP_EOL . + 'TRANSP:TRANSPARENT' . PHP_EOL . + 'DTSTART;VALUE=DATE:20161005' . PHP_EOL . + 'DTSTAMP:20161004T144437Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // DURATION - private $vEvent5 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20161004T144433Z'.PHP_EOL. - 'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL. - 'DURATION:P5D'.PHP_EOL. - 'TRANSP:TRANSPARENT'.PHP_EOL. - 'DTSTART;VALUE=DATE:20161005'.PHP_EOL. - 'DTSTAMP:20161004T144437Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent5 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20161004T144433Z' . PHP_EOL . + 'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL . + 'DURATION:P5D' . PHP_EOL . + 'TRANSP:TRANSPARENT' . PHP_EOL . + 'DTSTART;VALUE=DATE:20161005' . PHP_EOL . + 'DTSTAMP:20161004T144437Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // NO DTEND - DATE - private $vEvent6 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20161004T144433Z'.PHP_EOL. - 'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL. - 'TRANSP:TRANSPARENT'.PHP_EOL. - 'DTSTART;VALUE=DATE:20161005'.PHP_EOL. - 'DTSTAMP:20161004T144437Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent6 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20161004T144433Z' . PHP_EOL . + 'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL . + 'TRANSP:TRANSPARENT' . PHP_EOL . + 'DTSTART;VALUE=DATE:20161005' . PHP_EOL . + 'DTSTAMP:20161004T144437Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; // NO DTEND - DATE-TIME - private $vEvent7 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'PRODID:-//Tests//'.PHP_EOL. - 'CALSCALE:GREGORIAN'.PHP_EOL. - 'BEGIN:VTIMEZONE'.PHP_EOL. - 'TZID:Europe/Berlin'.PHP_EOL. - 'BEGIN:DAYLIGHT'.PHP_EOL. - 'TZOFFSETFROM:+0100'.PHP_EOL. - 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU'.PHP_EOL. - 'DTSTART:19810329T020000'.PHP_EOL. - 'TZNAME:GMT+2'.PHP_EOL. - 'TZOFFSETTO:+0200'.PHP_EOL. - 'END:DAYLIGHT'.PHP_EOL. - 'BEGIN:STANDARD'.PHP_EOL. - 'TZOFFSETFROM:+0200'.PHP_EOL. - 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU'.PHP_EOL. - 'DTSTART:19961027T030000'.PHP_EOL. - 'TZNAME:GMT+1'.PHP_EOL. - 'TZOFFSETTO:+0100'.PHP_EOL. - 'END:STANDARD'.PHP_EOL. - 'END:VTIMEZONE'.PHP_EOL. - 'BEGIN:VEVENT'.PHP_EOL. - 'CREATED:20160809T163629Z'.PHP_EOL. - 'UID:0AD16F58-01B3-463B-A215-FD09FC729A02'.PHP_EOL. - 'TRANSP:OPAQUE'.PHP_EOL. - 'SUMMARY:Test Europe Berlin'.PHP_EOL. - 'DTSTART;TZID=Europe/Berlin:20160816T090000'.PHP_EOL. - 'DTSTAMP:20160809T163632Z'.PHP_EOL. - 'SEQUENCE:0'.PHP_EOL. - 'END:VEVENT'.PHP_EOL. + private $vEvent7 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'PRODID:-//Tests//' . PHP_EOL . + 'CALSCALE:GREGORIAN' . PHP_EOL . + 'BEGIN:VTIMEZONE' . PHP_EOL . + 'TZID:Europe/Berlin' . PHP_EOL . + 'BEGIN:DAYLIGHT' . PHP_EOL . + 'TZOFFSETFROM:+0100' . PHP_EOL . + 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU' . PHP_EOL . + 'DTSTART:19810329T020000' . PHP_EOL . + 'TZNAME:GMT+2' . PHP_EOL . + 'TZOFFSETTO:+0200' . PHP_EOL . + 'END:DAYLIGHT' . PHP_EOL . + 'BEGIN:STANDARD' . PHP_EOL . + 'TZOFFSETFROM:+0200' . PHP_EOL . + 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU' . PHP_EOL . + 'DTSTART:19961027T030000' . PHP_EOL . + 'TZNAME:GMT+1' . PHP_EOL . + 'TZOFFSETTO:+0100' . PHP_EOL . + 'END:STANDARD' . PHP_EOL . + 'END:VTIMEZONE' . PHP_EOL . + 'BEGIN:VEVENT' . PHP_EOL . + 'CREATED:20160809T163629Z' . PHP_EOL . + 'UID:0AD16F58-01B3-463B-A215-FD09FC729A02' . PHP_EOL . + 'TRANSP:OPAQUE' . PHP_EOL . + 'SUMMARY:Test Europe Berlin' . PHP_EOL . + 'DTSTART;TZID=Europe/Berlin:20160816T090000' . PHP_EOL . + 'DTSTAMP:20160809T163632Z' . PHP_EOL . + 'SEQUENCE:0' . PHP_EOL . + 'END:VEVENT' . PHP_EOL . 'END:VCALENDAR'; protected function setUp(): void { diff --git a/apps/dav/tests/unit/Search/TasksSearchProviderTest.php b/apps/dav/tests/unit/Search/TasksSearchProviderTest.php index 18b6f0a593019..0b1bf1ba0d79c 100644 --- a/apps/dav/tests/unit/Search/TasksSearchProviderTest.php +++ b/apps/dav/tests/unit/Search/TasksSearchProviderTest.php @@ -38,67 +38,67 @@ class TasksSearchProviderTest extends TestCase { private $provider; // NO DUE NOR COMPLETED NOR SUMMARY - private $vTodo0 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'PRODID:TEST'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'BEGIN:VTODO'.PHP_EOL. - 'UID:20070313T123432Z-456553@example.com'.PHP_EOL. - 'DTSTAMP:20070313T123432Z'.PHP_EOL. - 'STATUS:NEEDS-ACTION'.PHP_EOL. - 'END:VTODO'.PHP_EOL. + private $vTodo0 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'PRODID:TEST' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'BEGIN:VTODO' . PHP_EOL . + 'UID:20070313T123432Z-456553@example.com' . PHP_EOL . + 'DTSTAMP:20070313T123432Z' . PHP_EOL . + 'STATUS:NEEDS-ACTION' . PHP_EOL . + 'END:VTODO' . PHP_EOL . 'END:VCALENDAR'; // DUE AND COMPLETED - private $vTodo1 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'PRODID:TEST'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'BEGIN:VTODO'.PHP_EOL. - 'UID:20070313T123432Z-456553@example.com'.PHP_EOL. - 'DTSTAMP:20070313T123432Z'.PHP_EOL. - 'COMPLETED:20070707T100000Z'.PHP_EOL. - 'DUE;VALUE=DATE:20070501'.PHP_EOL. - 'SUMMARY:Task title'.PHP_EOL. - 'STATUS:NEEDS-ACTION'.PHP_EOL. - 'END:VTODO'.PHP_EOL. + private $vTodo1 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'PRODID:TEST' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'BEGIN:VTODO' . PHP_EOL . + 'UID:20070313T123432Z-456553@example.com' . PHP_EOL . + 'DTSTAMP:20070313T123432Z' . PHP_EOL . + 'COMPLETED:20070707T100000Z' . PHP_EOL . + 'DUE;VALUE=DATE:20070501' . PHP_EOL . + 'SUMMARY:Task title' . PHP_EOL . + 'STATUS:NEEDS-ACTION' . PHP_EOL . + 'END:VTODO' . PHP_EOL . 'END:VCALENDAR'; // COMPLETED ONLY - private $vTodo2 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'PRODID:TEST'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'BEGIN:VTODO'.PHP_EOL. - 'UID:20070313T123432Z-456553@example.com'.PHP_EOL. - 'DTSTAMP:20070313T123432Z'.PHP_EOL. - 'COMPLETED:20070707T100000Z'.PHP_EOL. - 'SUMMARY:Task title'.PHP_EOL. - 'STATUS:NEEDS-ACTION'.PHP_EOL. - 'END:VTODO'.PHP_EOL. + private $vTodo2 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'PRODID:TEST' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'BEGIN:VTODO' . PHP_EOL . + 'UID:20070313T123432Z-456553@example.com' . PHP_EOL . + 'DTSTAMP:20070313T123432Z' . PHP_EOL . + 'COMPLETED:20070707T100000Z' . PHP_EOL . + 'SUMMARY:Task title' . PHP_EOL . + 'STATUS:NEEDS-ACTION' . PHP_EOL . + 'END:VTODO' . PHP_EOL . 'END:VCALENDAR'; // DUE DATE - private $vTodo3 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'PRODID:TEST'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'BEGIN:VTODO'.PHP_EOL. - 'UID:20070313T123432Z-456553@example.com'.PHP_EOL. - 'DTSTAMP:20070313T123432Z'.PHP_EOL. - 'DUE;VALUE=DATE:20070501'.PHP_EOL. - 'SUMMARY:Task title'.PHP_EOL. - 'STATUS:NEEDS-ACTION'.PHP_EOL. - 'END:VTODO'.PHP_EOL. + private $vTodo3 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'PRODID:TEST' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'BEGIN:VTODO' . PHP_EOL . + 'UID:20070313T123432Z-456553@example.com' . PHP_EOL . + 'DTSTAMP:20070313T123432Z' . PHP_EOL . + 'DUE;VALUE=DATE:20070501' . PHP_EOL . + 'SUMMARY:Task title' . PHP_EOL . + 'STATUS:NEEDS-ACTION' . PHP_EOL . + 'END:VTODO' . PHP_EOL . 'END:VCALENDAR'; // DUE DATETIME - private $vTodo4 = 'BEGIN:VCALENDAR'.PHP_EOL. - 'PRODID:TEST'.PHP_EOL. - 'VERSION:2.0'.PHP_EOL. - 'BEGIN:VTODO'.PHP_EOL. - 'UID:20070313T123432Z-456553@example.com'.PHP_EOL. - 'DTSTAMP:20070313T123432Z'.PHP_EOL. - 'DUE:20070709T130000Z'.PHP_EOL. - 'SUMMARY:Task title'.PHP_EOL. - 'STATUS:NEEDS-ACTION'.PHP_EOL. - 'END:VTODO'.PHP_EOL. + private $vTodo4 = 'BEGIN:VCALENDAR' . PHP_EOL . + 'PRODID:TEST' . PHP_EOL . + 'VERSION:2.0' . PHP_EOL . + 'BEGIN:VTODO' . PHP_EOL . + 'UID:20070313T123432Z-456553@example.com' . PHP_EOL . + 'DTSTAMP:20070313T123432Z' . PHP_EOL . + 'DUE:20070709T130000Z' . PHP_EOL . + 'SUMMARY:Task title' . PHP_EOL . + 'STATUS:NEEDS-ACTION' . PHP_EOL . + 'END:VTODO' . PHP_EOL . 'END:VCALENDAR'; protected function setUp(): void { diff --git a/apps/dav/tests/unit/bootstrap.php b/apps/dav/tests/unit/bootstrap.php index 61dbda35ae252..886a7f0b859f2 100644 --- a/apps/dav/tests/unit/bootstrap.php +++ b/apps/dav/tests/unit/bootstrap.php @@ -9,7 +9,7 @@ define('PHPUNIT_RUN', 1); } -require_once __DIR__.'/../../../../lib/base.php'; +require_once __DIR__ . '/../../../../lib/base.php'; \OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true); diff --git a/apps/encryption/lib/Command/DropLegacyFileKey.php b/apps/encryption/lib/Command/DropLegacyFileKey.php index 03c24fe8a22af..a9add1ad93b45 100644 --- a/apps/encryption/lib/Command/DropLegacyFileKey.php +++ b/apps/encryption/lib/Command/DropLegacyFileKey.php @@ -114,10 +114,10 @@ private function migrateSinglefile(string $path, FileInfo $fileInfo, OutputInter $copyResource = $this->rootView->fopen($target, 'r'); $sourceResource = $this->rootView->fopen($source, 'w'); if ($copyResource === false || $sourceResource === false) { - throw new DecryptionFailedException('Failed to open '.$source.' or '.$target); + throw new DecryptionFailedException('Failed to open ' . $source . ' or ' . $target); } if (stream_copy_to_stream($copyResource, $sourceResource) === false) { - $output->writeln('Failed to copy '.$target.' data into '.$source.''); + $output->writeln('Failed to copy ' . $target . ' data into ' . $source . ''); $output->writeln('Leaving both files in there to avoid data loss'); return; } diff --git a/apps/encryption/lib/Controller/SettingsController.php b/apps/encryption/lib/Controller/SettingsController.php index 251f385127a3d..df896e52fa54d 100644 --- a/apps/encryption/lib/Controller/SettingsController.php +++ b/apps/encryption/lib/Controller/SettingsController.php @@ -69,7 +69,7 @@ public function __construct($AppName, Crypt $crypt, Session $session, ISession $ocSession, - Util $util + Util $util, ) { parent::__construct($AppName, $request); $this->l = $l10n; diff --git a/apps/encryption/lib/Controller/StatusController.php b/apps/encryption/lib/Controller/StatusController.php index b5b54ee2f6d71..5c6a950d0a33c 100644 --- a/apps/encryption/lib/Controller/StatusController.php +++ b/apps/encryption/lib/Controller/StatusController.php @@ -37,7 +37,7 @@ public function __construct($AppName, IRequest $request, IL10N $l10n, Session $session, - IManager $encryptionManager + IManager $encryptionManager, ) { parent::__construct($AppName, $request); $this->l = $l10n; diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php index 92d6ed6a44393..b38734dd06139 100644 --- a/apps/encryption/lib/Crypto/Crypt.php +++ b/apps/encryption/lib/Crypto/Crypt.php @@ -155,7 +155,7 @@ public function symmetricEncryptFileContent(string $plainContent, string $passPh $this->getCipher()); // Create a signature based on the key as well as the current version - $sig = $this->createSignature($encryptedContent, $passPhrase.'_'.$version.'_'.$position); + $sig = $this->createSignature($encryptedContent, $passPhrase . '_' . $version . '_' . $position); // combine content to encrypt the IV identifier and actual IV $catFile = $this->concatIV($encryptedContent, $iv); @@ -760,7 +760,7 @@ private function opensslOpen(string $data, string &$output, string $encrypted_ke $result = (strlen($output) === strlen($data)); } } else { - throw new DecryptionFailedException('Unsupported cipher '.$cipher_algo); + throw new DecryptionFailedException('Unsupported cipher ' . $cipher_algo); } return $result; @@ -807,7 +807,7 @@ private function opensslSeal(string $data, string &$sealed_data, array &$encrypt } } } else { - throw new EncryptionFailedException('Unsupported cipher '.$cipher_algo); + throw new EncryptionFailedException('Unsupported cipher ' . $cipher_algo); } return $result; diff --git a/apps/encryption/lib/Crypto/DecryptAll.php b/apps/encryption/lib/Crypto/DecryptAll.php index 80c187571b7db..e153712fb9959 100644 --- a/apps/encryption/lib/Crypto/DecryptAll.php +++ b/apps/encryption/lib/Crypto/DecryptAll.php @@ -45,7 +45,7 @@ public function __construct( KeyManager $keyManager, Crypt $crypt, Session $session, - QuestionHelper $questionHelper + QuestionHelper $questionHelper, ) { $this->util = $util; $this->keyManager = $keyManager; diff --git a/apps/encryption/lib/Crypto/EncryptAll.php b/apps/encryption/lib/Crypto/EncryptAll.php index 310f37aba838a..e9db5034baaea 100644 --- a/apps/encryption/lib/Crypto/EncryptAll.php +++ b/apps/encryption/lib/Crypto/EncryptAll.php @@ -82,7 +82,7 @@ public function __construct( IL10N $l, IFactory $l10nFactory, QuestionHelper $questionHelper, - ISecureRandom $secureRandom + ISecureRandom $secureRandom, ) { $this->userSetup = $userSetup; $this->userManager = $userManager; diff --git a/apps/encryption/lib/KeyManager.php b/apps/encryption/lib/KeyManager.php index 9fd6c7655afd5..0c9c02760a897 100644 --- a/apps/encryption/lib/KeyManager.php +++ b/apps/encryption/lib/KeyManager.php @@ -211,7 +211,7 @@ public function storeKeyPair($uid, $password, $keyPair) { */ public function setRecoveryKey($password, $keyPair) { // Save Public Key - $this->keyStorage->setSystemUserKey($this->getRecoveryKeyId(). + $this->keyStorage->setSystemUserKey($this->getRecoveryKeyId() . '.' . $this->publicKeyId, $keyPair['publicKey'], Encryption::ID); diff --git a/apps/encryption/lib/Settings/Admin.php b/apps/encryption/lib/Settings/Admin.php index 4f695f61b1b0f..e8290b778ada2 100644 --- a/apps/encryption/lib/Settings/Admin.php +++ b/apps/encryption/lib/Settings/Admin.php @@ -25,7 +25,7 @@ public function __construct( private IUserSession $userSession, private IConfig $config, private IUserManager $userManager, - private ISession $session + private ISession $session, ) { } diff --git a/apps/encryption/tests/Command/FixEncryptedVersionTest.php b/apps/encryption/tests/Command/FixEncryptedVersionTest.php index fd6e27e030bd3..e5079b9a8afb8 100644 --- a/apps/encryption/tests/Command/FixEncryptedVersionTest.php +++ b/apps/encryption/tests/Command/FixEncryptedVersionTest.php @@ -251,7 +251,7 @@ public function testRepairUnencryptedFileWhenVersionIsSet(): void { $cacheInfo = ['encryptedVersion' => 1, 'encrypted' => 1]; $cache1->put($fileCache1->getPath(), $cacheInfo); - $absPath = $storage1->getSourcePath('').$fileInfo1->getInternalPath(); + $absPath = $storage1->getSourcePath('') . $fileInfo1->getInternalPath(); // create unencrypted file on disk, the version stays file_put_contents($absPath, 'hello contents'); diff --git a/apps/federatedfilesharing/lib/AddressHandler.php b/apps/federatedfilesharing/lib/AddressHandler.php index 320f65c2b4255..d96c956eb1154 100644 --- a/apps/federatedfilesharing/lib/AddressHandler.php +++ b/apps/federatedfilesharing/lib/AddressHandler.php @@ -38,7 +38,7 @@ class AddressHandler { public function __construct( IURLGenerator $urlGenerator, IL10N $il10n, - ICloudIdManager $cloudIdManager + ICloudIdManager $cloudIdManager, ) { $this->l = $il10n; $this->urlGenerator = $urlGenerator; diff --git a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php index 71661efa384b1..8d4f6fd3af857 100644 --- a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php +++ b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php @@ -84,7 +84,7 @@ public function __construct(string $appName, LoggerInterface $logger, ICloudFederationFactory $cloudFederationFactory, ICloudFederationProviderManager $cloudFederationProviderManager, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { parent::__construct($appName, $request); diff --git a/apps/federatedfilesharing/lib/Settings/Admin.php b/apps/federatedfilesharing/lib/Settings/Admin.php index 90ee9a8c74835..a7bdc545413d5 100644 --- a/apps/federatedfilesharing/lib/Settings/Admin.php +++ b/apps/federatedfilesharing/lib/Settings/Admin.php @@ -28,7 +28,7 @@ public function __construct( IConfig $globalScaleConfig, IL10N $l, IURLGenerator $urlGenerator, - IInitialState $initialState + IInitialState $initialState, ) { $this->fedShareProvider = $fedShareProvider; $this->gsConfig = $globalScaleConfig; diff --git a/apps/federatedfilesharing/lib/Settings/Personal.php b/apps/federatedfilesharing/lib/Settings/Personal.php index bee6cc538c66b..93ca36ab4204c 100644 --- a/apps/federatedfilesharing/lib/Settings/Personal.php +++ b/apps/federatedfilesharing/lib/Settings/Personal.php @@ -28,7 +28,7 @@ public function __construct( IUserSession $userSession, Defaults $defaults, IInitialState $initialState, - IURLGenerator $urlGenerator + IURLGenerator $urlGenerator, ) { $this->federatedShareProvider = $federatedShareProvider; $this->userSession = $userSession; diff --git a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php index 6eb7ce302746b..9caafb35bb3ab 100644 --- a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php +++ b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php @@ -129,7 +129,7 @@ public function testCreateFederatedShare($shareWith, $validToken, $createSuccessful, $expectedReturnData, - $permissions + $permissions, ): void { $this->federatedShareProvider->expects($this->any()) ->method('isOutgoingServer2serverShareEnabled') diff --git a/apps/federatedfilesharing/tests/NotificationsTest.php b/apps/federatedfilesharing/tests/NotificationsTest.php index 868591cb4dde4..7ac4e964362c0 100644 --- a/apps/federatedfilesharing/tests/NotificationsTest.php +++ b/apps/federatedfilesharing/tests/NotificationsTest.php @@ -113,7 +113,7 @@ public function testSendUpdateToRemote($try, $httpRequestResult, $expected): voi $instance->expects($this->any())->method('getTimestamp')->willReturn($timestamp); $instance->expects($this->once())->method('tryHttpPostToShareEndpoint') - ->with($remote, '/'.$id.'/unshare', ['token' => $token, 'data1Key' => 'data1Value', 'remoteId' => $id], $action) + ->with($remote, '/' . $id . '/unshare', ['token' => $token, 'data1Key' => 'data1Value', 'remoteId' => $id], $action) ->willReturn($httpRequestResult); // only add background job on first try diff --git a/apps/federation/lib/BackgroundJob/GetSharedSecret.php b/apps/federation/lib/BackgroundJob/GetSharedSecret.php index 1a23d58a7d100..92196e68e0124 100644 --- a/apps/federation/lib/BackgroundJob/GetSharedSecret.php +++ b/apps/federation/lib/BackgroundJob/GetSharedSecret.php @@ -47,7 +47,7 @@ public function __construct( TrustedServers $trustedServers, LoggerInterface $logger, IDiscoveryService $ocsDiscoveryService, - ITimeFactory $timeFactory + ITimeFactory $timeFactory, ) { parent::__construct($timeFactory); $this->logger = $logger; diff --git a/apps/federation/lib/Controller/OCSAuthAPIController.php b/apps/federation/lib/Controller/OCSAuthAPIController.php index 8412868da42c8..221a9321cd7bf 100644 --- a/apps/federation/lib/Controller/OCSAuthAPIController.php +++ b/apps/federation/lib/Controller/OCSAuthAPIController.php @@ -50,7 +50,7 @@ public function __construct( DbHandler $dbHandler, LoggerInterface $logger, ITimeFactory $timeFactory, - IThrottler $throttler + IThrottler $throttler, ) { parent::__construct($appName, $request); @@ -165,7 +165,7 @@ public function getSharedSecret(string $url, string $token): DataResponse { $this->throttler->registerAttempt('federationSharedSecret', $this->request->getRemoteAddress()); $expectedToken = $this->dbHandler->getToken($url); $this->logger->error( - 'remote server (' . $url . ') didn\'t send a valid token (got "' . $token . '" but expected "'. $expectedToken . '") while getting shared secret', + 'remote server (' . $url . ') didn\'t send a valid token (got "' . $token . '" but expected "' . $expectedToken . '") while getting shared secret', ['app' => 'federation'] ); throw new OCSForbiddenException(); diff --git a/apps/federation/lib/Controller/SettingsController.php b/apps/federation/lib/Controller/SettingsController.php index f5131581d94b7..18ebc516cb8dd 100644 --- a/apps/federation/lib/Controller/SettingsController.php +++ b/apps/federation/lib/Controller/SettingsController.php @@ -23,7 +23,7 @@ class SettingsController extends Controller { public function __construct(string $AppName, IRequest $request, IL10N $l10n, - TrustedServers $trustedServers + TrustedServers $trustedServers, ) { parent::__construct($AppName, $request); $this->l = $l10n; diff --git a/apps/federation/lib/DbHandler.php b/apps/federation/lib/DbHandler.php index 8a189dc56f7ac..4b7fc1a8da1d5 100644 --- a/apps/federation/lib/DbHandler.php +++ b/apps/federation/lib/DbHandler.php @@ -31,7 +31,7 @@ class DbHandler { public function __construct( IDBConnection $connection, - IL10N $il10n + IL10N $il10n, ) { $this->connection = $connection; $this->IL10N = $il10n; diff --git a/apps/federation/lib/SyncFederationAddressBooks.php b/apps/federation/lib/SyncFederationAddressBooks.php index aaed6ca9d9469..8060a78ada73d 100644 --- a/apps/federation/lib/SyncFederationAddressBooks.php +++ b/apps/federation/lib/SyncFederationAddressBooks.php @@ -22,7 +22,7 @@ class SyncFederationAddressBooks { public function __construct(DbHandler $dbHandler, SyncService $syncService, IDiscoveryService $ocsDiscoveryService, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->syncService = $syncService; $this->dbHandler = $dbHandler; diff --git a/apps/federation/lib/TrustedServers.php b/apps/federation/lib/TrustedServers.php index 48cffd2d274f8..e59f281df0bc3 100644 --- a/apps/federation/lib/TrustedServers.php +++ b/apps/federation/lib/TrustedServers.php @@ -51,7 +51,7 @@ public function __construct( ISecureRandom $secureRandom, IConfig $config, IEventDispatcher $dispatcher, - ITimeFactory $timeFactory + ITimeFactory $timeFactory, ) { $this->dbHandler = $dbHandler; $this->httpClientService = $httpClientService; diff --git a/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php b/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php index 81f3d229bc01f..ce2de9a74bbb9 100644 --- a/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php +++ b/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php @@ -22,7 +22,7 @@ class DeleteExpiredOpenLocalEditor extends TimedJob { public function __construct( ITimeFactory $time, - OpenLocalEditorMapper $mapper + OpenLocalEditorMapper $mapper, ) { parent::__construct($time); $this->mapper = $mapper; diff --git a/apps/files/lib/BackgroundJob/ScanFiles.php b/apps/files/lib/BackgroundJob/ScanFiles.php index b7e6e8db10ecb..88b45033255f3 100644 --- a/apps/files/lib/BackgroundJob/ScanFiles.php +++ b/apps/files/lib/BackgroundJob/ScanFiles.php @@ -37,7 +37,7 @@ public function __construct( IEventDispatcher $dispatcher, LoggerInterface $logger, IDBConnection $connection, - ITimeFactory $time + ITimeFactory $time, ) { parent::__construct($time); // Run once per 10 minutes diff --git a/apps/files/lib/Command/ScanAppData.php b/apps/files/lib/Command/ScanAppData.php index 5360d38bdb629..22de2f6d19f9c 100644 --- a/apps/files/lib/Command/ScanAppData.php +++ b/apps/files/lib/Command/ScanAppData.php @@ -238,6 +238,6 @@ private function getAppDataFolder(): Node { throw new NotFoundException(); } - return $this->rootFolder->get('appdata_'.$instanceId); + return $this->rootFolder->get('appdata_' . $instanceId); } } diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index 62ae4e6b0f049..0ca4a1efd4b5c 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -47,7 +47,8 @@ * @package OCA\Files\Controller */ class ApiController extends Controller { - public function __construct(string $appName, + public function __construct( + string $appName, IRequest $request, private IUserSession $userSession, private TagService $tagService, diff --git a/apps/files/lib/Controller/DirectEditingController.php b/apps/files/lib/Controller/DirectEditingController.php index 693587f9c8a56..63f29d3ba2a69 100644 --- a/apps/files/lib/Controller/DirectEditingController.php +++ b/apps/files/lib/Controller/DirectEditingController.php @@ -29,7 +29,7 @@ public function __construct( private IURLGenerator $urlGenerator, private IManager $directEditingManager, private DirectEditingService $directEditingService, - private LoggerInterface $logger + private LoggerInterface $logger, ) { parent::__construct($appName, $request, $corsMethods, $corsAllowedHeaders, $corsMaxAge); } diff --git a/apps/files/lib/Controller/OpenLocalEditorController.php b/apps/files/lib/Controller/OpenLocalEditorController.php index 0c13af2a6d2c4..1982569e7d28f 100644 --- a/apps/files/lib/Controller/OpenLocalEditorController.php +++ b/apps/files/lib/Controller/OpenLocalEditorController.php @@ -42,7 +42,7 @@ public function __construct( OpenLocalEditorMapper $mapper, ISecureRandom $secureRandom, LoggerInterface $logger, - ?string $userId + ?string $userId, ) { parent::__construct($appName, $request); diff --git a/apps/files/lib/Controller/TemplateController.php b/apps/files/lib/Controller/TemplateController.php index d4232763235cf..f3272d70d6880 100644 --- a/apps/files/lib/Controller/TemplateController.php +++ b/apps/files/lib/Controller/TemplateController.php @@ -62,7 +62,7 @@ public function create( string $filePath, string $templatePath = '', string $templateType = 'user', - array $templateFields = [] + array $templateFields = [], ): DataResponse { try { return new DataResponse($this->templateManager->createFromTemplate( diff --git a/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php b/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php index 1ae80735972c8..5fd233d232e55 100644 --- a/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php +++ b/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php @@ -27,7 +27,7 @@ public function __construct( ITimeFactory $time, ICredentialsManager $credentialsManager, UserGlobalStoragesService $userGlobalStoragesService, - IUserManager $userManager + IUserManager $userManager, ) { parent::__construct($time); diff --git a/apps/files_external/lib/Command/Scan.php b/apps/files_external/lib/Command/Scan.php index 575ee5989f543..374566ce211b9 100644 --- a/apps/files_external/lib/Command/Scan.php +++ b/apps/files_external/lib/Command/Scan.php @@ -24,7 +24,7 @@ class Scan extends StorageAuthBase { public function __construct( GlobalStoragesService $globalService, - IUserManager $userManager + IUserManager $userManager, ) { parent::__construct($globalService, $userManager); } diff --git a/apps/files_external/lib/Controller/ApiController.php b/apps/files_external/lib/Controller/ApiController.php index 10fd120c3d92f..d326e1f7f444b 100644 --- a/apps/files_external/lib/Controller/ApiController.php +++ b/apps/files_external/lib/Controller/ApiController.php @@ -31,7 +31,7 @@ public function __construct( string $appName, IRequest $request, UserGlobalStoragesService $userGlobalStorageService, - UserStoragesService $userStorageService + UserStoragesService $userStorageService, ) { parent::__construct($appName, $request); $this->userGlobalStoragesService = $userGlobalStorageService; diff --git a/apps/files_external/lib/Controller/GlobalStoragesController.php b/apps/files_external/lib/Controller/GlobalStoragesController.php index d773f3ea5e245..05cfd4684d8bd 100644 --- a/apps/files_external/lib/Controller/GlobalStoragesController.php +++ b/apps/files_external/lib/Controller/GlobalStoragesController.php @@ -41,7 +41,7 @@ public function __construct( LoggerInterface $logger, IUserSession $userSession, IGroupManager $groupManager, - IConfig $config + IConfig $config, ) { parent::__construct( $AppName, @@ -77,7 +77,7 @@ public function create( $mountOptions, $applicableUsers, $applicableGroups, - $priority + $priority, ) { $canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', true); if (!$canCreateNewLocalStorage && $backend === 'local') { @@ -144,7 +144,7 @@ public function update( $applicableUsers, $applicableGroups, $priority, - $testOnly = true + $testOnly = true, ) { $storage = $this->createStorage( $mountPoint, diff --git a/apps/files_external/lib/Controller/StoragesController.php b/apps/files_external/lib/Controller/StoragesController.php index ab580987b0e74..fcd3863e65888 100644 --- a/apps/files_external/lib/Controller/StoragesController.php +++ b/apps/files_external/lib/Controller/StoragesController.php @@ -44,7 +44,7 @@ public function __construct( protected LoggerInterface $logger, protected IUserSession $userSession, protected IGroupManager $groupManager, - protected IConfig $config + protected IConfig $config, ) { parent::__construct($AppName, $request); } @@ -71,7 +71,7 @@ protected function createStorage( $mountOptions = null, $applicableUsers = null, $applicableGroups = null, - $priority = null + $priority = null, ) { $canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', true); if (!$canCreateNewLocalStorage && $backend === 'local') { diff --git a/apps/files_external/lib/Controller/UserGlobalStoragesController.php b/apps/files_external/lib/Controller/UserGlobalStoragesController.php index 3d364fff57dc5..60159e1bc5420 100644 --- a/apps/files_external/lib/Controller/UserGlobalStoragesController.php +++ b/apps/files_external/lib/Controller/UserGlobalStoragesController.php @@ -47,7 +47,7 @@ public function __construct( LoggerInterface $logger, IUserSession $userSession, IGroupManager $groupManager, - IConfig $config + IConfig $config, ) { parent::__construct( $AppName, @@ -139,7 +139,7 @@ public function show($id, $testOnly = true) { public function update( $id, $backendOptions, - $testOnly = true + $testOnly = true, ) { try { $storage = $this->service->getStorage($id); diff --git a/apps/files_external/lib/Controller/UserStoragesController.php b/apps/files_external/lib/Controller/UserStoragesController.php index a85aa3faa96f3..ac806fe219c8c 100644 --- a/apps/files_external/lib/Controller/UserStoragesController.php +++ b/apps/files_external/lib/Controller/UserStoragesController.php @@ -44,7 +44,7 @@ public function __construct( LoggerInterface $logger, IUserSession $userSession, IGroupManager $groupManager, - IConfig $config + IConfig $config, ) { parent::__construct( $AppName, @@ -104,7 +104,7 @@ public function create( $backend, $authMechanism, $backendOptions, - $mountOptions + $mountOptions, ) { $canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', true); if (!$canCreateNewLocalStorage && $backend === 'local') { @@ -161,7 +161,7 @@ public function update( $authMechanism, $backendOptions, $mountOptions, - $testOnly = true + $testOnly = true, ) { $storage = $this->createStorage( $mountPoint, diff --git a/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php b/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php index ea42b0275f71f..5c36f8433070b 100644 --- a/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php +++ b/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php @@ -46,7 +46,7 @@ public function __construct( ICredentialsManager $credentialsManager, CredentialsStore $credentialsStore, IEventDispatcher $eventDispatcher, - ILDAPProviderFactory $ldapFactory + ILDAPProviderFactory $ldapFactory, ) { $this->session = $session; $this->credentialsManager = $credentialsManager; diff --git a/apps/files_external/lib/Lib/PersonalMount.php b/apps/files_external/lib/Lib/PersonalMount.php index 64e8fdcea695e..610807bc7a251 100644 --- a/apps/files_external/lib/Lib/PersonalMount.php +++ b/apps/files_external/lib/Lib/PersonalMount.php @@ -39,7 +39,7 @@ public function __construct( $arguments = null, $loader = null, $mountOptions = null, - $mountId = null + $mountId = null, ) { parent::__construct($storageConfig, $storage, $mountpoint, $arguments, $loader, $mountOptions, $mountId); $this->storagesService = $storagesService; diff --git a/apps/files_external/lib/MountConfig.php b/apps/files_external/lib/MountConfig.php index b057fb810bd08..1cbd6e14ebea2 100644 --- a/apps/files_external/lib/MountConfig.php +++ b/apps/files_external/lib/MountConfig.php @@ -41,7 +41,7 @@ class MountConfig { public function __construct( UserGlobalStoragesService $userGlobalStorageService, UserStoragesService $userStorageService, - GlobalStoragesService $globalStorageService + GlobalStoragesService $globalStorageService, ) { $this->userGlobalStorageService = $userGlobalStorageService; $this->userStorageService = $userStorageService; diff --git a/apps/files_external/lib/Service/BackendService.php b/apps/files_external/lib/Service/BackendService.php index 5eb0276be6500..a72179a337343 100644 --- a/apps/files_external/lib/Service/BackendService.php +++ b/apps/files_external/lib/Service/BackendService.php @@ -62,7 +62,7 @@ class BackendService { * @param IConfig $config */ public function __construct( - IConfig $config + IConfig $config, ) { $this->config = $config; diff --git a/apps/files_external/lib/Service/LegacyStoragesService.php b/apps/files_external/lib/Service/LegacyStoragesService.php index ac9273f2afcad..1f5cf8cdf2881 100644 --- a/apps/files_external/lib/Service/LegacyStoragesService.php +++ b/apps/files_external/lib/Service/LegacyStoragesService.php @@ -37,7 +37,7 @@ protected function populateStorageConfigWithLegacyOptions( &$storageConfig, $mountType, $applicable, - $storageOptions + $storageOptions, ) { $backend = $this->backendService->getBackend($storageOptions['backend']); if (!$backend) { diff --git a/apps/files_external/lib/Service/StoragesService.php b/apps/files_external/lib/Service/StoragesService.php index 09f7ea954b494..40bf5bfe1a80a 100644 --- a/apps/files_external/lib/Service/StoragesService.php +++ b/apps/files_external/lib/Service/StoragesService.php @@ -50,7 +50,7 @@ public function __construct( BackendService $backendService, DBConfigService $dbConfigService, IUserMountCache $userMountCache, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { $this->backendService = $backendService; $this->dbConfig = $dbConfigService; @@ -282,7 +282,7 @@ public function createStorage( $mountOptions = null, $applicableUsers = null, $applicableGroups = null, - $priority = null + $priority = null, ) { $backend = $this->backendService->getBackend($backendIdentifier); if (!$backend) { diff --git a/apps/files_external/lib/Service/UserGlobalStoragesService.php b/apps/files_external/lib/Service/UserGlobalStoragesService.php index 58590b8d682d1..6fc37ea99b324 100644 --- a/apps/files_external/lib/Service/UserGlobalStoragesService.php +++ b/apps/files_external/lib/Service/UserGlobalStoragesService.php @@ -37,7 +37,7 @@ public function __construct( IUserSession $userSession, IGroupManager $groupManager, IUserMountCache $userMountCache, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { parent::__construct($backendService, $dbConfig, $userMountCache, $eventDispatcher); $this->userSession = $userSession; diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php index ba67815636828..b461451389b38 100644 --- a/apps/files_external/lib/Service/UserStoragesService.php +++ b/apps/files_external/lib/Service/UserStoragesService.php @@ -34,7 +34,7 @@ public function __construct( DBConfigService $dbConfig, IUserSession $userSession, IUserMountCache $userMountCache, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { $this->userSession = $userSession; parent::__construct($backendService, $dbConfig, $userMountCache, $eventDispatcher); diff --git a/apps/files_external/lib/Settings/Admin.php b/apps/files_external/lib/Settings/Admin.php index 63a420e749e6a..707f7704702c3 100644 --- a/apps/files_external/lib/Settings/Admin.php +++ b/apps/files_external/lib/Settings/Admin.php @@ -30,7 +30,7 @@ public function __construct( IManager $encryptionManager, GlobalStoragesService $globalStoragesService, BackendService $backendService, - GlobalAuth $globalAuth + GlobalAuth $globalAuth, ) { $this->encryptionManager = $encryptionManager; $this->globalStoragesService = $globalStoragesService; diff --git a/apps/files_external/lib/Settings/Personal.php b/apps/files_external/lib/Settings/Personal.php index ecd56e632a98b..f84051626a222 100644 --- a/apps/files_external/lib/Settings/Personal.php +++ b/apps/files_external/lib/Settings/Personal.php @@ -35,7 +35,7 @@ public function __construct( UserGlobalStoragesService $userGlobalStoragesService, BackendService $backendService, GlobalAuth $globalAuth, - IUserSession $userSession + IUserSession $userSession, ) { $this->encryptionManager = $encryptionManager; $this->userGlobalStoragesService = $userGlobalStoragesService; diff --git a/apps/files_external/lib/Settings/PersonalSection.php b/apps/files_external/lib/Settings/PersonalSection.php index 41db1fcd9062f..f72ef95ad7f04 100644 --- a/apps/files_external/lib/Settings/PersonalSection.php +++ b/apps/files_external/lib/Settings/PersonalSection.php @@ -26,7 +26,7 @@ public function __construct( IL10N $l, IUserSession $userSession, UserGlobalStoragesService $userGlobalStoragesService, - BackendService $backendService + BackendService $backendService, ) { parent::__construct($url, $l); $this->userSession = $userSession; diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index c4d14ecb2b4ed..0ebb5800d29e0 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -116,7 +116,7 @@ function writeParameterInput($parameter, $options, $classes = []) {

t('External storage enables you to mount external storage services and devices as secondary Nextcloud storage devices. You may also allow people to mount their own external storage services.')); ?>

'> @@ -127,7 +127,7 @@ function writeParameterInput($parameter, $options, $classes = []) { '.$l->t('Available for').''); + print_unescaped(''); } ?> diff --git a/apps/files_external/tests/Controller/StoragesControllerTest.php b/apps/files_external/tests/Controller/StoragesControllerTest.php index 9e9595152aded..94512c56cadc8 100644 --- a/apps/files_external/tests/Controller/StoragesControllerTest.php +++ b/apps/files_external/tests/Controller/StoragesControllerTest.php @@ -47,7 +47,7 @@ protected function getBackendMock($class = '\OCA\Files_External\Lib\Backend\SMB' $backend->method('getStorageClass') ->willReturn($storageClass); $backend->method('getIdentifier') - ->willReturn('identifier:'.$class); + ->willReturn('identifier:' . $class); $backend->method('getParameters') ->willReturn([]); return $backend; @@ -63,7 +63,7 @@ protected function getAuthMechMock($scheme = 'null', $class = '\OCA\Files_Extern $authMech->method('getScheme') ->willReturn($scheme); $authMech->method('getIdentifier') - ->willReturn('identifier:'.$class); + ->willReturn('identifier:' . $class); $authMech->method('getParameters') ->willReturn([]); diff --git a/apps/files_external/tests/Service/BackendServiceTest.php b/apps/files_external/tests/Service/BackendServiceTest.php index 6d9754a533579..74a4b223a96d2 100644 --- a/apps/files_external/tests/Service/BackendServiceTest.php +++ b/apps/files_external/tests/Service/BackendServiceTest.php @@ -32,8 +32,8 @@ protected function getBackendMock($class) { $backend = $this->getMockBuilder(Backend::class) ->disableOriginalConstructor() ->getMock(); - $backend->method('getIdentifier')->willReturn('identifier:'.$class); - $backend->method('getIdentifierAliases')->willReturn(['identifier:'.$class]); + $backend->method('getIdentifier')->willReturn('identifier:' . $class); + $backend->method('getIdentifierAliases')->willReturn(['identifier:' . $class]); return $backend; } @@ -46,8 +46,8 @@ protected function getAuthMechanismMock($class) { $backend = $this->getMockBuilder(AuthMechanism::class) ->disableOriginalConstructor() ->getMock(); - $backend->method('getIdentifier')->willReturn('identifier:'.$class); - $backend->method('getIdentifierAliases')->willReturn(['identifier:'.$class]); + $backend->method('getIdentifier')->willReturn('identifier:' . $class); + $backend->method('getIdentifierAliases')->willReturn(['identifier:' . $class]); return $backend; } diff --git a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php index 992960a6ea10c..ff8d5f4e49492 100644 --- a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php +++ b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php @@ -243,7 +243,7 @@ public function getUniqueStoragesProvider() { public function testGetUniqueStorages( $priority1, $applicableUsers1, $applicableGroups1, $priority2, $applicableUsers2, $applicableGroups2, - $expectedPrecedence + $expectedPrecedence, ): void { $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); $backend->method('isVisibleFor') diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php index 26a9bc7b5248c..94427f7a97974 100644 --- a/apps/files_sharing/lib/Cache.php +++ b/apps/files_sharing/lib/Cache.php @@ -43,7 +43,7 @@ public function __construct( $storage, ICacheEntry $sourceRootInfo, CacheDependencies $dependencies, - IShare $share + IShare $share, ) { $this->storage = $storage; $this->sourceRootInfo = $sourceRootInfo; diff --git a/apps/files_sharing/lib/Controller/PublicPreviewController.php b/apps/files_sharing/lib/Controller/PublicPreviewController.php index 4dc3989f866d3..a2e244c7ba08c 100644 --- a/apps/files_sharing/lib/Controller/PublicPreviewController.php +++ b/apps/files_sharing/lib/Controller/PublicPreviewController.php @@ -83,7 +83,7 @@ public function getPreview( string $file = '', int $x = 32, int $y = 32, - $a = false + $a = false, ) { if ($token === '' || $x === 0 || $y === 0) { return new DataResponse([], Http::STATUS_BAD_REQUEST); diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 9ca9774013c18..cf83587467724 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -88,7 +88,7 @@ public function __construct( private LoggerInterface $logger, private IProviderFactory $factory, private IMailer $mailer, - ?string $userId = null + ?string $userId = null, ) { parent::__construct($appName, $request); $this->currentUser = $userId; @@ -565,7 +565,7 @@ public function createShare( string $note = '', string $label = '', ?string $attributes = null, - ?string $sendMail = null + ?string $sendMail = null, ): DataResponse { $share = $this->shareManager->newShare(); @@ -930,7 +930,7 @@ public function getShares( string $reshares = 'false', string $subfiles = 'false', string $path = '', - string $include_tags = 'false' + string $include_tags = 'false', ): DataResponse { $node = null; if ($path !== '') { @@ -978,7 +978,7 @@ private function getFormattedShares( bool $sharedWithMe = false, bool $reShares = false, bool $subFiles = false, - bool $includeTags = false + bool $includeTags = false, ): array { if ($sharedWithMe) { return $this->getSharedWithMe($node, $includeTags); diff --git a/apps/files_sharing/lib/DeleteOrphanedSharesJob.php b/apps/files_sharing/lib/DeleteOrphanedSharesJob.php index 2315ff5c12070..4ab95c2587bc5 100644 --- a/apps/files_sharing/lib/DeleteOrphanedSharesJob.php +++ b/apps/files_sharing/lib/DeleteOrphanedSharesJob.php @@ -38,7 +38,7 @@ class DeleteOrphanedSharesJob extends TimedJob { public function __construct( ITimeFactory $time, IDBConnection $db, - LoggerInterface $logger + LoggerInterface $logger, ) { parent::__construct($time); diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php index a3226e9f3dd5b..86c9ae830e4ab 100644 --- a/apps/files_sharing/lib/External/Manager.php +++ b/apps/files_sharing/lib/External/Manager.php @@ -84,7 +84,7 @@ public function __construct( IUserManager $userManager, IUserSession $userSession, IEventDispatcher $eventDispatcher, - LoggerInterface $logger + LoggerInterface $logger, ) { $user = $userSession->getUser(); $this->connection = $connection; diff --git a/apps/files_sharing/lib/Helper.php b/apps/files_sharing/lib/Helper.php index f2f92679e2f91..3f1937396a01e 100644 --- a/apps/files_sharing/lib/Helper.php +++ b/apps/files_sharing/lib/Helper.php @@ -28,12 +28,12 @@ public static function registerHooks() { */ public static function generateUniqueTarget($path, $excludeList, $view) { $pathinfo = pathinfo($path); - $ext = isset($pathinfo['extension']) ? '.'.$pathinfo['extension'] : ''; + $ext = isset($pathinfo['extension']) ? '.' . $pathinfo['extension'] : ''; $name = $pathinfo['filename']; $dir = $pathinfo['dirname']; $i = 2; while ($view->file_exists($path) || in_array($path, $excludeList)) { - $path = Filesystem::normalizePath($dir . '/' . $name . ' ('.$i.')' . $ext); + $path = Filesystem::normalizePath($dir . '/' . $name . ' (' . $i . ')' . $ext); $i++; } diff --git a/apps/files_sharing/lib/Listener/LoadSidebarListener.php b/apps/files_sharing/lib/Listener/LoadSidebarListener.php index 7fd10b3877922..b00e937d6754d 100644 --- a/apps/files_sharing/lib/Listener/LoadSidebarListener.php +++ b/apps/files_sharing/lib/Listener/LoadSidebarListener.php @@ -22,7 +22,10 @@ */ class LoadSidebarListener implements IEventListener { - public function __construct(private IInitialState $initialState, private IManager $shareManager) { + public function __construct( + private IInitialState $initialState, + private IManager $shareManager, + ) { } public function handle(Event $event): void { diff --git a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php index e13c3354f27ca..009692c566762 100644 --- a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php +++ b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php @@ -47,7 +47,7 @@ public function __construct(string $appName, IAppManager $appManager, IControllerMethodReflector $reflector, IManager $shareManager, - IRequest $request + IRequest $request, ) { $this->appName = $appName; $this->config = $config; diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php index 64847bf5a5f1d..5313f40ff6bbe 100644 --- a/apps/files_sharing/lib/MountProvider.php +++ b/apps/files_sharing/lib/MountProvider.php @@ -30,7 +30,7 @@ public function __construct( protected IManager $shareManager, protected LoggerInterface $logger, protected IEventDispatcher $eventDispatcher, - protected ICacheFactory $cacheFactory + protected ICacheFactory $cacheFactory, ) { } diff --git a/apps/files_sharing/lib/Notification/Listener.php b/apps/files_sharing/lib/Notification/Listener.php index aaac32897d79b..e925ca75fb8e8 100644 --- a/apps/files_sharing/lib/Notification/Listener.php +++ b/apps/files_sharing/lib/Notification/Listener.php @@ -30,7 +30,7 @@ class Listener { public function __construct( INotificationManager $notificationManager, IShareManager $shareManager, - IGroupManager $groupManager + IGroupManager $groupManager, ) { $this->notificationManager = $notificationManager; $this->shareManager = $shareManager; diff --git a/apps/files_sharing/lib/OrphanHelper.php b/apps/files_sharing/lib/OrphanHelper.php index 94fe4f0831838..c5ad93a354f54 100644 --- a/apps/files_sharing/lib/OrphanHelper.php +++ b/apps/files_sharing/lib/OrphanHelper.php @@ -19,7 +19,7 @@ class OrphanHelper { public function __construct( IDBConnection $connection, - IRootFolder $rootFolder + IRootFolder $rootFolder, ) { $this->connection = $connection; $this->rootFolder = $rootFolder; diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php index 6c7178132adf3..ddd6af3845da6 100644 --- a/apps/files_sharing/lib/SharedMount.php +++ b/apps/files_sharing/lib/SharedMount.php @@ -55,7 +55,7 @@ public function __construct( CappedMemoryCache $folderExistCache, IEventDispatcher $eventDispatcher, IUser $user, - ICache $cache + ICache $cache, ) { $this->user = $user; $this->recipientView = $recipientView; @@ -81,7 +81,7 @@ public function __construct( private function verifyMountPoint( \OCP\Share\IShare $share, array $mountpoints, - CappedMemoryCache $folderExistCache + CappedMemoryCache $folderExistCache, ) { $cacheKey = $this->user->getUID() . '/' . $share->getId() . '/' . $share->getTarget(); $cached = $this->cache->get($cacheKey); diff --git a/apps/files_sharing/lib/SharesReminderJob.php b/apps/files_sharing/lib/SharesReminderJob.php index 6780ee77fe3f3..580cc4f7f92bf 100644 --- a/apps/files_sharing/lib/SharesReminderJob.php +++ b/apps/files_sharing/lib/SharesReminderJob.php @@ -127,7 +127,7 @@ private function getShares(): array|\Iterator { * @param IShare $share Share that was obtained with {@link getShares} * @return array|null Info needed to send a reminder */ - private function prepareReminder(IShare $share): array|null { + private function prepareReminder(IShare $share): ?array { $sharedWith = $share->getSharedWith(); $reminderInfo = []; if ($share->getShareType() == IShare::TYPE_USER) { diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index fe0739cfcde6c..4d50fb4065eba 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -63,7 +63,7 @@ protected function setUp(): void { $this->view->mkdir($this->folder); $this->view->mkdir($this->folder . $this->subfolder); $this->view->mkdir($this->folder . $this->subfolder . $this->subsubfolder); - $this->view->file_put_contents($this->folder.$this->filename, $this->data); + $this->view->file_put_contents($this->folder . $this->filename, $this->data); $this->view->file_put_contents($this->folder . $this->subfolder . $this->filename, $this->data); $mount = $this->view->getMount($this->filename); $mount->getStorage()->getScanner()->scan('', Scanner::SCAN_RECURSIVE); @@ -135,7 +135,7 @@ public function testCreateShareUserFile(): void { $this->assertEquals(19, $data['permissions']); $this->assertEmpty($data['expiration']); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -152,7 +152,7 @@ public function testCreateShareUserFolder(): void { $this->assertEquals(31, $data['permissions']); $this->assertEmpty($data['expiration']); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -169,7 +169,7 @@ public function testCreateShareGroupFile(): void { $this->assertEquals(19, $data['permissions']); $this->assertEmpty($data['expiration']); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -185,7 +185,7 @@ public function testCreateShareGroupFolder(): void { $this->assertEquals(31, $data['permissions']); $this->assertEmpty($data['expiration']); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -210,7 +210,7 @@ public function testCreateShareLink(): void { $url = \OC::$server->getURLGenerator()->getAbsoluteURL('/index.php/s/' . $data['token']); $this->assertEquals($url, $data['url']); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -241,7 +241,7 @@ public function testCreateShareLinkPublicUpload(): void { $url = \OC::$server->getURLGenerator()->getAbsoluteURL('/index.php/s/' . $data['token']); $this->assertEquals($url, $data['url']); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -313,7 +313,7 @@ public function testSharePermissions(): void { $data = $result->getData(); - $this->shareManager->getShareById('ocinternal:'.$data['id']); + $this->shareManager->getShareById('ocinternal:' . $data['id']); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->deleteShare($data['id']); @@ -571,7 +571,7 @@ public function testGetShareFromFolder(): void { ->setPermissions(19); $share1 = $this->shareManager->createShare($share1); - $node2 = $this->userFolder->get($this->folder.'/'.$this->filename); + $node2 = $this->userFolder->get($this->folder . '/' . $this->filename); $share2 = $this->shareManager->newShare(); $share2->setNode($node2) ->setSharedBy(self::TEST_FILES_SHARING_API_USER1) @@ -629,7 +629,7 @@ public function testGetShareFromFolderReshares(): void { $share1->setStatus(IShare::STATUS_ACCEPTED); $this->shareManager->updateShare($share1); - $node2 = $this->userFolder->get($this->folder.'/'.$this->filename); + $node2 = $this->userFolder->get($this->folder . '/' . $this->filename); $share2 = $this->shareManager->newShare(); $share2->setNode($node2) ->setSharedBy(self::TEST_FILES_SHARING_API_USER2) @@ -639,7 +639,7 @@ public function testGetShareFromFolderReshares(): void { $share2->setStatus(IShare::STATUS_ACCEPTED); $this->shareManager->updateShare($share2); - $node3 = $this->userFolder->get($this->folder.'/'.$this->subfolder.'/'.$this->filename); + $node3 = $this->userFolder->get($this->folder . '/' . $this->subfolder . '/' . $this->filename); $share3 = $this->shareManager->newShare(); $share3->setNode($node3) ->setSharedBy(self::TEST_FILES_SHARING_API_USER2) @@ -850,7 +850,7 @@ public function testGetShareMultipleSharedFolder(): void { $s2 = reset($data2); $this->assertEquals($this->subfolder, $s1['path']); - $this->assertEquals($this->folder.$this->subfolder, $s2['path']); + $this->assertEquals($this->folder . $this->subfolder, $s2['path']); $this->shareManager->deleteShare($share1); $this->shareManager->deleteShare($share2); @@ -1141,7 +1141,7 @@ public function testDeleteReshare(): void { $this->shareManager->updateShare($share1); $user2folder = \OC::$server->getUserFolder(self::TEST_FILES_SHARING_API_USER2); - $node2 = $user2folder->get($this->folder.'/'.$this->filename); + $node2 = $user2folder->get($this->folder . '/' . $this->filename); $share2 = $this->shareManager->newShare(); $share2->setNode($node2) ->setSharedBy(self::TEST_FILES_SHARING_API_USER2) @@ -1184,7 +1184,7 @@ public function testShareFolderWithAMountPoint(): void { $view->mkdir('localDir'); // move mount point to the folder "localDir" - $result = $view->rename($this->folder, 'localDir/'.$this->folder); + $result = $view->rename($this->folder, 'localDir/' . $this->folder); $this->assertTrue($result !== false); // try to share "localDir" @@ -1308,7 +1308,7 @@ public function testPublicLinkExpireDate($date, $valid): void { $url = \OC::$server->getURLGenerator()->getAbsoluteURL('/index.php/s/' . $data['token']); $this->assertEquals($url, $data['url']); - $share = $this->shareManager->getShareById('ocinternal:'.$data['id']); + $share = $this->shareManager->getShareById('ocinternal:' . $data['id']); $this->assertEquals($date, $share->getExpirationDate()->format('Y-m-d H:i:s')); @@ -1340,7 +1340,7 @@ public function testCreatePublicLinkExpireDateValid(): void { $url = \OC::$server->getURLGenerator()->getAbsoluteURL('/index.php/s/' . $data['token']); $this->assertEquals($url, $data['url']); - $share = $this->shareManager->getShareById('ocinternal:'.$data['id']); + $share = $this->shareManager->getShareById('ocinternal:' . $data['id']); $date->setTime(0, 0, 0); $this->assertEquals($date, $share->getExpirationDate()); diff --git a/apps/files_sharing/tests/CacheTest.php b/apps/files_sharing/tests/CacheTest.php index 4db3adf34a644..ebcfc43edadae 100644 --- a/apps/files_sharing/tests/CacheTest.php +++ b/apps/files_sharing/tests/CacheTest.php @@ -50,7 +50,7 @@ protected function setUp(): void { self::loginHelper(self::TEST_FILES_SHARING_API_USER1); - $this->user2View = new \OC\Files\View('/'. self::TEST_FILES_SHARING_API_USER2 . '/files'); + $this->user2View = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2 . '/files'); // prepare user1's dir structure $this->view->mkdir('container'); diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index 67aa15d82faa7..f741bb64c8186 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -512,7 +512,7 @@ public function createShare($id, $shareType, $sharedWith, $sharedBy, $shareOwner if ($shareType === IShare::TYPE_USER || $shareType === IShare::TYPE_GROUP || $shareType === IShare::TYPE_LINK) { - $share->method('getFullId')->willReturn('ocinternal:'.$id); + $share->method('getFullId')->willReturn('ocinternal:' . $id); } return $share; diff --git a/apps/files_sharing/tests/ShareTest.php b/apps/files_sharing/tests/ShareTest.php index 651341a560764..6956093a0c16c 100644 --- a/apps/files_sharing/tests/ShareTest.php +++ b/apps/files_sharing/tests/ShareTest.php @@ -34,7 +34,7 @@ protected function setUp(): void { $this->view->mkdir($this->folder); $this->view->mkdir($this->folder . $this->subfolder); $this->view->mkdir($this->folder . $this->subfolder . $this->subsubfolder); - $this->view->file_put_contents($this->folder.$this->filename, $this->data); + $this->view->file_put_contents($this->folder . $this->filename, $this->data); $this->view->file_put_contents($this->folder . $this->subfolder . $this->filename, $this->data); } @@ -103,7 +103,7 @@ public function testUnshareFromSelf(): void { public function verifyDirContent($content, $expected) { foreach ($content as $c) { if (!in_array($c['name'], $expected)) { - $this->assertTrue(false, "folder should only contain '" . implode(',', $expected) . "', found: " .$c['name']); + $this->assertTrue(false, "folder should only contain '" . implode(',', $expected) . "', found: " . $c['name']); } } } diff --git a/apps/files_sharing/tests/SharesReminderJobTest.php b/apps/files_sharing/tests/SharesReminderJobTest.php index 5f01f4850e9e8..05646b2cdbc0b 100644 --- a/apps/files_sharing/tests/SharesReminderJobTest.php +++ b/apps/files_sharing/tests/SharesReminderJobTest.php @@ -150,7 +150,7 @@ public function dataSharesReminder() { * @param bool $shouldBeReminded */ public function testSharesReminder( - \DateTime|null $expirationDate, string $email, bool $isEmpty, int $permissions, bool $shouldBeReminded + ?\DateTime $expirationDate, string $email, bool $isEmpty, int $permissions, bool $shouldBeReminded, ): void { $this->loginAsUser($this->user1); diff --git a/apps/files_sharing/tests/UpdaterTest.php b/apps/files_sharing/tests/UpdaterTest.php index 9d26ff873a5ab..8aee8d7ddfc6a 100644 --- a/apps/files_sharing/tests/UpdaterTest.php +++ b/apps/files_sharing/tests/UpdaterTest.php @@ -85,7 +85,7 @@ public function testDeleteParentFolder(): void { // share mount point should now be moved to the subfolder $this->assertFalse($view->file_exists($this->folder)); - $this->assertTrue($view->file_exists('localFolder/' .$this->folder)); + $this->assertTrue($view->file_exists('localFolder/' . $this->folder)); $view->unlink('localFolder'); @@ -290,7 +290,7 @@ public function testMovedIntoShareChangeOwner(): void { ); // user2 moves folder2 into folder1 - $viewUser2->rename($folder2, $folder1.'/'.$folder2); + $viewUser2->rename($folder2, $folder1 . '/' . $folder2); $folder2Share = $this->shareManager->getShareById($folder2Share->getFullId()); $file1Share = $this->shareManager->getShareById($file1Share->getFullId()); $subfolder1Share = $this->shareManager->getShareById($subfolder1Share->getFullId()); @@ -308,7 +308,7 @@ public function testMovedIntoShareChangeOwner(): void { $this->assertEquals(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE, $file2Share->getPermissions()); // user2 moves folder2 out of folder1 - $viewUser2->rename($folder1.'/'.$folder2, $folder2); + $viewUser2->rename($folder1 . '/' . $folder2, $folder2); $folder2Share = $this->shareManager->getShareById($folder2Share->getFullId()); $file1Share = $this->shareManager->getShareById($file1Share->getFullId()); $subfolder1Share = $this->shareManager->getShareById($subfolder1Share->getFullId()); diff --git a/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php b/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php index e458039bf4f1d..18172560893a7 100644 --- a/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php +++ b/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php @@ -24,7 +24,7 @@ public function __construct( IConfig $config, IUserManager $userManager, Expiration $expiration, - ITimeFactory $time + ITimeFactory $time, ) { parent::__construct($time); // Run once per 30 minutes diff --git a/apps/files_trashbin/lib/Command/Size.php b/apps/files_trashbin/lib/Command/Size.php index 48ee2ced6cb7e..81ae82c02d309 100644 --- a/apps/files_trashbin/lib/Command/Size.php +++ b/apps/files_trashbin/lib/Command/Size.php @@ -26,7 +26,7 @@ class Size extends Base { public function __construct( IConfig $config, IUserManager $userManager, - IBus $commandBus + IBus $commandBus, ) { parent::__construct(); diff --git a/apps/files_trashbin/lib/Controller/PreviewController.php b/apps/files_trashbin/lib/Controller/PreviewController.php index 19eb15b733a8e..b006ba5e5aca4 100644 --- a/apps/files_trashbin/lib/Controller/PreviewController.php +++ b/apps/files_trashbin/lib/Controller/PreviewController.php @@ -50,7 +50,7 @@ public function __construct( IUserSession $userSession, IMimeTypeDetector $mimeTypeDetector, IPreview $previewManager, - ITimeFactory $time + ITimeFactory $time, ) { parent::__construct($appName, $request); diff --git a/apps/files_trashbin/lib/Events/BeforeNodeRestoredEvent.php b/apps/files_trashbin/lib/Events/BeforeNodeRestoredEvent.php index 2aabd101d28c3..0bc6b37c35b95 100644 --- a/apps/files_trashbin/lib/Events/BeforeNodeRestoredEvent.php +++ b/apps/files_trashbin/lib/Events/BeforeNodeRestoredEvent.php @@ -16,7 +16,11 @@ * @since 28.0.0 */ class BeforeNodeRestoredEvent extends AbstractNodesEvent { - public function __construct(Node $source, Node $target, private bool &$run) { + public function __construct( + Node $source, + Node $target, + private bool &$run, + ) { parent::__construct($source, $target); } diff --git a/apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php b/apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php index db9a43be6fc48..2cb3a94aa1dc8 100644 --- a/apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php +++ b/apps/files_trashbin/lib/Listeners/SyncLivePhotosListener.php @@ -113,8 +113,8 @@ private function handleRestore(BeforeNodeRestoredEvent $event, Node $peerFile): */ 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/RootCollection.php b/apps/files_trashbin/lib/Sabre/RootCollection.php index f626bfd7ee150..11c44266c3d61 100644 --- a/apps/files_trashbin/lib/Sabre/RootCollection.php +++ b/apps/files_trashbin/lib/Sabre/RootCollection.php @@ -21,7 +21,7 @@ class RootCollection extends AbstractPrincipalCollection { public function __construct( ITrashManager $trashManager, PrincipalBackend\BackendInterface $principalBackend, - IConfig $config + IConfig $config, ) { parent::__construct($principalBackend, 'principals/users'); diff --git a/apps/files_trashbin/lib/Sabre/TrashHome.php b/apps/files_trashbin/lib/Sabre/TrashHome.php index edea2744e6f8d..2c7fe749be5f6 100644 --- a/apps/files_trashbin/lib/Sabre/TrashHome.php +++ b/apps/files_trashbin/lib/Sabre/TrashHome.php @@ -27,7 +27,7 @@ class TrashHome implements ICollection { public function __construct( array $principalInfo, ITrashManager $trashManager, - IUser $user + IUser $user, ) { $this->principalInfo = $principalInfo; $this->trashManager = $trashManager; diff --git a/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php b/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php index 3299c2d6126e2..83564d2a783db 100644 --- a/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php +++ b/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php @@ -32,7 +32,7 @@ class TrashbinPlugin extends ServerPlugin { private $previewManager; public function __construct( - IPreview $previewManager + IPreview $previewManager, ) { $this->previewManager = $previewManager; } diff --git a/apps/files_trashbin/lib/Storage.php b/apps/files_trashbin/lib/Storage.php index d146f23d70a8d..412b9f44df935 100644 --- a/apps/files_trashbin/lib/Storage.php +++ b/apps/files_trashbin/lib/Storage.php @@ -43,7 +43,7 @@ public function __construct( ?IUserManager $userManager = null, ?LoggerInterface $logger = null, ?IEventDispatcher $eventDispatcher = null, - ?IRootFolder $rootFolder = null + ?IRootFolder $rootFolder = null, ) { $this->mountPoint = $parameters['mountPoint']; $this->trashManager = $trashManager; diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 544bc877d70a6..29e4d5e8a3c10 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -990,7 +990,7 @@ private static function getVersionsFromTrash($filename, $timestamp, string $user Server::get(IDBConnection::class)->getQueryBuilder(), Server::get(IFilesMetadataManager::class), ); - $normalizedParentPath = ltrim(Filesystem::normalizePath(dirname('files_trashbin/versions/'. $filename)), '/'); + $normalizedParentPath = ltrim(Filesystem::normalizePath(dirname('files_trashbin/versions/' . $filename)), '/'); $parentId = $cache->getId($normalizedParentPath); if ($parentId === -1) { return []; diff --git a/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php b/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php index 277c176d191ec..87c8647450fb4 100644 --- a/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php +++ b/apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php @@ -28,8 +28,8 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator { use TMigratorBasicVersionHandling; - protected const PATH_FILES_FOLDER = Application::APP_ID.'/files'; - protected const PATH_LOCATIONS_FILE = Application::APP_ID.'/locations.json'; + protected const PATH_FILES_FOLDER = Application::APP_ID . '/files'; + protected const PATH_LOCATIONS_FILE = Application::APP_ID . '/locations.json'; protected IRootFolder $root; @@ -40,7 +40,7 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator { public function __construct( IRootFolder $rootFolder, IDBConnection $dbc, - IL10N $l10n + IL10N $l10n, ) { $this->root = $rootFolder; $this->dbc = $dbc; @@ -54,7 +54,7 @@ public function getEstimatedExportSize(IUser $user): int|float { $uid = $user->getUID(); try { - $trashbinFolder = $this->root->get('/'.$uid.'/files_trashbin'); + $trashbinFolder = $this->root->get('/' . $uid . '/files_trashbin'); if (!$trashbinFolder instanceof Folder) { return 0; } @@ -73,9 +73,9 @@ public function export(IUser $user, IExportDestination $exportDestination, Outpu $uid = $user->getUID(); try { - $trashbinFolder = $this->root->get('/'.$uid.'/files_trashbin'); + $trashbinFolder = $this->root->get('/' . $uid . '/files_trashbin'); if (!$trashbinFolder instanceof Folder) { - throw new UserMigrationException('/'.$uid.'/files_trashbin is not a folder'); + throw new UserMigrationException('/' . $uid . '/files_trashbin is not a folder'); } $output->writeln('Exporting trashbin files…'); $exportDestination->copyFolder($trashbinFolder, static::PATH_FILES_FOLDER); @@ -92,7 +92,7 @@ public function export(IUser $user, IExportDestination $exportDestination, Outpu } catch (NotFoundException $e) { $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); } } @@ -111,12 +111,12 @@ public function import(IUser $user, IImportSource $importSource, OutputInterface if ($importSource->pathExists(static::PATH_FILES_FOLDER)) { try { - $trashbinFolder = $this->root->get('/'.$uid.'/files_trashbin'); + $trashbinFolder = $this->root->get('/' . $uid . '/files_trashbin'); if (!$trashbinFolder instanceof Folder) { - throw new UserMigrationException('Could not import trashbin, /'.$uid.'/files_trashbin is not a folder'); + throw new UserMigrationException('Could not import trashbin, /' . $uid . '/files_trashbin is not a folder'); } } catch (NotFoundException $e) { - $trashbinFolder = $this->root->newFolder('/'.$uid.'/files_trashbin'); + $trashbinFolder = $this->root->newFolder('/' . $uid . '/files_trashbin'); } $output->writeln('Importing trashbin files…'); try { diff --git a/apps/files_trashbin/tests/Command/CleanUpTest.php b/apps/files_trashbin/tests/Command/CleanUpTest.php index 49ae103ea303c..6299400a65a73 100644 --- a/apps/files_trashbin/tests/Command/CleanUpTest.php +++ b/apps/files_trashbin/tests/Command/CleanUpTest.php @@ -64,10 +64,10 @@ public function initTable() { for ($i = 0; $i < 10; $i++) { $query->insert($this->trashTable) ->values([ - 'id' => $query->expr()->literal('file'.$i), + 'id' => $query->expr()->literal('file' . $i), 'timestamp' => $query->expr()->literal($i), 'location' => $query->expr()->literal('.'), - 'user' => $query->expr()->literal('user'.$i % 2) + 'user' => $query->expr()->literal('user' . $i % 2) ])->execute(); } $getAllQuery = $this->dbConnection->getQueryBuilder(); diff --git a/apps/files_versions/lib/Capabilities.php b/apps/files_versions/lib/Capabilities.php index ce7239a4bf56c..3566b82842ad8 100644 --- a/apps/files_versions/lib/Capabilities.php +++ b/apps/files_versions/lib/Capabilities.php @@ -16,7 +16,7 @@ class Capabilities implements ICapability { public function __construct( IConfig $config, - IAppManager $appManager + IAppManager $appManager, ) { $this->config = $config; $this->appManager = $appManager; diff --git a/apps/files_versions/lib/Controller/PreviewController.php b/apps/files_versions/lib/Controller/PreviewController.php index 8416503c6432b..4cda69beb9695 100644 --- a/apps/files_versions/lib/Controller/PreviewController.php +++ b/apps/files_versions/lib/Controller/PreviewController.php @@ -38,7 +38,7 @@ public function __construct( IRootFolder $rootFolder, IUserSession $userSession, IVersionManager $versionManager, - IPreview $previewManager + IPreview $previewManager, ) { parent::__construct($appName, $request); @@ -67,7 +67,7 @@ public function getPreview( string $file = '', int $x = 44, int $y = 44, - string $version = '' + string $version = '', ) { if ($file === '' || $version === '' || $x === 0 || $y === 0) { return new DataResponse([], Http::STATUS_BAD_REQUEST); diff --git a/apps/files_versions/lib/Sabre/RootCollection.php b/apps/files_versions/lib/Sabre/RootCollection.php index 8ed397069f7af..2d59acdada07d 100644 --- a/apps/files_versions/lib/Sabre/RootCollection.php +++ b/apps/files_versions/lib/Sabre/RootCollection.php @@ -34,7 +34,7 @@ public function __construct( IConfig $config, IUserManager $userManager, IVersionManager $versionManager, - IUserSession $userSession + IUserSession $userSession, ) { parent::__construct($principalBackend, 'principals/users'); diff --git a/apps/files_versions/lib/Sabre/VersionFile.php b/apps/files_versions/lib/Sabre/VersionFile.php index 94fc101f05e35..faa0347364891 100644 --- a/apps/files_versions/lib/Sabre/VersionFile.php +++ b/apps/files_versions/lib/Sabre/VersionFile.php @@ -23,7 +23,7 @@ class VersionFile implements IFile { public function __construct( private IVersion $version, - private IVersionManager $versionManager + private IVersionManager $versionManager, ) { } diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index 41f04b5a1d1b1..af14f8e4b9f2a 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -91,7 +91,7 @@ public static function getUidAndFilename($filename) { Filesystem::initMountPoints($uid); if ($uid !== OC_User::getUser()) { $info = Filesystem::getFileInfo($filename); - $ownerView = new View('/'.$uid.'/files'); + $ownerView = new View('/' . $uid . '/files'); try { $filename = $ownerView->getPath($info['fileid']); // make sure that the file name doesn't end with a trailing slash @@ -303,7 +303,7 @@ public static function renameOrCopy($sourcePath, $targetPath, $operation) { // does the directory exists for versions too ? if ($rootView->is_dir('/' . $sourceOwner . '/files_versions/' . $sourcePath)) { // create missing dirs if necessary - self::createMissingDirectories($targetPath, new View('/'. $targetOwner)); + self::createMissingDirectories($targetPath, new View('/' . $targetOwner)); // move the directory containing the versions $rootView->$operation( @@ -313,13 +313,13 @@ public static function renameOrCopy($sourcePath, $targetPath, $operation) { } } elseif ($versions = Storage::getVersions($sourceOwner, '/' . $sourcePath)) { // create missing dirs if necessary - self::createMissingDirectories($targetPath, new View('/'. $targetOwner)); + self::createMissingDirectories($targetPath, new View('/' . $targetOwner)); foreach ($versions as $v) { // move each version one by one to the target directory $rootView->$operation( - '/' . $sourceOwner . '/files_versions/' . $sourcePath.'.v' . $v['version'], - '/' . $targetOwner . '/files_versions/' . $targetPath.'.v' . $v['version'] + '/' . $sourceOwner . '/files_versions/' . $sourcePath . '.v' . $v['version'], + '/' . $targetOwner . '/files_versions/' . $targetPath . '.v' . $v['version'] ); } } @@ -345,8 +345,8 @@ public static function rollback(string $file, int $revision, IUser $user) { $root = \OC::$server->get(IRootFolder::class); $userFolder = $root->getUserFolder($user->getUID()); - $users_view = new View('/'.$user->getUID()); - $files_view = new View('/'. $user->getUID().'/files'); + $users_view = new View('/' . $user->getUID()); + $files_view = new View('/' . $user->getUID() . '/files'); $versionCreated = false; @@ -358,9 +358,9 @@ public static function rollback(string $file, int $revision, IUser $user) { } //first create a new version - $version = 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename); + $version = 'files_versions' . $filename . '.v' . $users_view->filemtime('files' . $filename); if (!$users_view->file_exists($version)) { - $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename)); + $users_view->copy('files' . $filename, 'files_versions' . $filename . '.v' . $users_view->filemtime('files' . $filename)); $versionCreated = true; } @@ -562,7 +562,7 @@ public static function expireOlderThanMaxForUser($uid) { } try { - $node = $userFolder->get(substr($path, 0, -strlen('.v'.$version))); + $node = $userFolder->get(substr($path, 0, -strlen('.v' . $version))); $versionEntity = $versionsMapper->findVersionForFileId($node->getId(), $version); $versionEntities[$info->getId()] = $versionEntity; @@ -668,7 +668,7 @@ private static function getAllVersions($uid) { ]; foreach ($versions as $key => $value) { - $size = $view->filesize(self::VERSIONS_ROOT.'/'.$value['path'].'.v'.$value['timestamp']); + $size = $view->filesize(self::VERSIONS_ROOT . '/' . $value['path'] . '.v' . $value['timestamp']); $filename = $value['path']; $result['all'][$key]['version'] = $value['timestamp']; @@ -703,7 +703,7 @@ protected static function getExpireList($time, $versions, $quotaExceeded = false foreach ($versions as $key => $version) { if (!is_numeric($version['version'])) { \OC::$server->get(LoggerInterface::class)->error( - 'Found a non-numeric timestamp version: '. json_encode($version), + 'Found a non-numeric timestamp version: ' . json_encode($version), ['app' => 'files_versions']); continue; } @@ -753,7 +753,7 @@ protected static function getAutoExpireList($time, $versions) { //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']; @@ -833,7 +833,7 @@ public static function expire($filename, $uid) { // file maybe renamed or deleted return false; } - $versionsFileview = new View('/'.$uid.'/files_versions'); + $versionsFileview = new View('/' . $uid . '/files_versions'); $softQuota = true; $quota = $user->getQuota(); @@ -925,10 +925,10 @@ public static function expire($filename, $uid) { reset($allVersions); while ($availableSpace < 0 && $i < $numOfVersions) { $version = current($allVersions); - \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]); + \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $version['path'] . '.v' . $version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]); self::deleteVersion($versionsFileview, $version['path'] . '.v' . $version['version']); - \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]); - $logger->info('running out of space! Delete oldest version: ' . $version['path'].'.v'.$version['version'], ['app' => 'files_versions']); + \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $version['path'] . '.v' . $version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]); + $logger->info('running out of space! Delete oldest version: ' . $version['path'] . '.v' . $version['version'], ['app' => 'files_versions']); $versionsSize -= $version['size']; $availableSpace += $version['size']; next($allVersions); diff --git a/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php b/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php index 84d62ab6b459b..d1647381ffa76 100644 --- a/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php +++ b/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php @@ -23,7 +23,6 @@ public function __construct( ITimeFactory $timeFactory, private AccessTokenMapper $accessTokenMapper, private LoggerInterface $logger, - ) { parent::__construct($timeFactory); // 30 days diff --git a/apps/oauth2/lib/Controller/OauthApiController.php b/apps/oauth2/lib/Controller/OauthApiController.php index d763779053a35..2e0732a109970 100644 --- a/apps/oauth2/lib/Controller/OauthApiController.php +++ b/apps/oauth2/lib/Controller/OauthApiController.php @@ -68,7 +68,7 @@ public function __construct( #[BruteForceProtection(action: 'oauth2GetToken')] public function getToken( string $grant_type, ?string $code, ?string $refresh_token, - ?string $client_id, ?string $client_secret + ?string $client_id, ?string $client_secret, ): JSONResponse { // We only handle two types diff --git a/apps/oauth2/lib/Controller/SettingsController.php b/apps/oauth2/lib/Controller/SettingsController.php index f16b26696c4ab..9cbb978123172 100644 --- a/apps/oauth2/lib/Controller/SettingsController.php +++ b/apps/oauth2/lib/Controller/SettingsController.php @@ -35,7 +35,7 @@ public function __construct( private IL10N $l, private IAuthTokenProvider $tokenProvider, private IUserManager $userManager, - private ICrypto $crypto + private ICrypto $crypto, ) { parent::__construct($appName, $request); } diff --git a/apps/oauth2/lib/Db/ClientMapper.php b/apps/oauth2/lib/Db/ClientMapper.php index dc19c93c4e103..c5ca2989d0fde 100644 --- a/apps/oauth2/lib/Db/ClientMapper.php +++ b/apps/oauth2/lib/Db/ClientMapper.php @@ -41,7 +41,7 @@ public function getByIdentifier(string $clientIdentifier): Client { try { $client = $this->findEntity($qb); } catch (IMapperException $e) { - throw new ClientNotFoundException('could not find client '.$clientIdentifier, 0, $e); + throw new ClientNotFoundException('could not find client ' . $clientIdentifier, 0, $e); } return $client; } @@ -61,7 +61,7 @@ public function getByUid(int $id): Client { try { $client = $this->findEntity($qb); } catch (IMapperException $e) { - throw new ClientNotFoundException('could not find client with id '.$id, 0, $e); + throw new ClientNotFoundException('could not find client with id ' . $id, 0, $e); } return $client; } diff --git a/apps/oauth2/tests/Controller/OauthApiControllerTest.php b/apps/oauth2/tests/Controller/OauthApiControllerTest.php index fa8c90843e6d3..8d13265ec9e8d 100644 --- a/apps/oauth2/tests/Controller/OauthApiControllerTest.php +++ b/apps/oauth2/tests/Controller/OauthApiControllerTest.php @@ -352,7 +352,7 @@ public function testRefreshTokenValidAppToken(): void { $this->secureRandom->method('generate') ->willReturnCallback(function ($len) { - return 'random'.$len; + return 'random' . $len; }); $this->tokenProvider->expects($this->once()) @@ -448,7 +448,7 @@ public function testRefreshTokenValidAppTokenBasicAuth(): void { $this->secureRandom->method('generate') ->willReturnCallback(function ($len) { - return 'random'.$len; + return 'random' . $len; }); $this->tokenProvider->expects($this->once()) @@ -547,7 +547,7 @@ public function testRefreshTokenExpiredAppToken(): void { $this->secureRandom->method('generate') ->willReturnCallback(function ($len) { - return 'random'.$len; + return 'random' . $len; }); $this->tokenProvider->expects($this->once()) diff --git a/apps/provisioning_api/lib/Controller/AppsController.php b/apps/provisioning_api/lib/Controller/AppsController.php index d60a85f374039..955c2bc39abfd 100644 --- a/apps/provisioning_api/lib/Controller/AppsController.php +++ b/apps/provisioning_api/lib/Controller/AppsController.php @@ -25,7 +25,7 @@ class AppsController extends OCSController { public function __construct( string $appName, IRequest $request, - IAppManager $appManager + IAppManager $appManager, ) { parent::__construct($appName, $request); diff --git a/apps/provisioning_api/lib/Controller/PreferencesController.php b/apps/provisioning_api/lib/Controller/PreferencesController.php index 2a31e076c838a..f230d1d781fc4 100644 --- a/apps/provisioning_api/lib/Controller/PreferencesController.php +++ b/apps/provisioning_api/lib/Controller/PreferencesController.php @@ -31,7 +31,7 @@ public function __construct( IRequest $request, IConfig $config, IUserSession $userSession, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { parent::__construct($appName, $request); $this->config = $config; diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index e65585902bcad..9b90f95d84206 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -787,7 +787,7 @@ public function editUserMultiValue( string $userId, string $collectionName, string $key, - string $value + string $value, ): DataResponse { $currentLoggedInUser = $this->userSession->getUser(); if ($currentLoggedInUser === null) { diff --git a/apps/provisioning_api/lib/Controller/VerificationController.php b/apps/provisioning_api/lib/Controller/VerificationController.php index 18113484c8a4e..33b5bb0020f6b 100644 --- a/apps/provisioning_api/lib/Controller/VerificationController.php +++ b/apps/provisioning_api/lib/Controller/VerificationController.php @@ -49,7 +49,7 @@ public function __construct( IL10N $l10n, IUserSession $userSession, IAccountManager $accountManager, - Crypto $crypto + Crypto $crypto, ) { parent::__construct($appName, $request); $this->verificationToken = $verificationToken; diff --git a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php index 8bbc8a29c29fc..f9c0848fb7249 100644 --- a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php +++ b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php @@ -90,7 +90,7 @@ private function createGroup($gid) { ->willReturn($gid); $group ->method('getDisplayName') - ->willReturn($gid.'-name'); + ->willReturn($gid . '-name'); $group ->method('count') ->willReturn(123); diff --git a/apps/settings/lib/Command/AdminDelegation/Add.php b/apps/settings/lib/Command/AdminDelegation/Add.php index 26a13b2cd6eb6..5cbef5c5d157b 100644 --- a/apps/settings/lib/Command/AdminDelegation/Add.php +++ b/apps/settings/lib/Command/AdminDelegation/Add.php @@ -52,7 +52,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->authorizedGroupService->create($groupId, $settingClass); - $io->success('Administration of '.$settingClass.' delegated to '.$groupId.'.'); + $io->success('Administration of ' . $settingClass . ' delegated to ' . $groupId . '.'); return 0; } diff --git a/apps/settings/lib/Command/AdminDelegation/Remove.php b/apps/settings/lib/Command/AdminDelegation/Remove.php index 584b9201193c9..6b5347ce89f6e 100644 --- a/apps/settings/lib/Command/AdminDelegation/Remove.php +++ b/apps/settings/lib/Command/AdminDelegation/Remove.php @@ -43,12 +43,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int foreach ($groups as $group) { if ($group->getGroupId() === $groupId) { $this->authorizedGroupService->delete($group->getId()); - $io->success('Removed delegation of '.$settingClass.' to '.$groupId.'.'); + $io->success('Removed delegation of ' . $settingClass . ' to ' . $groupId . '.'); return 0; } } - $io->success('Group '.$groupId.' didn’t have delegation for '.$settingClass.'.'); + $io->success('Group ' . $groupId . ' didn’t have delegation for ' . $settingClass . '.'); return 0; } diff --git a/apps/settings/lib/Command/AdminDelegation/Show.php b/apps/settings/lib/Command/AdminDelegation/Show.php index 73f89ad0eadff..9aba6bc0cb7c7 100644 --- a/apps/settings/lib/Command/AdminDelegation/Show.php +++ b/apps/settings/lib/Command/AdminDelegation/Show.php @@ -47,7 +47,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int continue; } - $io->section('Section: '.$section->getID()); + $io->section('Section: ' . $section->getID()); $io->table($headers, array_map(function (IDelegatedSettings $setting) use ($section) { $className = get_class($setting); $groups = array_map( diff --git a/apps/settings/lib/Controller/AppSettingsController.php b/apps/settings/lib/Controller/AppSettingsController.php index 2c682ac460035..930c1c0f7e278 100644 --- a/apps/settings/lib/Controller/AppSettingsController.php +++ b/apps/settings/lib/Controller/AppSettingsController.php @@ -437,7 +437,7 @@ private function getAppsForCategory($requestedCategory = ''): array { 'missingMaxOwnCloudVersion' => false, 'missingMinOwnCloudVersion' => false, 'canInstall' => true, - 'screenshot' => isset($app['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/'.base64_encode($app['screenshots'][0]['url']) : '', + 'screenshot' => isset($app['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/' . base64_encode($app['screenshots'][0]['url']) : '', 'score' => $app['ratingOverall'], 'ratingNumOverall' => $app['ratingNumOverall'], 'ratingNumThresholdReached' => $app['ratingNumOverall'] > 5, diff --git a/apps/settings/lib/Controller/UsersController.php b/apps/settings/lib/Controller/UsersController.php index eb401f855360e..71f256f57d69d 100644 --- a/apps/settings/lib/Controller/UsersController.php +++ b/apps/settings/lib/Controller/UsersController.php @@ -336,7 +336,7 @@ public function setUserSettings(?string $avatarScope = null, ?string $birthdate = null, ?string $birthdateScope = null, ?string $pronouns = null, - ?string $pronounsScope = null + ?string $pronounsScope = null, ) { $user = $this->userSession->getUser(); if (!$user instanceof IUser) { diff --git a/apps/settings/lib/Listener/UserAddedToGroupActivityListener.php b/apps/settings/lib/Listener/UserAddedToGroupActivityListener.php index 7369f54bf371f..36feeaa1035a4 100644 --- a/apps/settings/lib/Listener/UserAddedToGroupActivityListener.php +++ b/apps/settings/lib/Listener/UserAddedToGroupActivityListener.php @@ -32,7 +32,7 @@ class UserAddedToGroupActivityListener implements IEventListener { public function __construct( Manager $groupManager, IManager $activityManager, - IUserSession $userSession + IUserSession $userSession, ) { $this->groupManager = $groupManager; $this->activityManager = $activityManager; diff --git a/apps/settings/lib/Listener/UserRemovedFromGroupActivityListener.php b/apps/settings/lib/Listener/UserRemovedFromGroupActivityListener.php index 711f78212bc1e..82302f748eccb 100644 --- a/apps/settings/lib/Listener/UserRemovedFromGroupActivityListener.php +++ b/apps/settings/lib/Listener/UserRemovedFromGroupActivityListener.php @@ -32,7 +32,7 @@ class UserRemovedFromGroupActivityListener implements IEventListener { public function __construct( Manager $groupManager, IManager $activityManager, - IUserSession $userSession + IUserSession $userSession, ) { $this->groupManager = $groupManager; $this->activityManager = $activityManager; diff --git a/apps/settings/lib/Settings/Admin/Delegation.php b/apps/settings/lib/Settings/Admin/Delegation.php index e38507b4fc148..72798a30673aa 100644 --- a/apps/settings/lib/Settings/Admin/Delegation.php +++ b/apps/settings/lib/Settings/Admin/Delegation.php @@ -28,7 +28,7 @@ public function __construct( IInitialState $initialStateService, IGroupManager $groupManager, AuthorizedGroupService $authorizedGroupService, - IURLGenerator $urlGenerator + IURLGenerator $urlGenerator, ) { $this->settingManager = $settingManager; $this->initialStateService = $initialStateService; diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php index 232fea8bd73ef..9aa0f9ee80775 100644 --- a/apps/settings/lib/Settings/Personal/PersonalInfo.php +++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php @@ -71,7 +71,7 @@ public function __construct( IFactory $l10nFactory, IL10N $l, IInitialState $initialStateService, - IManager $manager + IManager $manager, ) { $this->config = $config; $this->userManager = $userManager; diff --git a/apps/settings/lib/SetupChecks/CronErrors.php b/apps/settings/lib/SetupChecks/CronErrors.php index 9a5c5b8af7158..dc625b0447707 100644 --- a/apps/settings/lib/SetupChecks/CronErrors.php +++ b/apps/settings/lib/SetupChecks/CronErrors.php @@ -35,7 +35,7 @@ public function run(): SetupResult { return SetupResult::error( $this->l10n->t( "It was not possible to execute the cron job via CLI. The following technical errors have appeared:\n%s", - implode("\n", array_map(fn (array $error) => '- '.$error['error'].' '.$error['hint'], $errors)) + implode("\n", array_map(fn (array $error) => '- ' . $error['error'] . ' ' . $error['hint'], $errors)) ) ); } else { diff --git a/apps/settings/lib/SetupChecks/DatabaseHasMissingColumns.php b/apps/settings/lib/SetupChecks/DatabaseHasMissingColumns.php index b004c5ada3590..ec004f7302145 100644 --- a/apps/settings/lib/SetupChecks/DatabaseHasMissingColumns.php +++ b/apps/settings/lib/SetupChecks/DatabaseHasMissingColumns.php @@ -62,10 +62,10 @@ public function run(): SetupResult { } else { $list = ''; foreach ($missingColumns as $missingColumn) { - $list .= "\n".$this->l10n->t('Missing optional column "%s" in table "%s".', [$missingColumn['columnName'], $missingColumn['tableName']]); + $list .= "\n" . $this->l10n->t('Missing optional column "%s" in table "%s".', [$missingColumn['columnName'], $missingColumn['tableName']]); } return SetupResult::warning( - $this->l10n->t('The database is missing some optional columns. Due to the fact that adding columns on big tables could take some time they were not added automatically when they can be optional. By running "occ db:add-missing-columns" those missing columns could be added manually while the instance keeps running. Once the columns are added some features might improve responsiveness or usability.').$list + $this->l10n->t('The database is missing some optional columns. Due to the fact that adding columns on big tables could take some time they were not added automatically when they can be optional. By running "occ db:add-missing-columns" those missing columns could be added manually while the instance keeps running. Once the columns are added some features might improve responsiveness or usability.') . $list ); } } diff --git a/apps/settings/lib/SetupChecks/DatabaseHasMissingPrimaryKeys.php b/apps/settings/lib/SetupChecks/DatabaseHasMissingPrimaryKeys.php index 8e2a0d18e4181..03810ca8faf9e 100644 --- a/apps/settings/lib/SetupChecks/DatabaseHasMissingPrimaryKeys.php +++ b/apps/settings/lib/SetupChecks/DatabaseHasMissingPrimaryKeys.php @@ -62,10 +62,10 @@ public function run(): SetupResult { } else { $list = ''; foreach ($missingPrimaryKeys as $missingPrimaryKey) { - $list .= "\n".$this->l10n->t('Missing primary key on table "%s".', [$missingPrimaryKey['tableName']]); + $list .= "\n" . $this->l10n->t('Missing primary key on table "%s".', [$missingPrimaryKey['tableName']]); } return SetupResult::warning( - $this->l10n->t('The database is missing some primary keys. Due to the fact that adding primary keys on big tables could take some time they were not added automatically. By running "occ db:add-missing-primary-keys" those missing primary keys could be added manually while the instance keeps running.').$list + $this->l10n->t('The database is missing some primary keys. Due to the fact that adding primary keys on big tables could take some time they were not added automatically. By running "occ db:add-missing-primary-keys" those missing primary keys could be added manually while the instance keeps running.') . $list ); } } diff --git a/apps/settings/lib/SetupChecks/DatabasePendingBigIntConversions.php b/apps/settings/lib/SetupChecks/DatabasePendingBigIntConversions.php index dc9f00e844883..bb9794c1e03c0 100644 --- a/apps/settings/lib/SetupChecks/DatabasePendingBigIntConversions.php +++ b/apps/settings/lib/SetupChecks/DatabasePendingBigIntConversions.php @@ -74,7 +74,7 @@ public function run(): SetupResult { } $list .= "\n"; return SetupResult::info( - $this->l10n->t('Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running "occ db:convert-filecache-bigint" those pending changes could be applied manually. This operation needs to be made while the instance is offline.').$list, + $this->l10n->t('Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running "occ db:convert-filecache-bigint" those pending changes could be applied manually. This operation needs to be made while the instance is offline.') . $list, $this->urlGenerator->linkToDocs('admin-bigint-conversion') ); } diff --git a/apps/settings/lib/SetupChecks/OcxProviders.php b/apps/settings/lib/SetupChecks/OcxProviders.php index 191341b0ee431..c53e8087bd959 100644 --- a/apps/settings/lib/SetupChecks/OcxProviders.php +++ b/apps/settings/lib/SetupChecks/OcxProviders.php @@ -76,7 +76,7 @@ public function run(): SetupResult { $this->l10n->t('Your web server is not properly set up to resolve %1$s. This is most likely related to a web server configuration that was not updated to deliver this folder directly. Please compare your configuration against the shipped rewrite rules in ".htaccess" for Apache or the provided one in the documentation for Nginx. -On Nginx those are typically the lines starting with "location ~" that need an update.', [join(', ', array_map(fn ($s) => '"'.$s.'"', $missingProviders))]), +On Nginx those are typically the lines starting with "location ~" that need an update.', [join(', ', array_map(fn ($s) => '"' . $s . '"', $missingProviders))]), $this->urlGenerator->linkToDocs('admin-nginx'), ); } diff --git a/apps/settings/lib/SetupChecks/PhpModules.php b/apps/settings/lib/SetupChecks/PhpModules.php index 6d4246ffdaec8..60c14757301d0 100644 --- a/apps/settings/lib/SetupChecks/PhpModules.php +++ b/apps/settings/lib/SetupChecks/PhpModules.php @@ -77,7 +77,7 @@ public function run(): SetupResult { $moduleList = implode( "\n", array_map( - fn (string $module) => '- '.$module.' '.$this->getRecommendedModuleDescription($module), + fn (string $module) => '- ' . $module . ' ' . $this->getRecommendedModuleDescription($module), $missingRecommendedModules ) ); diff --git a/apps/settings/lib/SetupChecks/SecurityHeaders.php b/apps/settings/lib/SetupChecks/SecurityHeaders.php index b85ab9b401804..ed4e56218da58 100644 --- a/apps/settings/lib/SetupChecks/SecurityHeaders.php +++ b/apps/settings/lib/SetupChecks/SecurityHeaders.php @@ -65,16 +65,16 @@ public function run(): SetupResult { $value = preg_replace('/,\s+/', ',', strtolower($response->getHeader($header))); if ($value !== $expected) { if ($accepted !== null && $value === $accepted) { - $msg .= $this->l10n->t('- The `%1$s` HTTP header is not set to `%2$s`. Some features might not work correctly, as it is recommended to adjust this setting accordingly.', [$header, $expected])."\n"; + $msg .= $this->l10n->t('- The `%1$s` HTTP header is not set to `%2$s`. Some features might not work correctly, as it is recommended to adjust this setting accordingly.', [$header, $expected]) . "\n"; } else { - $msg .= $this->l10n->t('- The `%1$s` HTTP header is not set to `%2$s`. This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.', [$header, $expected])."\n"; + $msg .= $this->l10n->t('- The `%1$s` HTTP header is not set to `%2$s`. This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.', [$header, $expected]) . "\n"; } } } $xssFields = array_map('trim', explode(';', $response->getHeader('X-XSS-Protection'))); if (!in_array('1', $xssFields) || !in_array('mode=block', $xssFields)) { - $msg .= $this->l10n->t('- The `%1$s` HTTP header does not contain `%2$s`. This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.', ['X-XSS-Protection', '1; mode=block'])."\n"; + $msg .= $this->l10n->t('- The `%1$s` HTTP header does not contain `%2$s`. This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.', ['X-XSS-Protection', '1; mode=block']) . "\n"; } $referrerPolicy = $response->getHeader('Referrer-Policy'); @@ -89,7 +89,7 @@ public function run(): SetupResult { 'strict-origin-when-cross-origin', 'same-origin', ] - )."\n"; + ) . "\n"; $msgParameters['w3c-recommendation'] = [ 'type' => 'highlight', 'id' => 'w3c-recommendation', @@ -103,17 +103,17 @@ public function run(): SetupResult { if (preg_match('/^max-age=(\d+)(;.*)?$/', $transportSecurityValidity, $m)) { $transportSecurityValidity = (int)$m[1]; if ($transportSecurityValidity < $minimumSeconds) { - $msg .= $this->l10n->t('- The `Strict-Transport-Security` HTTP header is not set to at least `%d` seconds (current value: `%d`). For enhanced security, it is recommended to use a long HSTS policy.', [$minimumSeconds, $transportSecurityValidity])."\n"; + $msg .= $this->l10n->t('- The `Strict-Transport-Security` HTTP header is not set to at least `%d` seconds (current value: `%d`). For enhanced security, it is recommended to use a long HSTS policy.', [$minimumSeconds, $transportSecurityValidity]) . "\n"; } } elseif (!empty($transportSecurityValidity)) { - $msg .= $this->l10n->t('- The `Strict-Transport-Security` HTTP header is malformed: `%s`. For enhanced security, it is recommended to enable HSTS.', [$transportSecurityValidity])."\n"; + $msg .= $this->l10n->t('- The `Strict-Transport-Security` HTTP header is malformed: `%s`. For enhanced security, it is recommended to enable HSTS.', [$transportSecurityValidity]) . "\n"; } else { - $msg .= $this->l10n->t('- The `Strict-Transport-Security` HTTP header is not set (should be at least `%d` seconds). For enhanced security, it is recommended to enable HSTS.', [$minimumSeconds])."\n"; + $msg .= $this->l10n->t('- The `Strict-Transport-Security` HTTP header is not set (should be at least `%d` seconds). For enhanced security, it is recommended to enable HSTS.', [$minimumSeconds]) . "\n"; } if (!empty($msg)) { return SetupResult::warning( - $this->l10n->t('Some headers are not set correctly on your instance')."\n".$msg, + $this->l10n->t('Some headers are not set correctly on your instance') . "\n" . $msg, $this->urlGenerator->linkToDocs('admin-security'), $msgParameters, ); diff --git a/apps/settings/lib/SetupChecks/TempSpaceAvailable.php b/apps/settings/lib/SetupChecks/TempSpaceAvailable.php index ef51ffe0e07a1..49dc0d377e74d 100644 --- a/apps/settings/lib/SetupChecks/TempSpaceAvailable.php +++ b/apps/settings/lib/SetupChecks/TempSpaceAvailable.php @@ -85,7 +85,7 @@ public function run(): SetupResult { return SetupResult::error($this->l10n->t('Error while checking the available disk space of temporary PHP path or no free disk space returned. Temporary path: %s', [$nextcloudTempPath])); } $freeSpaceInNextcloudTempInGB = $freeSpaceInNextcloudTemp / 1024 / 1024 / 1024; - $spaceDetail .= "\n".$this->l10n->t('- %.1f GiB available in %s (Nextcloud temporary directory)', [round($freeSpaceInNextcloudTempInGB, 1),$nextcloudTempPath]); + $spaceDetail .= "\n" . $this->l10n->t('- %.1f GiB available in %s (Nextcloud temporary directory)', [round($freeSpaceInNextcloudTempInGB, 1),$nextcloudTempPath]); } if (!$this->isPrimaryStorageS3()) { diff --git a/apps/settings/lib/UserMigration/AccountMigrator.php b/apps/settings/lib/UserMigration/AccountMigrator.php index dc5ca2691f7b2..81107cd81c599 100644 --- a/apps/settings/lib/UserMigration/AccountMigrator.php +++ b/apps/settings/lib/UserMigration/AccountMigrator.php @@ -55,7 +55,7 @@ public function __construct( IAvatarManager $avatarManager, ProfileManager $profileManager, ProfileConfigMapper $configMapper, - IL10N $l10n + IL10N $l10n, ) { $this->accountManager = $accountManager; $this->avatarManager = $avatarManager; diff --git a/apps/settings/tests/Controller/UsersControllerTest.php b/apps/settings/tests/Controller/UsersControllerTest.php index e8ae965b3bbaa..80eb252f98866 100644 --- a/apps/settings/tests/Controller/UsersControllerTest.php +++ b/apps/settings/tests/Controller/UsersControllerTest.php @@ -669,7 +669,7 @@ public function dataTestSetUserSettingsSubset() { */ public function testSaveUserSettings($data, $oldEmailAddress, - $oldDisplayName + $oldDisplayName, ): void { $controller = $this->getController(); $user = $this->createMock(IUser::class); @@ -792,7 +792,7 @@ public function testSaveUserSettingsException( string $oldEmailAddress, string $oldDisplayName, bool $setDisplayNameResult, - bool $canChangeEmail + bool $canChangeEmail, ): void { $this->expectException(ForbiddenException::class); diff --git a/apps/settings/tests/SetupChecks/SecurityHeadersTest.php b/apps/settings/tests/SetupChecks/SecurityHeadersTest.php index 2bc5aa69b9c91..d8bb51d47c670 100644 --- a/apps/settings/tests/SetupChecks/SecurityHeadersTest.php +++ b/apps/settings/tests/SetupChecks/SecurityHeadersTest.php @@ -176,7 +176,7 @@ public function testFailure(array $headers, string $msg): void { $result = $this->setupcheck->run(); $this->assertEquals( - 'Some headers are not set correctly on your instance'."\n$msg", + 'Some headers are not set correctly on your instance' . "\n$msg", $result->getDescription() ); $this->assertEquals(SetupResult::WARNING, $result->getSeverity()); diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 744837717620d..fd43e7c089e9a 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -684,7 +684,7 @@ protected function addShareToDB( ?\DateTimeInterface $expirationTime, ?string $note = '', ?IAttributes $attributes = null, - ?bool $mailSend = true + ?bool $mailSend = true, ): int { $qb = $this->dbConnection->getQueryBuilder(); $qb->insert('share') diff --git a/apps/systemtags/lib/Activity/Setting.php b/apps/systemtags/lib/Activity/Setting.php index c65cf3d404a58..95001e95cf3ab 100644 --- a/apps/systemtags/lib/Activity/Setting.php +++ b/apps/systemtags/lib/Activity/Setting.php @@ -9,7 +9,9 @@ use OCP\IL10N; class Setting extends ActivitySettings { - public function __construct(protected IL10N $l) { + public function __construct( + protected IL10N $l, + ) { } /** diff --git a/apps/systemtags/lib/Search/TagSearchProvider.php b/apps/systemtags/lib/Search/TagSearchProvider.php index 80f9d39c141ce..6e6f587d36638 100644 --- a/apps/systemtags/lib/Search/TagSearchProvider.php +++ b/apps/systemtags/lib/Search/TagSearchProvider.php @@ -52,7 +52,7 @@ public function __construct( IMimeTypeDetector $mimeTypeDetector, IRootFolder $rootFolder, ISystemTagObjectMapper $objectMapper, - ISystemTagManager $tagManager + ISystemTagManager $tagManager, ) { $this->l10n = $l10n; $this->urlGenerator = $urlGenerator; @@ -118,7 +118,7 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { $thumbnailUrl = ''; $link = $this->urlGenerator->linkToRoute('files.view.indexView', [ 'view' => 'tags', - ]) . '?dir='.$tag->getId(); + ]) . '?dir=' . $tag->getId(); $searchResultEntry = new SearchResultEntry( $thumbnailUrl, $this->l10n->t('All tagged %s …', [$tag->getName()]), diff --git a/apps/testing/lib/Listener/GetDeclarativeSettingsValueListener.php b/apps/testing/lib/Listener/GetDeclarativeSettingsValueListener.php index 312f49e5f5c66..0df5816800759 100644 --- a/apps/testing/lib/Listener/GetDeclarativeSettingsValueListener.php +++ b/apps/testing/lib/Listener/GetDeclarativeSettingsValueListener.php @@ -17,7 +17,9 @@ */ class GetDeclarativeSettingsValueListener implements IEventListener { - public function __construct(private IConfig $config) { + public function __construct( + private IConfig $config, + ) { } public function handle(Event $event): void { diff --git a/apps/testing/lib/Listener/SetDeclarativeSettingsValueListener.php b/apps/testing/lib/Listener/SetDeclarativeSettingsValueListener.php index 19f1ae79b7b76..0058e7df43ef8 100644 --- a/apps/testing/lib/Listener/SetDeclarativeSettingsValueListener.php +++ b/apps/testing/lib/Listener/SetDeclarativeSettingsValueListener.php @@ -17,7 +17,9 @@ */ class SetDeclarativeSettingsValueListener implements IEventListener { - public function __construct(private IConfig $config) { + public function __construct( + private IConfig $config, + ) { } public function handle(Event $event): void { diff --git a/apps/testing/lib/Locking/FakeDBLockingProvider.php b/apps/testing/lib/Locking/FakeDBLockingProvider.php index 2c4d394fb0d4e..6e2fd9a77d822 100644 --- a/apps/testing/lib/Locking/FakeDBLockingProvider.php +++ b/apps/testing/lib/Locking/FakeDBLockingProvider.php @@ -21,7 +21,7 @@ class FakeDBLockingProvider extends DBLockingProvider { public function __construct( IDBConnection $connection, - ITimeFactory $timeFactory + ITimeFactory $timeFactory, ) { parent::__construct($connection, $timeFactory); $this->db = $connection; diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php index bdd5a43ddc3c6..7ba9e801d9b43 100644 --- a/apps/theming/lib/Controller/IconController.php +++ b/apps/theming/lib/Controller/IconController.php @@ -40,7 +40,7 @@ public function __construct( IconBuilder $iconBuilder, ImageManager $imageManager, FileAccessHelper $fileAccessHelper, - IAppManager $appManager + IAppManager $appManager, ) { parent::__construct($appName, $request); diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php index e7e83a0b4c04b..5e8754dec833c 100644 --- a/apps/theming/lib/IconBuilder.php +++ b/apps/theming/lib/IconBuilder.php @@ -27,7 +27,7 @@ class IconBuilder { public function __construct( ThemingDefaults $themingDefaults, Util $util, - ImageManager $imageManager + ImageManager $imageManager, ) { $this->themingDefaults = $themingDefaults; $this->util = $util; @@ -127,12 +127,12 @@ public function renderAppIcon($app, $size) { $cornerRadius = 0.2 * $size; $background = '' . '' . - '' . + '' . ''; // resize svg magic as this seems broken in Imagemagick if ($mime === 'image/svg+xml' || substr($appIconContent, 0, 4) === 'appDataFactory = $appDataFactory; @@ -54,7 +54,7 @@ public function __construct( protected function run(mixed $argument): void { if (!is_array($argument) || !isset($argument['stage'])) { - throw new \Exception('Job '.self::class.' called with wrong argument'); + throw new \Exception('Job ' . self::class . ' called with wrong argument'); } switch ($argument['stage']) { diff --git a/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php b/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php index 1ec659d0646df..42662dacef2a1 100644 --- a/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php +++ b/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php @@ -42,7 +42,7 @@ public function __construct( protected function run(mixed $argument): void { if (!is_array($argument) || !isset($argument['stage'])) { - throw new \Exception('Job '.self::class.' called with wrong argument'); + throw new \Exception('Job ' . self::class . ' called with wrong argument'); } switch ($argument['stage']) { @@ -69,7 +69,7 @@ protected function runPreparation(): void { // Get those users, that have a background_image set - not the default, but no background_color. $result = $qb->selectDistinct('a.userid') ->from('preferences', 'a') - ->leftJoin('a', $qb->createFunction('('.$innerSQL->getSQL().')'), 'b', 'a.userid = b.userid') + ->leftJoin('a', $qb->createFunction('(' . $innerSQL->getSQL() . ')'), 'b', 'a.userid = b.userid') ->where($qb2->expr()->eq('a.configkey', $qb->createNamedParameter('background_image'))) ->andWhere($qb2->expr()->neq('a.configvalue', $qb->createNamedParameter(BackgroundService::BACKGROUND_DEFAULT))) ->andWhere($qb2->expr()->isNull('b.userid')) @@ -101,7 +101,7 @@ protected function runMigration(): void { } $background = $this->config->getUserValue($userId, Application::APP_ID, 'background_image'); - switch($background) { + switch ($background) { case BackgroundService::BACKGROUND_DEFAULT: $this->service->setDefaultBackground($userId); break; diff --git a/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php b/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php index cb72e46360ec2..2ad495b02397d 100644 --- a/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php +++ b/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php @@ -35,7 +35,7 @@ public function __construct( ContainerInterface $container, ThemeInjectionService $themeInjectionService, IUserSession $userSession, - IConfig $config + IConfig $config, ) { $this->initialState = $initialState; $this->container = $container; diff --git a/apps/theming/lib/Service/BackgroundService.php b/apps/theming/lib/Service/BackgroundService.php index a0158dcb667e1..bf6508744487c 100644 --- a/apps/theming/lib/Service/BackgroundService.php +++ b/apps/theming/lib/Service/BackgroundService.php @@ -321,7 +321,7 @@ public function getBackground(): ?ISimpleFile { * @param resource|string $path * @return string|null The fallback background color - if any */ - public function setGlobalBackground($path): string|null { + public function setGlobalBackground($path): ?string { $image = new \OCP\Image(); $handle = is_resource($path) ? $path : fopen($path, 'rb'); @@ -347,7 +347,7 @@ function toHex(int $channel): string { $hex = dechex($channel); return match (strlen($hex)) { 0 => '00', - 1 => '0'.$hex, + 1 => '0' . $hex, 2 => $hex, default => 'ff', }; diff --git a/apps/theming/lib/Service/ThemesService.php b/apps/theming/lib/Service/ThemesService.php index 49cd72d4255a9..ef8d1ff44ffcf 100644 --- a/apps/theming/lib/Service/ThemesService.php +++ b/apps/theming/lib/Service/ThemesService.php @@ -31,7 +31,8 @@ public function __construct( private DarkTheme $darkTheme, HighContrastTheme $highContrastTheme, DarkHighContrastTheme $darkHighContrastTheme, - DyslexiaFont $dyslexiaFont) { + DyslexiaFont $dyslexiaFont, + ) { // Register themes $this->themesProviders = [ diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index 9be830a61fda9..42c96557ba76e 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -123,7 +123,7 @@ public function getShortFooter() { $footer = '' . $entity . ''; } else { - $footer = '' .$entity . ''; + $footer = '' . $entity . ''; } } $footer .= ($slogan !== '' ? ' – ' . $slogan : ''); @@ -340,10 +340,10 @@ public function getScssVariables() { 'theming-favicon-mime' => "'" . $this->config->getAppValue('theming', 'faviconMime') . "'" ]; - $variables['image-logo'] = "url('".$this->imageManager->getImageUrl('logo')."')"; - $variables['image-logoheader'] = "url('".$this->imageManager->getImageUrl('logoheader')."')"; - $variables['image-favicon'] = "url('".$this->imageManager->getImageUrl('favicon')."')"; - $variables['image-login-background'] = "url('".$this->imageManager->getImageUrl('background')."')"; + $variables['image-logo'] = "url('" . $this->imageManager->getImageUrl('logo') . "')"; + $variables['image-logoheader'] = "url('" . $this->imageManager->getImageUrl('logoheader') . "')"; + $variables['image-favicon'] = "url('" . $this->imageManager->getImageUrl('favicon') . "')"; + $variables['image-login-background'] = "url('" . $this->imageManager->getImageUrl('background') . "')"; $variables['image-login-plain'] = 'false'; if ($this->appConfig->getValueString(Application::APP_ID, 'primary_color', '') !== '') { diff --git a/apps/theming/lib/Util.php b/apps/theming/lib/Util.php index 809ff53f5e1af..839ef1d0b465e 100644 --- a/apps/theming/lib/Util.php +++ b/apps/theming/lib/Util.php @@ -189,7 +189,7 @@ public function hexToRGB(string $color): array { */ public function generateRadioButton($color) { $radioButtonIcon = '' . - ''; + ''; return base64_encode($radioButtonIcon); } diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php index d69ceefa0e551..6ce808253a0a3 100644 --- a/apps/theming/tests/Controller/ThemingControllerTest.php +++ b/apps/theming/tests/Controller/ThemingControllerTest.php @@ -256,7 +256,7 @@ public function testUploadSVGFaviconWithoutImagemagick(): void { ->method('getUploadedFile') ->with('image') ->willReturn([ - 'tmp_name' => __DIR__ . '/../../../../tests/data/testimagelarge.svg', + 'tmp_name' => __DIR__ . '/../../../../tests/data/testimagelarge.svg', 'type' => 'image/svg', 'name' => 'testimagelarge.svg', 'error' => 0, @@ -297,7 +297,7 @@ public function testUpdateLogoInvalidMimeType(): void { ->method('getUploadedFile') ->with('image') ->willReturn([ - 'tmp_name' => __DIR__ . '/../../../../tests/data/lorem.txt', + 'tmp_name' => __DIR__ . '/../../../../tests/data/lorem.txt', 'type' => 'application/pdf', 'name' => 'logo.pdf', 'error' => 0, @@ -443,7 +443,7 @@ public function testUpdateLogoLoginScreenUploadWithInvalidImage(): void { $tmpLogo = \OC::$server->getTempManager()->getTemporaryFolder() . '/logo.svg'; touch($tmpLogo); - file_put_contents($tmpLogo, file_get_contents(__DIR__ . '/../../../../tests/data/data.zip')); + file_put_contents($tmpLogo, file_get_contents(__DIR__ . '/../../../../tests/data/data.zip')); $this->request ->expects($this->once()) ->method('getParam') diff --git a/apps/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php index 942bcf399fa98..bef48448bfa1b 100644 --- a/apps/theming/tests/IconBuilderTest.php +++ b/apps/theming/tests/IconBuilderTest.php @@ -84,7 +84,7 @@ public function testRenderAppIcon($app, $color, $file): void { ->with('global/images') ->willThrowException(new NotFoundException()); - $expectedIcon = new \Imagick(realpath(__DIR__). '/data/' . $file); + $expectedIcon = new \Imagick(realpath(__DIR__) . '/data/' . $file); $icon = $this->iconBuilder->renderAppIcon($app, 512); $this->assertEquals(true, $icon->valid()); @@ -113,7 +113,7 @@ public function testGetTouchIcon($app, $color, $file): void { ->with('global/images') ->willThrowException(new NotFoundException()); - $expectedIcon = new \Imagick(realpath(__DIR__). '/data/' . $file); + $expectedIcon = new \Imagick(realpath(__DIR__) . '/data/' . $file); $icon = new \Imagick(); $icon->readImageBlob($this->iconBuilder->getTouchIcon($app)); @@ -146,7 +146,7 @@ public function testGetFavicon($app, $color, $file): void { ->with('global/images') ->willThrowException(new NotFoundException()); - $expectedIcon = new \Imagick(realpath(__DIR__). '/data/' . $file); + $expectedIcon = new \Imagick(realpath(__DIR__) . '/data/' . $file); $actualIcon = $this->iconBuilder->getFavicon($app); $icon = new \Imagick(); diff --git a/apps/updatenotification/lib/Command/Check.php b/apps/updatenotification/lib/Command/Check.php index 75e42904515f1..a66e729e8a7e8 100644 --- a/apps/updatenotification/lib/Command/Check.php +++ b/apps/updatenotification/lib/Command/Check.php @@ -52,7 +52,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int // Server $r = $this->updateChecker->getUpdateState(); if (isset($r['updateAvailable']) && $r['updateAvailable']) { - $output->writeln($r['updateVersionString'] . ' is available. Get more information on how to update at '. $r['updateLink'] . '.'); + $output->writeln($r['updateVersionString'] . ' is available. Get more information on how to update at ' . $r['updateLink'] . '.'); $updatesAvailableCount += 1; } diff --git a/apps/updatenotification/lib/Manager.php b/apps/updatenotification/lib/Manager.php index f2e75eedfa44f..b6f455f93fe7a 100644 --- a/apps/updatenotification/lib/Manager.php +++ b/apps/updatenotification/lib/Manager.php @@ -34,7 +34,7 @@ public function __construct( * @param ?string $languageCode The language in which to query the changelog (defaults to current user language and fallsback to English) * @return string|null Either the changelog entry or null if no changelog is found */ - public function getChangelog(string $appId, string $version, ?string $languageCode = null): string|null { + public function getChangelog(string $appId, string $version, ?string $languageCode = null): ?string { if ($languageCode === null) { $languageCode = $this->l10NFactory->getUserLanguage($this->currentUser); } @@ -55,7 +55,7 @@ public function getChangelog(string $appId, string $version, ?string $languageCo * @param string $languageCode The language code to search * @return string|null Either the file path or null if not found */ - public function getChangelogFile(string $appId, string $languageCode): string|null { + public function getChangelogFile(string $appId, string $languageCode): ?string { try { $appPath = $this->appManager->getAppPath($appId); $files = ["CHANGELOG.$languageCode.md", 'CHANGELOG.en.md']; @@ -76,7 +76,7 @@ public function getChangelogFile(string $appId, string $languageCode): string|nu * @param string $path The path to the changlog file * @param string $version The version to query (make sure to only pass in "{major}.{minor}(.{patch}" format) */ - protected function retrieveChangelogEntry(string $path, string $version): string|null { + protected function retrieveChangelogEntry(string $path, string $version): ?string { $matches = []; $content = file_get_contents($path); if ($content === false) { diff --git a/apps/updatenotification/lib/Settings/Admin.php b/apps/updatenotification/lib/Settings/Admin.php index 6e39a40ad8d8a..4a74993f0a57c 100644 --- a/apps/updatenotification/lib/Settings/Admin.php +++ b/apps/updatenotification/lib/Settings/Admin.php @@ -35,7 +35,7 @@ public function __construct( private IRegistry $subscriptionRegistry, private IUserManager $userManager, private LoggerInterface $logger, - private IInitialState $initialState + private IInitialState $initialState, ) { } diff --git a/apps/user_ldap/ajax/getNewServerConfigPrefix.php b/apps/user_ldap/ajax/getNewServerConfigPrefix.php index 8064ce928333e..ccd96250d524f 100644 --- a/apps/user_ldap/ajax/getNewServerConfigPrefix.php +++ b/apps/user_ldap/ajax/getNewServerConfigPrefix.php @@ -15,7 +15,7 @@ sort($serverConnections); $lk = array_pop($serverConnections); $ln = (int)str_replace('s', '', $lk); -$nk = 's'.str_pad($ln + 1, 2, '0', STR_PAD_LEFT); +$nk = 's' . str_pad($ln + 1, 2, '0', STR_PAD_LEFT); $resultData = ['configPrefix' => $nk]; diff --git a/apps/user_ldap/ajax/wizard.php b/apps/user_ldap/ajax/wizard.php index 5c2cddc767295..f177867732712 100644 --- a/apps/user_ldap/ajax/wizard.php +++ b/apps/user_ldap/ajax/wizard.php @@ -98,7 +98,7 @@ $setParameters = []; $configuration->setConfiguration($cfg, $setParameters); if (!in_array($key, $setParameters)) { - \OC_JSON::error(['message' => $l->t($key. + \OC_JSON::error(['message' => $l->t($key . ' Could not set configuration %s', $setParameters[0])]); exit; } diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index dab8db20c9915..81f3dc6cb707d 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -624,7 +624,7 @@ public function mapAndAnnounceIfApplicable( string $fdn, string $name, string $uuid, - bool $isUser + bool $isUser, ): bool { if ($mapper->map($fdn, $name, $uuid)) { if ($isUser) { @@ -1118,7 +1118,7 @@ private function executeSearch( string $base, ?array &$attr, ?int $pageSize, - ?int $offset + ?int $offset, ) { // See if we have a resource, in case not cancel with message $cr = $this->connection->getConnectionResource(); @@ -1158,7 +1158,7 @@ private function processPagedSearchStatus( int $foundItems, int $limit, bool $pagedSearchOK, - bool $skipHandling + bool $skipHandling, ): bool { $cookie = ''; if ($pagedSearchOK) { @@ -1213,7 +1213,7 @@ private function count( ?array $attr = null, int $limit = 0, int $offset = 0, - bool $skipHandling = false + bool $skipHandling = false, ) { $this->logger->debug('Count filter: {filter}', [ 'app' => 'user_ldap', @@ -1278,7 +1278,7 @@ public function search( ?array $attr = null, ?int $limit = null, ?int $offset = null, - bool $skipHandling = false + bool $skipHandling = false, ): array { $limitPerPage = (int)$this->connection->ldapPagingSize; if (!is_null($limit) && $limit < $limitPerPage && $limit > 0) { @@ -1983,7 +1983,7 @@ private function initPagedSearch( string $base, ?array $attr, int $pageSize, - int $offset + int $offset, ): array { $pagedSearchOK = false; if ($pageSize !== 0) { diff --git a/apps/user_ldap/lib/AppInfo/Application.php b/apps/user_ldap/lib/AppInfo/Application.php index 400315442bb93..e3f6f56152c49 100644 --- a/apps/user_ldap/lib/AppInfo/Application.php +++ b/apps/user_ldap/lib/AppInfo/Application.php @@ -109,7 +109,7 @@ public function boot(IBootContext $context): void { IGroupManager $groupManager, User_Proxy $userBackend, Group_Proxy $groupBackend, - Helper $helper + Helper $helper, ) { $configPrefixes = $helper->getServerConfigurationPrefixes(true); if (count($configPrefixes) > 0) { diff --git a/apps/user_ldap/lib/Command/CheckGroup.php b/apps/user_ldap/lib/Command/CheckGroup.php index c376d0f890aa5..9c7ccb9d3b3ec 100644 --- a/apps/user_ldap/lib/Command/CheckGroup.php +++ b/apps/user_ldap/lib/Command/CheckGroup.php @@ -99,25 +99,25 @@ protected function execute(InputInterface $input, OutputInterface $output): int throw new \Exception('The given group is not a recognized LDAP group.'); } catch (\Exception $e) { - $output->writeln('' . $e->getMessage(). ''); + $output->writeln('' . $e->getMessage() . ''); return self::FAILURE; } } public function onGroupCreatedEvent(GroupCreatedEvent $event, OutputInterface $output): void { - $output->writeln('The group '.$event->getGroup()->getGID().' was added to Nextcloud with '.$event->getGroup()->count().' users'); + $output->writeln('The group ' . $event->getGroup()->getGID() . ' was added to Nextcloud with ' . $event->getGroup()->count() . ' users'); } public function onUserAddedEvent(UserAddedEvent $event, OutputInterface $output): void { $user = $event->getUser(); $group = $event->getGroup(); - $output->writeln('The user '.$user->getUID().' was added to group '.$group->getGID().''); + $output->writeln('The user ' . $user->getUID() . ' was added to group ' . $group->getGID() . ''); } public function onUserRemovedEvent(UserRemovedEvent $event, OutputInterface $output): void { $user = $event->getUser(); $group = $event->getGroup(); - $output->writeln('The user '.$user->getUID().' was removed from group '.$group->getGID().''); + $output->writeln('The user ' . $user->getUID() . ' was removed from group ' . $group->getGID() . ''); } /** diff --git a/apps/user_ldap/lib/Command/CheckUser.php b/apps/user_ldap/lib/Command/CheckUser.php index ebb416c24a6a7..d5bd0235b2cec 100644 --- a/apps/user_ldap/lib/Command/CheckUser.php +++ b/apps/user_ldap/lib/Command/CheckUser.php @@ -84,7 +84,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int throw new \Exception('The given user is not a recognized LDAP user.'); } catch (\Exception $e) { - $output->writeln('' . $e->getMessage(). ''); + $output->writeln('' . $e->getMessage() . ''); return self::FAILURE; } } diff --git a/apps/user_ldap/lib/Command/PromoteGroup.php b/apps/user_ldap/lib/Command/PromoteGroup.php index bb5362e470047..b203a910b1498 100644 --- a/apps/user_ldap/lib/Command/PromoteGroup.php +++ b/apps/user_ldap/lib/Command/PromoteGroup.php @@ -22,7 +22,7 @@ class PromoteGroup extends Command { public function __construct( private IGroupManager $groupManager, - private Group_Proxy $backend + private Group_Proxy $backend, ) { parent::__construct(); } diff --git a/apps/user_ldap/lib/Command/Search.php b/apps/user_ldap/lib/Command/Search.php index 4886e0c763855..fe1b9f3498835 100644 --- a/apps/user_ldap/lib/Command/Search.php +++ b/apps/user_ldap/lib/Command/Search.php @@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $result = $proxy->$getMethod($input->getArgument('search'), $limit, $offset); foreach ($result as $id => $name) { - $line = $name . ($printID ? ' ('.$id.')' : ''); + $line = $name . ($printID ? ' (' . $id . ')' : ''); $output->writeln($line); } return self::SUCCESS; diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php index 9de180cad767c..989d0bd3929d8 100644 --- a/apps/user_ldap/lib/Configuration.php +++ b/apps/user_ldap/lib/Configuration.php @@ -241,7 +241,7 @@ public function setConfiguration(array $config, ?array &$applied = null): void { case 'homeFolderNamingRule': $trimmedVal = trim($val); if ($trimmedVal !== '' && !str_contains($val, 'attr:')) { - $val = 'attr:'.$trimmedVal; + $val = 'attr:' . $trimmedVal; } break; case 'ldapBase': @@ -450,7 +450,7 @@ protected function getValue(string $varName): string { $defaults = $this->getDefaults(); } return \OC::$server->getConfig()->getAppValue('user_ldap', - $this->configPrefix.$varName, + $this->configPrefix . $varName, $defaults[$varName]); } @@ -480,7 +480,7 @@ protected function setRawValue(string $varName, $value): void { protected function saveValue(string $varName, string $value): bool { \OC::$server->getConfig()->setAppValue( 'user_ldap', - $this->configPrefix.$varName, + $this->configPrefix . $varName, $value ); return true; diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php index b74c964eb7247..757ba2d8e8a10 100644 --- a/apps/user_ldap/lib/Connection.php +++ b/apps/user_ldap/lib/Connection.php @@ -259,11 +259,11 @@ public function resetConnectionResource(): void { * @param string|null $key */ private function getCacheKey($key): string { - $prefix = 'LDAP-'.$this->configID.'-'.$this->configPrefix.'-'; + $prefix = 'LDAP-' . $this->configID . '-' . $this->configPrefix . '-'; if (is_null($key)) { return $prefix; } - return $prefix.hash('sha256', $key); + return $prefix . hash('sha256', $key); } /** @@ -410,7 +410,7 @@ private function doSoftValidation(): void { $this->configuration->$effectiveSetting = 'auto'; $this->configuration->saveConfiguration(); $this->logger->info( - 'Illegal value for the '.$effectiveSetting.', reset to autodetect.', + 'Illegal value for the ' . $effectiveSetting . ', reset to autodetect.', ['app' => 'user_ldap'] ); } @@ -480,7 +480,7 @@ private function doCriticalValidation(): bool { } $configurationOK = false; $this->logger->warning( - $errorStr.'No '.$subj.' given!', + $errorStr . 'No ' . $subj . ' given!', ['app' => 'user_ldap'] ); } @@ -494,7 +494,7 @@ private function doCriticalValidation(): bool { || ($agent !== '' && $pwd === '') ) { $this->logger->warning( - $errorStr.'either no password is given for the user ' . + $errorStr . 'either no password is given for the user ' . 'agent or a password is given, but not an LDAP agent.', ['app' => 'user_ldap'] ); @@ -507,7 +507,7 @@ private function doCriticalValidation(): bool { if (empty($base) && empty($baseUsers) && empty($baseGroups)) { $this->logger->warning( - $errorStr.'Not a single Base DN given.', + $errorStr . 'Not a single Base DN given.', ['app' => 'user_ldap'] ); $configurationOK = false; @@ -516,7 +516,7 @@ private function doCriticalValidation(): bool { if (mb_strpos((string)$this->configuration->ldapLoginFilter, '%uid', 0, 'UTF-8') === false) { $this->logger->warning( - $errorStr.'login filter does not contain %uid place holder.', + $errorStr . 'login filter does not contain %uid place holder.', ['app' => 'user_ldap'] ); $configurationOK = false; diff --git a/apps/user_ldap/lib/Controller/ConfigAPIController.php b/apps/user_ldap/lib/Controller/ConfigAPIController.php index 978aa005559f0..f4f55217ef17d 100644 --- a/apps/user_ldap/lib/Controller/ConfigAPIController.php +++ b/apps/user_ldap/lib/Controller/ConfigAPIController.php @@ -33,7 +33,7 @@ public function __construct( Manager $keyManager, private Helper $ldapHelper, private LoggerInterface $logger, - private ConnectionFactory $connectionFactory + private ConnectionFactory $connectionFactory, ) { parent::__construct( $appName, diff --git a/apps/user_ldap/lib/GroupPluginManager.php b/apps/user_ldap/lib/GroupPluginManager.php index fca9f37d09225..37622a5348068 100644 --- a/apps/user_ldap/lib/GroupPluginManager.php +++ b/apps/user_ldap/lib/GroupPluginManager.php @@ -41,7 +41,7 @@ public function register(ILDAPGroupPlugin $plugin) { 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 d4d67b546d67a..5fe5abf4c13a7 100644 --- a/apps/user_ldap/lib/Group_LDAP.php +++ b/apps/user_ldap/lib/Group_LDAP.php @@ -46,7 +46,7 @@ public function __construct( Access $access, GroupPluginManager $groupPluginManager, IConfig $config, - IUserManager $ncUserManager + IUserManager $ncUserManager, ) { $this->access = $access; $filter = $this->access->connection->ldapGroupFilter; @@ -454,7 +454,7 @@ public function getUsersInGidNumber( string $groupDN, string $search = '', ?int $limit = -1, - ?int $offset = 0 + ?int $offset = 0, ): array { try { $filter = $this->prepareFilterForUsersHasGidNumber($groupDN, $search); @@ -578,7 +578,7 @@ public function getUsersInPrimaryGroup( string $groupDN, string $search = '', ?int $limit = -1, - ?int $offset = 0 + ?int $offset = 0, ): array { try { $filter = $this->prepareFilterForUsersInPrimaryGroup($groupDN, $search); @@ -603,7 +603,7 @@ public function countUsersInPrimaryGroup( string $groupDN, string $search = '', int $limit = -1, - int $offset = 0 + int $offset = 0, ): int { try { $filter = $this->prepareFilterForUsersInPrimaryGroup($groupDN, $search); @@ -1266,7 +1266,7 @@ public function deleteGroup(string $gid): bool { // Getting dn, if false the group is not mapped $dn = $this->access->groupname2dn($gid); if (!$dn) { - throw new Exception('Could not delete unknown group '.$gid.' in LDAP backend.'); + throw new Exception('Could not delete unknown group ' . $gid . ' in LDAP backend.'); } if (!$this->groupExists($gid)) { @@ -1276,7 +1276,7 @@ public function deleteGroup(string $gid): bool { return true; } - throw new Exception('Could not delete existing group '.$gid.' in LDAP backend.'); + throw new Exception('Could not delete existing group ' . $gid . ' in LDAP backend.'); } /** diff --git a/apps/user_ldap/lib/Jobs/CleanUp.php b/apps/user_ldap/lib/Jobs/CleanUp.php index 22c878ed067a9..b04dc67ef4923 100644 --- a/apps/user_ldap/lib/Jobs/CleanUp.php +++ b/apps/user_ldap/lib/Jobs/CleanUp.php @@ -50,7 +50,7 @@ class CleanUp extends TimedJob { public function __construct( ITimeFactory $timeFactory, User_Proxy $userBackend, - DeletedUsersIndex $dui + DeletedUsersIndex $dui, ) { parent::__construct($timeFactory); $minutes = \OC::$server->getConfig()->getSystemValue( diff --git a/apps/user_ldap/lib/LDAPProvider.php b/apps/user_ldap/lib/LDAPProvider.php index a6634382fa1f4..697c7b7742c9c 100644 --- a/apps/user_ldap/lib/LDAPProvider.php +++ b/apps/user_ldap/lib/LDAPProvider.php @@ -36,7 +36,7 @@ public function __construct(IServerContainer $serverContainer, Helper $helper, D $userBackendFound = false; $groupBackendFound = false; foreach ($serverContainer->getUserManager()->getBackends() as $backend) { - $this->logger->debug('instance '.get_class($backend).' user backend.', ['app' => 'user_ldap']); + $this->logger->debug('instance ' . get_class($backend) . ' user backend.', ['app' => 'user_ldap']); if ($backend instanceof IUserLDAP) { $this->userBackend = $backend; $userBackendFound = true; @@ -44,7 +44,7 @@ public function __construct(IServerContainer $serverContainer, Helper $helper, D } } foreach ($serverContainer->getGroupManager()->getBackends() as $backend) { - $this->logger->debug('instance '.get_class($backend).' group backend.', ['app' => 'user_ldap']); + $this->logger->debug('instance ' . get_class($backend) . ' group backend.', ['app' => 'user_ldap']); if ($backend instanceof IGroupLDAP) { $this->groupBackend = $backend; $groupBackendFound = true; diff --git a/apps/user_ldap/lib/Proxy.php b/apps/user_ldap/lib/Proxy.php index 285427bfd4d09..88a55f6462d53 100644 --- a/apps/user_ldap/lib/Proxy.php +++ b/apps/user_ldap/lib/Proxy.php @@ -22,7 +22,7 @@ abstract class Proxy { public function __construct( ILDAPWrapper $ldap, - AccessFactory $accessFactory + AccessFactory $accessFactory, ) { $this->ldap = $ldap; $this->accessFactory = $accessFactory; diff --git a/apps/user_ldap/lib/Settings/Admin.php b/apps/user_ldap/lib/Settings/Admin.php index 71532846b9118..8fc0915c6fe42 100644 --- a/apps/user_ldap/lib/Settings/Admin.php +++ b/apps/user_ldap/lib/Settings/Admin.php @@ -55,7 +55,7 @@ public function getForm() { } $defaults = $config->getDefaults(); foreach ($defaults as $key => $default) { - $parameters[$key.'_default'] = $default; + $parameters[$key . '_default'] = $default; } return new TemplateResponse('user_ldap', 'settings', $parameters); diff --git a/apps/user_ldap/lib/SetupChecks/LdapConnection.php b/apps/user_ldap/lib/SetupChecks/LdapConnection.php index a33dd10f063d2..ee8c4ddd5959d 100644 --- a/apps/user_ldap/lib/SetupChecks/LdapConnection.php +++ b/apps/user_ldap/lib/SetupChecks/LdapConnection.php @@ -61,7 +61,7 @@ public function run(): SetupResult { 'Binding failed for %n LDAP configurations: %s', count($bindFailedConfigurations), [implode(',', $bindFailedConfigurations)] - )."\n"; + ) . "\n"; } if (!empty($searchFailedConfigurations)) { $output .= $this->l10n->n( @@ -69,7 +69,7 @@ public function run(): SetupResult { 'Searching failed for %n LDAP configurations: %s', count($searchFailedConfigurations), [implode(',', $searchFailedConfigurations)] - )."\n"; + ) . "\n"; } if (!empty($inactiveConfigurations)) { $output .= $this->l10n->n( @@ -77,7 +77,7 @@ public function run(): SetupResult { 'There are %n inactive LDAP configurations: %s', count($inactiveConfigurations), [implode(',', $inactiveConfigurations)] - )."\n"; + ) . "\n"; } if (!empty($bindFailedConfigurations) || !empty($searchFailedConfigurations)) { return SetupResult::error($output); diff --git a/apps/user_ldap/lib/User/DeletedUsersIndex.php b/apps/user_ldap/lib/User/DeletedUsersIndex.php index 4b5bb26fa96ec..515233b382569 100644 --- a/apps/user_ldap/lib/User/DeletedUsersIndex.php +++ b/apps/user_ldap/lib/User/DeletedUsersIndex.php @@ -22,7 +22,7 @@ class DeletedUsersIndex { public function __construct( IConfig $config, UserMapping $mapping, - IManager $shareManager + IManager $shareManager, ) { $this->config = $config; $this->mapping = $mapping; diff --git a/apps/user_ldap/lib/User/Manager.php b/apps/user_ldap/lib/User/Manager.php index bf1da54823ccc..5d5ad8b26585f 100644 --- a/apps/user_ldap/lib/User/Manager.php +++ b/apps/user_ldap/lib/User/Manager.php @@ -49,7 +49,7 @@ public function __construct( Image $image, IUserManager $userManager, INotificationManager $notificationManager, - IManager $shareManager + IManager $shareManager, ) { $this->ocConfig = $ocConfig; $this->ocFilesystem = $ocFilesystem; diff --git a/apps/user_ldap/lib/User/OfflineUser.php b/apps/user_ldap/lib/User/OfflineUser.php index 24f11a5a1f9c3..eed715ccc1cc3 100644 --- a/apps/user_ldap/lib/User/OfflineUser.php +++ b/apps/user_ldap/lib/User/OfflineUser.php @@ -70,7 +70,7 @@ public function __construct( $ocName, IConfig $config, UserMapping $mapping, - IManager $shareManager + IManager $shareManager, ) { $this->ocName = $ocName; $this->config = $config; diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php index f2a9ba49f2f81..0688a843bd7e2 100644 --- a/apps/user_ldap/lib/User/User.php +++ b/apps/user_ldap/lib/User/User.php @@ -201,7 +201,7 @@ public function processAttributes($ldapEntry) { } //memberOf groups - $cacheKey = 'getMemberOf'.$this->getUsername(); + $cacheKey = 'getMemberOf' . $this->getUsername(); $groups = false; if (isset($ldapEntry['memberof'])) { $groups = $ldapEntry['memberof']; @@ -217,7 +217,7 @@ public function processAttributes($ldapEntry) { // check for cached profile data $username = $this->getUsername(); // buffer variable, to save resource - $cacheKey = 'getUserProfile-'.$username; + $cacheKey = 'getUserProfile-' . $username; $profileCached = $this->connection->getFromCache($cacheKey); // honoring profile disabled in config.php and check if user profile was refreshed if ($this->config->getSystemValueBool('profile.enabled', true) && @@ -404,7 +404,7 @@ public function getHomePath($valueFromLDAP = null) { && $path[1] === ':' && ($path[2] === '\\' || $path[2] === '/')) ) { $path = $this->config->getSystemValue('datadirectory', - \OC::$SERVERROOT.'/data') . '/' . $path; + \OC::$SERVERROOT . '/data') . '/' . $path; } //we need it to store it in the DB as well in case a user gets //deleted so we can clean up afterwards @@ -427,7 +427,7 @@ public function getHomePath($valueFromLDAP = null) { } public function getMemberOfGroups() { - $cacheKey = 'getMemberOf'.$this->getUsername(); + $cacheKey = 'getMemberOf' . $this->getUsername(); $memberOfGroups = $this->connection->getFromCache($cacheKey); if (!is_null($memberOfGroups)) { return $memberOfGroups; @@ -637,7 +637,7 @@ private function updateProfile(array $profileValues): void { // fetch/prepare user $user = $this->userManager->get($this->uid); if (is_null($user)) { - $this->logger->error('could not get user for uid='.$this->uid.'', ['app' => 'user_ldap']); + $this->logger->error('could not get user for uid=' . $this->uid . '', ['app' => 'user_ldap']); return; } // prepare AccountManager and Account @@ -654,22 +654,22 @@ private function updateProfile(array $profileValues): void { $currentValue = $accountProperty->getValue(); $scope = ($accountProperty->getScope() ?: $defaultScopes[$property]); } catch (PropertyDoesNotExistException $e) { // thrown at getProperty - $this->logger->error('property does not exist: '.$property - .' for uid='.$this->uid.'', ['app' => 'user_ldap', 'exception' => $e]); + $this->logger->error('property does not exist: ' . $property + . ' for uid=' . $this->uid . '', ['app' => 'user_ldap', 'exception' => $e]); $currentValue = ''; $scope = $defaultScopes[$property]; } $verified = IAccountManager::VERIFIED; // trust the LDAP admin knew what he put there if ($currentValue !== $value) { $account->setProperty($property, $value, $scope, $verified); - $this->logger->debug('update user profile: '.$property.'='.$value - .' for uid='.$this->uid.'', ['app' => 'user_ldap']); + $this->logger->debug('update user profile: ' . $property . '=' . $value + . ' for uid=' . $this->uid . '', ['app' => 'user_ldap']); } } try { $accountManager->updateAccount($account); // may throw InvalidArgumentException } catch (\InvalidArgumentException $e) { - $this->logger->error('invalid data from LDAP: for uid='.$this->uid.'', ['app' => 'user_ldap', 'func' => 'updateProfile' + $this->logger->error('invalid data from LDAP: for uid=' . $this->uid . '', ['app' => 'user_ldap', 'func' => 'updateProfile' , 'exception' => $e]); } } @@ -735,7 +735,7 @@ private function avatarExists(): bool { */ private function setOwnCloudAvatar() { if (!$this->image->valid()) { - $this->logger->error('avatar image data from LDAP invalid for '.$this->dn, ['app' => 'user_ldap']); + $this->logger->error('avatar image data from LDAP invalid for ' . $this->dn, ['app' => 'user_ldap']); return false; } @@ -743,7 +743,7 @@ private function setOwnCloudAvatar() { //make sure it is a square and not bigger than 512x512 $size = min([$this->image->width(), $this->image->height(), 512]); if (!$this->image->centerCrop($size)) { - $this->logger->error('croping image for avatar failed for '.$this->dn, ['app' => 'user_ldap']); + $this->logger->error('croping image for avatar failed for ' . $this->dn, ['app' => 'user_ldap']); return false; } @@ -845,10 +845,10 @@ public function handlePasswordExpiry($params) { if (!empty($pwdGraceAuthNLimit) && count($pwdGraceUseTime) < (int)$pwdGraceAuthNLimit[0]) { //at least one more grace login available? $this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true'); - header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( + header('Location: ' . \OC::$server->getURLGenerator()->linkToRouteAbsolute( 'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid])); } else { //no more grace login available - header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( + header('Location: ' . \OC::$server->getURLGenerator()->linkToRouteAbsolute( 'user_ldap.renewPassword.showLoginFormInvalidPassword', ['user' => $uid])); } exit(); @@ -856,7 +856,7 @@ public function handlePasswordExpiry($params) { //handle pwdReset attribute if (!empty($pwdReset) && $pwdReset[0] === 'TRUE') { //user must change his password $this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true'); - header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( + header('Location: ' . \OC::$server->getURLGenerator()->linkToRouteAbsolute( 'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid])); exit(); } @@ -868,7 +868,7 @@ public function handlePasswordExpiry($params) { $pwdExpireWarningInt = (int)$pwdExpireWarning[0]; if ($pwdMaxAgeInt > 0 && $pwdExpireWarningInt > 0) { $pwdChangedTimeDt = \DateTime::createFromFormat('YmdHisZ', $pwdChangedTime[0]); - $pwdChangedTimeDt->add(new \DateInterval('PT'.$pwdMaxAgeInt.'S')); + $pwdChangedTimeDt->add(new \DateInterval('PT' . $pwdMaxAgeInt . 'S')); $currentDateTime = new \DateTime(); $secondsToExpiry = $pwdChangedTimeDt->getTimestamp() - $currentDateTime->getTimestamp(); if ($secondsToExpiry <= $pwdExpireWarningInt) { diff --git a/apps/user_ldap/lib/UserPluginManager.php b/apps/user_ldap/lib/UserPluginManager.php index ddf23ddfe3e51..4a36794bca523 100644 --- a/apps/user_ldap/lib/UserPluginManager.php +++ b/apps/user_ldap/lib/UserPluginManager.php @@ -43,12 +43,12 @@ public function register(ILDAPUserPlugin $plugin) { 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 b1065fcf7a78d..e34f0fcb18506 100644 --- a/apps/user_ldap/lib/User_LDAP.php +++ b/apps/user_ldap/lib/User_LDAP.php @@ -217,7 +217,7 @@ public function setPassword($uid, $password) { */ public function getUsers($search = '', $limit = 10, $offset = 0) { $search = $this->access->escapeFilterPart($search, true); - $cachekey = 'getUsers-'.$search.'-'.$limit.'-'.$offset; + $cachekey = 'getUsers-' . $search . '-' . $limit . '-' . $offset; //check if users are cached, if so return $ldap_users = $this->access->connection->getFromCache($cachekey); @@ -237,7 +237,7 @@ public function getUsers($search = '', $limit = 10, $offset = 0) { ]); $this->logger->debug( - 'getUsers: Options: search '.$search.' limit '.$limit.' offset '.$offset.' Filter: '.$filter, + 'getUsers: Options: search ' . $search . ' limit ' . $limit . ' offset ' . $offset . ' Filter: ' . $filter, ['app' => 'user_ldap'] ); //do the search and translate results to Nextcloud names @@ -247,7 +247,7 @@ public function getUsers($search = '', $limit = 10, $offset = 0) { $limit, $offset); $ldap_users = $this->access->nextcloudUserNames($ldap_users); $this->logger->debug( - 'getUsers: '.count($ldap_users). ' Users found', + 'getUsers: ' . count($ldap_users) . ' Users found', ['app' => 'user_ldap'] ); @@ -318,7 +318,7 @@ public function userExistsOnLDAP($user, bool $ignoreCache = false): bool { * @throws \Exception when connection could not be established */ public function userExists($uid) { - $userExists = $this->access->connection->getFromCache('userExists'.$uid); + $userExists = $this->access->connection->getFromCache('userExists' . $uid); if (!is_null($userExists)) { return (bool)$userExists; } @@ -326,14 +326,14 @@ public function userExists($uid) { if (!$userExists) { $this->logger->debug( - 'No DN found for '.$uid.' on '.$this->access->connection->ldapHost, + 'No DN found for ' . $uid . ' on ' . $this->access->connection->ldapHost, ['app' => 'user_ldap'] ); - $this->access->connection->writeToCache('userExists'.$uid, false); + $this->access->connection->writeToCache('userExists' . $uid, false); return false; } - $this->access->connection->writeToCache('userExists'.$uid, true); + $this->access->connection->writeToCache('userExists' . $uid, true); return true; } @@ -367,7 +367,7 @@ public function deleteUser($uid) { } if (!$marked) { $this->logger->notice( - 'User '.$uid . ' is not marked as deleted, not cleaning up.', + 'User ' . $uid . ' is not marked as deleted, not cleaning up.', ['app' => 'user_ldap'] ); return false; @@ -400,7 +400,7 @@ public function getHome($uid) { return $this->userPluginManager->getHome($uid); } - $cacheKey = 'getHome'.$uid; + $cacheKey = 'getHome' . $uid; $path = $this->access->connection->getFromCache($cacheKey); if (!is_null($path)) { return $path; @@ -432,7 +432,7 @@ public function getDisplayName($uid) { return false; } - $cacheKey = 'getDisplayName'.$uid; + $cacheKey = 'getDisplayName' . $uid; if (!is_null($displayName = $this->access->connection->getFromCache($cacheKey))) { return $displayName; } @@ -495,7 +495,7 @@ public function setDisplayName($uid, $displayName) { * @return array an array of all displayNames (value) and the corresponding uids (key) */ public function getDisplayNames($search = '', $limit = null, $offset = null) { - $cacheKey = 'getDisplayNames-'.$search.'-'.$limit.'-'.$offset; + $cacheKey = 'getDisplayNames-' . $search . '-' . $limit . '-' . $offset; if (!is_null($displayNames = $this->access->connection->getFromCache($cacheKey))) { return $displayNames; } @@ -546,7 +546,7 @@ public function countUsers() { } $filter = $this->access->getFilterForUserCount(); - $cacheKey = 'countUsers-'.$filter; + $cacheKey = 'countUsers-' . $filter; if (!is_null($entries = $this->access->connection->getFromCache($cacheKey))) { return $entries; } diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php index fd5f12ce0cf4a..87f0d04f4974a 100644 --- a/apps/user_ldap/lib/Wizard.php +++ b/apps/user_ldap/lib/Wizard.php @@ -37,7 +37,7 @@ class Wizard extends LDAPUtility { public function __construct( Configuration $configuration, ILDAPWrapper $ldap, - Access $access + Access $access, ) { parent::__construct($ldap); $this->configuration = $configuration; @@ -262,7 +262,7 @@ public function detectEmailAttribute() { $this->applyFind('ldap_email_attr', $winner); if ($writeLog) { $this->logger->info( - 'The mail attribute has automatically been reset, '. + 'The mail attribute has automatically been reset, ' . 'because the original value did not return any results.', ['app' => 'user_ldap'] ); @@ -402,7 +402,7 @@ public function fetchGroups(string $dbKey, string $confKey): array { $filterParts = []; foreach ($obclasses as $obclass) { - $filterParts[] = 'objectclass='.$obclass; + $filterParts[] = 'objectclass=' . $obclass; } //we filter for everything //- that looks like a group and @@ -647,7 +647,7 @@ public function guessPortAndTLS() { $p = $setting['port']; $t = $setting['tls']; $this->logger->debug( - 'Wiz: trying port '. $p . ', TLS '. $t, + 'Wiz: trying port ' . $p . ', TLS ' . $t, ['app' => 'user_ldap'] ); //connectAndBind may throw Exception, it needs to be caught by the @@ -755,7 +755,7 @@ private function checkHost(): void { //removes Port from Host if (is_array($hostInfo) && isset($hostInfo['port'])) { $port = $hostInfo['port']; - $host = str_replace(':'.$port, '', $host); + $host = str_replace(':' . $port, '', $host); $this->applyFind('ldap_host', $host); $this->applyFind('ldap_port', (string)$port); } @@ -824,7 +824,7 @@ private function testBaseDN(string $base): bool { $errorNo = $this->ldap->errno($cr); $errorMsg = $this->ldap->error($cr); $this->logger->info( - 'Wiz: Could not search base '.$base.' Error '.$errorNo.': '.$errorMsg, + 'Wiz: Could not search base ' . $base . ' Error ' . $errorNo . ': ' . $errorMsg, ['app' => 'user_ldap'] ); return false; @@ -902,7 +902,7 @@ private function composeLdapFilter(int $filterType): string { $filterPart = '(memberof=' . ldap_escape($dn, '', LDAP_ESCAPE_FILTER) . ')'; if (isset($attrs['primaryGroupToken'])) { $pgt = $attrs['primaryGroupToken'][0]; - $primaryFilterPart = '(primaryGroupID=' . ldap_escape($pgt, '', LDAP_ESCAPE_FILTER) .')'; + $primaryFilterPart = '(primaryGroupID=' . ldap_escape($pgt, '', LDAP_ESCAPE_FILTER) . ')'; $filterPart = '(|' . $filterPart . $primaryFilterPart . ')'; } $filter .= $filterPart; @@ -1002,12 +1002,12 @@ private function composeLdapFilter(int $filterType): string { $filterLogin .= ')'; } - $filter = '(&'.$ulf.$filterLogin.')'; + $filter = '(&' . $ulf . $filterLogin . ')'; break; } $this->logger->debug( - 'Wiz: Final filter '.$filter, + 'Wiz: Final filter ' . $filter, ['app' => 'user_ldap'] ); @@ -1069,7 +1069,7 @@ private function connectAndBind(int $port, bool $tls): bool { if ($login === true) { $this->logger->debug( - 'Wiz: Bind successful to Port '. $port . ' TLS ' . (int)$tls, + 'Wiz: Bind successful to Port ' . $port . ' TLS ' . (int)$tls, ['app' => 'user_ldap'] ); return true; @@ -1203,7 +1203,7 @@ private function determineFeature(array $objectclasses, string $attr, string $db } $p = 'objectclass='; foreach ($objectclasses as $key => $value) { - $objectclasses[$key] = $p.$value; + $objectclasses[$key] = $p . $value; } $maxEntryObjC = ''; diff --git a/apps/user_ldap/templates/part.wizard-server.php b/apps/user_ldap/templates/part.wizard-server.php index 94bd59f7b96f0..9fb67342247cc 100644 --- a/apps/user_ldap/templates/part.wizard-server.php +++ b/apps/user_ldap/templates/part.wizard-server.php @@ -15,7 +15,7 @@ foreach ($_['serverConfigurationPrefixes'] as $prefix) { ?> + $sel = ''; ?>>t('%s. Server:', [$i++])); ?> diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php index 4be24095e9915..9117a9f533caa 100644 --- a/apps/user_ldap/templates/settings.php +++ b/apps/user_ldap/templates/settings.php @@ -73,7 +73,7 @@ '.$l->t('Warning: The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.').'

'); + print_unescaped('

' . $l->t('Warning: The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.') . '

'); } ?> diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php index 79c0f3216a210..a9eeceeb86b3d 100644 --- a/apps/user_ldap/tests/AccessTest.php +++ b/apps/user_ldap/tests/AccessTest.php @@ -526,7 +526,7 @@ protected function prepareMocksForSearchTests( $base, $fakeConnection, $fakeSearchResultResource, - $fakeLdapEntries + $fakeLdapEntries, ) { $this->connection ->expects($this->any()) diff --git a/apps/user_ldap/tests/Group_LDAPTest.php b/apps/user_ldap/tests/Group_LDAPTest.php index 580066274103f..13c5d35dce4aa 100644 --- a/apps/user_ldap/tests/Group_LDAPTest.php +++ b/apps/user_ldap/tests/Group_LDAPTest.php @@ -1033,10 +1033,10 @@ public function testGetGroupsByMember(bool $nestedGroups): void { $this->assertTrue(str_contains($filter, $groupFilter)); } [$memberFilter] = explode('&', $filter); - if ($memberFilter === 'member='.$dn) { + if ($memberFilter === 'member=' . $dn) { return [$group1, $group2]; return []; - } elseif ($memberFilter === 'member='.$group2['dn'][0]) { + } elseif ($memberFilter === 'member=' . $group2['dn'][0]) { return [$group3]; } else { return []; diff --git a/apps/user_ldap/tests/Integration/Bootstrap.php b/apps/user_ldap/tests/Integration/Bootstrap.php index 872e06139ff31..1e270aa6f8a1f 100644 --- a/apps/user_ldap/tests/Integration/Bootstrap.php +++ b/apps/user_ldap/tests/Integration/Bootstrap.php @@ -4,5 +4,5 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ define('CLI_TEST_RUN', true); -require_once __DIR__ . '/../../../../lib/base.php'; +require_once __DIR__ . '/../../../../lib/base.php'; require_once __DIR__ . '/setup-scripts/config.php'; diff --git a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php index f42c6d4bccde6..4618179f8abc0 100644 --- a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php +++ b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php @@ -77,7 +77,7 @@ public function __destruct() { * @throws \Exception */ public function setUp(): void { - require_once __DIR__ . '/../../../../lib/base.php'; + require_once __DIR__ . '/../../../../lib/base.php'; \OC_App::loadApps(['user_ldap']); $ch = $this->getCurl(); diff --git a/apps/user_ldap/tests/Settings/AdminTest.php b/apps/user_ldap/tests/Settings/AdminTest.php index e06563d1856da..099cc09c06854 100644 --- a/apps/user_ldap/tests/Settings/AdminTest.php +++ b/apps/user_ldap/tests/Settings/AdminTest.php @@ -52,7 +52,7 @@ public function testGetForm(): void { $config = new Configuration('', false); $defaults = $config->getDefaults(); foreach ($defaults as $key => $default) { - $parameters[$key.'_default'] = $default; + $parameters[$key . '_default'] = $default; } $expected = new TemplateResponse('user_ldap', 'settings', $parameters); diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php index aca4e2434e2e0..d596402d32296 100644 --- a/apps/user_ldap/tests/User/UserTest.php +++ b/apps/user_ldap/tests/User/UserTest.php @@ -1110,7 +1110,7 @@ public function testHandlePasswordExpiryWarningDefaultPolicy(): void { if ($base === $this->dn) { return [ [ - 'pwdchangedtime' => [(new \DateTime())->sub(new \DateInterval('P28D'))->format('Ymdhis').'Z'], + 'pwdchangedtime' => [(new \DateTime())->sub(new \DateInterval('P28D'))->format('Ymdhis') . 'Z'], 'pwdgraceusetime' => [], ], ]; @@ -1174,7 +1174,7 @@ public function testHandlePasswordExpiryWarningCustomPolicy(): void { return [ [ 'pwdpolicysubentry' => ['cn=custom,ou=policies,dc=foo,dc=bar'], - 'pwdchangedtime' => [(new \DateTime())->sub(new \DateInterval('P28D'))->format('Ymdhis').'Z'], + 'pwdchangedtime' => [(new \DateTime())->sub(new \DateInterval('P28D'))->format('Ymdhis') . 'Z'], 'pwdgraceusetime' => [], ] ]; diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php index 90166beccff59..f766c7f583aeb 100644 --- a/apps/user_ldap/tests/User_LDAPTest.php +++ b/apps/user_ldap/tests/User_LDAPTest.php @@ -654,7 +654,7 @@ public function testGetHomeRelative(): void { $this->prepareMockForUserExists(); $dataDir = \OC::$server->getConfig()->getSystemValue( - 'datadirectory', \OC::$SERVERROOT.'/data'); + 'datadirectory', \OC::$SERVERROOT . '/data'); $this->connection->expects($this->any()) ->method('__get') @@ -689,7 +689,7 @@ public function testGetHomeRelative(): void { ->willReturn('dnOfLadyOfShadows,dc=test'); $user->expects($this->any()) ->method('getHomePath') - ->willReturn($dataDir.'/susannah/'); + ->willReturn($dataDir . '/susannah/'); $this->userManager->expects($this->atLeastOnce()) ->method('get') @@ -701,7 +701,7 @@ public function testGetHomeRelative(): void { /** @noinspection PhpUnhandledExceptionInspection */ $result = $backend->getHome('ladyofshadows'); - $this->assertEquals($dataDir.'/susannah/', $result); + $this->assertEquals($dataDir . '/susannah/', $result); } @@ -1078,11 +1078,11 @@ public function testLoginName2UserNameSuccess(): void { $this->connection->expects($this->exactly(2)) ->method('getFromCache') - ->with($this->equalTo('loginName2UserName-'.$loginName)) + ->with($this->equalTo('loginName2UserName-' . $loginName)) ->willReturnOnConsecutiveCalls(null, $username); $this->connection->expects($this->once()) ->method('writeToCache') - ->with($this->equalTo('loginName2UserName-'.$loginName), $this->equalTo($username)); + ->with($this->equalTo('loginName2UserName-' . $loginName), $this->equalTo($username)); $backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex); $user = $this->createMock(User::class); @@ -1121,11 +1121,11 @@ public function testLoginName2UserNameNoUsersOnLDAP(): void { $this->connection->expects($this->exactly(2)) ->method('getFromCache') - ->with($this->equalTo('loginName2UserName-'.$loginName)) + ->with($this->equalTo('loginName2UserName-' . $loginName)) ->willReturnOnConsecutiveCalls(null, false); $this->connection->expects($this->once()) ->method('writeToCache') - ->with($this->equalTo('loginName2UserName-'.$loginName), false); + ->with($this->equalTo('loginName2UserName-' . $loginName), false); $this->userManager->expects($this->any()) ->method('getAttributes') @@ -1154,11 +1154,11 @@ public function testLoginName2UserNameOfflineUser(): void { $this->connection->expects($this->exactly(2)) ->method('getFromCache') - ->with($this->equalTo('loginName2UserName-'.$loginName)) + ->with($this->equalTo('loginName2UserName-' . $loginName)) ->willReturnOnConsecutiveCalls(null, false); $this->connection->expects($this->once()) ->method('writeToCache') - ->with($this->equalTo('loginName2UserName-'.$loginName), $this->equalTo(false)); + ->with($this->equalTo('loginName2UserName-' . $loginName), $this->equalTo(false)); $this->userManager->expects($this->any()) ->method('get') @@ -1196,7 +1196,7 @@ private function prepareAccessForSetPassword($enablePasswordChange = true) { $this->connection->expects($this->any()) ->method('getFromCache') ->willReturnCallback(function ($uid) { - if ($uid === 'userExists'.'roland') { + if ($uid === 'userExists' . 'roland') { return true; } return null; diff --git a/apps/user_status/lib/ContactsMenu/StatusProvider.php b/apps/user_status/lib/ContactsMenu/StatusProvider.php index 023b4402fc264..6a6949b46bad2 100644 --- a/apps/user_status/lib/ContactsMenu/StatusProvider.php +++ b/apps/user_status/lib/ContactsMenu/StatusProvider.php @@ -19,7 +19,9 @@ class StatusProvider implements IBulkProvider { - public function __construct(private StatusService $statusService) { + public function __construct( + private StatusService $statusService, + ) { } public function process(array $entries): void { diff --git a/apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php b/apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php index 8b639169b0704..49ac93573dd96 100644 --- a/apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php +++ b/apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php @@ -46,7 +46,7 @@ public function __construct( ProfileManager $profileManager, IUserSession $userSession, IInitialStateService $initialState, - JSDataService $jsDataService + JSDataService $jsDataService, ) { $this->profileManager = $profileManager; $this->userSession = $userSession; diff --git a/apps/user_status/lib/Listener/OutOfOfficeStatusListener.php b/apps/user_status/lib/Listener/OutOfOfficeStatusListener.php index 23dec45292819..6337d637896a3 100644 --- a/apps/user_status/lib/Listener/OutOfOfficeStatusListener.php +++ b/apps/user_status/lib/Listener/OutOfOfficeStatusListener.php @@ -28,9 +28,11 @@ * */ class OutOfOfficeStatusListener implements IEventListener { - public function __construct(private IJobList $jobsList, + public function __construct( + private IJobList $jobsList, private ITimeFactory $time, - private IManager $manager) { + private IManager $manager, + ) { } /** diff --git a/apps/user_status/lib/Listener/UserLiveStatusListener.php b/apps/user_status/lib/Listener/UserLiveStatusListener.php index ea8d995b8a3ef..79305a99b05bf 100644 --- a/apps/user_status/lib/Listener/UserLiveStatusListener.php +++ b/apps/user_status/lib/Listener/UserLiveStatusListener.php @@ -33,11 +33,13 @@ class UserLiveStatusListener implements IEventListener { private StatusService $statusService; private ITimeFactory $timeFactory; - public function __construct(UserStatusMapper $mapper, + public function __construct( + UserStatusMapper $mapper, StatusService $statusService, ITimeFactory $timeFactory, private CalendarStatusService $calendarStatusService, - private LoggerInterface $logger) { + private LoggerInterface $logger, + ) { $this->mapper = $mapper; $this->statusService = $statusService; $this->timeFactory = $timeFactory; diff --git a/apps/user_status/lib/Migration/Version1008Date20230921144701.php b/apps/user_status/lib/Migration/Version1008Date20230921144701.php index 561dfd343cf6e..30ebbf37b0e55 100644 --- a/apps/user_status/lib/Migration/Version1008Date20230921144701.php +++ b/apps/user_status/lib/Migration/Version1008Date20230921144701.php @@ -18,7 +18,9 @@ class Version1008Date20230921144701 extends SimpleMigrationStep { - public function __construct(private IDBConnection $connection) { + public function __construct( + private IDBConnection $connection, + ) { } public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { diff --git a/apps/user_status/tests/bootstrap.php b/apps/user_status/tests/bootstrap.php index 6abfa6019438d..c24f86c7cbeab 100644 --- a/apps/user_status/tests/bootstrap.php +++ b/apps/user_status/tests/bootstrap.php @@ -10,7 +10,7 @@ define('PHPUNIT_RUN', 1); } -require_once __DIR__.'/../../../lib/base.php'; +require_once __DIR__ . '/../../../lib/base.php'; \OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true); diff --git a/apps/weather_status/lib/Service/WeatherStatusService.php b/apps/weather_status/lib/Service/WeatherStatusService.php index 1ffb3e5cff26a..9d9972e84efc9 100644 --- a/apps/weather_status/lib/Service/WeatherStatusService.php +++ b/apps/weather_status/lib/Service/WeatherStatusService.php @@ -49,7 +49,7 @@ public function __construct( private IUserManager $userManager, private IAppManager $appManager, private ICacheFactory $cacheFactory, - private ?string $userId + private ?string $userId, ) { $this->version = $appManager->getAppVersion(Application::APP_ID); $this->client = $clientService->newClient(); diff --git a/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php b/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php index efc9401f44f8d..c78be6e4e6b5d 100644 --- a/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php +++ b/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php @@ -81,12 +81,12 @@ protected function run($argument): void { } $statusCode = $response->getStatusCode(); if ($statusCode >= 200 && $statusCode < 300) { - $this->logger->debug('Webhook returned status code '.$statusCode, ['body' => $response->getBody()]); + $this->logger->debug('Webhook returned status code ' . $statusCode, ['body' => $response->getBody()]); } else { - $this->logger->warning('Webhook(' . $webhookId . ') returned unexpected status code '.$statusCode, ['body' => $response->getBody()]); + $this->logger->warning('Webhook(' . $webhookId . ') returned unexpected status code ' . $statusCode, ['body' => $response->getBody()]); } } catch (\Exception $e) { - $this->logger->error('Webhook(' . $webhookId . ') call failed: '.$e->getMessage(), ['exception' => $e]); + $this->logger->error('Webhook(' . $webhookId . ') call failed: ' . $e->getMessage(), ['exception' => $e]); } } } diff --git a/apps/webhook_listeners/lib/Db/WebhookListener.php b/apps/webhook_listeners/lib/Db/WebhookListener.php index fd592fda1695c..4f226a3407ca7 100644 --- a/apps/webhook_listeners/lib/Db/WebhookListener.php +++ b/apps/webhook_listeners/lib/Db/WebhookListener.php @@ -118,7 +118,7 @@ public function getAuthDataClear(): array { public function setAuthDataClear( #[\SensitiveParameter] - ?array $data + ?array $data, ): void { if ($data === null) { if ($this->getAuthMethodEnum() === AuthMethod::Header) { diff --git a/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php b/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php index c0d96891ecc2b..75456cc0b7555 100644 --- a/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php +++ b/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php @@ -256,6 +256,6 @@ public function getByUri(string $uri): array { } private function buildCacheKey(?string $userIdFilter): string { - return self::EVENTS_CACHE_KEY_PREFIX.'_'.($userIdFilter ?? ''); + return self::EVENTS_CACHE_KEY_PREFIX . '_' . ($userIdFilter ?? ''); } } diff --git a/apps/webhook_listeners/lib/Service/PHPMongoQuery.php b/apps/webhook_listeners/lib/Service/PHPMongoQuery.php index 43429ce9393de..d2668d1764487 100644 --- a/apps/webhook_listeners/lib/Service/PHPMongoQuery.php +++ b/apps/webhook_listeners/lib/Service/PHPMongoQuery.php @@ -76,7 +76,7 @@ public static function executeQuery($query, array &$document, array $options = [ */ private static function _executeQuery(array $query, array &$document, array $options = [], string $logicalOperator = '$and'): bool { if ($logicalOperator !== '$and' && (!count($query) || !isset($query[0]))) { - throw new Exception($logicalOperator.' requires nonempty array'); + throw new Exception($logicalOperator . ' requires nonempty array'); } if ($options['_debug'] && $options['_shouldLog']) { $options['logger']->debug('_executeQuery called', ['query' => $query, 'document' => $document, 'logicalOperator' => $logicalOperator]); @@ -180,7 +180,7 @@ private static function _isEqual($v, $operatorValue): bool { return in_array($operatorValue, $v); } if (is_string($operatorValue) && preg_match('/^\/(.*?)\/([a-z]*)$/i', $operatorValue, $matches)) { - return (bool)preg_match('/'.$matches[1].'/'.$matches[2], $v); + return (bool)preg_match('/' . $matches[1] . '/' . $matches[2], $v); } return $operatorValue === $v; } @@ -303,15 +303,15 @@ private static function _executeOperatorOnElement(string $operator, $operatorVal default: if (empty($options['unknownOperatorCallback']) || !is_callable($options['unknownOperatorCallback'])) { - throw new Exception('Operator '.$operator.' is unknown'); + throw new Exception('Operator ' . $operator . ' is unknown'); } $res = call_user_func($options['unknownOperatorCallback'], $operator, $operatorValue, $element, $document); if ($res === null) { - throw new Exception('Operator '.$operator.' is unknown'); + throw new Exception('Operator ' . $operator . ' is unknown'); } if (!is_bool($res)) { - throw new Exception('Return value of unknownOperatorCallback must be boolean, actual value '.$res); + throw new Exception('Return value of unknownOperatorCallback must be boolean, actual value ' . $res); } return $res; } diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php index ca81eb828dc48..e8d27c1c4ad0b 100644 --- a/apps/workflowengine/lib/Check/FileSystemTags.php +++ b/apps/workflowengine/lib/Check/FileSystemTags.php @@ -47,7 +47,7 @@ public function __construct( ISystemTagManager $systemTagManager, ISystemTagObjectMapper $systemTagObjectMapper, IUserSession $userSession, - IGroupManager $groupManager + IGroupManager $groupManager, ) { $this->l = $l; $this->systemTagManager = $systemTagManager; diff --git a/apps/workflowengine/lib/Controller/AWorkflowController.php b/apps/workflowengine/lib/Controller/AWorkflowController.php index a738d55dae82e..6863cd12ab59d 100644 --- a/apps/workflowengine/lib/Controller/AWorkflowController.php +++ b/apps/workflowengine/lib/Controller/AWorkflowController.php @@ -32,7 +32,7 @@ public function __construct( $appName, IRequest $request, Manager $manager, - LoggerInterface $logger + LoggerInterface $logger, ) { parent::__construct($appName, $request); @@ -92,7 +92,7 @@ public function create( array $checks, string $operation, string $entity, - array $events + array $events, ): DataResponse { $context = $this->getScopeContext(); try { @@ -121,7 +121,7 @@ public function update( array $checks, string $operation, string $entity, - array $events + array $events, ): DataResponse { try { $context = $this->getScopeContext(); diff --git a/apps/workflowengine/lib/Controller/UserWorkflowsController.php b/apps/workflowengine/lib/Controller/UserWorkflowsController.php index 10197a6f117fc..a615a280f322e 100644 --- a/apps/workflowengine/lib/Controller/UserWorkflowsController.php +++ b/apps/workflowengine/lib/Controller/UserWorkflowsController.php @@ -33,7 +33,7 @@ public function __construct( IRequest $request, Manager $manager, IUserSession $session, - LoggerInterface $logger + LoggerInterface $logger, ) { parent::__construct($appName, $request, $manager, $logger); diff --git a/apps/workflowengine/lib/Entity/File.php b/apps/workflowengine/lib/Entity/File.php index 25cefcd9314d7..f9234926e4d9f 100644 --- a/apps/workflowengine/lib/Entity/File.php +++ b/apps/workflowengine/lib/Entity/File.php @@ -68,7 +68,7 @@ public function __construct( ISystemTagManager $tagManager, IUserManager $userManager, UserMountCache $userMountCache, - IMountManager $mountManager + IMountManager $mountManager, ) { $this->l10n = $l10n; $this->urlGenerator = $urlGenerator; diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php index b51e85bdea785..f03f84a33c01d 100644 --- a/apps/workflowengine/lib/Manager.php +++ b/apps/workflowengine/lib/Manager.php @@ -238,7 +238,7 @@ protected function insertOperation( array $checkIds, string $operation, string $entity, - array $events + array $events, ): int { $query = $this->connection->getQueryBuilder(); $query->insert('flow_operations') @@ -273,7 +273,7 @@ public function addOperation( string $operation, ScopeContext $scope, string $entity, - array $events + array $events, ) { $this->validateOperation($class, $name, $checks, $operation, $scope, $entity, $events); @@ -342,7 +342,7 @@ public function updateOperation( string $operation, ScopeContext $scopeContext, string $entity, - array $events + array $events, ): array { if (!$this->canModify($id, $scopeContext)) { throw new \DomainException('Target operation not within scope'); diff --git a/apps/workflowengine/lib/Service/Logger.php b/apps/workflowengine/lib/Service/Logger.php index 13ac36659e569..494240bc40385 100644 --- a/apps/workflowengine/lib/Service/Logger.php +++ b/apps/workflowengine/lib/Service/Logger.php @@ -128,7 +128,7 @@ public function logEventDone(LogContext $logContext) { protected function log( string $message, array $context, - LogContext $logContext + LogContext $logContext, ): void { if (!isset($context['app'])) { $context['app'] = Application::APP_ID; diff --git a/apps/workflowengine/lib/Service/RuleMatcher.php b/apps/workflowengine/lib/Service/RuleMatcher.php index 1712b3b2a3286..467584562051f 100644 --- a/apps/workflowengine/lib/Service/RuleMatcher.php +++ b/apps/workflowengine/lib/Service/RuleMatcher.php @@ -53,7 +53,7 @@ public function __construct( IServerContainer $container, IL10N $l, Manager $manager, - Logger $logger + Logger $logger, ) { $this->session = $session; $this->manager = $manager; diff --git a/apps/workflowengine/lib/Settings/ASettings.php b/apps/workflowengine/lib/Settings/ASettings.php index 390682a2f0669..8b875db043c6d 100644 --- a/apps/workflowengine/lib/Settings/ASettings.php +++ b/apps/workflowengine/lib/Settings/ASettings.php @@ -41,7 +41,7 @@ public function __construct( Manager $manager, IInitialState $initialStateService, IConfig $config, - IURLGenerator $urlGenerator + IURLGenerator $urlGenerator, ) { $this->appName = $appName; $this->l10n = $l; diff --git a/build/integration/features/bootstrap/CalDavContext.php b/build/integration/features/bootstrap/CalDavContext.php index 11486bbbc97b1..80f8c53fc4e4a 100644 --- a/build/integration/features/bootstrap/CalDavContext.php +++ b/build/integration/features/bootstrap/CalDavContext.php @@ -41,7 +41,7 @@ public function setUpScenario() { /** @AfterScenario */ public function afterScenario() { - $davUrl = $this->baseUrl. '/remote.php/dav/calendars/admin/MyCalendar'; + $davUrl = $this->baseUrl . '/remote.php/dav/calendars/admin/MyCalendar'; try { $this->client->delete( $davUrl, @@ -266,7 +266,7 @@ public function theErrorMessageIs($message) { * @param string $name */ public function createsACalendarNamed($user, $name) { - $davUrl = $this->baseUrl . '/remote.php/dav/calendars/'.$user.'/'.$name; + $davUrl = $this->baseUrl . '/remote.php/dav/calendars/' . $user . '/' . $name; $password = ($user === 'admin') ? 'admin' : '123456'; $this->response = $this->client->request( @@ -289,7 +289,7 @@ public function createsACalendarNamed($user, $name) { * @param string $name */ public function publiclySharesTheCalendarNamed($user, $name) { - $davUrl = $this->baseUrl . '/remote.php/dav/calendars/'.$user.'/'.$name; + $davUrl = $this->baseUrl . '/remote.php/dav/calendars/' . $user . '/' . $name; $password = ($user === 'admin') ? 'admin' : '123456'; $this->response = $this->client->request( diff --git a/build/integration/features/bootstrap/CardDavContext.php b/build/integration/features/bootstrap/CardDavContext.php index 36337814e2d66..a59f0d56f9634 100644 --- a/build/integration/features/bootstrap/CardDavContext.php +++ b/build/integration/features/bootstrap/CardDavContext.php @@ -110,7 +110,7 @@ public function requestsAddressbookWithStatuscodeOnTheEndpoint($user, $addressBo * @throws \Exception */ public function createsAnAddressbookNamedWithStatuscode($user, $addressBook, $statusCode) { - $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/'.$user.'/'.$addressBook; + $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/' . $user . '/' . $addressBook; $password = ($user === 'admin') ? 'admin' : '123456'; $this->response = $this->client->request( @@ -123,7 +123,7 @@ public function createsAnAddressbookNamedWithStatuscode($user, $addressBook, $st , - ,'.$addressBook.' + ,' . $addressBook . ' ', @@ -190,7 +190,7 @@ public function theCarddavErrorMessageIs($message) { * @Given :user uploads the contact :fileName to the addressbook :addressbook */ public function uploadsTheContactToTheAddressbook($user, $fileName, $addressBook) { - $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/'.$user.'/'.$addressBook . '/' . $fileName; + $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/' . $user . '/' . $addressBook . '/' . $fileName; $password = ($user === 'admin') ? 'admin' : '123456'; $this->response = $this->client->request( @@ -223,7 +223,7 @@ public function uploadsTheContactToTheAddressbook($user, $fileName, $addressBook * @When Exporting the picture of contact :fileName from addressbook :addressBook as user :user */ public function whenExportingThePictureOfContactFromAddressbookAsUser($fileName, $addressBook, $user) { - $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/'.$user.'/'.$addressBook . '/' . $fileName . '?photo=true'; + $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/' . $user . '/' . $addressBook . '/' . $fileName . '?photo=true'; $password = ($user === 'admin') ? 'admin' : '123456'; try { @@ -249,7 +249,7 @@ public function whenExportingThePictureOfContactFromAddressbookAsUser($fileName, * @When Downloading the contact :fileName from addressbook :addressBook as user :user */ public function whenDownloadingTheContactFromAddressbookAsUser($fileName, $addressBook, $user) { - $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/'.$user.'/'.$addressBook . '/' . $fileName; + $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/' . $user . '/' . $addressBook . '/' . $fileName; $password = ($user === 'admin') ? 'admin' : '123456'; try { diff --git a/build/integration/features/bootstrap/ChecksumsContext.php b/build/integration/features/bootstrap/ChecksumsContext.php index d72e321ed7ea6..3392f8545d9dc 100644 --- a/build/integration/features/bootstrap/ChecksumsContext.php +++ b/build/integration/features/bootstrap/ChecksumsContext.php @@ -87,7 +87,7 @@ public function userUploadsFileToWithChecksum($user, $source, $destination, $che */ public function theWebdavResponseShouldHaveAStatusCode($statusCode) { if ((int)$statusCode !== $this->response->getStatusCode()) { - throw new \Exception("Expected $statusCode, got ".$this->response->getStatusCode()); + throw new \Exception("Expected $statusCode, got " . $this->response->getStatusCode()); } } @@ -131,7 +131,7 @@ public function theWebdavChecksumShouldMatch($checksum) { $checksums = $parsed[0]['value'][1]['value'][0]['value'][0]; if ($checksums['value'][0]['value'] !== $checksum) { - throw new \Exception("Expected $checksum, got ".$checksums['value'][0]['value']); + throw new \Exception("Expected $checksum, got " . $checksums['value'][0]['value']); } } @@ -159,7 +159,7 @@ public function userDownloadsTheFile($user, $path) { */ public function theHeaderChecksumShouldMatch($checksum) { if ($this->response->getHeader('OC-Checksum')[0] !== $checksum) { - throw new \Exception("Expected $checksum, got ".$this->response->getHeader('OC-Checksum')[0]); + throw new \Exception("Expected $checksum, got " . $this->response->getHeader('OC-Checksum')[0]); } } @@ -199,7 +199,7 @@ public function theWebdavChecksumShouldBeEmpty() { $status = $parsed[0]['value'][1]['value'][1]['value']; if ($status !== 'HTTP/1.1 404 Not Found') { - throw new \Exception("Expected 'HTTP/1.1 404 Not Found', got ".$status); + throw new \Exception("Expected 'HTTP/1.1 404 Not Found', got " . $status); } } @@ -208,7 +208,7 @@ public function theWebdavChecksumShouldBeEmpty() { */ public function theOcChecksumHeaderShouldNotBeThere() { if ($this->response->hasHeader('OC-Checksum')) { - throw new \Exception('Expected no checksum header but got '.$this->response->getHeader('OC-Checksum')[0]); + throw new \Exception('Expected no checksum header but got ' . $this->response->getHeader('OC-Checksum')[0]); } } } diff --git a/build/integration/features/bootstrap/FakeSMTPHelper.php b/build/integration/features/bootstrap/FakeSMTPHelper.php index 2d90494b82c23..caf2139faab5d 100644 --- a/build/integration/features/bootstrap/FakeSMTPHelper.php +++ b/build/integration/features/bootstrap/FakeSMTPHelper.php @@ -34,7 +34,7 @@ public function receive() { $hasValidTo = false; $receivingData = false; $header = true; - $this->reply('220 '.$this->serverHello); + $this->reply('220 ' . $this->serverHello); $this->mail['ipaddress'] = $this->detectIP(); while ($data = fgets($this->fd)) { $data = preg_replace('@\r\n@', "\n", $data); @@ -60,7 +60,7 @@ public function receive() { $this->reply('250 2.1.5 Ok'); $hasValidTo = true; } else { - $this->reply('501 5.1.3 Bad recipient address syntax '.$match[1]); + $this->reply('501 5.1.3 Bad recipient address syntax ' . $match[1]); } } } elseif (!$receivingData && preg_match('/^RSET$/i', trim($data))) { @@ -70,7 +70,7 @@ public function receive() { } elseif (!$receivingData && preg_match('/^NOOP$/i', trim($data))) { $this->reply('250 2.0.0 Ok'); } elseif (!$receivingData && preg_match('/^VRFY (.*)/i', trim($data), $match)) { - $this->reply('250 2.0.0 '.$match[1]); + $this->reply('250 2.0.0 ' . $match[1]); } elseif (!$receivingData && preg_match('/^DATA/i', trim($data))) { if (!$hasValidTo) { $this->reply('503 5.5.1 Error: need RCPT command'); @@ -79,7 +79,7 @@ public function receive() { $receivingData = true; } } elseif (!$receivingData && preg_match('/^(HELO|EHLO)/i', $data)) { - $this->reply('250 HELO '.$this->mail['ipaddress']); + $this->reply('250 HELO ' . $this->mail['ipaddress']); } elseif (!$receivingData && preg_match('/^QUIT/i', trim($data))) { break; } elseif (!$receivingData) { @@ -88,7 +88,7 @@ public function receive() { } elseif ($receivingData && $data == ".\n") { /* Email Received, now let's look at it */ $receivingData = false; - $this->reply('250 2.0.0 Ok: queued as '.$this->generateRandom(10)); + $this->reply('250 2.0.0 Ok: queued as ' . $this->generateRandom(10)); $splitmail = explode("\n\n", $this->mail['rawEmail'], 2); if (count($splitmail) == 2) { $this->mail['emailHeaders'] = $splitmail[0]; @@ -109,14 +109,14 @@ public function receive() { } } /* Say good bye */ - $this->reply('221 2.0.0 Bye '.$this->mail['ipaddress']); + $this->reply('221 2.0.0 Bye ' . $this->mail['ipaddress']); fclose($this->fd); } public function log($s) { if ($this->logFile) { - file_put_contents($this->logFile, trim($s)."\n", FILE_APPEND); + file_put_contents($this->logFile, trim($s) . "\n", FILE_APPEND); } } diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index 803099c9c5971..6c0c1767e73bf 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -74,7 +74,7 @@ public function makeDavRequest($user, $method, $path, $headers, $body = null, $t } elseif ($type === 'uploads') { $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath . "$path"; } else { - $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath . '/' . $type . "$path"; + $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath . '/' . $type . "$path"; } $client = new GClient(); $options = [ @@ -197,7 +197,7 @@ public function downloadedContentShouldBe($content) { */ public function checkPropForFile($file, $prefix, $prop, $value) { $elementList = $this->propfindFile($this->currentUser, $file, "<$prefix:$prop/>"); - $property = $elementList['/'.$this->getDavFilesPath($this->currentUser).$file][200]["{DAV:}$prop"]; + $property = $elementList['/' . $this->getDavFilesPath($this->currentUser) . $file][200]["{DAV:}$prop"]; Assert::assertEquals($property, $value); } @@ -563,7 +563,7 @@ public function makeSabrePath($user, $path, $type = 'files') { if ($type === 'files') { return $this->encodePath($this->getDavFilesPath($user) . $path); } else { - return $this->encodePath($this->davPath . '/' . $type . '/' . $user . '/' . $path); + return $this->encodePath($this->davPath . '/' . $type . '/' . $user . '/' . $path); } } @@ -705,28 +705,28 @@ public function userUploadsBulkedFiles($user, $name1, $content1, $name2, $conten $boundary = 'boundary_azertyuiop'; $body = ''; - $body .= '--'.$boundary."\r\n"; - $body .= 'X-File-Path: '.$name1."\r\n"; + $body .= '--' . $boundary . "\r\n"; + $body .= 'X-File-Path: ' . $name1 . "\r\n"; $body .= "X-File-MD5: f6a6263167c92de8644ac998b3c4e4d1\r\n"; $body .= "X-OC-Mtime: 1111111111\r\n"; - $body .= 'Content-Length: '.strlen($content1)."\r\n"; + $body .= 'Content-Length: ' . strlen($content1) . "\r\n"; $body .= "\r\n"; - $body .= $content1."\r\n"; - $body .= '--'.$boundary."\r\n"; - $body .= 'X-File-Path: '.$name2."\r\n"; + $body .= $content1 . "\r\n"; + $body .= '--' . $boundary . "\r\n"; + $body .= 'X-File-Path: ' . $name2 . "\r\n"; $body .= "X-File-MD5: 87c7d4068be07d390a1fffd21bf1e944\r\n"; $body .= "X-OC-Mtime: 2222222222\r\n"; - $body .= 'Content-Length: '.strlen($content2)."\r\n"; + $body .= 'Content-Length: ' . strlen($content2) . "\r\n"; $body .= "\r\n"; - $body .= $content2."\r\n"; - $body .= '--'.$boundary."\r\n"; - $body .= 'X-File-Path: '.$name3."\r\n"; + $body .= $content2 . "\r\n"; + $body .= '--' . $boundary . "\r\n"; + $body .= 'X-File-Path: ' . $name3 . "\r\n"; $body .= "X-File-MD5: e86a1cf0678099986a901c79086f5617\r\n"; $body .= "X-File-Mtime: 3333333333\r\n"; - $body .= 'Content-Length: '.strlen($content3)."\r\n"; + $body .= 'Content-Length: ' . strlen($content3) . "\r\n"; $body .= "\r\n"; - $body .= $content3."\r\n"; - $body .= '--'.$boundary."--\r\n"; + $body .= $content3 . "\r\n"; + $body .= '--' . $boundary . "--\r\n"; $stream = fopen('php://temp', 'r+'); fwrite($stream, $body); @@ -736,7 +736,7 @@ public function userUploadsBulkedFiles($user, $name1, $content1, $name2, $conten $options = [ 'auth' => [$user, $this->regularUser], 'headers' => [ - 'Content-Type' => 'multipart/related; boundary='.$boundary, + 'Content-Type' => 'multipart/related; boundary=' . $boundary, 'Content-Length' => (string)strlen($body), ], 'body' => $body diff --git a/build/license.php b/build/license.php index 6737caa8eec7e..b21f5b263fc65 100644 --- a/build/license.php +++ b/build/license.php @@ -119,10 +119,10 @@ public function writeAuthorsFile() { … '; $authors = implode(PHP_EOL, array_map(function ($author) { - return ' - '.$author; + return ' - ' . $author; }, $this->authors)); $template = str_replace('@AUTHORS@', $authors, $template); - file_put_contents(__DIR__.'/../AUTHORS', $template); + file_put_contents(__DIR__ . '/../AUTHORS', $template); } public function handleFile($path, $gitRoot) { @@ -422,7 +422,7 @@ private function checkCoreMailMap($author) { private function fixInvalidEmail($author) { preg_match('/<(.*)>/', $author, $mailMatch); if (count($mailMatch) === 2 && !filter_var($mailMatch[1], FILTER_VALIDATE_EMAIL)) { - $author = str_replace('<'.$mailMatch[1].'>', '"'.$mailMatch[1].'"', $author); + $author = str_replace('<' . $mailMatch[1] . '>', '"' . $mailMatch[1] . '"', $author); } return $author; } diff --git a/core/Command/Background/JobBase.php b/core/Command/Background/JobBase.php index 7229d7589eea7..d92bb77d4b6fb 100644 --- a/core/Command/Background/JobBase.php +++ b/core/Command/Background/JobBase.php @@ -19,7 +19,7 @@ abstract class JobBase extends \OC\Core\Command\Base { public function __construct( protected IJobList $jobList, - protected LoggerInterface $logger + protected LoggerInterface $logger, ) { parent::__construct(); } diff --git a/core/Command/Background/ListCommand.php b/core/Command/Background/ListCommand.php index 005f041857975..c8efbfef5c722 100644 --- a/core/Command/Background/ListCommand.php +++ b/core/Command/Background/ListCommand.php @@ -53,7 +53,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $jobsInfo = $this->formatJobs($this->jobList->getJobsIterator($input->getOption('class'), $limit, (int)$input->getOption('offset'))); $this->writeTableInOutputFormat($input, $output, $jobsInfo); if ($input->getOption('output') === self::OUTPUT_FORMAT_PLAIN && count($jobsInfo) >= $limit) { - $output->writeln("\nOutput is currently limited to " . $limit . ' jobs. Specify `-l, --limit[=LIMIT]` to override.'); + $output->writeln("\nOutput is currently limited to " . $limit . ' jobs. Specify `-l, --limit[=LIMIT]` to override.'); } return 0; } diff --git a/core/Command/Config/Import.php b/core/Command/Config/Import.php index 9974b11e19c97..b58abec33908a 100644 --- a/core/Command/Config/Import.php +++ b/core/Command/Config/Import.php @@ -49,7 +49,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int try { $configs = $this->validateFileContent($content); } catch (\UnexpectedValueException $e) { - $output->writeln('' . $e->getMessage(). ''); + $output->writeln('' . $e->getMessage() . ''); return 1; } diff --git a/core/Command/Db/ConvertType.php b/core/Command/Db/ConvertType.php index 031d5a83d121f..43b2d62a90013 100644 --- a/core/Command/Db/ConvertType.php +++ b/core/Command/Db/ConvertType.php @@ -215,7 +215,7 @@ protected function createSchema(Connection $fromDB, Connection $toDB, InputInter $apps = $input->getOption('all-apps') ? \OC_App::getAllApps() : \OC_App::getEnabledApps(); foreach ($apps as $app) { - $output->writeln(' - '.$app.''); + $output->writeln(' - ' . $app . ''); // Make sure autoloading works... \OC_App::loadApp($app); $fromMS = new MigrationService($app, $fromDB); @@ -404,7 +404,7 @@ protected function convertDB(Connection $fromDB, Connection $toDB, array $tables try { // copy table rows foreach ($tables as $table) { - $output->writeln(' - '.$table.''); + $output->writeln(' - ' . $table . ''); $this->copyTable($fromDB, $toDB, $schema->getTable($table), $input, $output); } if ($input->getArgument('type') === 'pgsql') { @@ -427,7 +427,7 @@ protected function saveDBInfo(InputInterface $input) { $dbName = $input->getArgument('database'); $password = $input->getOption('password'); if ($input->getOption('port')) { - $dbHost .= ':'.$input->getOption('port'); + $dbHost .= ':' . $input->getOption('port'); } $this->config->setSystemValues([ diff --git a/core/Command/Info/File.php b/core/Command/Info/File.php index 76fbd38712c2b..2a557b6768ee9 100644 --- a/core/Command/Info/File.php +++ b/core/Command/Info/File.php @@ -33,7 +33,7 @@ class File extends Command { public function __construct( IFactory $l10nFactory, private FileUtils $fileUtils, - private \OC\Encryption\Util $encryptionUtil + private \OC\Encryption\Util $encryptionUtil, ) { $this->l10n = $l10nFactory->get('core'); parent::__construct(); @@ -85,7 +85,7 @@ public function execute(InputInterface $input, OutputInterface $output): int { return $node->getSize(); }, $children)); if ($childSize != $node->getSize()) { - $output->writeln(' warning: folder has a size of ' . Util::humanFileSize($node->getSize()) ." but it's children sum up to " . Util::humanFileSize($childSize) . '.'); + $output->writeln(' warning: folder has a size of ' . Util::humanFileSize($node->getSize()) . " but it's children sum up to " . Util::humanFileSize($childSize) . '.'); $output->writeln(' Run occ files:scan --path ' . $node->getPath() . ' to attempt to resolve this.'); } if ($showChildren) { @@ -164,10 +164,10 @@ private function outputStorageDetails(IMountPoint $mountPoint, Node $node, Input } if ($input->getOption('storage-tree')) { $storageTmp = $storage; - $storageClass = get_class($storageTmp).' (cache:'.get_class($storageTmp->getCache()).')'; + $storageClass = get_class($storageTmp) . ' (cache:' . get_class($storageTmp->getCache()) . ')'; while ($storageTmp instanceof \OC\Files\Storage\Wrapper\Wrapper) { $storageTmp = $storageTmp->getWrapperStorage(); - $storageClass .= "\n\t".'> '.get_class($storageTmp).' (cache:'.get_class($storageTmp->getCache()).')'; + $storageClass .= "\n\t" . '> ' . get_class($storageTmp) . ' (cache:' . get_class($storageTmp->getCache()) . ')'; } $output->writeln(' storage wrapping: ' . $storageClass); } diff --git a/core/Command/Integrity/SignApp.php b/core/Command/Integrity/SignApp.php index 6df8466238888..d307bc589859c 100644 --- a/core/Command/Integrity/SignApp.php +++ b/core/Command/Integrity/SignApp.php @@ -51,7 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $documentationUrl = $this->urlGenerator->linkToDocs('developer-code-integrity'); $output->writeln('This command requires the --path, --privateKey and --certificate.'); $output->writeln('Example: ./occ integrity:sign-app --path="/Users/lukasreschke/Programming/myapp/" --privateKey="/Users/lukasreschke/private/myapp.key" --certificate="/Users/lukasreschke/public/mycert.crt"'); - $output->writeln('For more information please consult the documentation: '. $documentationUrl); + $output->writeln('For more information please consult the documentation: ' . $documentationUrl); return 1; } @@ -75,7 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $x509->setPrivateKey($rsa); try { $this->checker->writeAppSignature($path, $x509, $rsa); - $output->writeln('Successfully signed "'.$path.'"'); + $output->writeln('Successfully signed "' . $path . '"'); } catch (\Exception $e) { $output->writeln('Error: ' . $e->getMessage()); return 1; diff --git a/core/Command/L10n/CreateJs.php b/core/Command/L10n/CreateJs.php index 7d45fbe91f891..64a21e6d48c31 100644 --- a/core/Command/L10n/CreateJs.php +++ b/core/Command/L10n/CreateJs.php @@ -153,7 +153,7 @@ public function completeArgumentValues($argumentName, CompletionContext $context $appName = $context->getWordAtIndex($context->getWordIndex() - 1); try { return $this->getAllLanguages($this->appManager->getAppPath($appName)); - } catch(AppPathNotFoundException) { + } catch (AppPathNotFoundException) { return []; } } diff --git a/core/Command/Log/File.php b/core/Command/Log/File.php index e04d19f51cf36..8b4a38db61159 100644 --- a/core/Command/Log/File.php +++ b/core/Command/Log/File.php @@ -79,11 +79,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int } else { $enabledText = 'disabled'; } - $output->writeln('Log backend file: '.$enabledText); + $output->writeln('Log backend file: ' . $enabledText); - $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data'); - $defaultLogFile = rtrim($dataDir, '/').'/nextcloud.log'; - $output->writeln('Log file: '.$this->config->getSystemValue('logfile', $defaultLogFile)); + $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); + $defaultLogFile = rtrim($dataDir, '/') . '/nextcloud.log'; + $output->writeln('Log file: ' . $this->config->getSystemValue('logfile', $defaultLogFile)); $rotateSize = $this->config->getSystemValue('log_rotate_size', 100 * 1024 * 1024); if ($rotateSize) { @@ -91,7 +91,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } else { $rotateString = 'disabled'; } - $output->writeln('Rotate at: '.$rotateString); + $output->writeln('Rotate at: ' . $rotateString); return 0; } diff --git a/core/Command/Log/Manage.php b/core/Command/Log/Manage.php index e68720a1280c1..f67f0d969f633 100644 --- a/core/Command/Log/Manage.php +++ b/core/Command/Log/Manage.php @@ -84,14 +84,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int // display configuration $backend = $this->config->getSystemValue('log_type', self::DEFAULT_BACKEND); - $output->writeln('Enabled logging backend: '.$backend); + $output->writeln('Enabled logging backend: ' . $backend); $levelNum = $this->config->getSystemValue('loglevel', self::DEFAULT_LOG_LEVEL); $level = $this->convertLevelNumber($levelNum); - $output->writeln('Log level: '.$level.' ('.$levelNum.')'); + $output->writeln('Log level: ' . $level . ' (' . $levelNum . ')'); $timezone = $this->config->getSystemValue('logtimezone', self::DEFAULT_TIMEZONE); - $output->writeln('Log timezone: '.$timezone); + $output->writeln('Log timezone: ' . $timezone); return 0; } @@ -100,7 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int * @throws \InvalidArgumentException */ protected function validateBackend($backend) { - if (!class_exists('OC\\Log\\'.ucfirst($backend))) { + if (!class_exists('OC\\Log\\' . ucfirst($backend))) { throw new \InvalidArgumentException('Invalid backend'); } } diff --git a/core/Command/Maintenance/Install.php b/core/Command/Maintenance/Install.php index a954beb406d00..31f6d1cd79d3f 100644 --- a/core/Command/Maintenance/Install.php +++ b/core/Command/Maintenance/Install.php @@ -46,7 +46,7 @@ protected function configure(): void { ->addOption('admin-user', null, InputOption::VALUE_REQUIRED, 'Login of the admin account', 'admin') ->addOption('admin-pass', null, InputOption::VALUE_REQUIRED, 'Password of the admin account') ->addOption('admin-email', null, InputOption::VALUE_OPTIONAL, 'E-Mail of the admin account') - ->addOption('data-dir', null, InputOption::VALUE_REQUIRED, 'Path to data directory', \OC::$SERVERROOT.'/data'); + ->addOption('data-dir', null, InputOption::VALUE_REQUIRED, 'Path to data directory', \OC::$SERVERROOT . '/data'); } protected function execute(InputInterface $input, OutputInterface $output): int { @@ -134,7 +134,7 @@ protected function validateInput(InputInterface $input, OutputInterface $output, if (is_null($dbPass)) { /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); - $question = new Question('What is the password to access the database with user <'.$dbUser.'>?'); + $question = new Question('What is the password to access the database with user <' . $dbUser . '>?'); $question->setHidden(true); $question->setHiddenFallback(false); $dbPass = $helper->ask($input, $output, $question); @@ -144,7 +144,7 @@ protected function validateInput(InputInterface $input, OutputInterface $output, if (is_null($adminPassword)) { /** @var QuestionHelper $helper */ $helper = $this->getHelper('question'); - $question = new Question('What is the password you like to use for the admin account <'.$adminLogin.'>?'); + $question = new Question('What is the password you like to use for the admin account <' . $adminLogin . '>?'); $question->setHidden(true); $question->setHiddenFallback(false); $adminPassword = $helper->ask($input, $output, $question); diff --git a/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php b/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php index 1a6c39334615b..283809a903184 100644 --- a/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php +++ b/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php @@ -22,7 +22,7 @@ public function generateFile(array $aliases): string { }, ARRAY_FILTER_USE_KEY); // Fetch all files - $dir = new \DirectoryIterator(\OC::$SERVERROOT.'/core/img/filetypes'); + $dir = new \DirectoryIterator(\OC::$SERVERROOT . '/core/img/filetypes'); $files = []; foreach ($dir as $fileInfo) { @@ -38,7 +38,7 @@ public function generateFile(array $aliases): string { // Fetch all themes! $themes = []; - $dirs = new \DirectoryIterator(\OC::$SERVERROOT.'/themes/'); + $dirs = new \DirectoryIterator(\OC::$SERVERROOT . '/themes/'); foreach ($dirs as $dir) { //Valid theme dir if ($dir->isFile() || $dir->isDot()) { diff --git a/core/Command/Maintenance/Mimetype/UpdateDB.php b/core/Command/Maintenance/Mimetype/UpdateDB.php index fd448cf862a30..9ba535ef658c3 100644 --- a/core/Command/Maintenance/Mimetype/UpdateDB.php +++ b/core/Command/Maintenance/Mimetype/UpdateDB.php @@ -55,21 +55,21 @@ protected function execute(InputInterface $input, OutputInterface $output): int $mimetypeId = $this->mimetypeLoader->getId($mimetype); if (!$existing) { - $output->writeln('Added mimetype "'.$mimetype.'" to database'); + $output->writeln('Added mimetype "' . $mimetype . '" to database'); $totalNewMimetypes++; } if (!$existing || $input->getOption('repair-filecache')) { $touchedFilecacheRows = $this->mimetypeLoader->updateFilecache($ext, $mimetypeId); if ($touchedFilecacheRows > 0) { - $output->writeln('Updated '.$touchedFilecacheRows.' filecache rows for mimetype "'.$mimetype.'"'); + $output->writeln('Updated ' . $touchedFilecacheRows . ' filecache rows for mimetype "' . $mimetype . '"'); } $totalFilecacheUpdates += $touchedFilecacheRows; } } - $output->writeln('Added '.$totalNewMimetypes.' new mimetypes'); - $output->writeln('Updated '.$totalFilecacheUpdates.' filecache rows'); + $output->writeln('Added ' . $totalNewMimetypes . ' new mimetypes'); + $output->writeln('Updated ' . $totalFilecacheUpdates . ' filecache rows'); return 0; } } diff --git a/core/Command/Maintenance/Mimetype/UpdateJS.php b/core/Command/Maintenance/Mimetype/UpdateJS.php index a1559024f2e67..35633f1635546 100644 --- a/core/Command/Maintenance/Mimetype/UpdateJS.php +++ b/core/Command/Maintenance/Mimetype/UpdateJS.php @@ -32,7 +32,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int // Output the JS $generatedMimetypeFile = new GenerateMimetypeFileBuilder(); - file_put_contents(\OC::$SERVERROOT.'/core/js/mimetypelist.js', $generatedMimetypeFile->generateFile($aliases)); + file_put_contents(\OC::$SERVERROOT . '/core/js/mimetypelist.js', $generatedMimetypeFile->generateFile($aliases)); $output->writeln('mimetypelist.js is updated'); return 0; diff --git a/core/Command/SetupChecks.php b/core/Command/SetupChecks.php index fda463b8f6d1a..60517e224b320 100644 --- a/core/Command/SetupChecks.php +++ b/core/Command/SetupChecks.php @@ -61,11 +61,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int $description = $this->richTextFormatter->richToParsed($description, $descriptionParameters); } $output->writeln( - "\t\t". - ($styleTag !== null ? "<{$styleTag}>" : ''). - "{$emoji} ". - ($check->getName() ?? $check::class). - ($description !== null ? ': '.$description : ''). + "\t\t" . + ($styleTag !== null ? "<{$styleTag}>" : '') . + "{$emoji} " . + ($check->getName() ?? $check::class) . + ($description !== null ? ': ' . $description : '') . ($styleTag !== null ? "" : ''), $verbosity ); diff --git a/core/Command/SystemTag/Add.php b/core/Command/SystemTag/Add.php index 9d8f7ae05e428..92ed42c37bccf 100644 --- a/core/Command/SystemTag/Add.php +++ b/core/Command/SystemTag/Add.php @@ -73,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int ]); return 0; } catch (TagAlreadyExistsException $e) { - $output->writeln(''.$e->getMessage().''); + $output->writeln('' . $e->getMessage() . ''); return 2; } } diff --git a/core/Command/SystemTag/Edit.php b/core/Command/SystemTag/Edit.php index 7ac74cbc53a8b..eb6412b763991 100644 --- a/core/Command/SystemTag/Edit.php +++ b/core/Command/SystemTag/Edit.php @@ -82,13 +82,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int try { $this->systemTagManager->updateTag($input->getArgument('id'), $name, $userVisible, $userAssignable); - $output->writeln('Tag updated ("' . $name . '", '. $userVisible . ', ' . $userAssignable . ')'); + $output->writeln('Tag updated ("' . $name . '", ' . $userVisible . ', ' . $userAssignable . ')'); return 0; } catch (TagNotFoundException $e) { $output->writeln('Tag not found'); return 1; } catch (TagAlreadyExistsException $e) { - $output->writeln(''.$e->getMessage().''); + $output->writeln('' . $e->getMessage() . ''); return 2; } } diff --git a/core/Command/Upgrade.php b/core/Command/Upgrade.php index 7b1526766f345..a9ed4cf2fd1be 100644 --- a/core/Command/Upgrade.php +++ b/core/Command/Upgrade.php @@ -35,7 +35,7 @@ class Upgrade extends Command { public const ERROR_FAILURE = 5; public function __construct( - private IConfig $config + private IConfig $config, ) { parent::__construct(); } diff --git a/core/Command/User/AuthTokens/Add.php b/core/Command/User/AuthTokens/Add.php index 43386b7709a94..ad4bf732bd008 100644 --- a/core/Command/User/AuthTokens/Add.php +++ b/core/Command/User/AuthTokens/Add.php @@ -81,7 +81,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln('No password provided. The generated app password will therefore have limited capabilities. Any operation that requires the login password will fail.'); } - $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS); + $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); $generatedToken = $this->tokenProvider->generateToken( $token, $user->getUID(), diff --git a/core/Command/User/SyncAccountDataCommand.php b/core/Command/User/SyncAccountDataCommand.php index e8fcccdaa28f7..640b66581e1f3 100644 --- a/core/Command/User/SyncAccountDataCommand.php +++ b/core/Command/User/SyncAccountDataCommand.php @@ -21,7 +21,7 @@ class SyncAccountDataCommand extends Base { public function __construct( IUserManager $userManager, - IAccountManager $accountManager + IAccountManager $accountManager, ) { $this->userManager = $userManager; $this->accountManager = $accountManager; diff --git a/core/Command/User/Welcome.php b/core/Command/User/Welcome.php index ba1c88a26c5bf..c383811f982cc 100644 --- a/core/Command/User/Welcome.php +++ b/core/Command/User/Welcome.php @@ -27,7 +27,7 @@ class Welcome extends Base { */ public function __construct( IUserManager $userManager, - NewUserMailHelper $newUserMailHelper + NewUserMailHelper $newUserMailHelper, ) { parent::__construct(); diff --git a/core/Controller/AppPasswordController.php b/core/Controller/AppPasswordController.php index 7cab4c5380b18..b43f0077507d3 100644 --- a/core/Controller/AppPasswordController.php +++ b/core/Controller/AppPasswordController.php @@ -78,7 +78,7 @@ public function getAppPassword(): DataResponse { $userAgent = $this->request->getHeader('USER_AGENT'); - $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS); + $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); $generatedToken = $this->tokenProvider->generateToken( $token, @@ -149,7 +149,7 @@ public function rotateAppPassword(): DataResponse { throw new OCSForbiddenException('could not rotate apptoken'); } - $newToken = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS); + $newToken = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); $this->tokenProvider->rotate($token, $appPassword, $newToken); return new DataResponse([ diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php index a7205abc0fc2c..93eec8921fe56 100644 --- a/core/Controller/ClientFlowLoginController.php +++ b/core/Controller/ClientFlowLoginController.php @@ -118,7 +118,7 @@ public function showAuthPickerPage(string $clientIdentifier = '', string $user = $stateToken = $this->random->generate( 64, - ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS + ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS ); $this->session->set(self::STATE_NAME, $stateToken); @@ -247,7 +247,7 @@ public function generateAppPassword(string $stateToken, $clientName = $client->getName(); } - $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS); + $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); $uid = $this->userSession->getUser()->getUID(); $generatedToken = $this->tokenProvider->generateToken( $token, @@ -260,7 +260,7 @@ public function generateAppPassword(string $stateToken, ); if ($client) { - $code = $this->random->generate(128, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS); + $code = $this->random->generate(128, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); $accessToken = new AccessToken(); $accessToken->setClientId($client->getId()); $accessToken->setEncryptedToken($this->crypto->encrypt($token, $code)); diff --git a/core/Controller/ClientFlowLoginV2Controller.php b/core/Controller/ClientFlowLoginV2Controller.php index e6e1c282d2b6b..43eac012be1a0 100644 --- a/core/Controller/ClientFlowLoginV2Controller.php +++ b/core/Controller/ClientFlowLoginV2Controller.php @@ -110,7 +110,7 @@ public function showAuthPickerPage(string $user = '', int $direct = 0): Standalo $stateToken = $this->random->generate( 64, - ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS + ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS ); $this->session->set(self::STATE_NAME, $stateToken); diff --git a/core/Controller/CssController.php b/core/Controller/CssController.php index 345b70fe2d332..37e7edc530ff5 100644 --- a/core/Controller/CssController.php +++ b/core/Controller/CssController.php @@ -65,11 +65,11 @@ public function getCss(string $fileName, string $appName): Response { } $ttl = 31536000; - $response->addHeader('Cache-Control', 'max-age='.$ttl.', immutable'); + $response->addHeader('Cache-Control', 'max-age=' . $ttl . ', immutable'); $expires = new \DateTime(); $expires->setTimestamp($this->timeFactory->getTime()); - $expires->add(new \DateInterval('PT'.$ttl.'S')); + $expires->add(new \DateInterval('PT' . $ttl . 'S')); $response->addHeader('Expires', $expires->format(\DateTime::RFC1123)); return $response; } diff --git a/core/Controller/JsController.php b/core/Controller/JsController.php index f5fe381688d51..5754c554e5046 100644 --- a/core/Controller/JsController.php +++ b/core/Controller/JsController.php @@ -65,11 +65,11 @@ public function getJs(string $fileName, string $appName): Response { } $ttl = 31536000; - $response->addHeader('Cache-Control', 'max-age='.$ttl.', immutable'); + $response->addHeader('Cache-Control', 'max-age=' . $ttl . ', immutable'); $expires = new \DateTime(); $expires->setTimestamp($this->timeFactory->getTime()); - $expires->add(new \DateInterval('PT'.$ttl.'S')); + $expires->add(new \DateInterval('PT' . $ttl . 'S')); $response->addHeader('Expires', $expires->format(\DateTime::RFC1123)); return $response; } diff --git a/core/Controller/OCMController.php b/core/Controller/OCMController.php index d79b5b1669e43..b53dc08fecf32 100644 --- a/core/Controller/OCMController.php +++ b/core/Controller/OCMController.php @@ -32,7 +32,7 @@ class OCMController extends Controller { public function __construct( IRequest $request, private IConfig $config, - private LoggerInterface $logger + private LoggerInterface $logger, ) { parent::__construct('core', $request); } diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php index e5f92eed1a980..eb78d74dd4e0f 100644 --- a/core/Controller/SetupController.php +++ b/core/Controller/SetupController.php @@ -18,7 +18,7 @@ public function __construct( protected Setup $setupHelper, protected LoggerInterface $logger, ) { - $this->autoConfigFile = \OC::$configDir.'autoconfig.php'; + $this->autoConfigFile = \OC::$configDir . 'autoconfig.php'; } public function run(array $post): void { diff --git a/core/Controller/TaskProcessingApiController.php b/core/Controller/TaskProcessingApiController.php index b459143aa7edc..cc685d34bf048 100644 --- a/core/Controller/TaskProcessingApiController.php +++ b/core/Controller/TaskProcessingApiController.php @@ -121,7 +121,7 @@ public function taskTypes(): DataResponse { #[ApiRoute(verb: 'POST', url: '/schedule', root: '/taskprocessing')] public function schedule( array $input, string $type, string $appId, string $customId = '', - ?string $webhookUri = null, ?string $webhookMethod = null + ?string $webhookUri = null, ?string $webhookMethod = null, ): DataResponse { $task = new Task($type, $input, $appId, $this->userId, $customId); $task->setWebhookUri($webhookUri); diff --git a/core/Listener/BeforeMessageLoggedEventListener.php b/core/Listener/BeforeMessageLoggedEventListener.php index ef771ca0a81bd..9010f7755eb4c 100644 --- a/core/Listener/BeforeMessageLoggedEventListener.php +++ b/core/Listener/BeforeMessageLoggedEventListener.php @@ -40,11 +40,11 @@ public function handle(Event $event): void { 2 => '[warning]', 3 => '[error]', 4 => '[fatal]', - default => '['.$event->getLevel().']', + default => '[' . $event->getLevel() . ']', } - .' ['.$event->getApp().'] ' - .$event->getMessage()['message'] - ."\n"; + . ' [' . $event->getApp() . '] ' + . $event->getMessage()['message'] + . "\n"; } /** @@ -55,10 +55,10 @@ public static function setup(): void { $argv = $_SERVER['argv']; $level = 0; foreach ($argv as $key => $arg) { - if ($arg === '--'.ReservedOptions::DEBUG_LOG) { + if ($arg === '--' . ReservedOptions::DEBUG_LOG) { unset($argv[$key]); - } elseif (str_starts_with($arg, '--'.ReservedOptions::DEBUG_LOG_LEVEL.'=')) { - $level = (int)substr($arg, strlen('--'.ReservedOptions::DEBUG_LOG_LEVEL.'=')); + } elseif (str_starts_with($arg, '--' . ReservedOptions::DEBUG_LOG_LEVEL . '=')) { + $level = (int)substr($arg, strlen('--' . ReservedOptions::DEBUG_LOG_LEVEL . '=')); unset($argv[$key]); } } diff --git a/core/Service/LoginFlowV2Service.php b/core/Service/LoginFlowV2Service.php index 89c89f50b3ec1..e67a602e7b5e6 100644 --- a/core/Service/LoginFlowV2Service.php +++ b/core/Service/LoginFlowV2Service.php @@ -126,7 +126,7 @@ public function flowDone(string $loginToken, string $sessionId, string $server, return false; } - $appPassword = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS); + $appPassword = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); $this->tokenProvider->generateToken( $appPassword, $userId, @@ -166,8 +166,8 @@ public function flowDoneWithAppPassword(string $loginToken, string $server, stri public function createTokens(string $userAgent): LoginFlowV2Tokens { $flow = new LoginFlowV2(); - $pollToken = $this->random->generate(128, ISecureRandom::CHAR_DIGITS.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER); - $loginToken = $this->random->generate(128, ISecureRandom::CHAR_DIGITS.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER); + $pollToken = $this->random->generate(128, ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER); + $loginToken = $this->random->generate(128, ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER); $flow->setPollToken($this->hashToken($pollToken)); $flow->setLoginToken($loginToken); $flow->setStarted(0); diff --git a/core/templates/installation.php b/core/templates/installation.php index 5343464edbc78..d03bc3cb174d3 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -67,7 +67,7 @@
diff --git a/core/templates/layout.public.php b/core/templates/layout.public.php index d3c558ec04fbb..e2ed47d071662 100644 --- a/core/templates/layout.public.php +++ b/core/templates/layout.public.php @@ -10,7 +10,7 @@ <?php - p(!empty($_['application']) ? $_['application'].' - ' : ''); + p(!empty($_['application']) ? $_['application'] . ' - ' : ''); p($theme->getTitle()); ?> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index f820a2f3ace47..fc0f3af2d090c 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -24,8 +24,8 @@ <?php - p(!empty($_['pageTitle']) && $_['pageTitle'] !== $_['application'] ? $_['pageTitle'].' - ' : ''); -p(!empty($_['application']) ? $_['application'].' - ' : ''); + p(!empty($_['pageTitle']) && $_['pageTitle'] !== $_['application'] ? $_['pageTitle'] . ' - ' : ''); +p(!empty($_['application']) ? $_['application'] . ' - ' : ''); p($theme->getTitle()); ?> @@ -84,7 +84,7 @@

getName()) ); ?>

diff --git a/cron.php b/cron.php index 5ff93fdf1d8c6..ebc0ca358a7a2 100644 --- a/cron.php +++ b/cron.php @@ -189,7 +189,7 @@ } if ($memoryAfter - $memoryBefore > 50_000_000) { - $message = 'Used memory grew by more than 50 MB when executing job ' . $jobDetails . ': ' . Util::humanFileSize($memoryAfter). ' (before: ' . Util::humanFileSize($memoryBefore) . ')'; + $message = 'Used memory grew by more than 50 MB when executing job ' . $jobDetails . ': ' . Util::humanFileSize($memoryAfter) . ' (before: ' . Util::humanFileSize($memoryBefore) . ')'; $logger->warning($message, ['app' => 'cron']); if ($verbose) { echo $message . PHP_EOL; diff --git a/lib/base.php b/lib/base.php index 1f9caf473e266..ec5cf3759f2b4 100644 --- a/lib/base.php +++ b/lib/base.php @@ -141,7 +141,7 @@ public static function initPaths(): void { // slash which is required by URL generation. if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] === \OC::$WEBROOT && substr($_SERVER['REQUEST_URI'], -1) !== '/') { - header('Location: '.\OC::$WEBROOT.'/'); + header('Location: ' . \OC::$WEBROOT . '/'); exit(); } } @@ -183,7 +183,7 @@ public static function checkConfig(): void { $l = Server::get(\OCP\L10N\IFactory::class)->get('lib'); // Create config if it does not already exist - $configFilePath = self::$configDir .'/config.php'; + $configFilePath = self::$configDir . '/config.php'; if (!file_exists($configFilePath)) { @touch($configFilePath); } @@ -195,11 +195,11 @@ public static function checkConfig(): void { $urlGenerator = Server::get(IURLGenerator::class); if (self::$CLI) { - echo $l->t('Cannot write into "config" directory!')."\n"; - echo $l->t('This can usually be fixed by giving the web server write access to the config directory.')."\n"; + echo $l->t('Cannot write into "config" directory!') . "\n"; + echo $l->t('This can usually be fixed by giving the web server write access to the config directory.') . "\n"; echo "\n"; - echo $l->t('But, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.')."\n"; - echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-config') ])."\n"; + echo $l->t('But, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.') . "\n"; + echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-config') ]) . "\n"; exit; } else { OC_Template::printErrorPage( @@ -568,7 +568,7 @@ public static function init(): void { try { self::initPaths(); // setup 3rdparty autoloader - $vendorAutoLoad = OC::$SERVERROOT. '/3rdparty/autoload.php'; + $vendorAutoLoad = OC::$SERVERROOT . '/3rdparty/autoload.php'; if (!file_exists($vendorAutoLoad)) { throw new \RuntimeException('Composer autoloader not found, unable to continue. Check the folder "3rdparty". Running "git submodule update --init" will initialize the git submodule that handles the subfolder "3rdparty".'); } @@ -587,7 +587,7 @@ public static function init(): void { self::$server = new \OC\Server(\OC::$WEBROOT, self::$config); self::$server->boot(); - if (self::$CLI && in_array('--'.\OCP\Console\ReservedOptions::DEBUG_LOG, $_SERVER['argv'])) { + if (self::$CLI && in_array('--' . \OCP\Console\ReservedOptions::DEBUG_LOG, $_SERVER['argv'])) { \OC\Core\Listener\BeforeMessageLoggedEventListener::setup(); } diff --git a/lib/private/Activity/ActivitySettingsAdapter.php b/lib/private/Activity/ActivitySettingsAdapter.php index 5579685ccb82f..27c85ee555456 100644 --- a/lib/private/Activity/ActivitySettingsAdapter.php +++ b/lib/private/Activity/ActivitySettingsAdapter.php @@ -19,7 +19,7 @@ class ActivitySettingsAdapter extends ActivitySettings { public function __construct( private ISetting $oldSettings, - private IL10N $l10n + private IL10N $l10n, ) { } diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php index f08e5125a478f..46b53e3c1b21d 100644 --- a/lib/private/AllConfig.php +++ b/lib/private/AllConfig.php @@ -41,7 +41,7 @@ class AllConfig implements IConfig { private CappedMemoryCache $userCache; public function __construct( - private SystemConfig $systemConfig + private SystemConfig $systemConfig, ) { $this->userCache = new CappedMemoryCache(); } diff --git a/lib/private/App/AppStore/Fetcher/AppDiscoverFetcher.php b/lib/private/App/AppStore/Fetcher/AppDiscoverFetcher.php index 1174c7d240b60..2537d1dcec906 100644 --- a/lib/private/App/AppStore/Fetcher/AppDiscoverFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppDiscoverFetcher.php @@ -81,7 +81,7 @@ public function get($allowUnstable = false) { }); } - public function getETag(): string|null { + public function getETag(): ?string { $rootFolder = $this->appData->getFolder('/'); try { diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index e7ab2f9c377be..352646c3f5ed0 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -18,7 +18,8 @@ class AppFetcher extends Fetcher { /** @var bool */ private $ignoreMaxVersion; - public function __construct(Factory $appDataFactory, + public function __construct( + Factory $appDataFactory, IClientService $clientService, ITimeFactory $timeFactory, IConfig $config, diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index f6361ff2ac68d..828d83bc67aca 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -281,7 +281,7 @@ public function getValueMixed( string $app, string $key, string $default = '', - ?bool $lazy = false + ?bool $lazy = false, ): string { try { $lazy = ($lazy === null) ? $this->isLazy($app, $key) : $lazy; @@ -316,7 +316,7 @@ public function getValueString( string $app, string $key, string $default = '', - bool $lazy = false + bool $lazy = false, ): string { return $this->getTypedValue($app, $key, $default, $lazy, self::VALUE_STRING); } @@ -339,7 +339,7 @@ public function getValueInt( string $app, string $key, int $default = 0, - bool $lazy = false + bool $lazy = false, ): int { return (int)$this->getTypedValue($app, $key, (string)$default, $lazy, self::VALUE_INT); } @@ -399,7 +399,7 @@ public function getValueArray( string $app, string $key, array $default = [], - bool $lazy = false + bool $lazy = false, ): array { try { $defaultJson = json_encode($default, JSON_THROW_ON_ERROR); @@ -427,7 +427,7 @@ private function getTypedValue( string $key, string $default, bool $lazy, - int $type + int $type, ): string { $this->assertParams($app, $key, valueType: $type); $this->loadConfig($lazy); @@ -526,7 +526,7 @@ public function setValueMixed( string $key, string $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->setTypedValue( $app, @@ -557,7 +557,7 @@ public function setValueString( string $key, string $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->setTypedValue( $app, @@ -587,7 +587,7 @@ public function setValueInt( string $key, int $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { if ($value > 2000000000) { $this->logger->debug('You are trying to store an integer value around/above 2,147,483,647. This is a reminder that reaching this theoretical limit on 32 bits system will throw an exception.'); @@ -621,7 +621,7 @@ public function setValueFloat( string $key, float $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->setTypedValue( $app, @@ -649,7 +649,7 @@ public function setValueBool( string $app, string $key, bool $value, - bool $lazy = false + bool $lazy = false, ): bool { return $this->setTypedValue( $app, @@ -680,7 +680,7 @@ public function setValueArray( string $key, array $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { try { return $this->setTypedValue( @@ -718,7 +718,7 @@ private function setTypedValue( string $key, string $value, bool $lazy, - int $type + int $type, ): bool { $this->assertParams($app, $key); $this->loadConfig($lazy); diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index 4bbeabb7aae04..d177221556c66 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -484,7 +484,7 @@ protected function getProtectedCookieName(string $name): string { $prefix = '__Host-'; } - return $prefix.$name; + return $prefix . $name; } /** @@ -606,7 +606,7 @@ public function getRemoteAddress(): string { * @return bool */ private function isOverwriteCondition(): bool { - $regex = '/' . $this->config->getSystemValueString('overwritecondaddr', '') . '/'; + $regex = '/' . $this->config->getSystemValueString('overwritecondaddr', '') . '/'; $remoteAddr = isset($this->server['REMOTE_ADDR']) ? $this->server['REMOTE_ADDR'] : ''; return $regex === '//' || preg_match($regex, $remoteAddr) === 1; } diff --git a/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php b/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php index 34291dfef100f..2b3025fccff5b 100644 --- a/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php +++ b/lib/private/AppFramework/Middleware/PublicShare/PublicShareMiddleware.php @@ -24,7 +24,7 @@ public function __construct( private IRequest $request, private ISession $session, private IConfig $config, - private IThrottler $throttler + private IThrottler $throttler, ) { } diff --git a/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php b/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php index 10c8f8c7aee99..d8f00f3109633 100644 --- a/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php @@ -40,7 +40,8 @@ class CORSMiddleware extends Middleware { /** @var IThrottler */ private $throttler; - public function __construct(IRequest $request, + public function __construct( + IRequest $request, ControllerMethodReflector $reflector, Session $session, IThrottler $throttler, @@ -135,7 +136,7 @@ public function afterController($controller, $methodName, Response $response) { foreach ($response->getHeaders() as $header => $value) { if (strtolower($header) === 'access-control-allow-credentials' && strtolower(trim($value)) === 'true') { - $msg = 'Access-Control-Allow-Credentials must not be '. + $msg = 'Access-Control-Allow-Credentials must not be ' . 'set to true in order to prevent CSRF'; throw new SecurityException($msg); } diff --git a/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php b/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php index 34933e13ecd2e..f5416ff652ad1 100644 --- a/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php @@ -44,7 +44,8 @@ class PasswordConfirmationMiddleware extends Middleware { * @param IUserSession $userSession * @param ITimeFactory $timeFactory */ - public function __construct(ControllerMethodReflector $reflector, + public function __construct( + ControllerMethodReflector $reflector, ISession $session, IUserSession $userSession, ITimeFactory $timeFactory, diff --git a/lib/private/AppFramework/Services/AppConfig.php b/lib/private/AppFramework/Services/AppConfig.php index e47bbc429d034..423a9eb5814ea 100644 --- a/lib/private/AppFramework/Services/AppConfig.php +++ b/lib/private/AppFramework/Services/AppConfig.php @@ -116,7 +116,7 @@ public function setAppValueString( string $key, string $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->appConfig->setValueString($this->appName, $key, $value, $lazy, $sensitive); } @@ -138,7 +138,7 @@ public function setAppValueInt( string $key, int $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->appConfig->setValueInt($this->appName, $key, $value, $lazy, $sensitive); } @@ -160,7 +160,7 @@ public function setAppValueFloat( string $key, float $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->appConfig->setValueFloat($this->appName, $key, $value, $lazy, $sensitive); } @@ -180,7 +180,7 @@ public function setAppValueFloat( public function setAppValueBool( string $key, bool $value, - bool $lazy = false + bool $lazy = false, ): bool { return $this->appConfig->setValueBool($this->appName, $key, $value, $lazy); } @@ -203,7 +203,7 @@ public function setAppValueArray( string $key, array $value, bool $lazy = false, - bool $sensitive = false + bool $sensitive = false, ): bool { return $this->appConfig->setValueArray($this->appName, $key, $value, $lazy, $sensitive); } diff --git a/lib/private/Archive/Archive.php b/lib/private/Archive/Archive.php index 26b940be4104a..874087fb16727 100644 --- a/lib/private/Archive/Archive.php +++ b/lib/private/Archive/Archive.php @@ -92,10 +92,10 @@ public function addRecursive(string $path, string $source): void { if ($file === '.' || $file === '..') { continue; } - if (is_dir($source.'/'.$file)) { - $this->addRecursive($path.'/'.$file, $source.'/'.$file); + if (is_dir($source . '/' . $file)) { + $this->addRecursive($path . '/' . $file, $source . '/' . $file); } else { - $this->addFile($path.'/'.$file, $source.'/'.$file); + $this->addFile($path . '/' . $file, $source . '/' . $file); } } } diff --git a/lib/private/Archive/ZIP.php b/lib/private/Archive/ZIP.php index 52352f9505e45..61fd25d071d66 100644 --- a/lib/private/Archive/ZIP.php +++ b/lib/private/Archive/ZIP.php @@ -26,7 +26,7 @@ public function __construct(string $source) { $this->zip = new \ZipArchive(); if ($this->zip->open($source, \ZipArchive::CREATE)) { } else { - \OC::$server->get(LoggerInterface::class)->warning('Error while opening archive '.$source, ['app' => 'files_archive']); + \OC::$server->get(LoggerInterface::class)->warning('Error while opening archive ' . $source, ['app' => 'files_archive']); } } @@ -169,15 +169,15 @@ public function extract(string $dest): bool { * check if a file or folder exists in the archive */ public function fileExists(string $path): bool { - return ($this->zip->locateName($path) !== false) or ($this->zip->locateName($path.'/') !== false); + return ($this->zip->locateName($path) !== false) or ($this->zip->locateName($path . '/') !== false); } /** * remove a file or folder from the archive */ public function remove(string $path): bool { - if ($this->fileExists($path.'/')) { - return $this->zip->deleteName($path.'/'); + if ($this->fileExists($path . '/')) { + return $this->zip->deleteName($path . '/'); } else { return $this->zip->deleteName($path); } diff --git a/lib/private/Authentication/Login/Chain.php b/lib/private/Authentication/Login/Chain.php index abd24287a6ccf..3cba396afdd3e 100644 --- a/lib/private/Authentication/Login/Chain.php +++ b/lib/private/Authentication/Login/Chain.php @@ -56,7 +56,7 @@ public function __construct(PreLoginHookCommand $preLoginHookCommand, UpdateLastPasswordConfirmCommand $updateLastPasswordConfirmCommand, SetUserTimezoneCommand $setUserTimezoneCommand, TwoFactorCommand $twoFactorCommand, - FinishRememberedLoginCommand $finishRememberedLoginCommand + FinishRememberedLoginCommand $finishRememberedLoginCommand, ) { $this->preLoginHookCommand = $preLoginHookCommand; $this->userDisabledCheckCommand = $userDisabledCheckCommand; diff --git a/lib/private/Authentication/Login/WebAuthnChain.php b/lib/private/Authentication/Login/WebAuthnChain.php index c31e39de28cb6..ae523c43da67b 100644 --- a/lib/private/Authentication/Login/WebAuthnChain.php +++ b/lib/private/Authentication/Login/WebAuthnChain.php @@ -48,7 +48,7 @@ public function __construct(UserDisabledCheckCommand $userDisabledCheckCommand, UpdateLastPasswordConfirmCommand $updateLastPasswordConfirmCommand, SetUserTimezoneCommand $setUserTimezoneCommand, TwoFactorCommand $twoFactorCommand, - FinishRememberedLoginCommand $finishRememberedLoginCommand + FinishRememberedLoginCommand $finishRememberedLoginCommand, ) { $this->userDisabledCheckCommand = $userDisabledCheckCommand; $this->webAuthnLoginCommand = $webAuthnLoginCommand; diff --git a/lib/private/Authentication/WebAuthn/Manager.php b/lib/private/Authentication/WebAuthn/Manager.php index 7aa7a3c8f3a20..e65002632d8d5 100644 --- a/lib/private/Authentication/WebAuthn/Manager.php +++ b/lib/private/Authentication/WebAuthn/Manager.php @@ -53,7 +53,7 @@ public function __construct( CredentialRepository $repository, PublicKeyCredentialMapper $credentialMapper, LoggerInterface $logger, - IConfig $config + IConfig $config, ) { $this->repository = $repository; $this->credentialMapper = $credentialMapper; diff --git a/lib/private/Avatar/Avatar.php b/lib/private/Avatar/Avatar.php index bf29d57b88d01..7aa2d220b88b8 100644 --- a/lib/private/Avatar/Avatar.php +++ b/lib/private/Avatar/Avatar.php @@ -183,7 +183,7 @@ protected function imageTTFCenter( string $text, string $font, int $size, - int $angle = 0 + int $angle = 0, ): array { // Image width & height $xi = imagesx($image); diff --git a/lib/private/Avatar/UserAvatar.php b/lib/private/Avatar/UserAvatar.php index c5a146a48b659..51c44b23a55b1 100644 --- a/lib/private/Avatar/UserAvatar.php +++ b/lib/private/Avatar/UserAvatar.php @@ -217,7 +217,7 @@ public function getFile(int $size, bool $darkTheme = false): ISimpleFile { if ($size === -1) { $path = 'avatar' . ($darkTheme ? '-dark' : '') . '.' . $ext; } else { - $path = 'avatar' . ($darkTheme ? '-dark' : '') . '.' . $size . '.' . $ext; + $path = 'avatar' . ($darkTheme ? '-dark' : '') . '.' . $size . '.' . $ext; } } else { if ($size === -1) { diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php index dc8e33c743c0f..f6410269d6726 100644 --- a/lib/private/BackgroundJob/JobList.php +++ b/lib/private/BackgroundJob/JobList.php @@ -27,7 +27,7 @@ public function __construct( protected IDBConnection $connection, protected IConfig $config, protected ITimeFactory $timeFactory, - protected LoggerInterface $logger + protected LoggerInterface $logger, ) { } diff --git a/lib/private/Collaboration/Collaborators/LookupPlugin.php b/lib/private/Collaboration/Collaborators/LookupPlugin.php index 3cc4e93a486ef..8b46ad5e07266 100644 --- a/lib/private/Collaboration/Collaborators/LookupPlugin.php +++ b/lib/private/Collaboration/Collaborators/LookupPlugin.php @@ -63,7 +63,7 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b try { $remote = $this->cloudIdManager->resolveCloudId($lookup['federationId'])->getRemote(); } catch (\Exception $e) { - $this->logger->error('Can not parse federated cloud ID "' . $lookup['federationId'] . '"', [ + $this->logger->error('Can not parse federated cloud ID "' . $lookup['federationId'] . '"', [ 'exception' => $e, ]); continue; diff --git a/lib/private/Collaboration/Resources/Collection.php b/lib/private/Collaboration/Resources/Collection.php index 2c5cc28ef28df..d652305016fc3 100644 --- a/lib/private/Collaboration/Resources/Collection.php +++ b/lib/private/Collaboration/Resources/Collection.php @@ -28,7 +28,7 @@ public function __construct( protected int $id, protected string $name, protected ?IUser $userForAccess = null, - protected ?bool $access = null + protected ?bool $access = null, ) { } diff --git a/lib/private/Collaboration/Resources/Resource.php b/lib/private/Collaboration/Resources/Resource.php index 34f68aeee1121..19da3da7e7d27 100644 --- a/lib/private/Collaboration/Resources/Resource.php +++ b/lib/private/Collaboration/Resources/Resource.php @@ -23,7 +23,7 @@ public function __construct( protected string $type, protected string $id, protected ?IUser $userForAccess = null, - protected ?bool $access = null + protected ?bool $access = null, ) { } diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php index ac022cd4c3c4a..0308d01ab9a89 100644 --- a/lib/private/Comments/Comment.php +++ b/lib/private/Comments/Comment.php @@ -175,7 +175,7 @@ public function setMessage($message, $maxLength = self::MAX_MESSAGE_LENGTH): ICo } $message = trim($message); if ($maxLength && mb_strlen($message, 'UTF-8') > $maxLength) { - throw new MessageTooLongException('Comment message must not exceed ' . $maxLength. ' characters'); + throw new MessageTooLongException('Comment message must not exceed ' . $maxLength . ' characters'); } $this->data['message'] = $message; return $this; diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index 8b7f43c03a2e5..41e0c6622128f 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -320,7 +320,7 @@ public function getForObject( $objectId, $limit = 0, $offset = 0, - ?\DateTime $notOlderThan = null + ?\DateTime $notOlderThan = null, ) { $comments = []; @@ -372,7 +372,7 @@ public function getForObjectSince( int $lastKnownCommentId, string $sortDirection = 'asc', int $limit = 30, - bool $includeLastKnown = false + bool $includeLastKnown = false, ): array { return $this->getCommentsWithVerbForObjectSinceComment( $objectType, @@ -403,7 +403,7 @@ public function getCommentsWithVerbForObjectSinceComment( int $lastKnownCommentId, string $sortDirection = 'asc', int $limit = 30, - bool $includeLastKnown = false + bool $includeLastKnown = false, ): array { $comments = []; @@ -575,7 +575,7 @@ public function searchForObjects(string $search, string $objectType, array $obje if ($search !== '') { $query->where($query->expr()->iLike('message', $query->createNamedParameter( - '%' . $this->dbConn->escapeLikeParameter($search). '%' + '%' . $this->dbConn->escapeLikeParameter($search) . '%' ))); } @@ -769,7 +769,7 @@ public function getLastCommentDateByActor( string $objectId, string $verb, string $actorType, - array $actors + array $actors, ): array { $lastComments = []; diff --git a/lib/private/Config.php b/lib/private/Config.php index 08f9b028856b7..d9b1683269870 100644 --- a/lib/private/Config.php +++ b/lib/private/Config.php @@ -35,7 +35,7 @@ class Config { */ public function __construct($configDir, $fileName = 'config.php') { $this->configDir = $configDir; - $this->configFilePath = $this->configDir.$fileName; + $this->configFilePath = $this->configDir . $fileName; $this->configFileName = $fileName; $this->readData(); $this->isReadOnly = $this->getValue('config_is_read_only', false); @@ -171,7 +171,7 @@ private function readData() { $configFiles = [$this->configFilePath]; // Add all files in the config dir ending with the same file name - $extra = glob($this->configDir.'*.'.$this->configFileName); + $extra = glob($this->configDir . '*.' . $this->configFileName); if (is_array($extra)) { natsort($extra); $configFiles = array_merge($configFiles, $extra); @@ -248,7 +248,7 @@ private function readData() { private function writeData() { $this->checkReadOnly(); - if (!is_file(\OC::$configDir.'/CAN_INSTALL') && !isset($this->cache['version'])) { + if (!is_file(\OC::$configDir . '/CAN_INSTALL') && !isset($this->cache['version'])) { throw new HintException(sprintf('Configuration was not read or initialized correctly, not overwriting %s', $this->configFilePath)); } diff --git a/lib/private/Console/Application.php b/lib/private/Console/Application.php index 22dc8d0c65eb3..1b6200897367e 100644 --- a/lib/private/Console/Application.php +++ b/lib/private/Console/Application.php @@ -47,7 +47,7 @@ public function __construct( */ public function loadCommands( InputInterface $input, - ConsoleOutputInterface $output + ConsoleOutputInterface $output, ): void { // $application is required to be defined in the register_command scripts $application = $this->application; diff --git a/lib/private/Contacts/ContactsMenu/ContactsStore.php b/lib/private/Contacts/ContactsMenu/ContactsStore.php index d15e6e35706e9..a502a58366d7f 100644 --- a/lib/private/Contacts/ContactsMenu/ContactsStore.php +++ b/lib/private/Contacts/ContactsMenu/ContactsStore.php @@ -163,7 +163,7 @@ public function getContacts(IUser $user, ?string $filter, ?int $limit = null, ?i private function filterContacts( IUser $self, array $entries, - ?string $filter + ?string $filter, ): array { $disallowEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') !== 'yes'; $restrictEnumerationGroup = $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_to_group', 'no') === 'yes'; diff --git a/lib/private/DB/Adapter.php b/lib/private/DB/Adapter.php index 71824bda9e8a3..8f1b8e6d75f48 100644 --- a/lib/private/DB/Adapter.php +++ b/lib/private/DB/Adapter.php @@ -51,7 +51,7 @@ public function fixupStatement($statement) { */ public function lockTable(string $tableName) { $this->conn->beginTransaction(); - $this->conn->executeUpdate('LOCK TABLE `' .$tableName . '` IN EXCLUSIVE MODE'); + $this->conn->executeUpdate('LOCK TABLE `' . $tableName . '` IN EXCLUSIVE MODE'); } /** diff --git a/lib/private/DB/AdapterMySQL.php b/lib/private/DB/AdapterMySQL.php index 598dbc4de20b5..63c75607379a3 100644 --- a/lib/private/DB/AdapterMySQL.php +++ b/lib/private/DB/AdapterMySQL.php @@ -15,7 +15,7 @@ class AdapterMySQL extends Adapter { * @param string $tableName */ public function lockTable($tableName) { - $this->conn->executeUpdate('LOCK TABLES `' .$tableName . '` WRITE'); + $this->conn->executeUpdate('LOCK TABLES `' . $tableName . '` WRITE'); } public function unlockTable() { diff --git a/lib/private/DB/AdapterSqlite.php b/lib/private/DB/AdapterSqlite.php index 0023ee1536415..aeadf55ecf7b5 100644 --- a/lib/private/DB/AdapterSqlite.php +++ b/lib/private/DB/AdapterSqlite.php @@ -50,7 +50,7 @@ public function insertIfNotExist($table, $input, ?array $compare = null) { } $fieldList = '`' . implode('`,`', array_keys($input)) . '`'; $query = "INSERT INTO `$table` ($fieldList) SELECT " - . str_repeat('?,', count($input) - 1).'? ' + . str_repeat('?,', count($input) - 1) . '? ' . " WHERE NOT EXISTS (SELECT 1 FROM `$table` WHERE "; $inserts = array_values($input); diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index ecc6d09bc9536..55e61a7be141e 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -117,7 +117,7 @@ public function __construct( private array $params, Driver $driver, ?Configuration $config = null, - ?EventManager $eventManager = null + ?EventManager $eventManager = null, ) { if (!isset($params['adapter'])) { throw new \Exception('adapter not set'); @@ -664,9 +664,9 @@ public function getError() { $msg = $this->errorCode() . ': '; $errorInfo = $this->errorInfo(); if (!empty($errorInfo)) { - $msg .= 'SQLSTATE = '.$errorInfo[0] . ', '; - $msg .= 'Driver Code = '.$errorInfo[1] . ', '; - $msg .= 'Driver Message = '.$errorInfo[2]; + $msg .= 'SQLSTATE = ' . $errorInfo[0] . ', '; + $msg .= 'Driver Code = ' . $errorInfo[1] . ', '; + $msg .= 'Driver Message = ' . $errorInfo[2]; } return $msg; } diff --git a/lib/private/DB/DbDataCollector.php b/lib/private/DB/DbDataCollector.php index fcaa74daeab7c..e3c7cd3585512 100644 --- a/lib/private/DB/DbDataCollector.php +++ b/lib/private/DB/DbDataCollector.php @@ -111,7 +111,7 @@ private function sanitizeParam($var, ?\Throwable $error): array { } if ($error) { - return ['⚠ '.$error->getMessage(), false, false]; + return ['⚠ ' . $error->getMessage(), false, false]; } if (\is_array($var)) { diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 61a6d2baf1662..0b59509eaabd4 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -396,7 +396,7 @@ public function migrate(string $to = 'latest', bool $schemaOnly = false): void { } catch (\Exception $e) { // The exception itself does not contain the name of the migration, // so we wrap it here, to make debugging easier. - throw new \Exception('Database error when running migration ' . $version . ' for app ' . $this->getApp() . PHP_EOL. $e->getMessage(), 0, $e); + throw new \Exception('Database error when running migration ' . $version . ' for app ' . $this->getApp() . PHP_EOL . $e->getMessage(), 0, $e); } } } diff --git a/lib/private/DB/MigratorExecuteSqlEvent.php b/lib/private/DB/MigratorExecuteSqlEvent.php index cfcfe7fa512da..340cd63630093 100644 --- a/lib/private/DB/MigratorExecuteSqlEvent.php +++ b/lib/private/DB/MigratorExecuteSqlEvent.php @@ -18,7 +18,7 @@ class MigratorExecuteSqlEvent extends Event { public function __construct( string $sql, int $current, - int $max + int $max, ) { $this->sql = $sql; $this->current = $current; diff --git a/lib/private/DB/QueryBuilder/CompositeExpression.php b/lib/private/DB/QueryBuilder/CompositeExpression.php index 6edf385360c36..bcdbce8c5cb3b 100644 --- a/lib/private/DB/QueryBuilder/CompositeExpression.php +++ b/lib/private/DB/QueryBuilder/CompositeExpression.php @@ -16,7 +16,7 @@ class CompositeExpression implements ICompositeExpression, \Countable { public function __construct( private string $type, - private array $parts = [] + private array $parts = [], ) { } diff --git a/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php b/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php index a8dc4d8cf14f4..6791430b1b049 100644 --- a/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php +++ b/lib/private/DB/QueryBuilder/FunctionBuilder/OCIFunctionBuilder.php @@ -15,7 +15,7 @@ public function md5($input): IQueryFunction { if (version_compare($this->connection->getServerVersion(), '20', '>=')) { return new QueryFunction('LOWER(STANDARD_HASH(' . $this->helper->quoteColumnName($input) . ", 'MD5'))"); } - return new QueryFunction('LOWER(DBMS_OBFUSCATION_TOOLKIT.md5 (input => UTL_RAW.cast_to_raw(' . $this->helper->quoteColumnName($input) .')))'); + return new QueryFunction('LOWER(DBMS_OBFUSCATION_TOOLKIT.md5 (input => UTL_RAW.cast_to_raw(' . $this->helper->quoteColumnName($input) . ')))'); } /** diff --git a/lib/private/DB/QueryBuilder/Partitioned/PartitionedResult.php b/lib/private/DB/QueryBuilder/Partitioned/PartitionedResult.php index aa9cc43b38bf4..b3b59e26298f4 100644 --- a/lib/private/DB/QueryBuilder/Partitioned/PartitionedResult.php +++ b/lib/private/DB/QueryBuilder/Partitioned/PartitionedResult.php @@ -24,7 +24,7 @@ class PartitionedResult extends ArrayResult { */ public function __construct( private array $splitOfParts, - private IResult $result + private IResult $result, ) { parent::__construct([]); } diff --git a/lib/private/DB/QueryBuilder/Sharded/CrossShardMoveHelper.php b/lib/private/DB/QueryBuilder/Sharded/CrossShardMoveHelper.php index 45f24e326858c..81530b567257d 100644 --- a/lib/private/DB/QueryBuilder/Sharded/CrossShardMoveHelper.php +++ b/lib/private/DB/QueryBuilder/Sharded/CrossShardMoveHelper.php @@ -16,7 +16,7 @@ */ class CrossShardMoveHelper { public function __construct( - private ShardConnectionManager $connectionManager + private ShardConnectionManager $connectionManager, ) { } diff --git a/lib/private/DirectEditing/Manager.php b/lib/private/DirectEditing/Manager.php index 4b8c6af31e231..7503ad9425890 100644 --- a/lib/private/DirectEditing/Manager.php +++ b/lib/private/DirectEditing/Manager.php @@ -59,7 +59,7 @@ public function __construct( IUserSession $userSession, IRootFolder $rootFolder, IFactory $l10nFactory, - EncryptionManager $encryptionManager + EncryptionManager $encryptionManager, ) { $this->random = $random; $this->connection = $connection; diff --git a/lib/private/Encryption/DecryptAll.php b/lib/private/Encryption/DecryptAll.php index 0007467298ce7..70dd0c0f0b0c2 100644 --- a/lib/private/Encryption/DecryptAll.php +++ b/lib/private/Encryption/DecryptAll.php @@ -29,7 +29,7 @@ class DecryptAll { public function __construct( protected IManager $encryptionManager, protected IUserManager $userManager, - protected View $rootView + protected View $rootView, ) { $this->failed = []; } diff --git a/lib/private/Encryption/EncryptionWrapper.php b/lib/private/Encryption/EncryptionWrapper.php index aec93a3ce4d85..7f355b603d620 100644 --- a/lib/private/Encryption/EncryptionWrapper.php +++ b/lib/private/Encryption/EncryptionWrapper.php @@ -39,7 +39,7 @@ class EncryptionWrapper { */ public function __construct(ArrayCache $arrayCache, Manager $manager, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->arrayCache = $arrayCache; $this->manager = $manager; diff --git a/lib/private/Encryption/Exceptions/EncryptionHeaderKeyExistsException.php b/lib/private/Encryption/Exceptions/EncryptionHeaderKeyExistsException.php index 07007dc0ec195..52f488e29560a 100644 --- a/lib/private/Encryption/Exceptions/EncryptionHeaderKeyExistsException.php +++ b/lib/private/Encryption/Exceptions/EncryptionHeaderKeyExistsException.php @@ -14,6 +14,6 @@ class EncryptionHeaderKeyExistsException extends GenericEncryptionException { * @param string $key */ public function __construct($key) { - parent::__construct('header key "'. $key . '" already reserved by ownCloud'); + parent::__construct('header key "' . $key . '" already reserved by ownCloud'); } } diff --git a/lib/private/Encryption/Keys/Storage.php b/lib/private/Encryption/Keys/Storage.php index 532d1a51dd694..2c0ce9e5ef30d 100644 --- a/lib/private/Encryption/Keys/Storage.php +++ b/lib/private/Encryption/Keys/Storage.php @@ -57,8 +57,8 @@ public function __construct(View $view, Util $util, ICrypto $crypto, IConfig $co $this->util = $util; $this->encryption_base_dir = '/files_encryption'; - $this->keys_base_dir = $this->encryption_base_dir .'/keys'; - $this->backup_base_dir = $this->encryption_base_dir .'/backup'; + $this->keys_base_dir = $this->encryption_base_dir . '/keys'; + $this->backup_base_dir = $this->encryption_base_dir . '/backup'; $this->root_dir = $this->util->getKeyStorageRoot(); $this->crypto = $crypto; $this->config = $config; diff --git a/lib/private/Encryption/Update.php b/lib/private/Encryption/Update.php index 6fee1afbe5c56..0b27d63c19a2a 100644 --- a/lib/private/Encryption/Update.php +++ b/lib/private/Encryption/Update.php @@ -49,7 +49,7 @@ public function __construct( Manager $encryptionManager, File $file, LoggerInterface $logger, - $uid + $uid, ) { $this->view = $view; $this->util = $util; diff --git a/lib/private/EventSource.php b/lib/private/EventSource.php index 18af6e3583250..1a005025ef929 100644 --- a/lib/private/EventSource.php +++ b/lib/private/EventSource.php @@ -51,7 +51,7 @@ protected function init(): void { header('Content-Type: text/event-stream'); } if (!$this->request->passesStrictCookieCheck()) { - header('Location: '.\OC::$WEBROOT); + header('Location: ' . \OC::$WEBROOT); exit(); } if (!$this->request->passesCSRFCheck()) { @@ -74,7 +74,7 @@ protected function init(): void { */ public function send($type, $data = null) { if ($data and !preg_match('/^[A-Za-z0-9_]+$/', $type)) { - throw new \BadMethodCallException('Type needs to be alphanumeric ('. $type .')'); + throw new \BadMethodCallException('Type needs to be alphanumeric (' . $type . ')'); } $this->init(); if (is_null($data)) { diff --git a/lib/private/Federation/CloudFederationProviderManager.php b/lib/private/Federation/CloudFederationProviderManager.php index 79b37b44c828d..be9e66fa9ec97 100644 --- a/lib/private/Federation/CloudFederationProviderManager.php +++ b/lib/private/Federation/CloudFederationProviderManager.php @@ -40,7 +40,7 @@ public function __construct( private IClientService $httpClientService, private ICloudIdManager $cloudIdManager, private IOCMDiscoveryService $discoveryService, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/Federation/CloudFederationShare.php b/lib/private/Federation/CloudFederationShare.php index aa86905f234c8..22e36d8731223 100644 --- a/lib/private/Federation/CloudFederationShare.php +++ b/lib/private/Federation/CloudFederationShare.php @@ -48,7 +48,7 @@ public function __construct($shareWith = '', $sharedByDisplayName = '', $shareType = '', $resourceType = '', - $sharedSecret = '' + $sharedSecret = '', ) { $this->setShareWith($shareWith); $this->setResourceName($name); diff --git a/lib/private/Federation/CloudIdManager.php b/lib/private/Federation/CloudIdManager.php index 69d48a148b321..f5c0035534ceb 100644 --- a/lib/private/Federation/CloudIdManager.php +++ b/lib/private/Federation/CloudIdManager.php @@ -36,7 +36,7 @@ public function __construct( IURLGenerator $urlGenerator, IUserManager $userManager, ICacheFactory $cacheFactory, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { $this->contactsManager = $contactsManager; $this->urlGenerator = $urlGenerator; diff --git a/lib/private/Files/Cache/QuerySearchHelper.php b/lib/private/Files/Cache/QuerySearchHelper.php index 82f9ec3be66e3..a4d118f88485b 100644 --- a/lib/private/Files/Cache/QuerySearchHelper.php +++ b/lib/private/Files/Cache/QuerySearchHelper.php @@ -54,7 +54,7 @@ protected function applySearchConstraints( CacheQueryBuilder $query, ISearchQuery $searchQuery, array $caches, - ?IMetadataQuery $metadataQuery = null + ?IMetadataQuery $metadataQuery = null, ): void { $storageFilters = array_values(array_map(function (ICache $cache) { return $cache->getQueryFilterForStorage(); diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php index 6e1c86eed4737..3bd674f79e276 100644 --- a/lib/private/Files/Cache/Scanner.php +++ b/lib/private/Files/Cache/Scanner.php @@ -489,7 +489,7 @@ private function handleChildren(string $path, $recursive, int $reuse, int $folde $file = trim(\OC\Files\Filesystem::normalizePath($originalFile), '/'); if (trim($originalFile, '/') !== $file) { // encoding mismatch, might require compatibility wrapper - \OC::$server->get(LoggerInterface::class)->debug('Scanner: Skipping non-normalized file name "'. $originalFile . '" in path "' . $path . '".', ['app' => 'core']); + \OC::$server->get(LoggerInterface::class)->debug('Scanner: Skipping non-normalized file name "' . $originalFile . '" in path "' . $path . '".', ['app' => 'core']); $this->emit('\OC\Files\Cache\Scanner', 'normalizedNameMismatch', [$path ? $path . '/' . $originalFile : $originalFile]); // skip this entry continue; diff --git a/lib/private/Files/Cache/SearchBuilder.php b/lib/private/Files/Cache/SearchBuilder.php index 41f942cab039f..e89b95b756ff8 100644 --- a/lib/private/Files/Cache/SearchBuilder.php +++ b/lib/private/Files/Cache/SearchBuilder.php @@ -84,7 +84,7 @@ class SearchBuilder { private $mimetypeLoader; public function __construct( - IMimeTypeLoader $mimetypeLoader + IMimeTypeLoader $mimetypeLoader, ) { $this->mimetypeLoader = $mimetypeLoader; } @@ -110,7 +110,7 @@ public function extractRequestedFields(ISearchOperator $operator): array { public function searchOperatorArrayToDBExprArray( IQueryBuilder $builder, array $operators, - ?IMetadataQuery $metadataQuery = null + ?IMetadataQuery $metadataQuery = null, ) { return array_filter(array_map(function ($operator) use ($builder, $metadataQuery) { return $this->searchOperatorToDBExpr($builder, $operator, $metadataQuery); @@ -120,7 +120,7 @@ public function searchOperatorArrayToDBExprArray( public function searchOperatorToDBExpr( IQueryBuilder $builder, ISearchOperator $operator, - ?IMetadataQuery $metadataQuery = null + ?IMetadataQuery $metadataQuery = null, ) { $expr = $builder->expr(); @@ -156,7 +156,7 @@ private function searchComparisonToDBExpr( IQueryBuilder $builder, ISearchComparison $comparison, array $operatorMap, - ?IMetadataQuery $metadataQuery = null + ?IMetadataQuery $metadataQuery = null, ) { if ($comparison->getExtra()) { [$field, $value, $type, $paramType] = $this->getExtraOperatorField($comparison, $metadataQuery); diff --git a/lib/private/Files/Config/CachedMountFileInfo.php b/lib/private/Files/Config/CachedMountFileInfo.php index 41dbec87ef58d..90a6b47f9d8f4 100644 --- a/lib/private/Files/Config/CachedMountFileInfo.php +++ b/lib/private/Files/Config/CachedMountFileInfo.php @@ -19,7 +19,7 @@ public function __construct( ?int $mountId, string $mountProvider, string $rootInternalPath, - string $internalPath + string $internalPath, ) { parent::__construct($user, $storageId, $rootId, $mountPoint, $mountProvider, $mountId, $rootInternalPath); $this->internalPath = $internalPath; diff --git a/lib/private/Files/Config/CachedMountInfo.php b/lib/private/Files/Config/CachedMountInfo.php index 80423dcae40fd..79dd6c6ea1da0 100644 --- a/lib/private/Files/Config/CachedMountInfo.php +++ b/lib/private/Files/Config/CachedMountInfo.php @@ -39,7 +39,7 @@ public function __construct( string $mountPoint, string $mountProvider, ?int $mountId = null, - string $rootInternalPath = '' + string $rootInternalPath = '', ) { $this->user = $user; $this->storageId = $storageId; diff --git a/lib/private/Files/Config/MountProviderCollection.php b/lib/private/Files/Config/MountProviderCollection.php index 1dbc469c8c3b1..6a5407934c850 100644 --- a/lib/private/Files/Config/MountProviderCollection.php +++ b/lib/private/Files/Config/MountProviderCollection.php @@ -58,7 +58,7 @@ class MountProviderCollection implements IMountProviderCollection, Emitter { public function __construct( IStorageFactory $loader, IUserMountCache $mountCache, - IEventLogger $eventLogger + IEventLogger $eventLogger, ) { $this->loader = $loader; $this->mountCache = $mountCache; diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 94da770b63f06..ad8061b1a8cb4 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -49,7 +49,7 @@ public function __construct( IDBConnection $connection, IUserManager $userManager, LoggerInterface $logger, - IEventLogger $eventLogger + IEventLogger $eventLogger, ) { $this->connection = $connection; $this->userManager = $userManager; diff --git a/lib/private/Files/Mount/HomeMountPoint.php b/lib/private/Files/Mount/HomeMountPoint.php index 0aa4b54ddf071..5a648f08c8978 100644 --- a/lib/private/Files/Mount/HomeMountPoint.php +++ b/lib/private/Files/Mount/HomeMountPoint.php @@ -22,7 +22,7 @@ public function __construct( ?IStorageFactory $loader = null, ?array $mountOptions = null, ?int $mountId = null, - ?string $mountProvider = null + ?string $mountProvider = null, ) { parent::__construct($storage, $mountpoint, $arguments, $loader, $mountOptions, $mountId, $mountProvider); $this->user = $user; diff --git a/lib/private/Files/Mount/Manager.php b/lib/private/Files/Mount/Manager.php index d118021afa2eb..55de488c726cd 100644 --- a/lib/private/Files/Mount/Manager.php +++ b/lib/private/Files/Mount/Manager.php @@ -104,7 +104,7 @@ public function find(string $path): IMountPoint { } } - throw new NotFoundException('No mount for path ' . $path . ' existing mounts (' . count($this->mounts) .'): ' . implode(',', array_keys($this->mounts))); + throw new NotFoundException('No mount for path ' . $path . ' existing mounts (' . count($this->mounts) . '): ' . implode(',', array_keys($this->mounts))); } /** diff --git a/lib/private/Files/Mount/MountPoint.php b/lib/private/Files/Mount/MountPoint.php index cb3a3e8a22d0f..7a5a87be35b17 100644 --- a/lib/private/Files/Mount/MountPoint.php +++ b/lib/private/Files/Mount/MountPoint.php @@ -75,7 +75,7 @@ public function __construct( ?IStorageFactory $loader = null, ?array $mountOptions = null, ?int $mountId = null, - ?string $mountProvider = null + ?string $mountProvider = null, ) { if (is_null($arguments)) { $arguments = []; diff --git a/lib/private/Files/Node/HookConnector.php b/lib/private/Files/Node/HookConnector.php index 8fd2ffa33695c..423eea258ed6c 100644 --- a/lib/private/Files/Node/HookConnector.php +++ b/lib/private/Files/Node/HookConnector.php @@ -39,7 +39,7 @@ public function __construct( private IRootFolder $root, private View $view, private IEventDispatcher $dispatcher, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 60affa4b89ea2..26823f65c2f0e 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -570,7 +570,7 @@ public function copyFromStorage( IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, - $preserveMtime = false + $preserveMtime = false, ) { if ($sourceStorage->instanceOfStorage(ObjectStoreStorage::class)) { /** @var ObjectStoreStorage $sourceStorage */ @@ -703,7 +703,7 @@ public function putChunkedWritePart( string $writeToken, string $chunkId, $data, - $size = null + $size = null, ): ?array { if (!$this->objectStore instanceof IObjectStoreMultiPartUpload) { throw new GenericFileException('Object store does not support multipart upload'); diff --git a/lib/private/Files/ObjectStore/S3Signature.php b/lib/private/Files/ObjectStore/S3Signature.php index 4e9784ee81a1e..994d65cc21930 100644 --- a/lib/private/Files/ObjectStore/S3Signature.php +++ b/lib/private/Files/ObjectStore/S3Signature.php @@ -41,7 +41,7 @@ public function __construct() { public function signRequest( RequestInterface $request, - CredentialsInterface $credentials + CredentialsInterface $credentials, ) { $request = $this->prepareRequest($request, $credentials); $stringToSign = $this->createCanonicalizedString($request); @@ -56,7 +56,7 @@ public function presign( RequestInterface $request, CredentialsInterface $credentials, $expires, - array $options = [] + array $options = [], ) { $query = []; // URL encoding already occurs in the URI template expansion. Undo that @@ -106,7 +106,7 @@ public function presign( */ private function prepareRequest( RequestInterface $request, - CredentialsInterface $creds + CredentialsInterface $creds, ) { $modify = [ 'remove_headers' => ['X-Amz-Date'], @@ -129,7 +129,7 @@ private function signString($string, CredentialsInterface $credentials) { private function createCanonicalizedString( RequestInterface $request, - $expires = null + $expires = null, ) { $buffer = $request->getMethod() . "\n"; diff --git a/lib/private/Files/Search/SearchComparison.php b/lib/private/Files/Search/SearchComparison.php index e3a8f80050690..c1f0176afd9a2 100644 --- a/lib/private/Files/Search/SearchComparison.php +++ b/lib/private/Files/Search/SearchComparison.php @@ -20,7 +20,7 @@ public function __construct( private string $field, /** @var ParamValue $value */ private \DateTime|int|string|bool|array $value, - private string $extra = '' + private string $extra = '', ) { } diff --git a/lib/private/Files/Search/SearchOrder.php b/lib/private/Files/Search/SearchOrder.php index f3f62b933a14f..3dcbc02bc1a63 100644 --- a/lib/private/Files/Search/SearchOrder.php +++ b/lib/private/Files/Search/SearchOrder.php @@ -12,7 +12,7 @@ class SearchOrder implements ISearchOrder { public function __construct( private string $direction, private string $field, - private string $extra = '' + private string $extra = '', ) { } diff --git a/lib/private/Files/Search/SearchQuery.php b/lib/private/Files/Search/SearchQuery.php index 3c8711facd8e1..1793e42d34962 100644 --- a/lib/private/Files/Search/SearchQuery.php +++ b/lib/private/Files/Search/SearchQuery.php @@ -39,7 +39,7 @@ public function __construct( int $offset, array $order, ?IUser $user = null, - bool $limitToHome = false + bool $limitToHome = false, ) { $this->searchOperation = $searchOperation; $this->limit = $limit; diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php index e74dd1042d69b..44c70bb5f3dd2 100644 --- a/lib/private/Files/SetupManager.php +++ b/lib/private/Files/SetupManager.php @@ -201,7 +201,7 @@ public function setupForUser(IUser $user): void { $this->setupForUserWith($user, function () use ($user) { $this->mountProviderCollection->addMountForUser($user, $this->mountManager, function ( - IMountProvider $provider + IMountProvider $provider, ) use ($user) { return !in_array(get_class($provider), $this->setupUserMountProviders[$user->getUID()]); }); @@ -542,7 +542,7 @@ private function listenForNewMountProviders() { if (!$this->listeningForProviders) { $this->listeningForProviders = true; $this->mountProviderCollection->listen('\OC\Files\Config', 'registerMountProvider', function ( - IMountProvider $provider + IMountProvider $provider, ) { foreach ($this->setupUsers as $userId) { $user = $this->userManager->get($userId); @@ -568,7 +568,7 @@ private function setupListeners() { $this->eventDispatcher->addListener(ShareCreatedEvent::class, function (ShareCreatedEvent $event) { $this->cache->remove($event->getShare()->getSharedWith()); }); - $this->eventDispatcher->addListener(InvalidateMountCacheEvent::class, function (InvalidateMountCacheEvent $event + $this->eventDispatcher->addListener(InvalidateMountCacheEvent::class, function (InvalidateMountCacheEvent $event, ) { if ($user = $event->getUser()) { $this->cache->remove($user->getUID()); diff --git a/lib/private/Files/Storage/CommonTest.php b/lib/private/Files/Storage/CommonTest.php index b92e493bc2cde..efdd36345785c 100644 --- a/lib/private/Files/Storage/CommonTest.php +++ b/lib/private/Files/Storage/CommonTest.php @@ -19,7 +19,7 @@ public function __construct($params) { } public function getId() { - return 'test::'.$this->storage->getId(); + return 'test::' . $this->storage->getId(); } public function mkdir($path) { return $this->storage->mkdir($path); diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index 4c017082ceafd..87aa78887b507 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -163,13 +163,13 @@ protected function init() { $lastRequestStart = 0; $this->client->on('beforeRequest', function (RequestInterface $request) use (&$lastRequestStart) { - $this->logger->debug('sending dav ' . $request->getMethod() . ' request to external storage: ' . $request->getAbsoluteUrl(), ['app' => 'dav']); + $this->logger->debug('sending dav ' . $request->getMethod() . ' request to external storage: ' . $request->getAbsoluteUrl(), ['app' => 'dav']); $lastRequestStart = microtime(true); $this->eventLogger->start('fs:storage:dav:request', 'Sending dav request to external storage'); }); $this->client->on('afterRequest', function (RequestInterface $request) use (&$lastRequestStart) { $elapsed = microtime(true) - $lastRequestStart; - $this->logger->debug('dav ' . $request->getMethod() . ' request to external storage: ' . $request->getAbsoluteUrl() . ' took ' . round($elapsed * 1000, 1) . 'ms', ['app' => 'dav']); + $this->logger->debug('dav ' . $request->getMethod() . ' request to external storage: ' . $request->getAbsoluteUrl() . ' took ' . round($elapsed * 1000, 1) . 'ms', ['app' => 'dav']); $this->eventLogger->end('fs:storage:dav:request'); }); } diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index 1ead1c342b084..3b45e996f5de5 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -86,7 +86,7 @@ public function __construct( ?IStorage $keyStorage = null, ?Update $update = null, ?Manager $mountManager = null, - ?ArrayCache $arrayCache = null + ?ArrayCache $arrayCache = null, ) { $this->mountPoint = $parameters['mountPoint']; $this->mount = $parameters['mount']; @@ -628,7 +628,7 @@ public function moveFromStorage( Storage\IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, - $preserveMtime = true + $preserveMtime = true, ) { if ($sourceStorage === $this) { return $this->rename($sourceInternalPath, $targetInternalPath); @@ -669,7 +669,7 @@ public function copyFromStorage( $sourceInternalPath, $targetInternalPath, $preserveMtime = false, - $isRename = false + $isRename = false, ) { // TODO clean this up once the underlying moveFromStorage in OC\Files\Storage\Wrapper\Common is fixed: // - call $this->storage->copyFromStorage() instead of $this->copyBetweenStorage @@ -694,7 +694,7 @@ private function updateEncryptedVersion( $sourceInternalPath, $targetInternalPath, $isRename, - $keepEncryptionVersion + $keepEncryptionVersion, ) { $isEncrypted = $this->encryptionManager->isEnabled() && $this->shouldEncrypt($targetInternalPath); $cacheInformation = [ @@ -749,7 +749,7 @@ private function copyBetweenStorage( $sourceInternalPath, $targetInternalPath, $preserveMtime, - $isRename + $isRename, ) { // for versions we have nothing to do, because versions should always use the // key from the original file. Just create a 1:1 copy and done diff --git a/lib/private/Files/Template/TemplateManager.php b/lib/private/Files/Template/TemplateManager.php index e61b47202890f..865af4eb90c96 100644 --- a/lib/private/Files/Template/TemplateManager.php +++ b/lib/private/Files/Template/TemplateManager.php @@ -63,7 +63,7 @@ public function __construct( IPreview $previewManager, IConfig $config, IFactory $l10nFactory, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->serverContainer = $serverContainer; $this->eventDispatcher = $eventDispatcher; diff --git a/lib/private/FilesMetadata/FilesMetadataManager.php b/lib/private/FilesMetadata/FilesMetadataManager.php index 5c1acb77ea7b0..f2ea6cb11a7b6 100644 --- a/lib/private/FilesMetadata/FilesMetadataManager.php +++ b/lib/private/FilesMetadata/FilesMetadataManager.php @@ -75,7 +75,7 @@ public function __construct( public function refreshMetadata( Node $node, int $process = self::PROCESS_LIVE, - string $namedEvent = '' + string $namedEvent = '', ): IFilesMetadata { try { $metadata = $this->metadataRequestService->getMetadataFromFileId($node->getId()); @@ -224,7 +224,7 @@ public function deleteMetadata(int $fileId): void { public function getMetadataQuery( IQueryBuilder $qb, string $fileTableAlias, - string $fileIdField + string $fileIdField, ): IMetadataQuery { return new MetadataQuery($qb, $this, $fileTableAlias, $fileIdField); } @@ -273,7 +273,7 @@ public function initMetadata( string $key, string $type, bool $indexed = false, - int $editPermission = IMetadataValueWrapper::EDIT_FORBIDDEN + int $editPermission = IMetadataValueWrapper::EDIT_FORBIDDEN, ): void { $current = $this->getKnownMetadata(); try { diff --git a/lib/private/FilesMetadata/Job/UpdateSingleMetadata.php b/lib/private/FilesMetadata/Job/UpdateSingleMetadata.php index c4b0117db13db..5746493ddef43 100644 --- a/lib/private/FilesMetadata/Job/UpdateSingleMetadata.php +++ b/lib/private/FilesMetadata/Job/UpdateSingleMetadata.php @@ -29,7 +29,7 @@ public function __construct( ITimeFactory $time, private IRootFolder $rootFolder, private FilesMetadataManager $filesMetadataManager, - private LoggerInterface $logger + private LoggerInterface $logger, ) { parent::__construct($time); } diff --git a/lib/private/FilesMetadata/Listener/MetadataDelete.php b/lib/private/FilesMetadata/Listener/MetadataDelete.php index c0a6fc758c13b..226bd3bdafa92 100644 --- a/lib/private/FilesMetadata/Listener/MetadataDelete.php +++ b/lib/private/FilesMetadata/Listener/MetadataDelete.php @@ -23,7 +23,7 @@ class MetadataDelete implements IEventListener { public function __construct( private IFilesMetadataManager $filesMetadataManager, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/FilesMetadata/Listener/MetadataUpdate.php b/lib/private/FilesMetadata/Listener/MetadataUpdate.php index 05422ba5abae5..4c5c913c740a7 100644 --- a/lib/private/FilesMetadata/Listener/MetadataUpdate.php +++ b/lib/private/FilesMetadata/Listener/MetadataUpdate.php @@ -26,7 +26,7 @@ class MetadataUpdate implements IEventListener { public function __construct( private IFilesMetadataManager $filesMetadataManager, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/FilesMetadata/MetadataQuery.php b/lib/private/FilesMetadata/MetadataQuery.php index aac93a23446ef..deae433e2fc1f 100644 --- a/lib/private/FilesMetadata/MetadataQuery.php +++ b/lib/private/FilesMetadata/MetadataQuery.php @@ -32,7 +32,7 @@ public function __construct( private string $fileTableAlias = 'fc', private string $fileIdField = 'fileid', private string $alias = 'meta', - private string $aliasIndexPrefix = 'meta_index' + private string $aliasIndexPrefix = 'meta_index', ) { if ($manager instanceof IFilesMetadata) { /** diff --git a/lib/private/FilesMetadata/Model/FilesMetadata.php b/lib/private/FilesMetadata/Model/FilesMetadata.php index dfeb429507a3a..d338bdbba8fb8 100644 --- a/lib/private/FilesMetadata/Model/FilesMetadata.php +++ b/lib/private/FilesMetadata/Model/FilesMetadata.php @@ -29,7 +29,7 @@ class FilesMetadata implements IFilesMetadata { private string $syncToken = ''; public function __construct( - private int $fileId = 0 + private int $fileId = 0, ) { } diff --git a/lib/private/FilesMetadata/Service/IndexRequestService.php b/lib/private/FilesMetadata/Service/IndexRequestService.php index b50fb3783254c..91bd9f0b11e3a 100644 --- a/lib/private/FilesMetadata/Service/IndexRequestService.php +++ b/lib/private/FilesMetadata/Service/IndexRequestService.php @@ -25,7 +25,7 @@ class IndexRequestService { public function __construct( private IDBConnection $dbConnection, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/FilesMetadata/Service/MetadataRequestService.php b/lib/private/FilesMetadata/Service/MetadataRequestService.php index b58912b0216b8..5fc02c5d00bb7 100644 --- a/lib/private/FilesMetadata/Service/MetadataRequestService.php +++ b/lib/private/FilesMetadata/Service/MetadataRequestService.php @@ -24,7 +24,7 @@ class MetadataRequestService { public function __construct( private IDBConnection $dbConnection, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index d18c7796805a9..bd46780a602a3 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -238,7 +238,7 @@ public function createGroup($gid) { } elseif ($group = $this->get($gid)) { return $group; } elseif (mb_strlen($gid) > self::MAX_GROUP_LENGTH) { - throw new \Exception('Group name is limited to '. self::MAX_GROUP_LENGTH.' characters'); + throw new \Exception('Group name is limited to ' . self::MAX_GROUP_LENGTH . ' characters'); } else { $this->dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid)); $this->emit('\OC\Group', 'preCreate', [$gid]); diff --git a/lib/private/Group/MetaData.php b/lib/private/Group/MetaData.php index fe0d931cb09b5..77432eea5ff4f 100644 --- a/lib/private/Group/MetaData.php +++ b/lib/private/Group/MetaData.php @@ -31,7 +31,7 @@ public function __construct( private bool $isAdmin, private bool $isDelegatedAdmin, private IGroupManager $groupManager, - private IUserSession $userSession + private IUserSession $userSession, ) { } diff --git a/lib/private/Http/Client/Client.php b/lib/private/Http/Client/Client.php index 0b72522c218ec..40ce012cd1a0d 100644 --- a/lib/private/Http/Client/Client.php +++ b/lib/private/Http/Client/Client.php @@ -61,7 +61,7 @@ private function buildRequestOptions(array $options): array { $onRedirectFunction = function ( \Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, - \Psr\Http\Message\UriInterface $uri + \Psr\Http\Message\UriInterface $uri, ) use ($options) { $this->preventLocalAddress($uri->__toString(), $options); }; @@ -167,7 +167,7 @@ protected function preventLocalAddress(string $uri, array $options): void { throw new LocalServerException('Could not detect any host'); } if (!$this->remoteHostValidator->isValid($host)) { - throw new LocalServerException('Host "'.$host.'" violates local access rules'); + throw new LocalServerException('Host "' . $host . '" violates local access rules'); } } diff --git a/lib/private/Http/Client/DnsPinMiddleware.php b/lib/private/Http/Client/DnsPinMiddleware.php index fcf0818ebb953..6618f22d825e2 100644 --- a/lib/private/Http/Client/DnsPinMiddleware.php +++ b/lib/private/Http/Client/DnsPinMiddleware.php @@ -19,7 +19,7 @@ class DnsPinMiddleware { public function __construct( NegativeDnsCache $negativeDnsCache, - IpAddressClassifier $ipAddressClassifier + IpAddressClassifier $ipAddressClassifier, ) { $this->negativeDnsCache = $negativeDnsCache; $this->ipAddressClassifier = $ipAddressClassifier; @@ -100,7 +100,7 @@ public function addDnsPinning() { return function (callable $handler) { return function ( RequestInterface $request, - array $options + array $options, ) use ($handler) { if ($options['nextcloud']['allow_local_address'] === true) { return $handler($request, $options); @@ -132,7 +132,7 @@ public function addDnsPinning() { foreach ($targetIps as $ip) { if ($this->ipAddressClassifier->isLocalAddress($ip)) { // TODO: continue with all non-local IPs? - throw new LocalServerException('Host "'.$ip.'" ('.$hostName.':'.$port.') violates local access rules'); + throw new LocalServerException('Host "' . $ip . '" (' . $hostName . ':' . $port . ') violates local access rules'); } $curlResolves["$hostName:$port"][] = $ip; } diff --git a/lib/private/InitialStateService.php b/lib/private/InitialStateService.php index 8d364a90f8427..c930ffd946665 100644 --- a/lib/private/InitialStateService.php +++ b/lib/private/InitialStateService.php @@ -47,12 +47,12 @@ public function provideInitialState(string $appName, string $key, $data): void { try { $this->states[$appName][$key] = json_encode($data, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { - $this->logger->error('Invalid '. $key . ' data provided to provideInitialState by ' . $appName, ['exception' => $e]); + $this->logger->error('Invalid ' . $key . ' data provided to provideInitialState by ' . $appName, ['exception' => $e]); } return; } - $this->logger->warning('Invalid '. $key . ' data provided to provideInitialState by ' . $appName); + $this->logger->warning('Invalid ' . $key . ' data provided to provideInitialState by ' . $appName); } public function provideLazyInitialState(string $appName, string $key, Closure $closure): void { diff --git a/lib/private/Installer.php b/lib/private/Installer.php index e0f7644304e2b..d5500c07a3cf9 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -58,7 +58,7 @@ public function installApp(string $appId, bool $forceEnable = false): string { throw new \Exception('App not found in any app directory'); } - $basedir = $app['path'].'/'.$appId; + $basedir = $app['path'] . '/' . $appId; if (is_file($basedir . '/appinfo/database.xml')) { throw new \Exception('The appinfo/database.xml file is not longer supported. Used in ' . $appId); @@ -122,10 +122,10 @@ public function installApp(string $appId, bool $forceEnable = false): string { //set remote/public handlers foreach ($info['remote'] as $name => $path) { - $config->setAppValue('core', 'remote_'.$name, $info['id'].'/'.$path); + $config->setAppValue('core', 'remote_' . $name, $info['id'] . '/' . $path); } foreach ($info['public'] as $name => $path) { - $config->setAppValue('core', 'public_'.$name, $info['id'].'/'.$path); + $config->setAppValue('core', 'public_' . $name, $info['id'] . '/' . $path); } OC_App::setAppTypes($info['id']); @@ -410,8 +410,8 @@ private function isInstalledFromGit(string $appId): bool { if ($app === false) { return false; } - $basedir = $app['path'].'/'.$appId; - return file_exists($basedir.'/.git/'); + $basedir = $app['path'] . '/' . $appId; + return file_exists($basedir . '/.git/'); } /** @@ -453,7 +453,7 @@ public function removeApp(string $appId): bool { OC_Helper::rmdirr($appDir); return true; } else { - $this->logger->error('can\'t remove app '.$appId.'. It is not installed.'); + $this->logger->error('can\'t remove app ' . $appId . '. It is not installed.'); return false; } @@ -497,8 +497,8 @@ public static function installShippedApps(bool $softErrors = false, ?IOutput $ou foreach (\OC::$APPSROOTS as $app_dir) { if ($dir = opendir($app_dir['path'])) { while (false !== ($filename = readdir($dir))) { - if ($filename[0] !== '.' and is_dir($app_dir['path']."/$filename")) { - if (file_exists($app_dir['path']."/$filename/appinfo/info.xml")) { + if ($filename[0] !== '.' and is_dir($app_dir['path'] . "/$filename")) { + if (file_exists($app_dir['path'] . "/$filename/appinfo/info.xml")) { if ($config->getAppValue($filename, 'installed_version', null) === null) { $enabled = $appManager->isDefaultEnabled($filename); if (($enabled || in_array($filename, $appManager->getAlwaysEnabledApps())) @@ -571,10 +571,10 @@ public static function installShippedApp(string $app, ?IOutput $output = null): //set remote/public handlers foreach ($info['remote'] as $name => $path) { - $config->setAppValue('core', 'remote_'.$name, $app.'/'.$path); + $config->setAppValue('core', 'remote_' . $name, $app . '/' . $path); } foreach ($info['public'] as $name => $path) { - $config->setAppValue('core', 'public_'.$name, $app.'/'.$path); + $config->setAppValue('core', 'public_' . $name, $app . '/' . $path); } OC_App::setAppTypes($info['id']); diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php index 6443c43d210b4..a6a6155595753 100644 --- a/lib/private/IntegrityCheck/Checker.php +++ b/lib/private/IntegrityCheck/Checker.php @@ -290,7 +290,7 @@ private function verify(string $signaturePath, string $basePath, string $certifi // Check if certificate is signed by Nextcloud Root Authority $x509 = new \phpseclib\File\X509(); - $rootCertificatePublicKey = $this->fileAccessHelper->file_get_contents($this->environmentHelper->getServerRoot().'/resources/codesigning/root.crt'); + $rootCertificatePublicKey = $this->fileAccessHelper->file_get_contents($this->environmentHelper->getServerRoot() . '/resources/codesigning/root.crt'); $rootCerts = $this->splitCerts($rootCertificatePublicKey); foreach ($rootCerts as $rootCert) { @@ -383,7 +383,7 @@ public function hasPassedCheck(): bool { /** * @return array|null Either the results or null if no results available */ - public function getResults(): array|null { + public function getResults(): ?array { $cachedResults = $this->cache->get(self::CACHE_KEY); if (!\is_null($cachedResults) and $cachedResults !== false) { return json_decode($cachedResults, true); diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php index fc76a15b07be9..7dd0704682d74 100644 --- a/lib/private/L10N/Factory.php +++ b/lib/private/L10N/Factory.php @@ -444,7 +444,7 @@ private function getLanguageFromRequest(?string $app = null): string { if ($preferred_language === strtolower($available_language)) { return $this->respectDefaultLanguage($app, $available_language); } - if (strtolower($available_language) === $preferred_language_parts[0].'_'.end($preferred_language_parts)) { + if (strtolower($available_language) === $preferred_language_parts[0] . '_' . end($preferred_language_parts)) { return $available_language; } } diff --git a/lib/private/Lock/AbstractLockingProvider.php b/lib/private/Lock/AbstractLockingProvider.php index aa203f6a90bed..d7e5976079c52 100644 --- a/lib/private/Lock/AbstractLockingProvider.php +++ b/lib/private/Lock/AbstractLockingProvider.php @@ -24,7 +24,9 @@ abstract class AbstractLockingProvider implements ILockingProvider { * * @param int $ttl how long until we clear stray locks in seconds */ - public function __construct(protected int $ttl) { + public function __construct( + protected int $ttl, + ) { } /** @inheritDoc */ diff --git a/lib/private/Lock/DBLockingProvider.php b/lib/private/Lock/DBLockingProvider.php index d19f2cf37914a..cb7f5cff35037 100644 --- a/lib/private/Lock/DBLockingProvider.php +++ b/lib/private/Lock/DBLockingProvider.php @@ -24,7 +24,7 @@ public function __construct( private IDBConnection $connection, private ITimeFactory $timeFactory, int $ttl = 3600, - private bool $cacheSharedLocks = true + private bool $cacheSharedLocks = true, ) { parent::__construct($ttl); } diff --git a/lib/private/Log.php b/lib/private/Log.php index 4f6003cf53d57..98de9bfa8585e 100644 --- a/lib/private/Log.php +++ b/lib/private/Log.php @@ -42,7 +42,7 @@ public function __construct( private IWriter $logger, private SystemConfig $config, private Normalizer $normalizer = new Normalizer(), - private ?IRegistry $crashReporters = null + private ?IRegistry $crashReporters = null, ) { } diff --git a/lib/private/Log/Errorlog.php b/lib/private/Log/Errorlog.php index d53b8b151a132..6188bb70fd5ec 100644 --- a/lib/private/Log/Errorlog.php +++ b/lib/private/Log/Errorlog.php @@ -26,6 +26,6 @@ public function __construct( * @param string|array $message */ public function write(string $app, $message, int $level): void { - error_log('[' . $this->tag . ']['.$app.']['.$level.'] '.$this->logDetailsAsJSON($app, $message, $level)); + error_log('[' . $this->tag . '][' . $app . '][' . $level . '] ' . $this->logDetailsAsJSON($app, $message, $level)); } } diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php index bc14de4ffdf13..ba428ba185b39 100644 --- a/lib/private/Log/File.php +++ b/lib/private/Log/File.php @@ -55,7 +55,7 @@ public function write(string $app, $message, int $level): void { @chmod($this->logFile, $this->logFileMode); } if ($handle) { - fwrite($handle, $entry."\n"); + fwrite($handle, $entry . "\n"); fclose($handle); } else { // Fall back to error_log @@ -91,7 +91,7 @@ public function getEntries(int $limit = 50, int $offset = 0): array { // Add the first character if at the start of the file, // because it doesn't hit the else in the loop if ($pos == 0) { - $line = $ch.$line; + $line = $ch . $line; } $entry = json_decode($line); // Add the line as an entry if it is passed the offset and is equal or above the log level @@ -105,7 +105,7 @@ public function getEntries(int $limit = 50, int $offset = 0): array { $line = ''; } } else { - $line = $ch.$line; + $line = $ch . $line; } $pos--; } diff --git a/lib/private/Log/LogFactory.php b/lib/private/Log/LogFactory.php index a5a7290bd9ce6..aa44757b89775 100644 --- a/lib/private/Log/LogFactory.php +++ b/lib/private/Log/LogFactory.php @@ -55,7 +55,7 @@ public function getCustomPsrLogger(string $path, string $type = 'file', string $ } protected function buildLogFile(string $logFile = ''): File { - $defaultLogFile = $this->systemConfig->getValue('datadirectory', \OC::$SERVERROOT.'/data').'/nextcloud.log'; + $defaultLogFile = $this->systemConfig->getValue('datadirectory', \OC::$SERVERROOT . '/data') . '/nextcloud.log'; if ($logFile === '') { $logFile = $this->systemConfig->getValue('logfile', $defaultLogFile); } diff --git a/lib/private/Log/Rotate.php b/lib/private/Log/Rotate.php index f2fdb83623d0d..839c40726b768 100644 --- a/lib/private/Log/Rotate.php +++ b/lib/private/Log/Rotate.php @@ -27,7 +27,7 @@ public function run($argument): void { $this->maxSize = $config->getSystemValueInt('log_rotate_size', 100 * 1024 * 1024); if ($this->shouldRotateBySize()) { $rotatedFile = $this->rotate(); - $msg = 'Log file "'.$this->filePath.'" was over '.$this->maxSize.' bytes, moved to "'.$rotatedFile.'"'; + $msg = 'Log file "' . $this->filePath . '" was over ' . $this->maxSize . ' bytes, moved to "' . $rotatedFile . '"'; \OCP\Server::get(LoggerInterface::class)->info($msg, ['app' => Rotate::class]); } } diff --git a/lib/private/Log/Systemdlog.php b/lib/private/Log/Systemdlog.php index 4e33a4e5419ba..46de0f7db97d3 100644 --- a/lib/private/Log/Systemdlog.php +++ b/lib/private/Log/Systemdlog.php @@ -58,8 +58,8 @@ public function __construct( */ public function write(string $app, $message, int $level): void { $journal_level = $this->levels[$level]; - sd_journal_send('PRIORITY='.$journal_level, - 'SYSLOG_IDENTIFIER='.$this->syslogId, + sd_journal_send('PRIORITY=' . $journal_level, + 'SYSLOG_IDENTIFIER=' . $this->syslogId, 'MESSAGE=' . $this->logDetailsAsJSON($app, $message, $level)); } } diff --git a/lib/private/Mail/Attachment.php b/lib/private/Mail/Attachment.php index 8dede9714f88d..2a5246c0019e2 100644 --- a/lib/private/Mail/Attachment.php +++ b/lib/private/Mail/Attachment.php @@ -22,7 +22,7 @@ public function __construct( private ?string $body, private ?string $name, private ?string $contentType, - private ?string $path = null + private ?string $path = null, ) { } diff --git a/lib/private/Mail/Provider/Manager.php b/lib/private/Mail/Provider/Manager.php index 14ffeac287b9c..6179162019813 100644 --- a/lib/private/Mail/Provider/Manager.php +++ b/lib/private/Mail/Provider/Manager.php @@ -125,7 +125,7 @@ public function providers(): array { * * @return IProvider|null */ - public function findProviderById(string $providerId): IProvider|null { + public function findProviderById(string $providerId): ?IProvider { // evaluate if we already have a cached collection of providers if (!is_array($this->providersCollection)) { @@ -178,7 +178,7 @@ public function services(string $userId): array { * * @return IService|null returns service object or null if none found */ - public function findServiceById(string $userId, string $serviceId, ?string $providerId = null): IService|null { + public function findServiceById(string $userId, string $serviceId, ?string $providerId = null): ?IService { // evaluate if provider id was specified if ($providerId !== null) { @@ -222,7 +222,7 @@ public function findServiceById(string $userId, string $serviceId, ?string $prov * * @return IService|null returns service object or null if none found */ - public function findServiceByAddress(string $userId, string $address, ?string $providerId = null): IService|null { + public function findServiceByAddress(string $userId, string $address, ?string $providerId = null): ?IService { // evaluate if provider id was specified if ($providerId !== null) { diff --git a/lib/private/Memcache/Factory.php b/lib/private/Memcache/Factory.php index 370130912d676..1d5bcdac16a41 100644 --- a/lib/private/Memcache/Factory.php +++ b/lib/private/Memcache/Factory.php @@ -55,7 +55,7 @@ public function __construct( ?string $localCacheClass = null, ?string $distributedCacheClass = null, ?string $lockingCacheClass = null, - string $logFile = '' + string $logFile = '', ) { $this->logFile = $logFile; diff --git a/lib/private/MemoryInfo.php b/lib/private/MemoryInfo.php index a90739a664337..9b5c709b4a94e 100644 --- a/lib/private/MemoryInfo.php +++ b/lib/private/MemoryInfo.php @@ -54,7 +54,7 @@ private function memoryLimitToBytes(string $memoryLimit): int|float { if (is_numeric($number)) { $memoryLimit = Util::numericToNumber($number); } else { - throw new \InvalidArgumentException($number.' is not a valid numeric string (in memory_limit ini directive)'); + throw new \InvalidArgumentException($number . ' is not a valid numeric string (in memory_limit ini directive)'); } // intended fall through diff --git a/lib/private/Migration/MetadataManager.php b/lib/private/Migration/MetadataManager.php index cdaa604ce5a02..fac9127a1236e 100644 --- a/lib/private/Migration/MetadataManager.php +++ b/lib/private/Migration/MetadataManager.php @@ -69,7 +69,7 @@ public function extractMigrationAttributes(string $appId): array { */ public function getMigrationsAttributesFromReleaseMetadata( array $metadata, - bool $filterKnownMigrations = false + bool $filterKnownMigrations = false, ): array { $appsAttributes = []; foreach (array_keys($metadata['apps']) as $appId) { diff --git a/lib/private/NaturalSort.php b/lib/private/NaturalSort.php index 9b097340b6372..09c043764a7a4 100644 --- a/lib/private/NaturalSort.php +++ b/lib/private/NaturalSort.php @@ -23,7 +23,7 @@ public function __construct($injectedCollator = null) { // or inject an instance of \OC\NaturalSort_DefaultCollator to force using Owncloud's default collator if (isset($injectedCollator)) { $this->collator = $injectedCollator; - \OC::$server->get(LoggerInterface::class)->debug('forced use of '.get_class($injectedCollator)); + \OC::$server->get(LoggerInterface::class)->debug('forced use of ' . get_class($injectedCollator)); } } diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php index 169c7aaf35081..12bef7daaf939 100644 --- a/lib/private/NavigationManager.php +++ b/lib/private/NavigationManager.php @@ -413,7 +413,7 @@ public function setUnreadCounter(string $id, int $unreadCounter): void { $this->unreadCounters[$id] = $unreadCounter; } - public function get(string $id): array|null { + public function get(string $id): ?array { $this->init(); foreach ($this->closureEntries as $c) { $this->add($c()); diff --git a/lib/private/OCS/DiscoveryService.php b/lib/private/OCS/DiscoveryService.php index fc9c1bd479633..85686e59b0238 100644 --- a/lib/private/OCS/DiscoveryService.php +++ b/lib/private/OCS/DiscoveryService.php @@ -27,7 +27,7 @@ class DiscoveryService implements IDiscoveryService { * @param IClientService $clientService */ public function __construct(ICacheFactory $cacheFactory, - IClientService $clientService + IClientService $clientService, ) { $this->cache = $cacheFactory->createDistributed('ocs-discovery'); $this->client = $clientService->newClient(); diff --git a/lib/private/OCS/Provider.php b/lib/private/OCS/Provider.php index 23547da94339d..402b6b7059d0c 100644 --- a/lib/private/OCS/Provider.php +++ b/lib/private/OCS/Provider.php @@ -18,9 +18,11 @@ class Provider extends Controller { * @param IRequest $request * @param IAppManager $appManager */ - public function __construct($appName, + public function __construct( + $appName, \OCP\IRequest $request, - private \OCP\App\IAppManager $appManager) { + private \OCP\App\IAppManager $appManager, + ) { parent::__construct($appName, $request); } diff --git a/lib/private/Preview/BackgroundCleanupJob.php b/lib/private/Preview/BackgroundCleanupJob.php index 44832a78eb91f..8449e73983cb7 100644 --- a/lib/private/Preview/BackgroundCleanupJob.php +++ b/lib/private/Preview/BackgroundCleanupJob.php @@ -172,7 +172,7 @@ private function getNewPreviewLocations(): \Iterator { private function getAllPreviewIds(string $previewRoot, int $chunkSize): \Iterator { // See `getNewPreviewLocations` for some more info about the logic here - $like = $this->connection->escapeLikeParameter($previewRoot). '/_/_/_/_/_/_/_/%'; + $like = $this->connection->escapeLikeParameter($previewRoot) . '/_/_/_/_/_/_/_/%'; $qb = $this->connection->getQueryBuilder(); $qb->select('name', 'fileid') diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php index c7eb312182501..ef68c17b896f3 100644 --- a/lib/private/Preview/Generator.php +++ b/lib/private/Preview/Generator.php @@ -41,7 +41,7 @@ public function __construct( IPreview $previewManager, IAppData $appData, GeneratorHelper $helper, - IEventDispatcher $eventDispatcher + IEventDispatcher $eventDispatcher, ) { $this->config = $config; $this->previewManager = $previewManager; diff --git a/lib/private/Preview/MimeIconProvider.php b/lib/private/Preview/MimeIconProvider.php index 167dd21b262d1..80545bd406368 100644 --- a/lib/private/Preview/MimeIconProvider.php +++ b/lib/private/Preview/MimeIconProvider.php @@ -22,7 +22,7 @@ public function __construct( ) { } - public function getMimeIconUrl(string $mime): null|string { + public function getMimeIconUrl(string $mime): ?string { if (!$mime) { return null; } @@ -55,7 +55,7 @@ public function getMimeIconUrl(string $mime): null|string { return null; } - private function searchfileName(string $fileName): null|string { + private function searchfileName(string $fileName): ?string { // If the file exists in the current enabled legacy // custom theme, let's return it $theme = $this->config->getSystemValue('theme', ''); diff --git a/lib/private/PreviewManager.php b/lib/private/PreviewManager.php index 6f43687ceea86..ae0aa42a522f4 100644 --- a/lib/private/PreviewManager.php +++ b/lib/private/PreviewManager.php @@ -62,7 +62,7 @@ public function __construct( Coordinator $bootstrapCoordinator, IServerContainer $container, IBinaryFinder $binaryFinder, - IMagickSupport $imagickSupport + IMagickSupport $imagickSupport, ) { $this->config = $config; $this->rootFolder = $rootFolder; diff --git a/lib/private/Profiler/FileProfilerStorage.php b/lib/private/Profiler/FileProfilerStorage.php index b4494ef7a378a..a4021d064a95e 100644 --- a/lib/private/Profiler/FileProfilerStorage.php +++ b/lib/private/Profiler/FileProfilerStorage.php @@ -96,7 +96,7 @@ public function read(string $token): ?IProfile { } if (\function_exists('gzcompress')) { - $file = 'compress.zlib://'.$file; + $file = 'compress.zlib://' . $file; } return $this->createProfileFromData($token, unserialize(file_get_contents($file))); @@ -140,7 +140,7 @@ public function write(IProfile $profile): bool { $context = stream_context_create(); if (\function_exists('gzcompress')) { - $file = 'compress.zlib://'.$file; + $file = 'compress.zlib://' . $file; stream_context_set_option($context, 'zlib', 'level', 3); } @@ -178,7 +178,7 @@ protected function getFilename(string $token): string { $folderA = substr($token, -2, 2); $folderB = substr($token, -4, 2); - return $this->folder.'/'.$folderA.'/'.$folderB.'/'.$token; + return $this->folder . '/' . $folderA . '/' . $folderB . '/' . $token; } /** @@ -187,7 +187,7 @@ protected function getFilename(string $token): string { * @return string The index filename */ protected function getIndexFilename(): string { - return $this->folder.'/index.csv'; + return $this->folder . '/index.csv'; } /** @@ -220,12 +220,12 @@ protected function readLineFromFile($file): ?string { $buffer = fread($file, $chunkSize); if (false === ($upTo = strrpos($buffer, "\n"))) { - $line = $buffer.$line; + $line = $buffer . $line; continue; } $position += $upTo; - $line = substr($buffer, $upTo + 1).$line; + $line = substr($buffer, $upTo + 1) . $line; fseek($file, max(0, $position), \SEEK_SET); if ($line !== '') { @@ -258,7 +258,7 @@ protected function createProfileFromData(string $token, array $data, ?IProfile $ } if (\function_exists('gzcompress')) { - $file = 'compress.zlib://'.$file; + $file = 'compress.zlib://' . $file; } $profile->addChild($this->createProfileFromData($token, unserialize(file_get_contents($file)), $profile)); diff --git a/lib/private/Repair.php b/lib/private/Repair.php index 9d079aabd296c..42d3cfb4910bc 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -77,7 +77,7 @@ class Repair implements IOutput { public function __construct( private IEventDispatcher $dispatcher, - private LoggerInterface $logger + private LoggerInterface $logger, ) { } diff --git a/lib/private/Repair/Collation.php b/lib/private/Repair/Collation.php index 9557aabd7187e..5a309892bf097 100644 --- a/lib/private/Repair/Collation.php +++ b/lib/private/Repair/Collation.php @@ -33,7 +33,7 @@ public function __construct( IConfig $config, LoggerInterface $logger, IDBConnection $connection, - $ignoreFailures + $ignoreFailures, ) { $this->connection = $connection; $this->config = $config; diff --git a/lib/private/Repair/Events/RepairAdvanceEvent.php b/lib/private/Repair/Events/RepairAdvanceEvent.php index c4be72ce530dc..476db9e47028c 100644 --- a/lib/private/Repair/Events/RepairAdvanceEvent.php +++ b/lib/private/Repair/Events/RepairAdvanceEvent.php @@ -16,7 +16,7 @@ class RepairAdvanceEvent extends Event { public function __construct( int $increment, - string $description + string $description, ) { $this->increment = $increment; $this->description = $description; diff --git a/lib/private/Repair/Events/RepairErrorEvent.php b/lib/private/Repair/Events/RepairErrorEvent.php index 8cd5d41b1b470..e5be8a5a0311c 100644 --- a/lib/private/Repair/Events/RepairErrorEvent.php +++ b/lib/private/Repair/Events/RepairErrorEvent.php @@ -14,7 +14,7 @@ class RepairErrorEvent extends Event { private string $message; public function __construct( - string $message + string $message, ) { $this->message = $message; } diff --git a/lib/private/Repair/Events/RepairInfoEvent.php b/lib/private/Repair/Events/RepairInfoEvent.php index c48b295a9a974..ce8eb2f99e677 100644 --- a/lib/private/Repair/Events/RepairInfoEvent.php +++ b/lib/private/Repair/Events/RepairInfoEvent.php @@ -14,7 +14,7 @@ class RepairInfoEvent extends Event { private string $message; public function __construct( - string $message + string $message, ) { $this->message = $message; } diff --git a/lib/private/Repair/Events/RepairStartEvent.php b/lib/private/Repair/Events/RepairStartEvent.php index e154df5e6e1ed..47e713d57d997 100644 --- a/lib/private/Repair/Events/RepairStartEvent.php +++ b/lib/private/Repair/Events/RepairStartEvent.php @@ -16,7 +16,7 @@ class RepairStartEvent extends Event { public function __construct( int $max, - string $current + string $current, ) { $this->max = $max; $this->current = $current; diff --git a/lib/private/Repair/Events/RepairStepEvent.php b/lib/private/Repair/Events/RepairStepEvent.php index 7140d13687d7b..27e1efbdb08e9 100644 --- a/lib/private/Repair/Events/RepairStepEvent.php +++ b/lib/private/Repair/Events/RepairStepEvent.php @@ -14,7 +14,7 @@ class RepairStepEvent extends Event { private string $stepName; public function __construct( - string $stepName + string $stepName, ) { $this->stepName = $stepName; } diff --git a/lib/private/Repair/Events/RepairWarningEvent.php b/lib/private/Repair/Events/RepairWarningEvent.php index 403eec8715892..6893a7212eca1 100644 --- a/lib/private/Repair/Events/RepairWarningEvent.php +++ b/lib/private/Repair/Events/RepairWarningEvent.php @@ -14,7 +14,7 @@ class RepairWarningEvent extends Event { private string $message; public function __construct( - string $message + string $message, ) { $this->message = $message; } diff --git a/lib/private/Repair/RepairDavShares.php b/lib/private/Repair/RepairDavShares.php index 792fdd4033e01..36e3c397a3926 100644 --- a/lib/private/Repair/RepairDavShares.php +++ b/lib/private/Repair/RepairDavShares.php @@ -38,7 +38,7 @@ public function __construct( IConfig $config, IDBConnection $dbc, IGroupManager $groupManager, - LoggerInterface $logger + LoggerInterface $logger, ) { $this->config = $config; $this->dbc = $dbc; diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index 6ff6d1ddd941c..715f7623440d7 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -26,7 +26,7 @@ class RepairMimeTypes implements IRepairStep { public function __construct( protected IConfig $config, protected IAppConfig $appConfig, - protected IDBConnection $connection + protected IDBConnection $connection, ) { } diff --git a/lib/private/RichObjectStrings/Validator.php b/lib/private/RichObjectStrings/Validator.php index 197f48ed48c0b..c7e4dcf50b9a7 100644 --- a/lib/private/RichObjectStrings/Validator.php +++ b/lib/private/RichObjectStrings/Validator.php @@ -76,7 +76,7 @@ protected function validateParameter(array $parameter) { $missingKeys = array_diff($requiredParameters, array_keys($parameter)); if (!empty($missingKeys)) { - throw new InvalidObjectExeption('Object is invalid, missing keys:'.json_encode($missingKeys)); + throw new InvalidObjectExeption('Object is invalid, missing keys:' . json_encode($missingKeys)); } foreach ($parameter as $key => $value) { diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php index ba369eecac07e..7ec2aac021caa 100644 --- a/lib/private/Route/Router.php +++ b/lib/private/Route/Router.php @@ -155,7 +155,7 @@ public function loadRoutes($app = null) { $this->root->addCollection($collection); // Also add the OCS collection - $collection = $this->getCollection($app.'.ocs'); + $collection = $this->getCollection($app . '.ocs'); $collection->addPrefix('/ocsapp'); $this->root->addCollection($collection); } diff --git a/lib/private/Search/Filter/BooleanFilter.php b/lib/private/Search/Filter/BooleanFilter.php index 92572a6007323..894dc13b65746 100644 --- a/lib/private/Search/Filter/BooleanFilter.php +++ b/lib/private/Search/Filter/BooleanFilter.php @@ -19,7 +19,7 @@ public function __construct(string $value) { $this->value = match ($value) { 'true', 'yes', 'y', '1' => true, 'false', 'no', 'n', '0', '' => false, - default => throw new InvalidArgumentException('Invalid boolean value '. $value), + default => throw new InvalidArgumentException('Invalid boolean value ' . $value), }; } diff --git a/lib/private/Search/Filter/DateTimeFilter.php b/lib/private/Search/Filter/DateTimeFilter.php index 367af80b505fd..48c1725a5e1bb 100644 --- a/lib/private/Search/Filter/DateTimeFilter.php +++ b/lib/private/Search/Filter/DateTimeFilter.php @@ -17,7 +17,7 @@ class DateTimeFilter implements IFilter { public function __construct(string $value) { if (filter_var($value, FILTER_VALIDATE_INT)) { - $value = '@'.$value; + $value = '@' . $value; } $this->value = new DateTimeImmutable($value); diff --git a/lib/private/Search/Filter/FloatFilter.php b/lib/private/Search/Filter/FloatFilter.php index 97d767e62cb33..f238455294331 100644 --- a/lib/private/Search/Filter/FloatFilter.php +++ b/lib/private/Search/Filter/FloatFilter.php @@ -18,7 +18,7 @@ class FloatFilter implements IFilter { public function __construct(string $value) { $this->value = filter_var($value, FILTER_VALIDATE_FLOAT); if ($this->value === false) { - throw new InvalidArgumentException('Invalid float value '. $value); + throw new InvalidArgumentException('Invalid float value ' . $value); } } diff --git a/lib/private/Search/Filter/GroupFilter.php b/lib/private/Search/Filter/GroupFilter.php index e7694a6daa234..fe0b2ce42d86b 100644 --- a/lib/private/Search/Filter/GroupFilter.php +++ b/lib/private/Search/Filter/GroupFilter.php @@ -23,7 +23,7 @@ public function __construct( ) { $group = $groupManager->get($value); if ($group === null) { - throw new InvalidArgumentException('Group '.$value.' not found'); + throw new InvalidArgumentException('Group ' . $value . ' not found'); } $this->group = $group; } diff --git a/lib/private/Search/Filter/IntegerFilter.php b/lib/private/Search/Filter/IntegerFilter.php index 825c7ddd3ebf0..028b7d0678f3e 100644 --- a/lib/private/Search/Filter/IntegerFilter.php +++ b/lib/private/Search/Filter/IntegerFilter.php @@ -18,7 +18,7 @@ class IntegerFilter implements IFilter { public function __construct(string $value) { $this->value = filter_var($value, FILTER_VALIDATE_INT); if ($this->value === false) { - throw new InvalidArgumentException('Invalid integer value '. $value); + throw new InvalidArgumentException('Invalid integer value ' . $value); } } diff --git a/lib/private/Search/Filter/UserFilter.php b/lib/private/Search/Filter/UserFilter.php index fbbc793e6336c..4f2061a4ba6f4 100644 --- a/lib/private/Search/Filter/UserFilter.php +++ b/lib/private/Search/Filter/UserFilter.php @@ -23,7 +23,7 @@ public function __construct( ) { $user = $userManager->get($value); if ($user === null) { - throw new InvalidArgumentException('User '.$value.' not found'); + throw new InvalidArgumentException('User ' . $value . ' not found'); } $this->user = $user; } diff --git a/lib/private/Search/FilterFactory.php b/lib/private/Search/FilterFactory.php index 1466042291dc2..07063c604f433 100644 --- a/lib/private/Search/FilterFactory.php +++ b/lib/private/Search/FilterFactory.php @@ -28,7 +28,7 @@ public static function get(string $type, string|array $filter): IFilter { FilterDefinition::TYPE_PERSON => self::getPerson($filter), FilterDefinition::TYPE_STRING => new Filter\StringFilter($filter), FilterDefinition::TYPE_STRINGS => new Filter\StringsFilter(... (array)$filter), - default => throw new RuntimeException('Invalid filter type '. $type), + default => throw new RuntimeException('Invalid filter type ' . $type), }; } diff --git a/lib/private/Search/SearchComposer.php b/lib/private/Search/SearchComposer.php index 8108c6bcde438..d23662f7055ff 100644 --- a/lib/private/Search/SearchComposer.php +++ b/lib/private/Search/SearchComposer.php @@ -59,7 +59,7 @@ public function __construct( private Coordinator $bootstrapCoordinator, private ContainerInterface $container, private IURLGenerator $urlGenerator, - private LoggerInterface $logger + private LoggerInterface $logger, ) { $this->commonFilters = [ IFilter::BUILTIN_TERM => new FilterDefinition(IFilter::BUILTIN_TERM, FilterDefinition::TYPE_STRING), @@ -130,7 +130,7 @@ private function loadFilters(): void { } foreach ($provider->getSupportedFilters() as $filterName) { if ($this->getFilterDefinition($filterName, $providerId) === null) { - throw new InvalidArgumentException('Invalid filter '. $filterName); + throw new InvalidArgumentException('Invalid filter ' . $filterName); } } } @@ -202,10 +202,10 @@ function (array $providerData) use ($route, $routeParameters) { private function fetchIcon(string $appId, string $providerId): string { $icons = [ - [$providerId, $providerId.'.svg'], + [$providerId, $providerId . '.svg'], [$providerId, 'app.svg'], - [$appId, $providerId.'.svg'], - [$appId, $appId.'.svg'], + [$appId, $providerId . '.svg'], + [$appId, $appId . '.svg'], [$appId, 'app.svg'], ['core', 'places/default-app-icon.svg'], ]; diff --git a/lib/private/Search/UnsupportedFilter.php b/lib/private/Search/UnsupportedFilter.php index bf251a91d312b..ea520e6b872eb 100644 --- a/lib/private/Search/UnsupportedFilter.php +++ b/lib/private/Search/UnsupportedFilter.php @@ -12,6 +12,6 @@ final class UnsupportedFilter extends Exception { public function __construct(string $filerName, $providerId) { - parent::__construct('Provider '.$providerId.' doesn’t support filter '.$filerName.'.'); + parent::__construct('Provider ' . $providerId . ' doesn’t support filter ' . $filerName . '.'); } } diff --git a/lib/private/Security/Bruteforce/Backend/MemoryCacheBackend.php b/lib/private/Security/Bruteforce/Backend/MemoryCacheBackend.php index bf076240bf870..9a0723db47e85 100644 --- a/lib/private/Security/Bruteforce/Backend/MemoryCacheBackend.php +++ b/lib/private/Security/Bruteforce/Backend/MemoryCacheBackend.php @@ -137,7 +137,7 @@ public function registerAttempt( $existingAttempts = array_values($existingAttempts); // Store the new attempt - $existingAttempts[] = $timestamp . '#' . $this->hash($action) . '#' . $this->hash($metadata); + $existingAttempts[] = $timestamp . '#' . $this->hash($action) . '#' . $this->hash($metadata); $this->cache->set($identifier, json_encode($existingAttempts), 12 * 3600); } diff --git a/lib/private/Security/CSP/ContentSecurityPolicyManager.php b/lib/private/Security/CSP/ContentSecurityPolicyManager.php index 77ecceb03c343..e9d6b2945a881 100644 --- a/lib/private/Security/CSP/ContentSecurityPolicyManager.php +++ b/lib/private/Security/CSP/ContentSecurityPolicyManager.php @@ -52,13 +52,13 @@ public function mergePolicies( EmptyContentSecurityPolicy $originalPolicy, ): ContentSecurityPolicy { foreach ((object)(array)$originalPolicy as $name => $value) { - $setter = 'set'.ucfirst($name); + $setter = 'set' . ucfirst($name); if (\is_array($value)) { - $getter = 'get'.ucfirst($name); + $getter = 'get' . ucfirst($name); $currentValues = \is_array($defaultPolicy->$getter()) ? $defaultPolicy->$getter() : []; $defaultPolicy->$setter(array_values(array_unique(array_merge($currentValues, $value)))); } elseif (\is_bool($value)) { - $getter = 'is'.ucfirst($name); + $getter = 'is' . ucfirst($name); $currentValue = $defaultPolicy->$getter(); // true wins over false if ($value > $currentValue) { diff --git a/lib/private/Security/Crypto.php b/lib/private/Security/Crypto.php index b03f8a4ddce14..f7f62aadb7b26 100644 --- a/lib/private/Security/Crypto.php +++ b/lib/private/Security/Crypto.php @@ -78,9 +78,9 @@ public function encrypt(string $plaintext, string $password = ''): string { $ciphertext = bin2hex($encrypted); $iv = bin2hex($iv); - $hmac = bin2hex($this->calculateHMAC($ciphertext.$iv, substr($keyMaterial, 32))); + $hmac = bin2hex($this->calculateHMAC($ciphertext . $iv, substr($keyMaterial, 32))); - return $ciphertext.'|'.$iv.'|'.$hmac.'|3'; + return $ciphertext . '|' . $iv . '|' . $hmac . '|3'; } /** diff --git a/lib/private/Security/Hasher.php b/lib/private/Security/Hasher.php index 3ab0e1bbcac1f..ba661f5a35650 100644 --- a/lib/private/Security/Hasher.php +++ b/lib/private/Security/Hasher.php @@ -106,7 +106,7 @@ protected function legacyHashVerify($message, $hash, &$newHash = null): bool { // Verify whether it matches a legacy PHPass or SHA1 string $hashLength = \strlen($hash); - if (($hashLength === 60 && password_verify($message.$this->legacySalt, $hash)) || + if (($hashLength === 60 && password_verify($message . $this->legacySalt, $hash)) || ($hashLength === 40 && hash_equals($hash, sha1($message)))) { $newHash = $this->hash($message); return true; diff --git a/lib/private/Security/Normalizer/IpAddress.php b/lib/private/Security/Normalizer/IpAddress.php index dc7c784fa4c1b..e9232c5fe9f26 100644 --- a/lib/private/Security/Normalizer/IpAddress.php +++ b/lib/private/Security/Normalizer/IpAddress.php @@ -38,7 +38,7 @@ private function getIPv6Subnet(string $ip): string { $binary = \inet_pton($ip); $mask = inet_pton('FFFF:FFFF:FFFF:FFFF::'); - return inet_ntop($binary & $mask).'/64'; + return inet_ntop($binary & $mask) . '/64'; } /** @@ -67,12 +67,12 @@ private function getEmbeddedIpv4(string $ipv6): ?string { */ public function getSubnet(): string { if (filter_var($this->ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { - return $this->ip.'/32'; + return $this->ip . '/32'; } $ipv4 = $this->getEmbeddedIpv4($this->ip); if ($ipv4 !== null) { - return $ipv4.'/32'; + return $ipv4 . '/32'; } return $this->getIPv6Subnet($this->ip); diff --git a/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php b/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php index 34fddff539bda..8adcd8e168ccf 100644 --- a/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php +++ b/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php @@ -20,7 +20,7 @@ class DatabaseBackend implements IBackend { public function __construct( private IConfig $config, private IDBConnection $dbConnection, - private ITimeFactory $timeFactory + private ITimeFactory $timeFactory, ) { } @@ -35,7 +35,7 @@ private function hash( * @throws Exception */ private function getExistingAttemptCount( - string $identifier + string $identifier, ): int { $currentTime = $this->timeFactory->getDateTime(); diff --git a/lib/private/Security/VerificationToken/VerificationToken.php b/lib/private/Security/VerificationToken/VerificationToken.php index f99e674595209..1995b482597e7 100644 --- a/lib/private/Security/VerificationToken/VerificationToken.php +++ b/lib/private/Security/VerificationToken/VerificationToken.php @@ -25,7 +25,7 @@ public function __construct( private ICrypto $crypto, private ITimeFactory $timeFactory, private ISecureRandom $secureRandom, - private IJobList $jobList + private IJobList $jobList, ) { } @@ -53,7 +53,7 @@ public function check( } try { - $decryptedToken = $this->crypto->decrypt($encryptedToken, $passwordPrefix.$this->config->getSystemValueString('secret')); + $decryptedToken = $this->crypto->decrypt($encryptedToken, $passwordPrefix . $this->config->getSystemValueString('secret')); } catch (\Exception $e) { // Retry with empty secret as a fallback for instances where the secret might not have been set by accident try { @@ -85,11 +85,11 @@ public function create( ): string { $token = $this->secureRandom->generate( 21, - ISecureRandom::CHAR_DIGITS. - ISecureRandom::CHAR_LOWER. + ISecureRandom::CHAR_DIGITS . + ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER ); - $tokenValue = $this->timeFactory->getTime() .':'. $token; + $tokenValue = $this->timeFactory->getTime() . ':' . $token; $encryptedValue = $this->crypto->encrypt($tokenValue, $passwordPrefix . $this->config->getSystemValueString('secret')); $this->config->setUserValue($user->getUID(), 'core', $subject, $encryptedValue); $jobArgs = json_encode([ diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index 3d4ea8ea39ff9..c96c04f34fff4 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -53,7 +53,7 @@ public function __construct( IServerContainer $container, AuthorizedGroupMapper $mapper, IGroupManager $groupManager, - ISubAdmin $subAdmin + ISubAdmin $subAdmin, ) { $this->log = $log; $this->l10nFactory = $l10nFactory; diff --git a/lib/private/Setup.php b/lib/private/Setup.php index fb054bca4e025..fa10f238bde50 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -44,7 +44,7 @@ public function __construct( protected Defaults $defaults, protected LoggerInterface $logger, protected ISecureRandom $random, - protected Installer $installer + protected Installer $installer, ) { $this->l10n = $l10nFactory->get('lib'); } @@ -377,7 +377,7 @@ public function install(array $options, ?IOutput $output = null): array { //and we are done $config->setSystemValue('installed', true); if (self::shouldRemoveCanInstallFile()) { - unlink(\OC::$configDir.'/CAN_INSTALL'); + unlink(\OC::$configDir . '/CAN_INSTALL'); } $bootstrapCoordinator = \OCP\Server::get(\OC\AppFramework\Bootstrap\Coordinator::class); @@ -561,11 +561,11 @@ private function getVendorData(): array { } public function shouldRemoveCanInstallFile(): bool { - return \OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir.'/CAN_INSTALL'); + return \OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir . '/CAN_INSTALL'); } public function canInstallFileExists(): bool { - return is_file(\OC::$configDir.'/CAN_INSTALL'); + return is_file(\OC::$configDir . '/CAN_INSTALL'); } protected function outputDebug(?IOutput $output, string $message): void { diff --git a/lib/private/Setup/AbstractDatabase.php b/lib/private/Setup/AbstractDatabase.php index b1d93f55cc0d0..dbbb587206b59 100644 --- a/lib/private/Setup/AbstractDatabase.php +++ b/lib/private/Setup/AbstractDatabase.php @@ -133,7 +133,7 @@ protected function connect(array $configOverwrite = []): Connection { abstract public function setupDatabase($username); public function runMigrations(?IOutput $output = null) { - if (!is_dir(\OC::$SERVERROOT.'/core/Migrations')) { + if (!is_dir(\OC::$SERVERROOT . '/core/Migrations')) { return; } $ms = new MigrationService('core', \OC::$server->get(Connection::class), $output); diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php index 93aee667d18da..2708ada31c150 100644 --- a/lib/private/Setup/MySQL.php +++ b/lib/private/Setup/MySQL.php @@ -41,7 +41,7 @@ public function setupDatabase($username) { //fill the database if needed $query = 'select count(*) from information_schema.tables where table_schema=? AND table_name = ?'; - $connection->executeQuery($query, [$this->dbName, $this->tablePrefix.'users']); + $connection->executeQuery($query, [$this->dbName, $this->tablePrefix . 'users']); $connection->close(); $connection = $this->connect(); diff --git a/lib/private/SetupCheck/SetupCheckManager.php b/lib/private/SetupCheck/SetupCheckManager.php index 41f393fef7a59..721885848e291 100644 --- a/lib/private/SetupCheck/SetupCheckManager.php +++ b/lib/private/SetupCheck/SetupCheckManager.php @@ -29,12 +29,12 @@ public function runAll(): array { foreach ($setupChecks as $setupCheck) { /** @var ISetupCheck $setupCheckObject */ $setupCheckObject = Server::get($setupCheck->getService()); - $this->logger->debug('Running check '.get_class($setupCheckObject)); + $this->logger->debug('Running check ' . get_class($setupCheckObject)); try { $setupResult = $setupCheckObject->run(); } catch (\Throwable $t) { $setupResult = SetupResult::error("An exception occured while running the setup check:\n$t"); - $this->logger->error('Exception running check '.get_class($setupCheckObject).': '.$t->getMessage(), ['exception' => $t]); + $this->logger->error('Exception running check ' . get_class($setupCheckObject) . ': ' . $t->getMessage(), ['exception' => $t]); } $setupResult->setName($setupCheckObject->getName()); $category = $setupCheckObject->getCategory(); diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 0af264fb96858..56a4c6410c525 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -54,8 +54,8 @@ public static function registerBackend($itemType, $class, $collectionOf = null, return true; } \OC::$server->get(LoggerInterface::class)->warning( - 'Sharing backend '.$class.' not registered, '.self::$backendTypes[$itemType]['class'] - .' is already registered for '.$itemType, + 'Sharing backend ' . $class . ' not registered, ' . self::$backendTypes[$itemType]['class'] + . ' is already registered for ' . $itemType, ['app' => 'files_sharing']); } return false; diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 5457e8024a41a..d82e57415d31b 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -54,7 +54,7 @@ */ class Manager implements IManager { - private IL10N|null $l; + private ?IL10N $l; private LegacyHooks $legacyHooks; public function __construct( @@ -75,7 +75,7 @@ public function __construct( private IUserSession $userSession, private KnownUserService $knownUserService, private ShareDisableChecker $shareDisableChecker, - private IDateTimeZone $dateTimeZone + private IDateTimeZone $dateTimeZone, ) { $this->l = $this->l10nFactory->get('lib'); // The constructor of LegacyHooks registers the listeners of share events diff --git a/lib/private/SystemTag/SystemTagManager.php b/lib/private/SystemTag/SystemTagManager.php index e99213b618bee..1a0d8fb618a02 100644 --- a/lib/private/SystemTag/SystemTagManager.php +++ b/lib/private/SystemTag/SystemTagManager.php @@ -110,7 +110,7 @@ public function getAllTags($visibilityFilter = null, $nameSearchPattern = null): $query->andWhere( $query->expr()->like( 'name', - $query->createNamedParameter('%' . $this->connection->escapeLikeParameter($nameSearchPattern). '%') + $query->createNamedParameter('%' . $this->connection->escapeLikeParameter($nameSearchPattern) . '%') ) ); } @@ -146,7 +146,7 @@ public function getTag(string $tagName, bool $userVisible, bool $userAssignable) $result->closeCursor(); if (!$row) { throw new TagNotFoundException( - 'Tag ("' . $truncatedTagName . '", '. $userVisible . ', ' . $userAssignable . ') does not exist' + 'Tag ("' . $truncatedTagName . '", ' . $userVisible . ', ' . $userAssignable . ') does not exist' ); } @@ -171,7 +171,7 @@ public function createTag(string $tagName, bool $userVisible, bool $userAssignab $query->execute(); } catch (UniqueConstraintViolationException $e) { throw new TagAlreadyExistsException( - 'Tag ("' . $truncatedTagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists', + 'Tag ("' . $truncatedTagName . '", ' . $userVisible . ', ' . $userAssignable . ') already exists', 0, $e ); @@ -239,7 +239,7 @@ public function updateTag( } } catch (UniqueConstraintViolationException $e) { throw new TagAlreadyExistsException( - 'Tag ("' . $newName . '", '. $userVisible . ', ' . $userAssignable . ') already exists', + 'Tag ("' . $newName . '", ' . $userVisible . ', ' . $userAssignable . ') already exists', 0, $e ); diff --git a/lib/private/SystemTag/SystemTagsInFilesDetector.php b/lib/private/SystemTag/SystemTagsInFilesDetector.php index a8dfec264a0e1..9268b7ab09843 100644 --- a/lib/private/SystemTag/SystemTagsInFilesDetector.php +++ b/lib/private/SystemTag/SystemTagsInFilesDetector.php @@ -26,7 +26,7 @@ public function detectAssignedSystemTagsIn( Folder $folder, string $filteredMediaType = '', int $limit = 0, - int $offset = 0 + int $offset = 0, ): array { $operator = new SearchComparison(ISearchComparison::COMPARE_LIKE, 'systemtag', '%'); // Currently query has to have exactly one search condition. If no media type is provided, diff --git a/lib/private/Tags.php b/lib/private/Tags.php index 6a31ac94ef61f..350c49bca2cd3 100644 --- a/lib/private/Tags.php +++ b/lib/private/Tags.php @@ -506,7 +506,7 @@ public function tagAs($objid, $tag) { if (is_string($tag) && !is_numeric($tag)) { $tag = trim($tag); if ($tag === '') { - $this->logger->debug(__METHOD__.', Cannot add an empty tag'); + $this->logger->debug(__METHOD__ . ', Cannot add an empty tag'); return false; } if (!$this->hasTag($tag)) { @@ -546,7 +546,7 @@ public function unTag($objid, $tag) { if (is_string($tag) && !is_numeric($tag)) { $tag = trim($tag); if ($tag === '') { - $this->logger->debug(__METHOD__.', Tag name is empty'); + $this->logger->debug(__METHOD__ . ', Tag name is empty'); return false; } $tagId = $this->getTagId($tag); diff --git a/lib/private/TaskProcessing/Db/Task.php b/lib/private/TaskProcessing/Db/Task.php index 6787c11344aa5..4d919deaf94a3 100644 --- a/lib/private/TaskProcessing/Db/Task.php +++ b/lib/private/TaskProcessing/Db/Task.php @@ -98,7 +98,7 @@ public function __construct() { public function toRow(): array { return array_combine(self::$columns, array_map(function ($field) { - return $this->{'get'.ucfirst($field)}(); + return $this->{'get' . ucfirst($field)}(); }, self::$fields)); } diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index 29153ca56f980..36089f50f7f42 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -312,7 +312,7 @@ public function process(?string $userId, array $input, callable $reportProgress) $resources = []; $files = []; for ($i = 0; $i < $input['numberOfImages']; $i++) { - $file = $folder->newFile(time() . '-' . rand(1, 100000) . '-' . $i); + $file = $folder->newFile(time() . '-' . rand(1, 100000) . '-' . $i); $files[] = $file; $resource = $file->write(); if ($resource !== false && $resource !== true && is_resource($resource)) { @@ -593,7 +593,7 @@ private static function validateInput(array $spec, array $defaults, array $enumV $type->validateInput($io[$key]); if ($type === EShapeType::Enum) { if (!isset($enumValues[$key])) { - throw new ValidationException('Provider did not provide enum values for an enum slot: "' . $key .'"'); + throw new ValidationException('Provider did not provide enum values for an enum slot: "' . $key . '"'); } $type->validateEnum($io[$key], $enumValues[$key]); } @@ -1048,7 +1048,7 @@ public function getUserTasks(?string $userId, ?string $taskTypeId = null, ?strin public function getTasks( ?string $userId, ?string $taskTypeId = null, ?string $appId = null, ?string $customId = null, - ?int $status = null, ?int $scheduleAfter = null, ?int $endedBefore = null + ?int $status = null, ?int $scheduleAfter = null, ?int $endedBefore = null, ): array { try { $taskEntities = $this->taskMapper->findTasks($userId, $taskTypeId, $appId, $customId, $status, $scheduleAfter, $endedBefore); @@ -1203,7 +1203,7 @@ private function prepareTask(Task $task): void { $provider = $this->getPreferredProvider($task->getTaskTypeId()); // calculate expected completion time $completionExpectedAt = new \DateTime('now'); - $completionExpectedAt->add(new \DateInterval('PT'.$provider->getExpectedRuntime().'S')); + $completionExpectedAt->add(new \DateInterval('PT' . $provider->getExpectedRuntime() . 'S')); $task->setCompletionExpectedAt($completionExpectedAt); } diff --git a/lib/private/Teams/TeamManager.php b/lib/private/Teams/TeamManager.php index 3d5f9f6d2a2b2..223579a11821a 100644 --- a/lib/private/Teams/TeamManager.php +++ b/lib/private/Teams/TeamManager.php @@ -62,7 +62,7 @@ public function getProvider(string $providerId): ITeamResourceProvider { return $providers[$providerId]; } - throw new \RuntimeException('No provider found for id ' .$providerId); + throw new \RuntimeException('No provider found for id ' . $providerId); } public function getSharedWith(string $teamId, string $userId): array { diff --git a/lib/private/Template/Base.php b/lib/private/Template/Base.php index b48c10143cf07..602c8e6257e58 100644 --- a/lib/private/Template/Base.php +++ b/lib/private/Template/Base.php @@ -46,15 +46,15 @@ public function __construct($template, $requestToken, $l10n, $theme, $cspNonce) */ protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) { // Check if the app is in the app folder or in the root - if ($app_dir !== false && file_exists($app_dir.'/templates/')) { + if ($app_dir !== false && file_exists($app_dir . '/templates/')) { return [ - $serverRoot.'/themes/'.$theme.'/apps/'.$app.'/templates/', - $app_dir.'/templates/', + $serverRoot . '/themes/' . $theme . '/apps/' . $app . '/templates/', + $app_dir . '/templates/', ]; } return [ - $serverRoot.'/themes/'.$theme.'/'.$app.'/templates/', - $serverRoot.'/'.$app.'/templates/', + $serverRoot . '/themes/' . $theme . '/' . $app . '/templates/', + $serverRoot . '/' . $app . '/templates/', ]; } @@ -65,8 +65,8 @@ protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) { */ protected function getCoreTemplateDirs($theme, $serverRoot) { return [ - $serverRoot.'/themes/'.$theme.'/core/templates/', - $serverRoot.'/core/templates/', + $serverRoot . '/themes/' . $theme . '/core/templates/', + $serverRoot . '/core/templates/', ]; } diff --git a/lib/private/Template/CSSResourceLocator.php b/lib/private/Template/CSSResourceLocator.php index e9aa38ef2cc7f..b501fd69874b1 100644 --- a/lib/private/Template/CSSResourceLocator.php +++ b/lib/private/Template/CSSResourceLocator.php @@ -19,8 +19,8 @@ public function __construct(LoggerInterface $logger) { */ public function doFind($style) { $app = substr($style, 0, strpos($style, '/')); - if ($this->appendIfExist($this->serverroot, $style.'.css') - || $this->appendIfExist($this->serverroot, 'core/'.$style.'.css') + if ($this->appendIfExist($this->serverroot, $style . '.css') + || $this->appendIfExist($this->serverroot, 'core/' . $style . '.css') ) { return; } @@ -41,17 +41,17 @@ public function doFind($style) { // turned into cwd. $app_path = realpath($app_path); - $this->append($app_path, $style.'.css', $app_url); + $this->append($app_path, $style . '.css', $app_url); } /** * @param string $style */ public function doFindTheme($style) { - $theme_dir = 'themes/'.$this->theme.'/'; - $this->appendIfExist($this->serverroot, $theme_dir.'apps/'.$style.'.css') - || $this->appendIfExist($this->serverroot, $theme_dir.$style.'.css') - || $this->appendIfExist($this->serverroot, $theme_dir.'core/'.$style.'.css'); + $theme_dir = 'themes/' . $this->theme . '/'; + $this->appendIfExist($this->serverroot, $theme_dir . 'apps/' . $style . '.css') + || $this->appendIfExist($this->serverroot, $theme_dir . $style . '.css') + || $this->appendIfExist($this->serverroot, $theme_dir . 'core/' . $style . '.css'); } public function append($root, $file, $webRoot = null, $throw = true, $scss = false) { diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php index a4984eaf93051..1dec8634aca2c 100644 --- a/lib/private/Template/JSConfigHelper.php +++ b/lib/private/Template/JSConfigHelper.php @@ -282,7 +282,7 @@ public function getConfig(): string { // Echo it foreach ($array as $setting => $value) { - $result .= 'var '. $setting . '='. $value . ';' . PHP_EOL; + $result .= 'var ' . $setting . '=' . $value . ';' . PHP_EOL; } return $result; diff --git a/lib/private/Template/JSResourceLocator.php b/lib/private/Template/JSResourceLocator.php index b9a2fce6cd56c..aad999f939a0f 100644 --- a/lib/private/Template/JSResourceLocator.php +++ b/lib/private/Template/JSResourceLocator.php @@ -26,7 +26,7 @@ public function __construct(LoggerInterface $logger, JSCombiner $JSCombiner, IAp * @param string $script */ public function doFind($script) { - $theme_dir = 'themes/'.$this->theme.'/'; + $theme_dir = 'themes/' . $this->theme . '/'; // Extracting the appId and the script file name $app = substr($script, 0, strpos($script, '/')); @@ -52,29 +52,29 @@ public function doFind($script) { // For language files we try to load them all, so themes can overwrite // single l10n strings without having to translate all of them. $found = 0; - $found += $this->appendScriptIfExist($this->serverroot, 'core/'.$script); - $found += $this->appendScriptIfExist($this->serverroot, $theme_dir.'core/'.$script); + $found += $this->appendScriptIfExist($this->serverroot, 'core/' . $script); + $found += $this->appendScriptIfExist($this->serverroot, $theme_dir . 'core/' . $script); $found += $this->appendScriptIfExist($this->serverroot, $script); - $found += $this->appendScriptIfExist($this->serverroot, $theme_dir.$script); + $found += $this->appendScriptIfExist($this->serverroot, $theme_dir . $script); $found += $this->appendScriptIfExist($appRoot, $script, $appWebRoot); - $found += $this->appendScriptIfExist($this->serverroot, $theme_dir.'apps/'.$script); + $found += $this->appendScriptIfExist($this->serverroot, $theme_dir . 'apps/' . $script); if ($found) { return; } - } elseif ($this->appendScriptIfExist($this->serverroot, $theme_dir.'apps/'.$script) - || $this->appendScriptIfExist($this->serverroot, $theme_dir.$script) + } elseif ($this->appendScriptIfExist($this->serverroot, $theme_dir . 'apps/' . $script) + || $this->appendScriptIfExist($this->serverroot, $theme_dir . $script) || $this->appendScriptIfExist($this->serverroot, $script) - || $this->appendScriptIfExist($this->serverroot, $theme_dir."dist/$app-$scriptName") + || $this->appendScriptIfExist($this->serverroot, $theme_dir . "dist/$app-$scriptName") || $this->appendScriptIfExist($this->serverroot, "dist/$app-$scriptName") || $this->appendScriptIfExist($appRoot, $script, $appWebRoot) - || $this->cacheAndAppendCombineJsonIfExist($this->serverroot, $script.'.json') - || $this->cacheAndAppendCombineJsonIfExist($appRoot, $script.'.json', $appWebRoot) - || $this->appendScriptIfExist($this->serverroot, $theme_dir.'core/'.$script) - || $this->appendScriptIfExist($this->serverroot, 'core/'.$script) - || (strpos($scriptName, '/') === -1 && ($this->appendScriptIfExist($this->serverroot, $theme_dir."dist/core-$scriptName") + || $this->cacheAndAppendCombineJsonIfExist($this->serverroot, $script . '.json') + || $this->cacheAndAppendCombineJsonIfExist($appRoot, $script . '.json', $appWebRoot) + || $this->appendScriptIfExist($this->serverroot, $theme_dir . 'core/' . $script) + || $this->appendScriptIfExist($this->serverroot, 'core/' . $script) + || (strpos($scriptName, '/') === -1 && ($this->appendScriptIfExist($this->serverroot, $theme_dir . "dist/core-$scriptName") || $this->appendScriptIfExist($this->serverroot, "dist/core-$scriptName"))) - || $this->cacheAndAppendCombineJsonIfExist($this->serverroot, 'core/'.$script.'.json') + || $this->cacheAndAppendCombineJsonIfExist($this->serverroot, 'core/' . $script . '.json') ) { return; } @@ -108,7 +108,7 @@ protected function appendScriptIfExist(string $root, string $file, ?string $webR } protected function cacheAndAppendCombineJsonIfExist($root, $file, $app = 'core') { - if (is_file($root.'/'.$file)) { + if (is_file($root . '/' . $file)) { if ($this->jsCombiner->process($root, $file, $app)) { $this->append($this->serverroot, $this->jsCombiner->getCachedJS($app, $file), false, false); } else { diff --git a/lib/private/Template/ResourceLocator.php b/lib/private/Template/ResourceLocator.php index 377f0e0b6a873..fa52f8e5c0d54 100755 --- a/lib/private/Template/ResourceLocator.php +++ b/lib/private/Template/ResourceLocator.php @@ -75,7 +75,7 @@ public function find($resources) { * @return bool True if the resource was found, false otherwise */ protected function appendIfExist($root, $file, $webRoot = null) { - if ($root !== false && is_file($root.'/'.$file)) { + if ($root !== false && is_file($root . '/' . $file)) { $this->append($root, $file, $webRoot, false); return true; } diff --git a/lib/private/Template/TemplateFileLocator.php b/lib/private/Template/TemplateFileLocator.php index 164fcd503c12b..38583d158a3c3 100644 --- a/lib/private/Template/TemplateFileLocator.php +++ b/lib/private/Template/TemplateFileLocator.php @@ -29,13 +29,13 @@ public function find($template) { } foreach ($this->dirs as $dir) { - $file = $dir.$template.'.php'; + $file = $dir . $template . '.php'; if (is_file($file)) { $this->path = $dir; return $file; } } - throw new \Exception('template file not found: template:'.$template); + throw new \Exception('template file not found: template:' . $template); } public function getPath() { diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 0ef4ec197cf67..6c7cec9074054 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -242,7 +242,7 @@ public function __construct($renderAs, $appId = '') { foreach ($jsFiles as $info) { $web = $info[1]; $file = $info[2]; - $this->append('jsfiles', $web.'/'.$file . $this->getVersionHashSuffix()); + $this->append('jsfiles', $web . '/' . $file . $this->getVersionHashSuffix()); } try { @@ -275,14 +275,14 @@ public function __construct($renderAs, $appId = '') { $file = $info[2]; if (str_ends_with($file, 'print.css')) { - $this->append('printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix()); + $this->append('printcssfiles', $web . '/' . $file . $this->getVersionHashSuffix()); } else { $suffix = $this->getVersionHashSuffix($web, $file); if (!str_contains($file, '?v=')) { - $this->append('cssfiles', $web.'/'.$file . $suffix); + $this->append('cssfiles', $web . '/' . $file . $suffix); } else { - $this->append('cssfiles', $web.'/'.$file . '-' . substr($suffix, 3)); + $this->append('cssfiles', $web . '/' . $file . '-' . substr($suffix, 3)); } } } diff --git a/lib/private/TextProcessing/Db/Task.php b/lib/private/TextProcessing/Db/Task.php index 31c9aab345b97..d4ebc19e74a7e 100644 --- a/lib/private/TextProcessing/Db/Task.php +++ b/lib/private/TextProcessing/Db/Task.php @@ -70,7 +70,7 @@ public function __construct() { public function toRow(): array { return array_combine(self::$columns, array_map(function ($field) { - return $this->{'get'.ucfirst($field)}(); + return $this->{'get' . ucfirst($field)}(); }, self::$fields)); } diff --git a/lib/private/TextProcessing/Manager.php b/lib/private/TextProcessing/Manager.php index 9801a99ddec79..8d34b5fba0113 100644 --- a/lib/private/TextProcessing/Manager.php +++ b/lib/private/TextProcessing/Manager.php @@ -167,7 +167,7 @@ public function runTask(OCPTask $task): string { $task->setStatus(OCPTask::STATUS_RUNNING); if ($provider instanceof IProviderWithExpectedRuntime) { $completionExpectedAt = new \DateTime('now'); - $completionExpectedAt->add(new \DateInterval('PT'.$provider->getExpectedRuntime().'S')); + $completionExpectedAt->add(new \DateInterval('PT' . $provider->getExpectedRuntime() . 'S')); $task->setCompletionExpectedAt($completionExpectedAt); } if ($task->getId() === null) { @@ -209,7 +209,7 @@ public function scheduleTask(OCPTask $task): void { [$provider,] = $providers; if ($provider instanceof IProviderWithExpectedRuntime) { $completionExpectedAt = new \DateTime('now'); - $completionExpectedAt->add(new \DateInterval('PT'.$provider->getExpectedRuntime().'S')); + $completionExpectedAt->add(new \DateInterval('PT' . $provider->getExpectedRuntime() . 'S')); $task->setCompletionExpectedAt($completionExpectedAt); } $taskEntity = DbTask::fromPublicTask($task); diff --git a/lib/private/TextProcessing/RemoveOldTasksBackgroundJob.php b/lib/private/TextProcessing/RemoveOldTasksBackgroundJob.php index 2a71256c492e4..4a336d56077bb 100644 --- a/lib/private/TextProcessing/RemoveOldTasksBackgroundJob.php +++ b/lib/private/TextProcessing/RemoveOldTasksBackgroundJob.php @@ -23,7 +23,6 @@ public function __construct( ITimeFactory $timeFactory, private TaskMapper $taskMapper, private LoggerInterface $logger, - ) { parent::__construct($timeFactory); $this->setInterval(60 * 60 * 24); diff --git a/lib/private/TextToImage/Db/Task.php b/lib/private/TextToImage/Db/Task.php index d7eb0a2201485..cc92c86522053 100644 --- a/lib/private/TextToImage/Db/Task.php +++ b/lib/private/TextToImage/Db/Task.php @@ -71,7 +71,7 @@ public function __construct() { public function toRow(): array { return array_combine(self::$columns, array_map(function ($field) { - return $this->{'get'.ucfirst($field)}(); + return $this->{'get' . ucfirst($field)}(); }, self::$fields)); } diff --git a/lib/private/TextToImage/Db/TaskMapper.php b/lib/private/TextToImage/Db/TaskMapper.php index 4c0357884e30d..b34c749eb663a 100644 --- a/lib/private/TextToImage/Db/TaskMapper.php +++ b/lib/private/TextToImage/Db/TaskMapper.php @@ -91,7 +91,7 @@ public function findUserTasksByApp(?string $userId, string $appId, ?string $iden */ public function deleteOlderThan(int $timeout): array { $datetime = $this->timeFactory->getDateTime(); - $datetime->sub(new \DateInterval('PT'.$timeout.'S')); + $datetime->sub(new \DateInterval('PT' . $timeout . 'S')); $qb = $this->db->getQueryBuilder(); $qb->select('*') ->from($this->tableName) diff --git a/lib/private/TextToImage/Manager.php b/lib/private/TextToImage/Manager.php index 88dc108f3801e..eec6cc3d24199 100644 --- a/lib/private/TextToImage/Manager.php +++ b/lib/private/TextToImage/Manager.php @@ -103,11 +103,11 @@ public function runTask(Task $task): void { $providers = $this->getPreferredProviders(); foreach ($providers as $provider) { - $this->logger->debug('Trying to run Text2Image provider '.$provider::class); + $this->logger->debug('Trying to run Text2Image provider ' . $provider::class); try { $task->setStatus(Task::STATUS_RUNNING); $completionExpectedAt = new \DateTime('now'); - $completionExpectedAt->add(new \DateInterval('PT'.$provider->getExpectedRuntime().'S')); + $completionExpectedAt->add(new \DateInterval('PT' . $provider->getExpectedRuntime() . 'S')); $task->setCompletionExpectedAt($completionExpectedAt); if ($task->getId() === null) { $this->logger->debug('Inserting Text2Image task into DB'); @@ -198,7 +198,7 @@ public function scheduleTask(Task $task): void { $this->logger->debug('Scheduling Text2Image Task'); $task->setStatus(Task::STATUS_SCHEDULED); $completionExpectedAt = new \DateTime('now'); - $completionExpectedAt->add(new \DateInterval('PT'.$this->getPreferredProviders()[0]->getExpectedRuntime().'S')); + $completionExpectedAt->add(new \DateInterval('PT' . $this->getPreferredProviders()[0]->getExpectedRuntime() . 'S')); $task->setCompletionExpectedAt($completionExpectedAt); $taskEntity = DbTask::fromPublicTask($task); $this->taskMapper->insert($taskEntity); diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index 24454806e029a..ad12fae514464 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -43,7 +43,7 @@ public function __construct(IConfig $config, IUserSession $userSession, ICacheFactory $cacheFactory, IRequest $request, - Router $router + Router $router, ) { $this->config = $config; $this->userSession = $userSession; @@ -96,7 +96,7 @@ public function linkToRouteAbsolute(string $routeName, array $arguments = []): s public function linkToOCSRouteAbsolute(string $routeName, array $arguments = []): string { // Returns `/subfolder/index.php/ocsapp/…` with `'htaccess.IgnoreFrontController' => false` in config.php // And `/subfolder/ocsapp/…` with `'htaccess.IgnoreFrontController' => true` in config.php - $route = $this->router->generate('ocs.'.$routeName, $arguments, false); + $route = $this->router->generate('ocs.' . $routeName, $arguments, false); // Cut off `/subfolder` if (\OC::$WEBROOT !== '' && str_starts_with($route, \OC::$WEBROOT)) { @@ -176,8 +176,8 @@ public function linkTo(string $appName, string $file, array $args = []): string * Returns the path to the image. */ public function imagePath(string $appName, string $file): string { - $cache = $this->cacheFactory->createDistributed('imagePath-'.md5($this->getBaseUrl()).'-'); - $cacheKey = $appName.'-'.$file; + $cache = $this->cacheFactory->createDistributed('imagePath-' . md5($this->getBaseUrl()) . '-'); + $cacheKey = $appName . '-' . $file; if ($key = $cache->get($cacheKey)) { return $key; } diff --git a/lib/private/Updater.php b/lib/private/Updater.php index 2722c172f1a40..2ea680efcf535 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -57,7 +57,7 @@ public function __construct( private IAppConfig $appConfig, private Checker $checker, private ?LoggerInterface $log, - private Installer $installer + private Installer $installer, ) { } @@ -82,7 +82,7 @@ public function upgrade(): bool { } // Clear CAN_INSTALL file if not on git - if (\OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir.'/CAN_INSTALL')) { + if (\OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir . '/CAN_INSTALL')) { if (!unlink(\OC::$configDir . '/CAN_INSTALL')) { $this->log->error('Could not cleanup CAN_INSTALL from your config folder. Please remove this file manually.'); } @@ -100,13 +100,13 @@ public function upgrade(): bool { $this->log->error($exception->getMessage(), [ 'exception' => $exception, ]); - $this->emit('\OC\Updater', 'failure', [$exception->getMessage() . ': ' .$exception->getHint()]); + $this->emit('\OC\Updater', 'failure', [$exception->getMessage() . ': ' . $exception->getHint()]); $success = false; } catch (\Exception $exception) { $this->log->error($exception->getMessage(), [ 'exception' => $exception, ]); - $this->emit('\OC\Updater', 'failure', [get_class($exception) . ': ' .$exception->getMessage()]); + $this->emit('\OC\Updater', 'failure', [get_class($exception) . ': ' . $exception->getMessage()]); $success = false; } @@ -410,29 +410,29 @@ private function logAllEvents(): void { $dispatcher->addListener( MigratorExecuteSqlEvent::class, function (MigratorExecuteSqlEvent $event) use ($log): void { - $log->info(get_class($event).': ' . $event->getSql() . ' (' . $event->getCurrentStep() . ' of ' . $event->getMaxStep() . ')', ['app' => 'updater']); + $log->info(get_class($event) . ': ' . $event->getSql() . ' (' . $event->getCurrentStep() . ' of ' . $event->getMaxStep() . ')', ['app' => 'updater']); } ); $repairListener = function (Event $event) use ($log): void { if ($event instanceof RepairStartEvent) { - $log->info(get_class($event).': Starting ... ' . $event->getMaxStep() . ' (' . $event->getCurrentStepName() . ')', ['app' => 'updater']); + $log->info(get_class($event) . ': Starting ... ' . $event->getMaxStep() . ' (' . $event->getCurrentStepName() . ')', ['app' => 'updater']); } elseif ($event instanceof RepairAdvanceEvent) { $desc = $event->getDescription(); if (empty($desc)) { $desc = ''; } - $log->info(get_class($event).': ' . $desc . ' (' . $event->getIncrement() . ')', ['app' => 'updater']); + $log->info(get_class($event) . ': ' . $desc . ' (' . $event->getIncrement() . ')', ['app' => 'updater']); } elseif ($event instanceof RepairFinishEvent) { $log->info(get_class($event), ['app' => 'updater']); } elseif ($event instanceof RepairStepEvent) { - $log->info(get_class($event).': Repair step: ' . $event->getStepName(), ['app' => 'updater']); + $log->info(get_class($event) . ': Repair step: ' . $event->getStepName(), ['app' => 'updater']); } elseif ($event instanceof RepairInfoEvent) { - $log->info(get_class($event).': Repair info: ' . $event->getMessage(), ['app' => 'updater']); + $log->info(get_class($event) . ': Repair info: ' . $event->getMessage(), ['app' => 'updater']); } elseif ($event instanceof RepairWarningEvent) { - $log->warning(get_class($event).': Repair warning: ' . $event->getMessage(), ['app' => 'updater']); + $log->warning(get_class($event) . ': Repair warning: ' . $event->getMessage(), ['app' => 'updater']); } elseif ($event instanceof RepairErrorEvent) { - $log->error(get_class($event).': Repair error: ' . $event->getMessage(), ['app' => 'updater']); + $log->error(get_class($event) . ': Repair error: ' . $event->getMessage(), ['app' => 'updater']); } }; diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 9a84b102a9901..925d0e53921ab 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -201,7 +201,7 @@ public function checkPassword($loginName, $password) { $result = $this->checkPasswordNoLogging($loginName, $password); if ($result === false) { - \OCP\Server::get(LoggerInterface::class)->warning('Login failed: \''. $loginName .'\' (Remote IP: \''. \OC::$server->getRequest()->getRemoteAddress(). '\')', ['app' => 'core']); + \OCP\Server::get(LoggerInterface::class)->warning('Login failed: \'' . $loginName . '\' (Remote IP: \'' . \OC::$server->getRequest()->getRemoteAddress() . '\')', ['app' => 'core']); } return $result; diff --git a/lib/private/User/OutOfOfficeData.php b/lib/private/User/OutOfOfficeData.php index b173912644388..0d4e142567e82 100644 --- a/lib/private/User/OutOfOfficeData.php +++ b/lib/private/User/OutOfOfficeData.php @@ -13,14 +13,16 @@ use OCP\User\IOutOfOfficeData; class OutOfOfficeData implements IOutOfOfficeData { - public function __construct(private string $id, + public function __construct( + private string $id, private IUser $user, private int $startDate, private int $endDate, private string $shortMessage, private string $message, private ?string $replacementUserId, - private ?string $replacementUserDisplayName) { + private ?string $replacementUserDisplayName, + ) { } public function getId(): string { diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 6f7ceb0853242..f2c388253381f 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -524,7 +524,7 @@ public function setQuota($quota) { if ($quota !== 'none' and $quota !== 'default') { $bytesQuota = OC_Helper::computerFileSize($quota); if ($bytesQuota === false) { - throw new InvalidArgumentException('Failed to set quota to invalid value '.$quota); + throw new InvalidArgumentException('Failed to set quota to invalid value ' . $quota); } $quota = OC_Helper::humanFileSize($bytesQuota); } diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index 0756f274a1192..8671fdf340bb2 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -239,7 +239,7 @@ public function enable(string $appId, /** * Get the path where to install apps */ - public static function getInstallPath(): string|null { + public static function getInstallPath(): ?string { foreach (OC::$APPSROOTS as $dir) { if (isset($dir['writable']) && $dir['writable'] === true) { return $dir['path']; diff --git a/lib/private/legacy/OC_Defaults.php b/lib/private/legacy/OC_Defaults.php index 54640a892c9d7..cc0ac687ccc35 100644 --- a/lib/private/legacy/OC_Defaults.php +++ b/lib/private/legacy/OC_Defaults.php @@ -223,8 +223,8 @@ public function getShortFooter() { if ($this->themeExist('getShortFooter')) { $footer = $this->theme->getShortFooter(); } else { - $footer = '' .$this->getEntity() . ''. + $footer = '' . $this->getEntity() . '' . ' – ' . $this->getSlogan(); } diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php index 8e23d70c69060..8d253bcc2ef4b 100644 --- a/lib/private/legacy/OC_Files.php +++ b/lib/private/legacy/OC_Files.php @@ -51,7 +51,7 @@ private static function sendHeaders($filename, $name, array $rangeArray): void { http_response_code(206); header('Accept-Ranges: bytes', true); if (count($rangeArray) > 1) { - $type = 'multipart/byteranges; boundary='.self::getBoundary(); + $type = 'multipart/byteranges; boundary=' . self::getBoundary(); // no Content-Length header here } else { header(sprintf('Content-Range: bytes %d-%d/%d', $rangeArray[0]['from'], $rangeArray[0]['to'], $fileSize), true); @@ -61,7 +61,7 @@ private static function sendHeaders($filename, $name, array $rangeArray): void { OC_Response::setContentLengthHeader($fileSize); } } - header('Content-Type: '.$type, true); + header('Content-Type: ' . $type, true); header('X-Accel-Buffering: no'); } @@ -334,12 +334,12 @@ private static function getSingleFile($view, $dir, $name, $params) { $type = \OC::$server->getMimeTypeDetector()->getSecureMimeType(\OC\Files\Filesystem::getMimeType($filename)); foreach ($rangeArray as $range) { - echo "\r\n--".self::getBoundary()."\r\n". - 'Content-type: '.$type."\r\n". - 'Content-range: bytes '.$range['from'].'-'.$range['to'].'/'.$range['size']."\r\n\r\n"; + echo "\r\n--" . self::getBoundary() . "\r\n" . + 'Content-type: ' . $type . "\r\n" . + 'Content-range: bytes ' . $range['from'] . '-' . $range['to'] . '/' . $range['size'] . "\r\n\r\n"; $view->readfilePart($filename, $range['from'], $range['to']); } - echo "\r\n--".self::getBoundary()."--\r\n"; + echo "\r\n--" . self::getBoundary() . "--\r\n"; } } catch (\OCP\Files\UnseekableException $ex) { // file is unseekable diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index 6da063ef2ce58..0e55eff8f8c62 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -463,7 +463,7 @@ public static function getStorageInfo($path, $rootInfo = null, $includeMountPoin } $fullPath = Filesystem::normalizePath($view->getAbsolutePath($path)); - $cacheKey = $fullPath. '::' . ($includeMountPoints ? 'include' : 'exclude'); + $cacheKey = $fullPath . '::' . ($includeMountPoints ? 'include' : 'exclude'); if ($useCache) { $cached = $memcache->get($cacheKey); if ($cached) { diff --git a/lib/private/legacy/OC_JSON.php b/lib/private/legacy/OC_JSON.php index a9682e2cce7df..e510595a3cb64 100644 --- a/lib/private/legacy/OC_JSON.php +++ b/lib/private/legacy/OC_JSON.php @@ -46,7 +46,7 @@ public static function checkLoggedIn() { */ public static function callCheck() { if (!\OC::$server->getRequest()->passesStrictCookieCheck()) { - header('Location: '.\OC::$WEBROOT); + header('Location: ' . \OC::$WEBROOT); exit(); } diff --git a/lib/private/legacy/OC_Response.php b/lib/private/legacy/OC_Response.php index 8c8890c74c4a9..86274f5fcb77c 100644 --- a/lib/private/legacy/OC_Response.php +++ b/lib/private/legacy/OC_Response.php @@ -43,7 +43,7 @@ public static function setContentLengthHeader($length) { $lfh = new \OC\LargeFileHelper; $length = $lfh->formatUnsignedInteger($length); } - header('Content-Length: '.$length); + header('Content-Length: ' . $length); } /** @@ -59,7 +59,7 @@ public static function addSecurityHeaders() { * @see \OCP\AppFramework\Http\Response::getHeaders */ $policy = 'default-src \'self\'; ' - . 'script-src \'self\' \'nonce-'.\OC::$server->getContentSecurityPolicyNonceManager()->getNonce().'\'; ' + . 'script-src \'self\' \'nonce-' . \OC::$server->getContentSecurityPolicyNonceManager()->getNonce() . '\'; ' . 'style-src \'self\' \'unsafe-inline\'; ' . 'frame-src *; ' . 'img-src * data: blob:; ' diff --git a/lib/private/legacy/OC_Template.php b/lib/private/legacy/OC_Template.php index 422709cec7d7c..6bd6ed0a4991f 100644 --- a/lib/private/legacy/OC_Template.php +++ b/lib/private/legacy/OC_Template.php @@ -10,7 +10,7 @@ use OCP\AppFramework\Http\TemplateResponse; use OCP\EventDispatcher\IEventDispatcher; -require_once __DIR__.'/template/functions.php'; +require_once __DIR__ . '/template/functions.php'; /** * This class provides the templates for ownCloud. @@ -127,15 +127,15 @@ public function fetchPage($additionalParams = null) { // Add custom headers $headers = ''; foreach (OC_Util::$headers as $header) { - $headers .= '<'.\OCP\Util::sanitizeHTML($header['tag']); + $headers .= '<' . \OCP\Util::sanitizeHTML($header['tag']); if (strcasecmp($header['tag'], 'script') === 0 && in_array('src', array_map('strtolower', array_keys($header['attributes'])))) { $headers .= ' defer'; } foreach ($header['attributes'] as $name => $value) { - $headers .= ' '.\OCP\Util::sanitizeHTML($name).'="'.\OCP\Util::sanitizeHTML($value).'"'; + $headers .= ' ' . \OCP\Util::sanitizeHTML($name) . '="' . \OCP\Util::sanitizeHTML($value) . '"'; } if ($header['text'] !== null) { - $headers .= '>'.\OCP\Util::sanitizeHTML($header['text']).''; + $headers .= '>' . \OCP\Util::sanitizeHTML($header['text']) . ''; } else { $headers .= '/>'; } @@ -161,7 +161,7 @@ public function fetchPage($additionalParams = null) { * do this. */ public function inc($file, $additionalParams = null) { - return $this->load($this->path.$file.'.php', $additionalParams); + return $this->load($this->path . $file . '.php', $additionalParams); } /** diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 84bb0b645d5d0..6168f7db9991e 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -156,7 +156,7 @@ public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) { } if (!empty($skeletonDirectory)) { - $logger->debug('copying skeleton for '.$userId.' from '.$skeletonDirectory.' to '.$userDirectory->getFullPath('/'), ['app' => 'files_skeleton']); + $logger->debug('copying skeleton for ' . $userId . ' from ' . $skeletonDirectory . ' to ' . $userDirectory->getFullPath('/'), ['app' => 'files_skeleton']); self::copyr($skeletonDirectory, $userDirectory); // update the file cache $userDirectory->getStorage()->getScanner()->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE); @@ -783,7 +783,7 @@ public static function getInstanceId() { $id = \OC::$server->getSystemConfig()->getValue('instanceid', null); if (is_null($id)) { // We need to guarantee at least one letter in instanceid so it can be used as the session_name - $id = 'oc' . \OC::$server->get(ISecureRandom::class)->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); + $id = 'oc' . \OC::$server->get(ISecureRandom::class)->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER . \OCP\Security\ISecureRandom::CHAR_DIGITS); \OC::$server->getSystemConfig()->setValue('instanceid', $id); } return $id; diff --git a/lib/private/legacy/template/functions.php b/lib/private/legacy/template/functions.php index a9a1f10a116f6..37df801c3c4ed 100644 --- a/lib/private/legacy/template/functions.php +++ b/lib/private/legacy/template/functions.php @@ -22,12 +22,12 @@ function p($string) { function emit_css_tag($href, $opts = '') { $s = '\n"); + print_unescaped($s . ">\n"); } /** @@ -58,16 +58,16 @@ function emit_script_tag(string $src, string $script_content = '', string $conte $s = ''; - print_unescaped($s."\n"); + print_unescaped($s . "\n"); } /** @@ -314,7 +314,7 @@ function html_select_options($options, $selected, $params = []) { $label = $label[$label_name]; } $select = in_array($value, $selected) ? ' selected="selected"' : ''; - $html .= ''."\n"; + $html .= '' . "\n"; } return $html; } diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php index 580288fbff7d5..1182f611b299f 100644 --- a/lib/public/App/IAppManager.php +++ b/lib/public/App/IAppManager.php @@ -51,7 +51,7 @@ public function getAppVersion(string $appId, bool $useCache = true): string; * @return string|null * @since 29.0.0 */ - public function getAppIcon(string $appId, bool $dark = false): string|null; + public function getAppIcon(string $appId, bool $dark = false): ?string; /** * Check if an app is enabled for user diff --git a/lib/public/AppFramework/AuthPublicShareController.php b/lib/public/AppFramework/AuthPublicShareController.php index b79f530dc4dcd..28a92fedcc9a1 100644 --- a/lib/public/AppFramework/AuthPublicShareController.php +++ b/lib/public/AppFramework/AuthPublicShareController.php @@ -192,7 +192,7 @@ private function getRoute(string $function): string { if (str_ends_with($class, 'Controller')) { $class = substr($class, 0, -10); } - return $app .'.'. $class .'.'. $function; + return $app . '.' . $class . '.' . $function; } /** diff --git a/lib/public/AppFramework/Controller.php b/lib/public/AppFramework/Controller.php index 99fed5350e59a..7c25b3382e7be 100644 --- a/lib/public/AppFramework/Controller.php +++ b/lib/public/AppFramework/Controller.php @@ -135,7 +135,7 @@ public function buildResponse($response, $format = 'json') { return $responder($response); } - throw new \DomainException('No responder registered for format '. + throw new \DomainException('No responder registered for format ' . $format . '!'); } } diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index cd09a6b11b62c..ef4516221e6b8 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -296,7 +296,7 @@ private function buildDebugMessage(string $msg, IQueryBuilder $sql): string { */ protected function mapRowToEntity(array $row): Entity { unset($row['DOCTRINE_ROWNUM']); // remove doctrine/dbal helper column - return \call_user_func($this->entityClass .'::fromRow', $row); + return \call_user_func($this->entityClass . '::fromRow', $row); } diff --git a/lib/public/AppFramework/Http/Attribute/AuthorizedAdminSetting.php b/lib/public/AppFramework/Http/Attribute/AuthorizedAdminSetting.php index e81f195b29893..83101143fc910 100644 --- a/lib/public/AppFramework/Http/Attribute/AuthorizedAdminSetting.php +++ b/lib/public/AppFramework/Http/Attribute/AuthorizedAdminSetting.php @@ -25,7 +25,7 @@ class AuthorizedAdminSetting { * @since 27.0.0 */ public function __construct( - protected string $settings + protected string $settings, ) { } diff --git a/lib/public/AppFramework/Http/Attribute/BruteForceProtection.php b/lib/public/AppFramework/Http/Attribute/BruteForceProtection.php index 9fd97cdc3ed3e..0fc1a3b9b6db7 100644 --- a/lib/public/AppFramework/Http/Attribute/BruteForceProtection.php +++ b/lib/public/AppFramework/Http/Attribute/BruteForceProtection.php @@ -23,7 +23,7 @@ class BruteForceProtection { * @since 27.0.0 */ public function __construct( - protected string $action + protected string $action, ) { } diff --git a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php index 0a6258be94138..584191b9aaa2b 100644 --- a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php +++ b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php @@ -448,7 +448,7 @@ public function buildPolicy() { if ($this->strictDynamicAllowed) { $scriptSrc .= '\'strict-dynamic\' '; } - $scriptSrc .= '\'nonce-'.$this->jsNonce.'\''; + $scriptSrc .= '\'nonce-' . $this->jsNonce . '\''; $allowedScriptDomains = array_flip($this->allowedScriptDomains); unset($allowedScriptDomains['\'self\'']); $this->allowedScriptDomains = array_flip($allowedScriptDomains); diff --git a/lib/public/AppFramework/Http/Events/BeforeLoginTemplateRenderedEvent.php b/lib/public/AppFramework/Http/Events/BeforeLoginTemplateRenderedEvent.php index d18cad25acc2f..b724b3a72adc8 100644 --- a/lib/public/AppFramework/Http/Events/BeforeLoginTemplateRenderedEvent.php +++ b/lib/public/AppFramework/Http/Events/BeforeLoginTemplateRenderedEvent.php @@ -20,7 +20,9 @@ class BeforeLoginTemplateRenderedEvent extends Event { /** * @since 28.0.0 */ - public function __construct(private TemplateResponse $response) { + public function __construct( + private TemplateResponse $response, + ) { parent::__construct(); } diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php index 940f0f124e882..d186040235939 100644 --- a/lib/public/AppFramework/Http/Response.php +++ b/lib/public/AppFramework/Http/Response.php @@ -96,7 +96,7 @@ public function cacheFor(int $cacheSeconds, bool $public = false, bool $immutabl /** @var ITimeFactory $time */ $time = \OCP\Server::get(ITimeFactory::class); $expires->setTimestamp($time->getTime()); - $expires->add(new \DateInterval('PT'.$cacheSeconds.'S')); + $expires->add(new \DateInterval('PT' . $cacheSeconds . 'S')); $this->addHeader('Expires', $expires->format(\DateTimeInterface::RFC2822)); } else { $this->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate'); diff --git a/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengeFailed.php b/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengeFailed.php index 15e5ed92509dc..42ca855df35a2 100644 --- a/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengeFailed.php +++ b/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengeFailed.php @@ -20,7 +20,8 @@ class TwoFactorProviderChallengeFailed extends Event { */ public function __construct( private IUser $user, - private IProvider $provider) { + private IProvider $provider, + ) { parent::__construct(); } diff --git a/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengePassed.php b/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengePassed.php index 2dc91a98880bc..396fbf9e9a5bd 100644 --- a/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengePassed.php +++ b/lib/public/Authentication/TwoFactorAuth/TwoFactorProviderChallengePassed.php @@ -20,7 +20,8 @@ class TwoFactorProviderChallengePassed extends Event { */ public function __construct( private IUser $user, - private IProvider $provider) { + private IProvider $provider, + ) { parent::__construct(); } diff --git a/lib/public/AutoloadNotAllowedException.php b/lib/public/AutoloadNotAllowedException.php index 6e897b49406cf..a296ea3356a85 100644 --- a/lib/public/AutoloadNotAllowedException.php +++ b/lib/public/AutoloadNotAllowedException.php @@ -18,6 +18,6 @@ class AutoloadNotAllowedException extends \DomainException { * @since 8.2.0 */ public function __construct($path) { - parent::__construct('Autoload path not allowed: '.$path); + parent::__construct('Autoload path not allowed: ' . $path); } } diff --git a/lib/public/Comments/ICommentsManager.php b/lib/public/Comments/ICommentsManager.php index af9d0fe61f073..0ff762e51d041 100644 --- a/lib/public/Comments/ICommentsManager.php +++ b/lib/public/Comments/ICommentsManager.php @@ -97,7 +97,7 @@ public function getForObject( $objectId, $limit = 0, $offset = 0, - ?\DateTime $notOlderThan = null + ?\DateTime $notOlderThan = null, ); /** @@ -118,7 +118,7 @@ public function getForObjectSince( int $lastKnownCommentId, string $sortDirection = 'asc', int $limit = 30, - bool $includeLastKnown = false + bool $includeLastKnown = false, ): array; /** @@ -140,7 +140,7 @@ public function getCommentsWithVerbForObjectSinceComment( int $lastKnownCommentId, string $sortDirection = 'asc', int $limit = 30, - bool $includeLastKnown = false + bool $includeLastKnown = false, ): array; /** @@ -240,7 +240,7 @@ public function getLastCommentDateByActor( string $objectId, string $verb, string $actorType, - array $actors + array $actors, ): array; /** diff --git a/lib/public/Files/Events/Node/AbstractNodeEvent.php b/lib/public/Files/Events/Node/AbstractNodeEvent.php index 64b0e3a3aa511..7afb71277f69a 100644 --- a/lib/public/Files/Events/Node/AbstractNodeEvent.php +++ b/lib/public/Files/Events/Node/AbstractNodeEvent.php @@ -21,7 +21,7 @@ abstract class AbstractNodeEvent extends Event implements IWebhookCompatibleEven * @since 20.0.0 */ public function __construct( - private Node $node + private Node $node, ) { } diff --git a/lib/public/Files/Events/Node/AbstractNodesEvent.php b/lib/public/Files/Events/Node/AbstractNodesEvent.php index 7941a9e596a80..8fa8795d1df82 100644 --- a/lib/public/Files/Events/Node/AbstractNodesEvent.php +++ b/lib/public/Files/Events/Node/AbstractNodesEvent.php @@ -22,7 +22,7 @@ abstract class AbstractNodesEvent extends Event implements IWebhookCompatibleEve */ public function __construct( private Node $source, - private Node $target + private Node $target, ) { } diff --git a/lib/public/Files/Lock/LockContext.php b/lib/public/Files/Lock/LockContext.php index 48d9f804fc409..5e61d3e2ec51a 100644 --- a/lib/public/Files/Lock/LockContext.php +++ b/lib/public/Files/Lock/LockContext.php @@ -33,7 +33,7 @@ final class LockContext { public function __construct( Node $node, int $type, - string $owner + string $owner, ) { $this->node = $node; $this->type = $type; diff --git a/lib/public/Files/Template/Field.php b/lib/public/Files/Template/Field.php index dd65ef857ea0c..ec195ca350497 100644 --- a/lib/public/Files/Template/Field.php +++ b/lib/public/Files/Template/Field.php @@ -22,7 +22,7 @@ abstract class Field implements \JsonSerializable { */ public function __construct( private string $index, - private FieldType $type + private FieldType $type, ) { } diff --git a/lib/public/Files/Template/FieldFactory.php b/lib/public/Files/Template/FieldFactory.php index 4c0fff6b46fe5..f14d44a85739d 100644 --- a/lib/public/Files/Template/FieldFactory.php +++ b/lib/public/Files/Template/FieldFactory.php @@ -21,7 +21,7 @@ class FieldFactory { */ public static function createField( string $index, - FieldType $type + FieldType $type, ): Field { return match ($type) { FieldType::RichText => new RichTextField($index, $type), diff --git a/lib/public/Files/Template/RegisterTemplateCreatorEvent.php b/lib/public/Files/Template/RegisterTemplateCreatorEvent.php index 4f739b1f9d303..c931f3e2a78d6 100644 --- a/lib/public/Files/Template/RegisterTemplateCreatorEvent.php +++ b/lib/public/Files/Template/RegisterTemplateCreatorEvent.php @@ -17,7 +17,7 @@ class RegisterTemplateCreatorEvent extends Event { * @since 30.0.0 */ public function __construct( - private ITemplateManager $templateManager + private ITemplateManager $templateManager, ) { } diff --git a/lib/public/Files/Template/TemplateFileCreator.php b/lib/public/Files/Template/TemplateFileCreator.php index b8174ec3ea095..9a4bd2fae43e6 100644 --- a/lib/public/Files/Template/TemplateFileCreator.php +++ b/lib/public/Files/Template/TemplateFileCreator.php @@ -34,7 +34,7 @@ final class TemplateFileCreator implements \JsonSerializable { * @since 21.0.0 */ public function __construct( - string $appId, string $actionName, string $fileExtension + string $appId, string $actionName, string $fileExtension, ) { $this->appId = $appId; $this->actionName = $actionName; diff --git a/lib/public/FilesMetadata/AMetadataEvent.php b/lib/public/FilesMetadata/AMetadataEvent.php index 637073a2ffd9b..8fef0d85db940 100644 --- a/lib/public/FilesMetadata/AMetadataEvent.php +++ b/lib/public/FilesMetadata/AMetadataEvent.php @@ -23,7 +23,7 @@ abstract class AMetadataEvent extends Event { */ public function __construct( protected Node $node, - protected IFilesMetadata $metadata + protected IFilesMetadata $metadata, ) { parent::__construct(); } diff --git a/lib/public/FilesMetadata/Event/MetadataNamedEvent.php b/lib/public/FilesMetadata/Event/MetadataNamedEvent.php index 6b40bc2f3796d..453eae1d6af2e 100644 --- a/lib/public/FilesMetadata/Event/MetadataNamedEvent.php +++ b/lib/public/FilesMetadata/Event/MetadataNamedEvent.php @@ -38,7 +38,7 @@ class MetadataNamedEvent extends AMetadataEvent { public function __construct( Node $node, IFilesMetadata $metadata, - private string $name = '' + private string $name = '', ) { parent::__construct($node, $metadata); } diff --git a/lib/public/FilesMetadata/IFilesMetadataManager.php b/lib/public/FilesMetadata/IFilesMetadataManager.php index ba2a5bd245063..4b1a6d32e8e76 100644 --- a/lib/public/FilesMetadata/IFilesMetadataManager.php +++ b/lib/public/FilesMetadata/IFilesMetadataManager.php @@ -50,7 +50,7 @@ interface IFilesMetadataManager { public function refreshMetadata( Node $node, int $process = self::PROCESS_LIVE, - string $namedEvent = '' + string $namedEvent = '', ): IFilesMetadata; /** @@ -112,7 +112,7 @@ public function deleteMetadata(int $fileId): void; public function getMetadataQuery( IQueryBuilder $qb, string $fileTableAlias, - string $fileIdField + string $fileIdField, ): IMetadataQuery; /** diff --git a/lib/public/INavigationManager.php b/lib/public/INavigationManager.php index d22e96aa9d337..2bd70c04d6500 100644 --- a/lib/public/INavigationManager.php +++ b/lib/public/INavigationManager.php @@ -87,7 +87,7 @@ public function setUnreadCounter(string $id, int $unreadCounter): void; * @param string $id ID of the navigation entry * @since 31.0.0 */ - public function get(string $id): array|null; + public function get(string $id): ?array; /** * Returns the id of the user's default entry diff --git a/lib/public/Log/RotationTrait.php b/lib/public/Log/RotationTrait.php index 1481ed71833f7..03100613c4ce1 100644 --- a/lib/public/Log/RotationTrait.php +++ b/lib/public/Log/RotationTrait.php @@ -29,7 +29,7 @@ trait RotationTrait { * @since 14.0.0 */ protected function rotate():string { - $rotatedFile = $this->filePath.'.1'; + $rotatedFile = $this->filePath . '.1'; rename($this->filePath, $rotatedFile); return $rotatedFile; } diff --git a/lib/public/Mail/Provider/Address.php b/lib/public/Mail/Provider/Address.php index 44a5544ee4b71..751fb99d930ff 100644 --- a/lib/public/Mail/Provider/Address.php +++ b/lib/public/Mail/Provider/Address.php @@ -28,7 +28,7 @@ class Address implements \OCP\Mail\Provider\IAddress { */ public function __construct( protected ?string $address = null, - protected ?string $label = null + protected ?string $label = null, ) { } @@ -53,7 +53,7 @@ public function setAddress(string $value): self { * * @return string|null returns the mail address or null if one is not set */ - public function getAddress(): string|null { + public function getAddress(): ?string { return $this->address; } @@ -78,7 +78,7 @@ public function setLabel(string $value): self { * * @return string|null returns the mail address label/name or null if one is not set */ - public function getLabel(): string|null { + public function getLabel(): ?string { return $this->label; } diff --git a/lib/public/Mail/Provider/Attachment.php b/lib/public/Mail/Provider/Attachment.php index cb7b9b0d24104..af7340a3ccfd3 100644 --- a/lib/public/Mail/Provider/Attachment.php +++ b/lib/public/Mail/Provider/Attachment.php @@ -32,7 +32,7 @@ public function __construct( protected ?string $contents, protected ?string $name, protected ?string $type, - protected bool $embedded = false + protected bool $embedded = false, ) { } @@ -57,7 +57,7 @@ public function setName(string $value): self { * * @return string | null returns the attachment file name or null if not set */ - public function getName(): string|null { + public function getName(): ?string { return $this->name; } @@ -82,7 +82,7 @@ public function setType(string $value): self { * * @return string | null returns the attachment mime type or null if not set */ - public function getType(): string|null { + public function getType(): ?string { return $this->type; } @@ -107,7 +107,7 @@ public function setContents(string $value): self { * * @return string | null returns the attachment contents or null if not set */ - public function getContents(): string|null { + public function getContents(): ?string { return $this->contents; } diff --git a/lib/public/Mail/Provider/IAddress.php b/lib/public/Mail/Provider/IAddress.php index b5748a51cc0c3..121467390dc59 100644 --- a/lib/public/Mail/Provider/IAddress.php +++ b/lib/public/Mail/Provider/IAddress.php @@ -36,7 +36,7 @@ public function setAddress(string $value): self; * * @return string returns the mail address */ - public function getAddress(): string|null; + public function getAddress(): ?string; /** * sets the mail address label/name @@ -56,6 +56,6 @@ public function setLabel(string $value): self; * * @return string returns the mail address label/name */ - public function getLabel(): string|null; + public function getLabel(): ?string; } diff --git a/lib/public/Mail/Provider/IAttachment.php b/lib/public/Mail/Provider/IAttachment.php index e27f5ee066b1b..ff26699491920 100644 --- a/lib/public/Mail/Provider/IAttachment.php +++ b/lib/public/Mail/Provider/IAttachment.php @@ -36,7 +36,7 @@ public function setName(string $value): self; * * @return string | null returns the attachment file name or null if one is not set */ - public function getName(): string|null; + public function getName(): ?string; /** * sets the attachment mime type @@ -56,7 +56,7 @@ public function setType(string $value): self; * * @return string | null returns the attachment mime type or null if not set */ - public function getType(): string|null; + public function getType(): ?string; /** * sets the attachment contents (actual data) @@ -76,7 +76,7 @@ public function setContents(string $value): self; * * @return string | null returns the attachment contents or null if not set */ - public function getContents(): string|null; + public function getContents(): ?string; /** * sets the embedded status of the attachment diff --git a/lib/public/Mail/Provider/IManager.php b/lib/public/Mail/Provider/IManager.php index ff01f93d2a408..3c639ef21efa6 100644 --- a/lib/public/Mail/Provider/IManager.php +++ b/lib/public/Mail/Provider/IManager.php @@ -63,7 +63,7 @@ public function providers(): array; * * @return IProvider|null */ - public function findProviderById(string $providerId): IProvider|null; + public function findProviderById(string $providerId): ?IProvider; /** * retrieve all services for all registered mail providers @@ -87,7 +87,7 @@ public function services(string $userId): array; * * @return IService|null returns service object or null if none found */ - public function findServiceById(string $userId, string $serviceId, ?string $providerId = null): IService|null; + public function findServiceById(string $userId, string $serviceId, ?string $providerId = null): ?IService; /** * retrieve a service for a specific mail address @@ -101,6 +101,6 @@ public function findServiceById(string $userId, string $serviceId, ?string $prov * * @return IService|null returns service object or null if none found */ - public function findServiceByAddress(string $userId, string $address, ?string $providerId = null): IService|null; + public function findServiceByAddress(string $userId, string $address, ?string $providerId = null): ?IService; } diff --git a/lib/public/Mail/Provider/IMessage.php b/lib/public/Mail/Provider/IMessage.php index 2ad3b422b9d4d..e3dfbe6981d5a 100644 --- a/lib/public/Mail/Provider/IMessage.php +++ b/lib/public/Mail/Provider/IMessage.php @@ -45,7 +45,7 @@ public function setFrom(IAddress $value): self; * * @return IAddress|null sender's mail address object */ - public function getFrom(): IAddress|null; + public function getFrom(): ?IAddress; /** * sets the sender's reply to address of this message @@ -65,7 +65,7 @@ public function setReplyTo(IAddress $value): self; * * @return IAddress|null sender's reply to mail address object */ - public function getReplyTo(): IAddress|null; + public function getReplyTo(): ?IAddress; /** * sets the recipient(s) of this message @@ -145,7 +145,7 @@ public function setSubject(string $value): self; * * @return string|null subject of message or null if one is not set */ - public function getSubject(): string|null; + public function getSubject(): ?string; /** * sets the plain text or html body of this message @@ -168,7 +168,7 @@ public function setBody(string $value, bool $html): self; * * @return string|null html/plain body of this message or null if one is not set */ - public function getBody(): string|null; + public function getBody(): ?string; /** * sets the html body of this message @@ -188,7 +188,7 @@ public function setBodyHtml(string $value): self; * * @return string|null html body of this message or null if one is not set */ - public function getBodyHtml(): string|null; + public function getBodyHtml(): ?string; /** * sets the plain text body of this message @@ -208,7 +208,7 @@ public function setBodyPlain(string $value): self; * * @return string|null plain text body of this message or null if one is not set */ - public function getBodyPlain(): string|null; + public function getBodyPlain(): ?string; /** * sets the attachments of this message diff --git a/lib/public/Mail/Provider/IProvider.php b/lib/public/Mail/Provider/IProvider.php index e94ee73217a76..d89022d7cbf2b 100644 --- a/lib/public/Mail/Provider/IProvider.php +++ b/lib/public/Mail/Provider/IProvider.php @@ -68,7 +68,7 @@ public function listServices(string $userId): array; * * @return IService|null returns service object or null if none found */ - public function findServiceById(string $userId, string $serviceId): IService|null; + public function findServiceById(string $userId, string $serviceId): ?IService; /** * retrieve a service for a specific mail address @@ -80,7 +80,7 @@ public function findServiceById(string $userId, string $serviceId): IService|nul * * @return IService|null returns service object or null if none found */ - public function findServiceByAddress(string $userId, string $address): IService|null; + public function findServiceByAddress(string $userId, string $address): ?IService; /** * construct a new empty service object diff --git a/lib/public/Mail/Provider/Message.php b/lib/public/Mail/Provider/Message.php index 7814fb849d548..f7a21c05ed3f6 100644 --- a/lib/public/Mail/Provider/Message.php +++ b/lib/public/Mail/Provider/Message.php @@ -65,7 +65,7 @@ public function setFrom(IAddress $value): self { * * @return IAddress|null sender's mail address object */ - public function getFrom(): IAddress|null { + public function getFrom(): ?IAddress { // evaluate if data store field exists and return value(s) or null otherwise return (isset($this->data['from'])) ? $this->data['from'] : null; } @@ -93,7 +93,7 @@ public function setReplyTo(IAddress $value): self { * * @return IAddress|null sender's reply to mail address object */ - public function getReplyTo(): IAddress|null { + public function getReplyTo(): ?IAddress { // evaluate if data store field exists and return value(s) or null otherwise return (isset($this->data['replyTo'])) ? $this->data['replyTo'] : null; } @@ -205,7 +205,7 @@ public function setSubject(string $value): self { * * @return string|null subject of message or null if one is not set */ - public function getSubject(): string|null { + public function getSubject(): ?string { // evaluate if data store field exists and return value(s) or null otherwise return (isset($this->data['subject'])) ? $this->data['subject'] : null; } @@ -240,7 +240,7 @@ public function setBody(string $value, bool $html = false): self { * * @return string|null html/plain body of this message or null if one is not set */ - public function getBody(): string|null { + public function getBody(): ?string { // evaluate if data store field(s) exists and return value if (isset($this->data['bodyHtml'])) { return $this->data['bodyHtml']; @@ -274,7 +274,7 @@ public function setBodyHtml(string $value): self { * * @return string|null html body of this message or null if one is not set */ - public function getBodyHtml(): string|null { + public function getBodyHtml(): ?string { // evaluate if data store field exists and return value(s) or null otherwise return (isset($this->data['bodyHtml'])) ? $this->data['bodyHtml'] : null; } @@ -302,7 +302,7 @@ public function setBodyPlain(string $value): self { * * @return string|null plain text body of this message or null if one is not set */ - public function getBodyPlain(): string|null { + public function getBodyPlain(): ?string { // evaluate if data store field exists and return value(s) or null otherwise return (isset($this->data['bodyPlain'])) ? $this->data['bodyPlain'] : null; } diff --git a/lib/public/Migration/Attributes/GenericMigrationAttribute.php b/lib/public/Migration/Attributes/GenericMigrationAttribute.php index 6f187635ff768..e63f78088e841 100644 --- a/lib/public/Migration/Attributes/GenericMigrationAttribute.php +++ b/lib/public/Migration/Attributes/GenericMigrationAttribute.php @@ -22,7 +22,7 @@ class GenericMigrationAttribute extends MigrationAttribute implements JsonSerial * @since 30.0.0 */ public function __construct( - private readonly array $details = [] + private readonly array $details = [], ) { parent::__construct( $details['table'] ?? '', diff --git a/lib/public/Preview/IMimeIconProvider.php b/lib/public/Preview/IMimeIconProvider.php index da4896bec8714..4a407f4857767 100644 --- a/lib/public/Preview/IMimeIconProvider.php +++ b/lib/public/Preview/IMimeIconProvider.php @@ -18,5 +18,5 @@ interface IMimeIconProvider { * if no preview is available. * @since 28.0.0 */ - public function getMimeIconUrl(string $mime): string|null; + public function getMimeIconUrl(string $mime): ?string; } diff --git a/lib/public/Settings/Events/DeclarativeSettingsRegisterFormEvent.php b/lib/public/Settings/Events/DeclarativeSettingsRegisterFormEvent.php index 951e4ad92980a..e861afdd5806c 100644 --- a/lib/public/Settings/Events/DeclarativeSettingsRegisterFormEvent.php +++ b/lib/public/Settings/Events/DeclarativeSettingsRegisterFormEvent.php @@ -22,7 +22,9 @@ class DeclarativeSettingsRegisterFormEvent extends Event { /** * @since 29.0.0 */ - public function __construct(private IDeclarativeManager $manager) { + public function __construct( + private IDeclarativeManager $manager, + ) { parent::__construct(); } diff --git a/lib/public/Share/IShare.php b/lib/public/Share/IShare.php index c2843c078e3aa..cdad084ac925f 100644 --- a/lib/public/Share/IShare.php +++ b/lib/public/Share/IShare.php @@ -368,7 +368,7 @@ public function getNote(); * @return \OCP\Share\IShare The modified object * @since 9.0.0 */ - public function setExpirationDate(\DateTime|null $expireDate); + public function setExpirationDate(?\DateTime $expireDate); /** * Get the expiration date diff --git a/lib/public/TaskProcessing/Events/AbstractTaskProcessingEvent.php b/lib/public/TaskProcessing/Events/AbstractTaskProcessingEvent.php index 84dbb8915f83a..55f33327e9f12 100644 --- a/lib/public/TaskProcessing/Events/AbstractTaskProcessingEvent.php +++ b/lib/public/TaskProcessing/Events/AbstractTaskProcessingEvent.php @@ -19,7 +19,7 @@ abstract class AbstractTaskProcessingEvent extends Event { * @since 30.0.0 */ public function __construct( - private readonly Task $task + private readonly Task $task, ) { parent::__construct(); } diff --git a/lib/public/TaskProcessing/IManager.php b/lib/public/TaskProcessing/IManager.php index c26a5d67339ce..2d5fe1d9ba69c 100644 --- a/lib/public/TaskProcessing/IManager.php +++ b/lib/public/TaskProcessing/IManager.php @@ -182,7 +182,7 @@ public function getUserTasks(?string $userId, ?string $taskTypeId = null, ?strin */ public function getTasks( ?string $userId, ?string $taskTypeId = null, ?string $appId = null, ?string $customId = null, - ?int $status = null, ?int $scheduleAfter = null, ?int $endedBefore = null + ?int $status = null, ?int $scheduleAfter = null, ?int $endedBefore = null, ): array; /** diff --git a/lib/public/Teams/Team.php b/lib/public/Teams/Team.php index 07fc3f9ccd306..8ece28bf6484b 100644 --- a/lib/public/Teams/Team.php +++ b/lib/public/Teams/Team.php @@ -18,7 +18,11 @@ class Team implements \JsonSerializable { /** * @since 29.0.0 */ - public function __construct(private string $teamId, private string $displayName, private ?string $link) { + public function __construct( + private string $teamId, + private string $displayName, + private ?string $link, + ) { } /** diff --git a/lib/public/TextProcessing/Events/AbstractTextProcessingEvent.php b/lib/public/TextProcessing/Events/AbstractTextProcessingEvent.php index e42f64ca28cfb..8b94425402017 100644 --- a/lib/public/TextProcessing/Events/AbstractTextProcessingEvent.php +++ b/lib/public/TextProcessing/Events/AbstractTextProcessingEvent.php @@ -20,7 +20,7 @@ abstract class AbstractTextProcessingEvent extends Event { * @since 27.1.0 */ public function __construct( - private Task $task + private Task $task, ) { parent::__construct(); } diff --git a/lib/public/TextToImage/Events/AbstractTextToImageEvent.php b/lib/public/TextToImage/Events/AbstractTextToImageEvent.php index 75920487412b3..df850e1be33ee 100644 --- a/lib/public/TextToImage/Events/AbstractTextToImageEvent.php +++ b/lib/public/TextToImage/Events/AbstractTextToImageEvent.php @@ -21,7 +21,7 @@ abstract class AbstractTextToImageEvent extends Event { * @since 28.0.0 */ public function __construct( - private Task $task + private Task $task, ) { parent::__construct(); } diff --git a/lib/public/Translation/LanguageTuple.php b/lib/public/Translation/LanguageTuple.php index 883daa01da3bc..07507ece68790 100644 --- a/lib/public/Translation/LanguageTuple.php +++ b/lib/public/Translation/LanguageTuple.php @@ -24,7 +24,7 @@ public function __construct( private string $from, private string $fromLabel, private string $to, - private string $toLabel + private string $toLabel, ) { } diff --git a/lib/public/User/Events/OutOfOfficeChangedEvent.php b/lib/public/User/Events/OutOfOfficeChangedEvent.php index b1cdb3abdd71b..10865ef7ed57d 100644 --- a/lib/public/User/Events/OutOfOfficeChangedEvent.php +++ b/lib/public/User/Events/OutOfOfficeChangedEvent.php @@ -21,7 +21,9 @@ class OutOfOfficeChangedEvent extends Event { /** * @since 28.0.0 */ - public function __construct(private IOutOfOfficeData $data) { + public function __construct( + private IOutOfOfficeData $data, + ) { parent::__construct(); } diff --git a/lib/public/User/Events/OutOfOfficeClearedEvent.php b/lib/public/User/Events/OutOfOfficeClearedEvent.php index 3eb8a9016e755..4153ce98ab5cc 100644 --- a/lib/public/User/Events/OutOfOfficeClearedEvent.php +++ b/lib/public/User/Events/OutOfOfficeClearedEvent.php @@ -21,7 +21,9 @@ class OutOfOfficeClearedEvent extends Event { /** * @since 28.0.0 */ - public function __construct(private IOutOfOfficeData $data) { + public function __construct( + private IOutOfOfficeData $data, + ) { parent::__construct(); } diff --git a/lib/public/User/Events/OutOfOfficeEndedEvent.php b/lib/public/User/Events/OutOfOfficeEndedEvent.php index e5cbc174d09f4..0817994f0698a 100644 --- a/lib/public/User/Events/OutOfOfficeEndedEvent.php +++ b/lib/public/User/Events/OutOfOfficeEndedEvent.php @@ -19,7 +19,9 @@ class OutOfOfficeEndedEvent extends Event { /** * @since 28.0.0 */ - public function __construct(private IOutOfOfficeData $data) { + public function __construct( + private IOutOfOfficeData $data, + ) { parent::__construct(); } diff --git a/lib/public/User/Events/OutOfOfficeScheduledEvent.php b/lib/public/User/Events/OutOfOfficeScheduledEvent.php index 0cf071baf5958..f830d2af209c0 100644 --- a/lib/public/User/Events/OutOfOfficeScheduledEvent.php +++ b/lib/public/User/Events/OutOfOfficeScheduledEvent.php @@ -21,7 +21,9 @@ class OutOfOfficeScheduledEvent extends Event { /** * @since 28.0.0 */ - public function __construct(private IOutOfOfficeData $data) { + public function __construct( + private IOutOfOfficeData $data, + ) { parent::__construct(); } diff --git a/lib/public/User/Events/OutOfOfficeStartedEvent.php b/lib/public/User/Events/OutOfOfficeStartedEvent.php index 9550f5072e02a..1b5c69b3cfbe3 100644 --- a/lib/public/User/Events/OutOfOfficeStartedEvent.php +++ b/lib/public/User/Events/OutOfOfficeStartedEvent.php @@ -19,7 +19,9 @@ class OutOfOfficeStartedEvent extends Event { /** * @since 28.0.0 */ - public function __construct(private IOutOfOfficeData $data) { + public function __construct( + private IOutOfOfficeData $data, + ) { parent::__construct(); } diff --git a/lib/public/UserMigration/IMigrator.php b/lib/public/UserMigration/IMigrator.php index 3083233a4c423..8ce2cca8f983d 100644 --- a/lib/public/UserMigration/IMigrator.php +++ b/lib/public/UserMigration/IMigrator.php @@ -25,7 +25,7 @@ interface IMigrator { public function export( IUser $user, IExportDestination $exportDestination, - OutputInterface $output + OutputInterface $output, ): void; /** @@ -37,7 +37,7 @@ public function export( public function import( IUser $user, IImportSource $importSource, - OutputInterface $output + OutputInterface $output, ): void; /** @@ -75,6 +75,6 @@ public function getVersion(): int; * @since 24.0.0 */ public function canImport( - IImportSource $importSource + IImportSource $importSource, ): bool; } diff --git a/lib/public/UserMigration/TMigratorBasicVersionHandling.php b/lib/public/UserMigration/TMigratorBasicVersionHandling.php index f679c8e87ae65..b33425a023dcd 100644 --- a/lib/public/UserMigration/TMigratorBasicVersionHandling.php +++ b/lib/public/UserMigration/TMigratorBasicVersionHandling.php @@ -31,7 +31,7 @@ public function getVersion(): int { * @since 24.0.0 */ public function canImport( - IImportSource $importSource + IImportSource $importSource, ): bool { $version = $importSource->getMigratorVersion($this->getId()); if ($version === null) { diff --git a/lib/public/Util.php b/lib/public/Util.php index 4bd2c61dfbed5..520e4616de538 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -302,7 +302,7 @@ public static function getDefaultEmailAddress(string $user_part): string { $user_part = $config->getSystemValueString('mail_from_address', $user_part); $host_name = self::getServerHostName(); $host_name = $config->getSystemValueString('mail_domain', $host_name); - $defaultEmailAddress = $user_part.'@'.$host_name; + $defaultEmailAddress = $user_part . '@' . $host_name; $mailer = \OC::$server->get(IMailer::class); if ($mailer->validateMailAddress($defaultEmailAddress)) { @@ -310,7 +310,7 @@ public static function getDefaultEmailAddress(string $user_part): string { } // in case we cannot build a valid email address from the hostname let's fallback to 'localhost.localdomain' - return $user_part.'@localhost.localdomain'; + return $user_part . '@localhost.localdomain'; } /** diff --git a/ocs/providers.php b/ocs/providers.php index af9863a32f255..6333a91fdb2d9 100644 --- a/ocs/providers.php +++ b/ocs/providers.php @@ -11,7 +11,7 @@ $request = \OC::$server->getRequest(); -$url = $request->getServerProtocol() . '://' . substr($request->getServerHost() . $request->getRequestUri(), 0, -17).'ocs/v1.php/'; +$url = $request->getServerProtocol() . '://' . substr($request->getServerHost() . $request->getRequestUri(), 0, -17) . 'ocs/v1.php/'; $writer = new XMLWriter(); $writer->openURI('php://output'); diff --git a/ocs/v1.php b/ocs/v1.php index 90d7971c549c8..7205f4a26b793 100644 --- a/ocs/v1.php +++ b/ocs/v1.php @@ -46,12 +46,12 @@ OC::handleLogin(\OC::$server->getRequest()); } - OC::$server->get(\OC\Route\Router::class)->match('/ocsapp'.\OC::$server->getRequest()->getRawPathInfo()); + OC::$server->get(\OC\Route\Router::class)->match('/ocsapp' . \OC::$server->getRequest()->getRawPathInfo()); } catch (MaxDelayReached $ex) { ApiHelper::respond(Http::STATUS_TOO_MANY_REQUESTS, $ex->getMessage()); } catch (ResourceNotFoundException $e) { $txt = 'Invalid query, please check the syntax. API specifications are here:' - .' http://www.freedesktop.org/wiki/Specifications/open-collaboration-services.'."\n"; + . ' http://www.freedesktop.org/wiki/Specifications/open-collaboration-services.' . "\n"; ApiHelper::respond(OCSController::RESPOND_NOT_FOUND, $txt); } catch (MethodNotAllowedException $e) { ApiHelper::setContentType(); @@ -61,7 +61,7 @@ } catch (\Exception $e) { \OCP\Server::get(LoggerInterface::class)->error($e->getMessage(), ['exception' => $e]); - $txt = 'Internal Server Error'."\n"; + $txt = 'Internal Server Error' . "\n"; try { if (\OC::$server->getSystemConfig()->getValue('debug', false)) { $txt .= $e->getMessage(); diff --git a/public.php b/public.php index d9320227dfdab..f6d0b0a794011 100644 --- a/public.php +++ b/public.php @@ -78,7 +78,7 @@ function resolveService(string $service): string { OC_App::loadApp($app); OC_User::setIncognitoMode(true); - $baseuri = OC::$WEBROOT . '/public.php/'.$service.'/'; + $baseuri = OC::$WEBROOT . '/public.php/' . $service . '/'; require_once $file; } catch (Exception $ex) { $status = 500; diff --git a/remote.php b/remote.php index 9b56e6c97f95e..bc97de7bcb382 100644 --- a/remote.php +++ b/remote.php @@ -131,17 +131,17 @@ function resolveService($service) { switch ($app) { case 'core': - $file = OC::$SERVERROOT .'/'. $file; + $file = OC::$SERVERROOT . '/' . $file; break; default: if (!$appManager->isInstalled($app)) { throw new RemoteException('App not installed: ' . $app); } $appManager->loadApp($app); - $file = $appManager->getAppPath($app) .'/'. ($parts[1] ?? ''); + $file = $appManager->getAppPath($app) . '/' . ($parts[1] ?? ''); break; } - $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; + $baseuri = OC::$WEBROOT . '/remote.php/' . $service . '/'; require_once $file; } catch (Exception $ex) { handleException($ex); diff --git a/tests/Core/Command/Log/FileTest.php b/tests/Core/Command/Log/FileTest.php index 08ff01e019df2..9c7e0297d535f 100644 --- a/tests/Core/Command/Log/FileTest.php +++ b/tests/Core/Command/Log/FileTest.php @@ -91,7 +91,7 @@ public function testGetConfiguration(): void { $this->config->method('getSystemValue') ->willReturnMap([ ['log_type', 'file', 'log_type_value'], - ['datadirectory', \OC::$SERVERROOT.'/data', '/data/directory/'], + ['datadirectory', \OC::$SERVERROOT . '/data', '/data/directory/'], ['logfile', '/data/directory/nextcloud.log', '/var/log/nextcloud.log'], ['log_rotate_size', 100 * 1024 * 1024, 5 * 1024 * 1024], ]); diff --git a/tests/Core/Command/Maintenance/ModeTest.php b/tests/Core/Command/Maintenance/ModeTest.php index 59b8bbfc045bb..a4c3347474515 100644 --- a/tests/Core/Command/Maintenance/ModeTest.php +++ b/tests/Core/Command/Maintenance/ModeTest.php @@ -123,7 +123,7 @@ public function testExecute( string $option, bool $currentMaintenanceState, $expectedMaintenanceState, - string $expectedOutput + string $expectedOutput, ): void { $this->config->expects($this->any()) ->method('getSystemValueBool') diff --git a/tests/Core/Command/SystemTag/AddTest.php b/tests/Core/Command/SystemTag/AddTest.php index 4dd0df7ffe0db..7ae832e407952 100644 --- a/tests/Core/Command/SystemTag/AddTest.php +++ b/tests/Core/Command/SystemTag/AddTest.php @@ -95,7 +95,7 @@ public function testAlreadyExists(): void { $this->systemTagManager->method('createTag') ->willReturnCallback(function ($tagName, $userVisible, $userAssignable) { throw new TagAlreadyExistsException( - 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists' + 'Tag ("' . $tagName . '", ' . $userVisible . ', ' . $userAssignable . ') already exists' ); }); diff --git a/tests/Core/Command/SystemTag/EditTest.php b/tests/Core/Command/SystemTag/EditTest.php index 1857da25ab0bc..f269559190565 100644 --- a/tests/Core/Command/SystemTag/EditTest.php +++ b/tests/Core/Command/SystemTag/EditTest.php @@ -87,7 +87,7 @@ public function testExecute(): void { $this->output->expects($this->once()) ->method('writeln') ->with( - 'Tag updated ("'.$newTagName.'", '.$newTagUserVisible.', '.$newTagUserAssignable.')' + 'Tag updated ("' . $newTagName . '", ' . $newTagUserVisible . ', ' . $newTagUserAssignable . ')' ); $this->invokePrivate($this->command, 'execute', [$this->input, $this->output]); @@ -135,7 +135,7 @@ public function testAlreadyExists(): void { $this->systemTagManager->method('updateTag') ->willReturnCallback(function ($tagId, $tagName, $userVisible, $userAssignable) { throw new TagAlreadyExistsException( - 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists' + 'Tag ("' . $tagName . '", ' . $userVisible . ', ' . $userAssignable . ') already exists' ); }); @@ -151,7 +151,7 @@ public function testAlreadyExists(): void { $this->output->expects($this->once()) ->method('writeln') ->with( - 'Tag ("' . $newTagName . '", '. $newTagUserVisible . ', ' . $newTagUserAssignable . ') already exists' + 'Tag ("' . $newTagName . '", ' . $newTagUserVisible . ', ' . $newTagUserAssignable . ') already exists' ); $this->invokePrivate($this->command, 'execute', [$this->input, $this->output]); diff --git a/tests/Core/Controller/AppPasswordControllerTest.php b/tests/Core/Controller/AppPasswordControllerTest.php index f0246561145ab..b33033edac3a3 100644 --- a/tests/Core/Controller/AppPasswordControllerTest.php +++ b/tests/Core/Controller/AppPasswordControllerTest.php @@ -128,7 +128,7 @@ public function testGetAppPassword(): void { $this->random->method('generate') ->with( 72, - ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS + ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS )->willReturn('myToken'); $this->tokenProvider->expects($this->once()) @@ -169,7 +169,7 @@ public function testGetAppPasswordNoPassword(): void { $this->random->method('generate') ->with( 72, - ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS + ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS )->willReturn('myToken'); $this->tokenProvider->expects($this->once()) diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php index 3a1123c940b7e..0dca611b0207f 100644 --- a/tests/Core/Controller/AvatarControllerTest.php +++ b/tests/Core/Controller/AvatarControllerTest.php @@ -309,7 +309,7 @@ public function testTmpAvatarNoTmp(): void { * Fetch tmp avatar */ public function testTmpAvatarValid(): void { - $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $response = $this->avatarController->getTmpAvatar(); $this->assertEquals(Http::STATUS_OK, $response->getStatus()); @@ -331,14 +331,14 @@ public function testPostAvatarNoPathOrImage(): void { public function testPostAvatarFile(): void { //Create temp file $fileName = tempnam('', 'avatarTest'); - $copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.jpg', $fileName); + $copyRes = copy(\OC::$SERVERROOT . '/tests/data/testimage.jpg', $fileName); $this->assertTrue($copyRes); //Create file in cache - $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); //Create request return - $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT.'/tests/data/testimage.jpg')]]; + $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT . '/tests/data/testimage.jpg')]]; $this->request->method('getUploadedFile')->willReturn($reqRet); $response = $this->avatarController->postAvatar(null); @@ -369,14 +369,14 @@ public function testPostAvatarInvalidFile(): void { public function testPostAvatarFileGif(): void { //Create temp file $fileName = tempnam('', 'avatarTest'); - $copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.gif', $fileName); + $copyRes = copy(\OC::$SERVERROOT . '/tests/data/testimage.gif', $fileName); $this->assertTrue($copyRes); //Create file in cache - $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.gif')); + $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.gif')); //Create request return - $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT.'/tests/data/testimage.gif')]]; + $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT . '/tests/data/testimage.gif')]]; $this->request->method('getUploadedFile')->willReturn($reqRet); $response = $this->avatarController->postAvatar(null); @@ -396,7 +396,7 @@ public function testPostAvatarFromFile(): void { ->disableOriginalConstructor()->getMock(); $file->expects($this->once()) ->method('getContent') - ->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + ->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $file->expects($this->once()) ->method('getMimeType') ->willReturn('image/jpeg'); @@ -474,7 +474,7 @@ public function testPostAvatarException(): void { ->disableOriginalConstructor()->getMock(); $file->expects($this->once()) ->method('getContent') - ->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + ->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $file->expects($this->once()) ->method('getMimeType') ->willReturn('image/jpeg'); @@ -512,7 +512,7 @@ public function testPostCroppedAvatarNoTmpAvatar(): void { * Test with non square crop */ public function testPostCroppedAvatarNoSquareCrop(): void { - $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->avatarMock->method('set')->will($this->throwException(new \OC\NotSquareException)); $this->avatarManager->method('getAvatar')->willReturn($this->avatarMock); @@ -525,7 +525,7 @@ public function testPostCroppedAvatarNoSquareCrop(): void { * Check for proper reply on proper crop argument */ public function testPostCroppedAvatarValidCrop(): void { - $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->avatarManager->method('getAvatar')->willReturn($this->avatarMock); $response = $this->avatarController->postCroppedAvatar(['x' => 0, 'y' => 0, 'w' => 10, 'h' => 10]); @@ -537,7 +537,7 @@ public function testPostCroppedAvatarValidCrop(): void { * Test what happens if the cropping of the avatar fails */ public function testPostCroppedAvatarException(): void { - $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->avatarMock->method('set')->will($this->throwException(new \Exception('foo'))); $this->avatarManager->method('getAvatar')->willReturn($this->avatarMock); @@ -554,7 +554,7 @@ public function testPostCroppedAvatarException(): void { * Check for proper reply on proper crop argument */ public function testFileTooBig(): void { - $fileName = \OC::$SERVERROOT.'/tests/data/testimage.jpg'; + $fileName = \OC::$SERVERROOT . '/tests/data/testimage.jpg'; //Create request return $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [21 * 1024 * 1024]]; $this->request->method('getUploadedFile')->willReturn($reqRet); diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php index a38f73c85a62e..7f9f11db7e379 100644 --- a/tests/Core/Controller/ClientFlowLoginControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php @@ -137,7 +137,7 @@ public function testShowAuthPickerPageWithOcsHeader(): void { ->method('generate') ->with( 64, - ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS + ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS ) ->willReturn('StateToken'); $this->session @@ -207,7 +207,7 @@ public function testShowAuthPickerPageWithOauth(): void { ->method('generate') ->with( 64, - ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS + ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS ) ->willReturn('StateToken'); $this->session @@ -448,8 +448,8 @@ public function testGeneratePasswordWithPasswordForOauthClient($redirectUri, $re [128] ) ->willReturnMap([ - [72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS, 'MyGeneratedToken'], - [128, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS, 'MyAccessCode'], + [72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS, 'MyGeneratedToken'], + [128, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS, 'MyAccessCode'], ]); $user = $this->createMock(IUser::class); $user diff --git a/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php b/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php index 093b8a3442d7b..98c7821791db6 100644 --- a/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php @@ -161,7 +161,7 @@ public function testShowAuthPickerValidLoginToken(): void { ->willReturn($flow); $this->random->method('generate') - ->with(64, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS) + ->with(64, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS) ->willReturn('random'); $this->session->expects($this->once()) ->method('set') diff --git a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php index 2fb61a2ef0856..1c31efee8f7c0 100644 --- a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php +++ b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php @@ -296,7 +296,7 @@ public function testFlowDone(): void { $this->secureRandom->expects($this->once()) ->method('generate') - ->with(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS) + ->with(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS) ->willReturn('test_pass'); // session token diff --git a/tests/enable_all.php b/tests/enable_all.php index db01de6ec4110..54e5614e55a5b 100644 --- a/tests/enable_all.php +++ b/tests/enable_all.php @@ -5,7 +5,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -require_once __DIR__.'/../lib/base.php'; +require_once __DIR__ . '/../lib/base.php'; function enableApp($app) { try { diff --git a/tests/lib/AllConfigTest.php b/tests/lib/AllConfigTest.php index f8b2e8e857f01..5d2091780a091 100644 --- a/tests/lib/AllConfigTest.php +++ b/tests/lib/AllConfigTest.php @@ -231,7 +231,7 @@ public function testSetUserValueUnchanged(): void { $connectionMock = $this->createMock(IDBConnection::class); $connectionMock->expects($this->once()) ->method('executeQuery') - ->with($this->equalTo('SELECT `configvalue` FROM `*PREFIX*preferences` '. + ->with($this->equalTo('SELECT `configvalue` FROM `*PREFIX*preferences` ' . 'WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?'), $this->equalTo(['userSetUnchanged', 'appSetUnchanged', 'keySetUnchanged'])) ->willReturn($resultMock); diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php index 5c79a75bf0dc6..266a60bf1596f 100644 --- a/tests/lib/App/AppManagerTest.php +++ b/tests/lib/App/AppManagerTest.php @@ -142,7 +142,7 @@ protected function setUp(): void { /** * @dataProvider dataGetAppIcon */ - public function testGetAppIcon($callback, ?bool $dark, string|null $expected): void { + public function testGetAppIcon($callback, ?bool $dark, ?string $expected): void { $this->urlGenerator->expects($this->atLeastOnce()) ->method('imagePath') ->willReturnCallback($callback); diff --git a/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php b/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php index fdc8b45cf7032..e7652d5c50c51 100644 --- a/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php +++ b/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php @@ -74,7 +74,7 @@ public function testNoInternet(): void { /** * @dataProvider dataGetETag */ - public function testGetEtag(string|null $expected, bool $throws, string $content = ''): void { + public function testGetEtag(?string $expected, bool $throws, string $content = ''): void { $folder = $this->createMock(ISimpleFolder::class); if (!$throws) { $file = $this->createMock(ISimpleFile::class); diff --git a/tests/lib/App/InfoParserTest.php b/tests/lib/App/InfoParserTest.php index 914741d05b168..66ff10266e239 100644 --- a/tests/lib/App/InfoParserTest.php +++ b/tests/lib/App/InfoParserTest.php @@ -26,7 +26,7 @@ public function parserTest($expectedJson, $xmlFile, $cache = null) { if (!is_null($expectedJson)) { $expectedData = json_decode(file_get_contents(OC::$SERVERROOT . "/tests/data/app/$expectedJson"), true); } - $data = $parser->parse(OC::$SERVERROOT. "/tests/data/app/$xmlFile"); + $data = $parser->parse(OC::$SERVERROOT . "/tests/data/app/$xmlFile"); $this->assertEquals($expectedData, $data); } diff --git a/tests/lib/AppConfigTest.php b/tests/lib/AppConfigTest.php index e6929484dc522..e8c10fe654b17 100644 --- a/tests/lib/AppConfigTest.php +++ b/tests/lib/AppConfigTest.php @@ -309,7 +309,7 @@ public function testHasKeyOnMistypeAsNonLazyReturnsTrueWithLazyArgumentIsNull(): * @dataProvider providerGetKeys */ public function testIsSensitive( - string $appId, string $configKey, string $configValue, int $type, bool $lazy, bool $sensitive + string $appId, string $configKey, string $configValue, int $type, bool $lazy, bool $sensitive, ): void { $config = $this->generateAppConfig(); $this->assertEquals($sensitive, $config->isSensitive($appId, $configKey, $lazy)); @@ -352,7 +352,7 @@ public function testIsSensitiveOnNonSensitiveMistypedAsNonLazyThrowsException(): /** * @dataProvider providerGetKeys */ - public function testIsLazy(string $appId, string $configKey, string $configValue, int $type, bool $lazy + public function testIsLazy(string $appId, string $configKey, string $configValue, int $type, bool $lazy, ): void { $config = $this->generateAppConfig(); $this->assertEquals($lazy, $config->isLazy($appId, $configKey)); diff --git a/tests/lib/AppFramework/Http/DownloadResponseTest.php b/tests/lib/AppFramework/Http/DownloadResponseTest.php index 8ac5954e00d28..ee89e8e55d1c8 100644 --- a/tests/lib/AppFramework/Http/DownloadResponseTest.php +++ b/tests/lib/AppFramework/Http/DownloadResponseTest.php @@ -34,7 +34,7 @@ public function testFilenameEncoding(string $input, string $expected): void { $response = new ChildDownloadResponse($input, 'content'); $headers = $response->getHeaders(); - $this->assertEquals('attachment; filename="'.$expected.'"', $headers['Content-Disposition']); + $this->assertEquals('attachment; filename="' . $expected . '"', $headers['Content-Disposition']); } public function filenameEncodingProvider() : array { diff --git a/tests/lib/AppFramework/Routing/RoutingTest.php b/tests/lib/AppFramework/Routing/RoutingTest.php index 32b57e7bf21fa..8522382ddcc6f 100644 --- a/tests/lib/AppFramework/Routing/RoutingTest.php +++ b/tests/lib/AppFramework/Routing/RoutingTest.php @@ -441,7 +441,7 @@ private function mockRoute( $controllerName, $actionName, array $requirements = [], - array $defaults = [] + array $defaults = [], ) { $route = $this->getMockBuilder(Route::class) ->onlyMethods(['method', 'requirements', 'defaults']) diff --git a/tests/lib/AppTest.php b/tests/lib/AppTest.php index e6759170fb124..41643b49ddc14 100644 --- a/tests/lib/AppTest.php +++ b/tests/lib/AppTest.php @@ -621,14 +621,14 @@ public function testParseAppInfo(array $data, array $expected): void { public function testParseAppInfoL10N(): void { $parser = new InfoParser(); - $data = $parser->parse(\OC::$SERVERROOT. '/tests/data/app/description-multi-lang.xml'); + $data = $parser->parse(\OC::$SERVERROOT . '/tests/data/app/description-multi-lang.xml'); $this->assertEquals('English', \OC_App::parseAppInfo($data, 'en')['description']); $this->assertEquals('German', \OC_App::parseAppInfo($data, 'de')['description']); } public function testParseAppInfoL10NSingleLanguage(): void { $parser = new InfoParser(); - $data = $parser->parse(\OC::$SERVERROOT. '/tests/data/app/description-single-lang.xml'); + $data = $parser->parse(\OC::$SERVERROOT . '/tests/data/app/description-single-lang.xml'); $this->assertEquals('English', \OC_App::parseAppInfo($data, 'en')['description']); } } diff --git a/tests/lib/Archive/TestBase.php b/tests/lib/Archive/TestBase.php index 3f2d8c9561e5d..fda485d2dc1ca 100644 --- a/tests/lib/Archive/TestBase.php +++ b/tests/lib/Archive/TestBase.php @@ -28,10 +28,10 @@ public function testGetFiles(): void { $this->instance = $this->getExisting(); $allFiles = $this->instance->getFiles(); $expected = ['lorem.txt','logo-wide.png','dir/', 'dir/lorem.txt']; - $this->assertEquals(4, count($allFiles), 'only found '.count($allFiles).' out of 4 expected files'); + $this->assertEquals(4, count($allFiles), 'only found ' . count($allFiles) . ' out of 4 expected files'); foreach ($expected as $file) { - $this->assertContains($file, $allFiles, 'cant find '. $file . ' in archive'); - $this->assertTrue($this->instance->fileExists($file), 'file '.$file.' does not exist in archive'); + $this->assertContains($file, $allFiles, 'cant find ' . $file . ' in archive'); + $this->assertTrue($this->instance->fileExists($file), 'file ' . $file . ' does not exist in archive'); } $this->assertFalse($this->instance->fileExists('non/existing/file')); @@ -39,21 +39,21 @@ public function testGetFiles(): void { $expected = ['lorem.txt','logo-wide.png', 'dir/']; $this->assertEquals(3, count($rootContent)); foreach ($expected as $file) { - $this->assertContains($file, $rootContent, 'cant find '. $file . ' in archive'); + $this->assertContains($file, $rootContent, 'cant find ' . $file . ' in archive'); } $dirContent = $this->instance->getFolder('dir/'); $expected = ['lorem.txt']; $this->assertEquals(1, count($dirContent)); foreach ($expected as $file) { - $this->assertContains($file, $dirContent, 'cant find '. $file . ' in archive'); + $this->assertContains($file, $dirContent, 'cant find ' . $file . ' in archive'); } } public function testContent(): void { $this->instance = $this->getExisting(); - $dir = \OC::$SERVERROOT.'/tests/data'; - $textFile = $dir.'/lorem.txt'; + $dir = \OC::$SERVERROOT . '/tests/data'; + $textFile = $dir . '/lorem.txt'; $this->assertEquals(file_get_contents($textFile), $this->instance->getFile('lorem.txt')); $tmpFile = \OC::$server->getTempManager()->getTemporaryFile('.txt'); @@ -62,8 +62,8 @@ public function testContent(): void { } public function testWrite(): void { - $dir = \OC::$SERVERROOT.'/tests/data'; - $textFile = $dir.'/lorem.txt'; + $dir = \OC::$SERVERROOT . '/tests/data'; + $textFile = $dir . '/lorem.txt'; $this->instance = $this->getNew(); $this->assertEquals(0, count($this->instance->getFiles())); $this->instance->addFile('lorem.txt', $textFile); @@ -77,24 +77,24 @@ public function testWrite(): void { } public function testReadStream(): void { - $dir = \OC::$SERVERROOT.'/tests/data'; + $dir = \OC::$SERVERROOT . '/tests/data'; $this->instance = $this->getExisting(); $fh = $this->instance->getStream('lorem.txt', 'r'); $this->assertTrue((bool)$fh); $content = fread($fh, $this->instance->filesize('lorem.txt')); fclose($fh); - $this->assertEquals(file_get_contents($dir.'/lorem.txt'), $content); + $this->assertEquals(file_get_contents($dir . '/lorem.txt'), $content); } public function testWriteStream(): void { - $dir = \OC::$SERVERROOT.'/tests/data'; + $dir = \OC::$SERVERROOT . '/tests/data'; $this->instance = $this->getNew(); $fh = $this->instance->getStream('lorem.txt', 'w'); - $source = fopen($dir.'/lorem.txt', 'r'); + $source = fopen($dir . '/lorem.txt', 'r'); \OCP\Files::streamCopy($source, $fh); fclose($source); fclose($fh); $this->assertTrue($this->instance->fileExists('lorem.txt')); - $this->assertEquals(file_get_contents($dir.'/lorem.txt'), $this->instance->getFile('lorem.txt')); + $this->assertEquals(file_get_contents($dir . '/lorem.txt'), $this->instance->getFile('lorem.txt')); } public function testFolder(): void { $this->instance = $this->getNew(); @@ -108,19 +108,19 @@ public function testFolder(): void { $this->assertFalse($this->instance->fileExists('/test/')); } public function testExtract(): void { - $dir = \OC::$SERVERROOT.'/tests/data'; + $dir = \OC::$SERVERROOT . '/tests/data'; $this->instance = $this->getExisting(); $tmpDir = \OC::$server->getTempManager()->getTemporaryFolder(); $this->instance->extract($tmpDir); - $this->assertEquals(true, file_exists($tmpDir.'lorem.txt')); - $this->assertEquals(true, file_exists($tmpDir.'dir/lorem.txt')); - $this->assertEquals(true, file_exists($tmpDir.'logo-wide.png')); - $this->assertEquals(file_get_contents($dir.'/lorem.txt'), file_get_contents($tmpDir.'lorem.txt')); + $this->assertEquals(true, file_exists($tmpDir . 'lorem.txt')); + $this->assertEquals(true, file_exists($tmpDir . 'dir/lorem.txt')); + $this->assertEquals(true, file_exists($tmpDir . 'logo-wide.png')); + $this->assertEquals(file_get_contents($dir . '/lorem.txt'), file_get_contents($tmpDir . 'lorem.txt')); \OCP\Files::rmdirr($tmpDir); } public function testMoveRemove(): void { - $dir = \OC::$SERVERROOT.'/tests/data'; - $textFile = $dir.'/lorem.txt'; + $dir = \OC::$SERVERROOT . '/tests/data'; + $textFile = $dir . '/lorem.txt'; $this->instance = $this->getNew(); $this->instance->addFile('lorem.txt', $textFile); $this->assertFalse($this->instance->fileExists('target.txt')); @@ -132,7 +132,7 @@ public function testMoveRemove(): void { $this->assertFalse($this->instance->fileExists('target.txt')); } public function testRecursive(): void { - $dir = \OC::$SERVERROOT.'/tests/data'; + $dir = \OC::$SERVERROOT . '/tests/data'; $this->instance = $this->getNew(); $this->instance->addRecursive('/dir', $dir); $this->assertTrue($this->instance->fileExists('/dir/lorem.txt')); diff --git a/tests/lib/Archive/ZIPTest.php b/tests/lib/Archive/ZIPTest.php index 62467ca230e93..25707e4b05199 100644 --- a/tests/lib/Archive/ZIPTest.php +++ b/tests/lib/Archive/ZIPTest.php @@ -16,6 +16,6 @@ protected function getExisting() { } protected function getNew() { - return new ZIP(\OC::$server->getTempManager()->getTempBaseDir().'/newArchive.zip'); + return new ZIP(\OC::$server->getTempManager()->getTempBaseDir() . '/newArchive.zip'); } } diff --git a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php index be90d60c64fbc..6097c1f482dd8 100644 --- a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php +++ b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php @@ -307,7 +307,7 @@ public function testInvalidateToken(): void { $this->mapper->expects($this->exactly(2)) ->method('invalidate') ->withConsecutive( - [hash('sha512', 'token7'.'1f4h9s')], + [hash('sha512', 'token7' . '1f4h9s')], [hash('sha512', 'token7')] ); @@ -443,7 +443,7 @@ public function testGetToken(): void { $this->mapper->method('getToken') ->with( $this->callback(function (string $token) { - return hash('sha512', 'unhashedTokentokentokentokentoken'.'1f4h9s') === $token; + return hash('sha512', 'unhashedTokentokentokentokentoken' . '1f4h9s') === $token; }) )->willReturn($token); @@ -457,7 +457,7 @@ public function testGetInvalidToken(): void { ->method('getToken') ->withConsecutive( [$this->callback(function (string $token): bool { - return hash('sha512', 'unhashedTokentokentokentokentoken'.'1f4h9s') === $token; + return hash('sha512', 'unhashedTokentokentokentokentoken' . '1f4h9s') === $token; })], [$this->callback(function (string $token): bool { return hash('sha512', 'unhashedTokentokentokentokentoken') === $token; @@ -481,7 +481,7 @@ public function testGetExpiredToken(): void { $this->mapper->method('getToken') ->with( $this->callback(function (string $token) { - return hash('sha512', 'tokentokentokentokentoken'.'1f4h9s') === $token; + return hash('sha512', 'tokentokentokentokentoken' . '1f4h9s') === $token; }) )->willReturn($actual); diff --git a/tests/lib/Collaboration/Collaborators/GroupPluginTest.php b/tests/lib/Collaboration/Collaborators/GroupPluginTest.php index e52ae95bf3482..8fe71234906dd 100644 --- a/tests/lib/Collaboration/Collaborators/GroupPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/GroupPluginTest.php @@ -440,7 +440,7 @@ public function testSearch( array $exactExpected, array $expected, bool $reachedEnd, - $singleGroup + $singleGroup, ): void { $this->config->expects($this->any()) ->method('getAppValue') diff --git a/tests/lib/Collaboration/Collaborators/SearchTest.php b/tests/lib/Collaboration/Collaborators/SearchTest.php index 88bdfa6047e91..3e43d6331b2b7 100644 --- a/tests/lib/Collaboration/Collaborators/SearchTest.php +++ b/tests/lib/Collaboration/Collaborators/SearchTest.php @@ -42,7 +42,7 @@ public function testSearch( array $mockedRemotesResult, array $mockedMailResult, array $expected, - bool $expectedMoreResults + bool $expectedMoreResults, ): void { $searchResult = new SearchResult(); diff --git a/tests/lib/Collaboration/Collaborators/UserPluginTest.php b/tests/lib/Collaboration/Collaborators/UserPluginTest.php index c6a266b55d601..453f16c6686c4 100644 --- a/tests/lib/Collaboration/Collaborators/UserPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/UserPluginTest.php @@ -441,7 +441,7 @@ public function testSearch( $reachedEnd, $singleUser, array $users = [], - $shareeEnumerationPhone = false + $shareeEnumerationPhone = false, ): void { $this->mockConfig(['core' => [ 'shareapi_only_share_with_group_members' => $shareWithGroupOnly ? 'yes' : 'no', diff --git a/tests/lib/Comments/FakeManager.php b/tests/lib/Comments/FakeManager.php index b22264cb21651..155bbc59dce98 100644 --- a/tests/lib/Comments/FakeManager.php +++ b/tests/lib/Comments/FakeManager.php @@ -26,7 +26,7 @@ public function getForObject( $objectId, $limit = 0, $offset = 0, - ?\DateTime $notOlderThan = null + ?\DateTime $notOlderThan = null, ) { } @@ -36,7 +36,7 @@ public function getForObjectSince( int $lastKnownCommentId, string $sortDirection = 'asc', int $limit = 30, - bool $includeLastKnown = false + bool $includeLastKnown = false, ): array { return []; } @@ -48,7 +48,7 @@ public function getCommentsWithVerbForObjectSinceComment( int $lastKnownCommentId, string $sortDirection = 'asc', int $limit = 30, - bool $includeLastKnown = false + bool $includeLastKnown = false, ): array { return []; } diff --git a/tests/lib/ConfigTest.php b/tests/lib/ConfigTest.php index 94ee8da5dec22..3be066c68390e 100644 --- a/tests/lib/ConfigTest.php +++ b/tests/lib/ConfigTest.php @@ -23,7 +23,7 @@ protected function setUp(): void { parent::setUp(); $this->randomTmpDir = \OC::$server->getTempManager()->getTemporaryFolder(); - $this->configFile = $this->randomTmpDir.'testconfig.php'; + $this->configFile = $this->randomTmpDir . 'testconfig.php'; file_put_contents($this->configFile, self::TESTCONTENT); } @@ -155,7 +155,7 @@ public function testDeleteKey(): void { public function testConfigMerge(): void { // Create additional config $additionalConfig = '"totallyOutdated");'; - $additionalConfigPath = $this->randomTmpDir.'additionalConfig.testconfig.php'; + $additionalConfigPath = $this->randomTmpDir . 'additionalConfig.testconfig.php'; file_put_contents($additionalConfigPath, $additionalConfig); // Reinstantiate the config to force a read-in of the additional configs diff --git a/tests/lib/ErrorHandlerTest.php b/tests/lib/ErrorHandlerTest.php index 0846d09fd4757..b45525e7962ba 100644 --- a/tests/lib/ErrorHandlerTest.php +++ b/tests/lib/ErrorHandlerTest.php @@ -54,7 +54,7 @@ public function passwordProvider() { * @param string $password */ public function testRemovePasswordFromError($username, $password): void { - $url = 'http://'.$username.':'.$password.'@owncloud.org'; + $url = 'http://' . $username . ':' . $password . '@owncloud.org'; $expectedResult = 'http://xxx:xxx@owncloud.org'; $this->logger->expects(self::once()) ->method('log') diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php index a6f2502619383..29f9334ae1598 100644 --- a/tests/lib/Files/Config/UserMountCacheTest.php +++ b/tests/lib/Files/Config/UserMountCacheTest.php @@ -120,7 +120,7 @@ private function clearCache() { } private function keyForMount(MountPoint $mount): string { - return $mount->getStorageRootId().'::'.$mount->getMountPoint(); + return $mount->getStorageRootId() . '::' . $mount->getMountPoint(); } public function testNewMounts(): void { diff --git a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php index bbeabcf0f4365..3dbdc3afc27c1 100644 --- a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php +++ b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php @@ -81,8 +81,8 @@ public function testMove($source, $target): void { $this->instance->rename($source, $target); - $this->assertTrue($this->instance->file_exists($target), $target.' was not created'); - $this->assertFalse($this->instance->file_exists($source), $source.' still exists'); + $this->assertTrue($this->instance->file_exists($target), $target . ' was not created'); + $this->assertFalse($this->instance->file_exists($source), $source . ' still exists'); $this->assertSameAsLorem($target); $targetId = $this->instance->getCache()->getId(ltrim($target, '/')); diff --git a/tests/lib/Files/Storage/StoragesTest.php b/tests/lib/Files/Storage/StoragesTest.php index d157d288f2c6e..e5a6469cdbebf 100644 --- a/tests/lib/Files/Storage/StoragesTest.php +++ b/tests/lib/Files/Storage/StoragesTest.php @@ -37,8 +37,8 @@ public function testMoveFileFromStorage() { $this->storage1->moveFromStorage($this->storage2, $source, $target); - $this->assertTrue($this->storage1->file_exists($target), $target.' was not created'); - $this->assertFalse($this->storage2->file_exists($source), $source.' still exists'); + $this->assertTrue($this->storage1->file_exists($target), $target . ' was not created'); + $this->assertFalse($this->storage2->file_exists($source), $source . ' still exists'); $this->assertEquals('foo', $this->storage1->file_get_contents($target)); } @@ -75,8 +75,8 @@ public function testCopyFileFromStorage() { $this->storage1->copyFromStorage($this->storage2, $source, $target); - $this->assertTrue($this->storage1->file_exists($target), $target.' was not created'); - $this->assertTrue($this->storage2->file_exists($source), $source.' was deleted'); + $this->assertTrue($this->storage1->file_exists($target), $target . ' was not created'); + $this->assertTrue($this->storage2->file_exists($source), $source . ' was deleted'); $this->assertEquals('foo', $this->storage1->file_get_contents($target)); } diff --git a/tests/lib/Files/Storage/Wrapper/EncodingTest.php b/tests/lib/Files/Storage/Wrapper/EncodingTest.php index 4256337f08e98..f52e36891557d 100644 --- a/tests/lib/Files/Storage/Wrapper/EncodingTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncodingTest.php @@ -114,7 +114,7 @@ public function encodedDirectoriesProvider() { return [ [self::NFD_NAME, self::NFC_NAME], [self::NFD_NAME . '/' . self::NFD_NAME, self::NFC_NAME . '/' . self::NFC_NAME], - [self::NFD_NAME . '/' . self::NFC_NAME . '/' .self::NFD_NAME, self::NFC_NAME . '/' . self::NFC_NAME . '/' . self::NFC_NAME], + [self::NFD_NAME . '/' . self::NFC_NAME . '/' . self::NFD_NAME, self::NFC_NAME . '/' . self::NFC_NAME . '/' . self::NFC_NAME], ]; } diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php index 2a131a1ea391c..851182ab3ebfc 100644 --- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php @@ -948,7 +948,7 @@ public function testShouldEncrypt( $encryptMountPoint, $encryptionModule, $encryptionModuleShouldEncrypt, - $expected + $expected, ): void { $encryptionManager = $this->createMock(\OC\Encryption\Manager::class); $util = $this->createMock(Util::class); diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index 0a029889fb1bc..53da32b24dbcc 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -1996,7 +1996,7 @@ function () use ($view, $path, &$lockTypeDuring) { public function testLockBasicOperationUnlocksAfterException( $operation, $operationArgs, - $path + $path, ): void { if ($operation === 'touch') { $this->markTestSkipped('touch handles storage exceptions internally'); @@ -2081,7 +2081,7 @@ public function testLockBasicOperationUnlocksAfterCancelledHook( $operation, $operationArgs, $path, - $hookType + $hookType, ): void { $view = new View('/' . $this->user . '/files/'); diff --git a/tests/lib/Http/Client/ClientTest.php b/tests/lib/Http/Client/ClientTest.php index 9c5bf1a6eb22f..237bb1299e526 100644 --- a/tests/lib/Http/Client/ClientTest.php +++ b/tests/lib/Http/Client/ClientTest.php @@ -486,7 +486,7 @@ public function testSetDefaultOptionsWithNotInstalled(): void { 'on_redirect' => function ( \Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, - \Psr\Http\Message\UriInterface $uri + \Psr\Http\Message\UriInterface $uri, ) { }, ], @@ -545,7 +545,7 @@ public function testSetDefaultOptionsWithProxy(): void { 'on_redirect' => function ( \Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, - \Psr\Http\Message\UriInterface $uri + \Psr\Http\Message\UriInterface $uri, ) { }, ], @@ -605,7 +605,7 @@ public function testSetDefaultOptionsWithProxyAndExclude(): void { 'on_redirect' => function ( \Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, - \Psr\Http\Message\UriInterface $uri + \Psr\Http\Message\UriInterface $uri, ) { }, ], diff --git a/tests/lib/ImageTest.php b/tests/lib/ImageTest.php index 76b110df52102..5de5435335a62 100644 --- a/tests/lib/ImageTest.php +++ b/tests/lib/ImageTest.php @@ -14,27 +14,27 @@ class ImageTest extends \Test\TestCase { public static function tearDownAfterClass(): void { - @unlink(OC::$SERVERROOT.'/tests/data/testimage2.png'); - @unlink(OC::$SERVERROOT.'/tests/data/testimage2.jpg'); + @unlink(OC::$SERVERROOT . '/tests/data/testimage2.png'); + @unlink(OC::$SERVERROOT . '/tests/data/testimage2.jpg'); parent::tearDownAfterClass(); } public function testConstructDestruct(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertInstanceOf('\OC\Image', $img); $this->assertInstanceOf('\OCP\IImage', $img); unset($img); - $imgcreate = imagecreatefromjpeg(OC::$SERVERROOT.'/tests/data/testimage.jpg'); + $imgcreate = imagecreatefromjpeg(OC::$SERVERROOT . '/tests/data/testimage.jpg'); $img = new Image(); $img->setResource($imgcreate); $this->assertInstanceOf('\OC\Image', $img); $this->assertInstanceOf('\OCP\IImage', $img); unset($img); - $base64 = base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif')); + $base64 = base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif')); $img = new Image(); $img->loadFromBase64($base64); $this->assertInstanceOf('\OC\Image', $img); @@ -49,7 +49,7 @@ public function testConstructDestruct(): void { public function testValid(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertTrue($img->valid()); $text = base64_encode('Lorem ipsum dolor sir amet …'); @@ -63,32 +63,32 @@ public function testValid(): void { public function testMimeType(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertEquals('image/png', $img->mimeType()); $img = new Image(); $this->assertEquals('', $img->mimeType()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->assertEquals('image/jpeg', $img->mimeType()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $this->assertEquals('image/gif', $img->mimeType()); } public function testWidth(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertEquals(128, $img->width()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->assertEquals(1680, $img->width()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $this->assertEquals(64, $img->width()); $img = new Image(); @@ -97,15 +97,15 @@ public function testWidth(): void { public function testHeight(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertEquals(128, $img->height()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->assertEquals(1050, $img->height()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $this->assertEquals(64, $img->height()); $img = new Image(); @@ -114,22 +114,22 @@ public function testHeight(): void { public function testSave(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $img->resize(16); - $img->save(OC::$SERVERROOT.'/tests/data/testimage2.png'); - $this->assertEquals(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage2.png'), $img->data()); + $img->save(OC::$SERVERROOT . '/tests/data/testimage2.png'); + $this->assertEquals(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage2.png'), $img->data()); $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.jpg'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.jpg'); $img->resize(128); - $img->save(OC::$SERVERROOT.'/tests/data/testimage2.jpg'); - $this->assertEquals(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage2.jpg'), $img->data()); + $img->save(OC::$SERVERROOT . '/tests/data/testimage2.jpg'); + $this->assertEquals(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage2.jpg'), $img->data()); } public function testData(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); - $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.png')); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); + $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.png')); // Preserve transparency imagealphablending($raw, true); imagesavealpha($raw, true); @@ -149,8 +149,8 @@ public function testData(): void { ->with('preview_max_memory', 256) ->willReturn(256); $img = new Image(null, $appConfig, $config); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.jpg'); - $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.jpg'); + $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); imageinterlace($raw, true); ob_start(); imagejpeg($raw, null, 80); @@ -158,8 +158,8 @@ public function testData(): void { $this->assertEquals($expected, $img->data()); $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.gif'); - $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif')); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.gif'); + $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif')); ob_start(); imagegif($raw); $expected = ob_get_clean(); @@ -176,36 +176,36 @@ public function testDataNoResource(): void { */ public function testToString(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $expected = base64_encode($img->data()); $this->assertEquals($expected, (string)$img); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $expected = base64_encode($img->data()); $this->assertEquals($expected, (string)$img); $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.gif'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.gif'); $expected = base64_encode($img->data()); $this->assertEquals($expected, (string)$img); } public function testResize(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertTrue($img->resize(32)); $this->assertEquals(32, $img->width()); $this->assertEquals(32, $img->height()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->assertTrue($img->resize(840)); $this->assertEquals(840, $img->width()); $this->assertEquals(525, $img->height()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $this->assertTrue($img->resize(100)); $this->assertEquals(100, $img->width()); $this->assertEquals(100, $img->height()); @@ -213,19 +213,19 @@ public function testResize(): void { public function testPreciseResize(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertTrue($img->preciseResize(128, 512)); $this->assertEquals(128, $img->width()); $this->assertEquals(512, $img->height()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->assertTrue($img->preciseResize(64, 840)); $this->assertEquals(64, $img->width()); $this->assertEquals(840, $img->height()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $this->assertTrue($img->preciseResize(1000, 1337)); $this->assertEquals(1000, $img->width()); $this->assertEquals(1337, $img->height()); @@ -233,19 +233,19 @@ public function testPreciseResize(): void { public function testCenterCrop(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $img->centerCrop(); $this->assertEquals(128, $img->width()); $this->assertEquals(128, $img->height()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $img->centerCrop(); $this->assertEquals(1050, $img->width()); $this->assertEquals(1050, $img->height()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $img->centerCrop(512); $this->assertEquals(512, $img->width()); $this->assertEquals(512, $img->height()); @@ -253,19 +253,19 @@ public function testCenterCrop(): void { public function testCrop(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $this->assertTrue($img->crop(0, 0, 50, 20)); $this->assertEquals(50, $img->width()); $this->assertEquals(20, $img->height()); $img = new Image(); - $img->loadFromData(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); + $img->loadFromData(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.jpg')); $this->assertTrue($img->crop(500, 700, 550, 300)); $this->assertEquals(550, $img->width()); $this->assertEquals(300, $img->height()); $img = new Image(); - $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'))); + $img->loadFromBase64(base64_encode(file_get_contents(OC::$SERVERROOT . '/tests/data/testimage.gif'))); $this->assertTrue($img->crop(10, 10, 15, 15)); $this->assertEquals(15, $img->width()); $this->assertEquals(15, $img->height()); @@ -311,7 +311,7 @@ public static function sampleFilenamesProvider() { */ public function testScaleDownToFitWhenSmallerAlready($filename): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/' . $filename); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/' . $filename); $currentWidth = $img->width(); $currentHeight = $img->height(); // We pick something larger than the image we want to scale down @@ -344,7 +344,7 @@ public static function largeSampleProvider() { */ public function testScaleDownWhenBigger($filename, $asked, $expected): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/' . $filename); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/' . $filename); //$this->assertTrue($img->scaleDownToFit($asked[0], $asked[1])); $img->scaleDownToFit($asked[0], $asked[1]); $this->assertEquals($expected[0], $img->width()); @@ -364,7 +364,7 @@ public function convertDataProvider() { */ public function testConvert($mimeType): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage.png'); $tempFile = tempnam(sys_get_temp_dir(), 'img-test'); $img->save($tempFile, $mimeType); @@ -373,12 +373,12 @@ public function testConvert($mimeType): void { public function testMemoryLimitFromFile(): void { $img = new Image(); - $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage-badheader.jpg'); + $img->loadFromFile(OC::$SERVERROOT . '/tests/data/testimage-badheader.jpg'); $this->assertFalse($img->valid()); } public function testMemoryLimitFromData(): void { - $data = file_get_contents(OC::$SERVERROOT.'/tests/data/testimage-badheader.jpg'); + $data = file_get_contents(OC::$SERVERROOT . '/tests/data/testimage-badheader.jpg'); $img = new Image(); $img->loadFromData($data); $this->assertFalse($img->valid()); diff --git a/tests/lib/InfoXmlTest.php b/tests/lib/InfoXmlTest.php index 461a2ecafa8ec..e579a4b4efd30 100644 --- a/tests/lib/InfoXmlTest.php +++ b/tests/lib/InfoXmlTest.php @@ -125,7 +125,7 @@ public function testClasses($app): void { if (isset($appInfo['commands'])) { foreach ($appInfo['commands'] as $command) { - $this->assertTrue(class_exists($command), 'Asserting command "'. $command . '"exists'); + $this->assertTrue(class_exists($command), 'Asserting command "' . $command . '"exists'); $this->assertInstanceOf($command, \OC::$server->query($command)); } } diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php index 8d579cda5290f..6b6da1cc30c04 100644 --- a/tests/lib/IntegrityCheck/CheckerTest.php +++ b/tests/lib/IntegrityCheck/CheckerTest.php @@ -89,8 +89,8 @@ public function testWriteAppSignatureOfNotExistingApp(): void { ->with('NotExistingApp/appinfo') ->willReturn(true); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -108,8 +108,8 @@ public function testWriteAppSignatureWrongPermissions(): void { ->method('file_put_contents') ->will($this->throwException(new \Exception('Exception message'))); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -139,8 +139,8 @@ public function testWriteAppSignature(): void { }) ); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -201,7 +201,7 @@ public function testVerifyAppSignatureWithValidSignatureData(): void { ) ->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $this->assertSame([], $this->checker->verifyAppSignature('SomeApp')); @@ -240,7 +240,7 @@ public function testVerifyAppSignatureWithTamperedSignatureData(): void { ) ->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $expected = [ @@ -285,7 +285,7 @@ public function testVerifyAppSignatureWithTamperedFiles(): void { ) ->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); @@ -345,7 +345,7 @@ public function testVerifyAppSignatureWithTamperedFilesAndAlternatePath(): void ) ->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); @@ -405,7 +405,7 @@ public function testVerifyAppWithDifferentScope(): void { ['/resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $expected = [ @@ -449,7 +449,7 @@ public function testVerifyAppWithDifferentScopeAndAlwaysTrustedCore(): void { ['/resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $this->assertSame([], $this->checker->verifyAppSignature('SomeApp')); @@ -470,8 +470,8 @@ public function testWriteCoreSignatureWithException(): void { ->with(__DIR__ . '/core') ->willReturn(true); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -494,8 +494,8 @@ public function testWriteCoreSignatureWrongPermissions(): void { ->with(__DIR__ . '/core') ->willReturn(false); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -529,8 +529,8 @@ public function testWriteCoreSignature(): void { }) ); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/core.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/core.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/core.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -564,8 +564,8 @@ public function testWriteCoreSignatureWithUnmodifiedHtaccess(): void { }) ); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/core.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/core.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/core.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -594,8 +594,8 @@ public function testWriteCoreSignatureWithInvalidModifiedHtaccess(): void { }) ); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/core.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/core.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/core.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -629,8 +629,8 @@ public function testWriteCoreSignatureWithValidModifiedHtaccess(): void { }) ); - $keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt'); - $rsaPrivateKey = file_get_contents(__DIR__ .'/../../data/integritycheck/core.key'); + $keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/core.crt'); + $rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/core.key'); $rsa = new RSA(); $rsa->loadKey($rsaPrivateKey); $x509 = new X509(); @@ -689,7 +689,7 @@ public function testVerifyCoreSignatureWithValidSignatureData(): void { [\OC::$SERVERROOT . '/tests/data/integritycheck/app//resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $this->assertSame([], $this->checker->verifyCoreSignature()); @@ -727,7 +727,7 @@ public function testVerifyCoreSignatureWithValidModifiedHtaccessSignatureData(): ) ->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $this->assertSame([], $this->checker->verifyCoreSignature()); @@ -774,12 +774,12 @@ public function testVerifyCoreSignatureWithModifiedMimetypelistSignatureData(): ->method('getServerRoot') ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified'); - $signatureDataFile = file_get_contents(__DIR__ .'/../../data/integritycheck/mimetypeListModified/core/signature.json'); + $signatureDataFile = file_get_contents(__DIR__ . '/../../data/integritycheck/mimetypeListModified/core/signature.json'); $this->fileAccessHelper ->method('file_get_contents') ->willReturnMap([ [\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/core/signature.json', $signatureDataFile], - [\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/resources/codesigning/root.crt', file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')], + [\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified/resources/codesigning/root.crt', file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt')], ]); $this->assertSame([], $this->checker->verifyCoreSignature()); @@ -816,7 +816,7 @@ public function testVerifyCoreSignatureWithValidSignatureDataAndNotAlphabeticOrd [\OC::$SERVERROOT . '/tests/data/integritycheck/app//resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $this->assertSame([], $this->checker->verifyCoreSignature()); @@ -853,7 +853,7 @@ public function testVerifyCoreSignatureWithTamperedSignatureData(): void { [\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData//resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $expected = [ @@ -896,7 +896,7 @@ public function testVerifyCoreSignatureWithTamperedFiles(): void { [\OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData//resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $expected = [ @@ -954,7 +954,7 @@ public function testVerifyCoreWithInvalidCertificate(): void { [\OC::$SERVERROOT . '/tests/data/integritycheck/app//resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $expected = [ @@ -997,7 +997,7 @@ public function testVerifyCoreWithDifferentScope(): void { [\OC::$SERVERROOT . '/tests/data/integritycheck/app//resources/codesigning/root.crt'], )->willReturnOnConsecutiveCalls( $signatureDataFile, - file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt') + file_get_contents(__DIR__ . '/../../data/integritycheck/root.crt') ); $expected = [ diff --git a/tests/lib/L10N/L10nTest.php b/tests/lib/L10N/L10nTest.php index 26f39e41c1384..32b81cf06a7b0 100644 --- a/tests/lib/L10N/L10nTest.php +++ b/tests/lib/L10N/L10nTest.php @@ -40,14 +40,14 @@ protected function getFactory() { } public function testSimpleTranslationWithTrailingColon(): void { - $transFile = \OC::$SERVERROOT.'/tests/data/l10n/de.json'; + $transFile = \OC::$SERVERROOT . '/tests/data/l10n/de.json'; $l = new L10N($this->getFactory(), 'test', 'de', 'de_AT', [$transFile]); $this->assertEquals('Files:', $l->t('Files:')); } public function testGermanPluralTranslations(): void { - $transFile = \OC::$SERVERROOT.'/tests/data/l10n/de.json'; + $transFile = \OC::$SERVERROOT . '/tests/data/l10n/de.json'; $l = new L10N($this->getFactory(), 'test', 'de', 'de_AT', [$transFile]); $this->assertEquals('1 Datei', (string)$l->n('%n file', '%n files', 1)); @@ -55,7 +55,7 @@ public function testGermanPluralTranslations(): void { } public function testRussianPluralTranslations(): void { - $transFile = \OC::$SERVERROOT.'/tests/data/l10n/ru.json'; + $transFile = \OC::$SERVERROOT . '/tests/data/l10n/ru.json'; $l = new L10N($this->getFactory(), 'test', 'ru', 'ru_UA', [$transFile]); $this->assertEquals('1 файл', (string)$l->n('%n file', '%n files', 1)); @@ -79,7 +79,7 @@ public function testRussianPluralTranslations(): void { } public function testCzechPluralTranslations(): void { - $transFile = \OC::$SERVERROOT.'/tests/data/l10n/cs.json'; + $transFile = \OC::$SERVERROOT . '/tests/data/l10n/cs.json'; $l = new L10N($this->getFactory(), 'test', 'cs', 'cs_CZ', [$transFile]); $this->assertEquals('1 okno', (string)$l->n('%n window', '%n windows', 1)); @@ -88,7 +88,7 @@ public function testCzechPluralTranslations(): void { } public function testGermanPluralWithCzechLocaleTranslations(): void { - $transFile = \OC::$SERVERROOT.'/tests/data/l10n/de.json'; + $transFile = \OC::$SERVERROOT . '/tests/data/l10n/de.json'; $l = new L10N($this->getFactory(), 'test', 'de', 'cs_CZ', [$transFile]); $this->assertEquals('1 Datei', (string)$l->n('%n file', '%n files', 1)); @@ -111,7 +111,7 @@ public function dataPlaceholders(): array { * @param $expected */ public function testPlaceholders($string, $expected): void { - $transFile = \OC::$SERVERROOT.'/tests/data/l10n/de.json'; + $transFile = \OC::$SERVERROOT . '/tests/data/l10n/de.json'; $l = new L10N($this->getFactory(), 'test', 'de', 'de_AT', [$transFile]); $this->assertEquals($expected, $l->t($string, ['1', '2'])); diff --git a/tests/lib/Log/LogFactoryTest.php b/tests/lib/Log/LogFactoryTest.php index 22ee0dfb26814..6219fd438f7be 100644 --- a/tests/lib/Log/LogFactoryTest.php +++ b/tests/lib/Log/LogFactoryTest.php @@ -62,7 +62,7 @@ public function fileTypeProvider(): array { * @throws \OCP\AppFramework\QueryException */ public function testFile(string $type): void { - $datadir = \OC::$SERVERROOT.'/data'; + $datadir = \OC::$SERVERROOT . '/data'; $defaultLog = $datadir . '/nextcloud.log'; $this->systemConfig->expects($this->exactly(3)) @@ -82,7 +82,7 @@ public function logFilePathProvider():array { ], [ '/xdev/youshallfallback', - \OC::$SERVERROOT.'/data/nextcloud.log' + \OC::$SERVERROOT . '/data/nextcloud.log' ] ]; } @@ -92,7 +92,7 @@ public function logFilePathProvider():array { * @throws \OCP\AppFramework\QueryException */ public function testFileCustomPath($path, $expected): void { - $datadir = \OC::$SERVERROOT.'/data'; + $datadir = \OC::$SERVERROOT . '/data'; $defaultLog = $datadir . '/nextcloud.log'; $this->systemConfig->expects($this->exactly(3)) diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php index 1297bfdf669e5..7767a8c2e8f91 100644 --- a/tests/lib/NavigationManagerTest.php +++ b/tests/lib/NavigationManagerTest.php @@ -311,7 +311,7 @@ public function providesNavigationConfig() { 'logout' => [ 'id' => 'logout', 'order' => 99999, - 'href' => 'https://example.com/logout?requesttoken='. urlencode(\OCP\Util::callRegister()), + 'href' => 'https://example.com/logout?requesttoken=' . urlencode(\OCP\Util::callRegister()), 'icon' => '/apps/core/img/actions/logout.svg', 'name' => 'Log out', 'active' => false, diff --git a/tests/lib/Preview/BackgroundCleanupJobTest.php b/tests/lib/Preview/BackgroundCleanupJobTest.php index d9ea171849160..9c521376af5ad 100644 --- a/tests/lib/Preview/BackgroundCleanupJobTest.php +++ b/tests/lib/Preview/BackgroundCleanupJobTest.php @@ -96,7 +96,7 @@ private function setup11Previews(): array { $files = []; for ($i = 0; $i < 11; $i++) { - $file = $userFolder->newFile($i.'.txt'); + $file = $userFolder->newFile($i . '.txt'); $file->putContent('hello world!'); $this->previewManager->getPreview($file); $files[] = $file; diff --git a/tests/lib/Route/RouterTest.php b/tests/lib/Route/RouterTest.php index 8647bb0f2f6bd..6f253d9121f0a 100644 --- a/tests/lib/Route/RouterTest.php +++ b/tests/lib/Route/RouterTest.php @@ -36,7 +36,7 @@ protected function setUp(): void { $logger->method('info') ->willReturnCallback( function (string $message, array $data) { - $this->fail('Unexpected info log: '.(string)($data['exception'] ?? $message)); + $this->fail('Unexpected info log: ' . (string)($data['exception'] ?? $message)); } ); diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php index 14036b3dd3ba1..095512d0b4f89 100644 --- a/tests/lib/Security/CertificateManagerTest.php +++ b/tests/lib/Security/CertificateManagerTest.php @@ -144,7 +144,7 @@ public function testGetCertificateBundle(): void { public function testNeedRebundling($CaBundleMtime, $targetBundleMtime, $targetBundleExists, - $expected + $expected, ): void { $view = $this->getMockBuilder(View::class) ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/Security/CertificateTest.php b/tests/lib/Security/CertificateTest.php index 8b084ca41b3b4..c787cc3355fcd 100644 --- a/tests/lib/Security/CertificateTest.php +++ b/tests/lib/Security/CertificateTest.php @@ -45,7 +45,7 @@ public function testCertificateStartingWithFileReference(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('Certificate could not get parsed.'); - new Certificate('file://'.__DIR__ . '/../../data/certificates/goodCertificate.crt', 'bar'); + new Certificate('file://' . __DIR__ . '/../../data/certificates/goodCertificate.crt', 'bar'); } public function testGetName(): void { diff --git a/tests/lib/Security/SecureRandomTest.php b/tests/lib/Security/SecureRandomTest.php index 08d33d4a1b3e5..8000917579b42 100644 --- a/tests/lib/Security/SecureRandomTest.php +++ b/tests/lib/Security/SecureRandomTest.php @@ -72,7 +72,7 @@ public function testScheme($charName, $chars): void { $generator = $this->rng; $scheme = constant('OCP\Security\ISecureRandom::' . $charName); $randomString = $generator->generate(100, $scheme); - $matchesRegex = preg_match('/^'.$chars.'+$/', $randomString); + $matchesRegex = preg_match('/^' . $chars . '+$/', $randomString); $this->assertSame(1, $matchesRegex); } diff --git a/tests/lib/Share/Backend.php b/tests/lib/Share/Backend.php index 42269d7e27531..489f4a9bfd1d0 100644 --- a/tests/lib/Share/Backend.php +++ b/tests/lib/Share/Backend.php @@ -54,11 +54,11 @@ public function generateTarget($itemSource, $shareWith, $exclude = null) { $ext = substr($target, $pos); $append = ''; $i = 1; - while (in_array($name.$append.$ext, $knownTargets)) { + while (in_array($name . $append . $ext, $knownTargets)) { $append = $i; $i++; } - $target = $name.$append.$ext; + $target = $name . $append . $ext; } return $target; diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index 36f070d7c99b8..5bed54cc18f64 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -716,7 +716,7 @@ public function testCreateUserShare(): void { $share2 = $this->provider->create($share); $this->assertNotNull($share2->getId()); - $this->assertSame('ocinternal:'.$share2->getId(), $share2->getFullId()); + $this->assertSame('ocinternal:' . $share2->getId(), $share2->getFullId()); $this->assertSame(IShare::TYPE_USER, $share2->getShareType()); $this->assertSame('sharedWith', $share2->getSharedWith()); $this->assertSame('sharedBy', $share2->getSharedBy()); @@ -786,7 +786,7 @@ public function testCreateGroupShare(): void { $share2 = $this->provider->create($share); $this->assertNotNull($share2->getId()); - $this->assertSame('ocinternal:'.$share2->getId(), $share2->getFullId()); + $this->assertSame('ocinternal:' . $share2->getId(), $share2->getFullId()); $this->assertSame(IShare::TYPE_GROUP, $share2->getShareType()); $this->assertSame('sharedWith', $share2->getSharedWith()); $this->assertSame('sharedBy', $share2->getSharedBy()); @@ -855,7 +855,7 @@ public function testCreateLinkShare(): void { $share2 = $this->provider->create($share); $this->assertNotNull($share2->getId()); - $this->assertSame('ocinternal:'.$share2->getId(), $share2->getFullId()); + $this->assertSame('ocinternal:' . $share2->getId(), $share2->getFullId()); $this->assertSame(IShare::TYPE_LINK, $share2->getShareType()); $this->assertSame('sharedBy', $share2->getSharedBy()); $this->assertSame('shareOwner', $share2->getShareOwner()); @@ -1033,7 +1033,7 @@ public function testGetSharedWithGroup($storageStringId, $fileName1, $fileName2) $groups = []; foreach (range(0, 100) as $i) { - $groups[] = 'group'.$i; + $groups[] = 'group' . $i; } $groups[] = 'sharedWith'; @@ -1287,7 +1287,7 @@ public function testGetSharedWithWithDeletedFile($shareType, $trashed): void { $groups = []; foreach (range(0, 100) as $i) { - $groups[] = 'group'.$i; + $groups[] = 'group' . $i; } $groups[] = 'sharedWith'; @@ -1820,9 +1820,9 @@ public function testUpdateUser(): void { $users = []; for ($i = 0; $i < 6; $i++) { $user = $this->createMock(IUser::class); - $user->method('getUID')->willReturn('user'.$i); + $user->method('getUID')->willReturn('user' . $i); $user->method('getDisplayName')->willReturn('user' . $i); - $users['user'.$i] = $user; + $users['user' . $i] = $user; } $this->userManager->method('get')->willReturnCallback( @@ -1878,8 +1878,8 @@ public function testUpdateLink(): void { $users = []; for ($i = 0; $i < 6; $i++) { $user = $this->createMock(IUser::class); - $user->method('getUID')->willReturn('user'.$i); - $users['user'.$i] = $user; + $user->method('getUID')->willReturn('user' . $i); + $users['user' . $i] = $user; } $this->userManager->method('get')->willReturnCallback( @@ -1944,8 +1944,8 @@ public function testUpdateLinkRemovePassword(): void { $users = []; for ($i = 0; $i < 6; $i++) { $user = $this->createMock(IUser::class); - $user->method('getUID')->willReturn('user'.$i); - $users['user'.$i] = $user; + $user->method('getUID')->willReturn('user' . $i); + $users['user' . $i] = $user; } $this->userManager->method('get')->willReturnCallback( @@ -2001,8 +2001,8 @@ public function testUpdateGroupNoSub(): void { $users = []; for ($i = 0; $i < 6; $i++) { $user = $this->createMock(IUser::class); - $user->method('getUID')->willReturn('user'.$i); - $users['user'.$i] = $user; + $user->method('getUID')->willReturn('user' . $i); + $users['user' . $i] = $user; } $this->userManager->method('get')->willReturnCallback( @@ -2014,9 +2014,9 @@ function ($userId) use ($users) { $groups = []; for ($i = 0; $i < 2; $i++) { $group = $this->createMock(IGroup::class); - $group->method('getGID')->willReturn('group'.$i); + $group->method('getGID')->willReturn('group' . $i); $group->method('getDisplayName')->willReturn('group-displayname' . $i); - $groups['group'.$i] = $group; + $groups['group' . $i] = $group; } $this->groupManager->method('get')->willReturnCallback( @@ -2080,8 +2080,8 @@ public function testUpdateGroupSubShares(): void { $users = []; for ($i = 0; $i < 6; $i++) { $user = $this->createMock(IUser::class); - $user->method('getUID')->willReturn('user'.$i); - $users['user'.$i] = $user; + $user->method('getUID')->willReturn('user' . $i); + $users['user' . $i] = $user; } $this->userManager->method('get')->willReturnCallback( @@ -2093,9 +2093,9 @@ function ($userId) use ($users) { $groups = []; for ($i = 0; $i < 2; $i++) { $group = $this->createMock(IGroup::class); - $group->method('getGID')->willReturn('group'.$i); - $group->method('getDisplayName')->willReturn('group-displayname'.$i); - $groups['group'.$i] = $group; + $group->method('getGID')->willReturn('group' . $i); + $group->method('getDisplayName')->willReturn('group-displayname' . $i); + $groups['group' . $i] = $group; } $this->groupManager->method('get')->willReturnCallback( diff --git a/tests/lib/SubAdminTest.php b/tests/lib/SubAdminTest.php index 2827fe84d788b..4cda08a294515 100644 --- a/tests/lib/SubAdminTest.php +++ b/tests/lib/SubAdminTest.php @@ -46,8 +46,8 @@ protected function setUp(): void { // Create 3 users and 3 groups for ($i = 0; $i < 3; $i++) { - $this->users[] = $this->userManager->createUser('user'.$i, 'user'); - $this->groups[] = $this->groupManager->createGroup('group'.$i); + $this->users[] = $this->userManager->createUser('user' . $i, 'user'); + $this->groups[] = $this->groupManager->createGroup('group' . $i); } // Create admin group diff --git a/tests/lib/TaskProcessing/TaskProcessingTest.php b/tests/lib/TaskProcessing/TaskProcessingTest.php index 38675e826bfa0..00e1da4acb5de 100644 --- a/tests/lib/TaskProcessing/TaskProcessingTest.php +++ b/tests/lib/TaskProcessing/TaskProcessingTest.php @@ -625,7 +625,7 @@ public function testProviderShouldBeRegisteredAndRun(): void { $backgroundJob->start($this->jobList); $task = $this->manager->getTask($task->getId()); - self::assertEquals(Task::STATUS_SUCCESSFUL, $task->getStatus(), 'Status is '. $task->getStatus() . ' with error message: ' . $task->getErrorMessage()); + self::assertEquals(Task::STATUS_SUCCESSFUL, $task->getStatus(), 'Status is ' . $task->getStatus() . ' with error message: ' . $task->getErrorMessage()); self::assertEquals(['output' => 'Hello'], $task->getOutput()); self::assertEquals(1, $task->getProgress()); } @@ -729,7 +729,7 @@ public function testAsyncProviderWithFilesShouldBeRegisteredAndRunReturningFileI self::assertEquals(1, $task->getProgress()); self::assertTrue(isset($task->getOutput()['spectrogram'])); $node = $this->rootFolder->getFirstNodeById($task->getOutput()['spectrogram']); - self::assertNotNull($node, 'fileId:' . $task->getOutput()['spectrogram']); + self::assertNotNull($node, 'fileId:' . $task->getOutput()['spectrogram']); self::assertInstanceOf(\OCP\Files\File::class, $node); self::assertEquals('World', $node->getContent()); } diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index 9369a20eb8112..03886d4a0be5c 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -530,7 +530,7 @@ protected function IsDatabaseAccessAllowed() { * @param array $vars */ protected function assertTemplate($expectedHtml, $template, $vars = []) { - require_once __DIR__.'/../../lib/private/legacy/template/functions.php'; + require_once __DIR__ . '/../../lib/private/legacy/template/functions.php'; $requestToken = 12345; /** @var Defaults|\PHPUnit\Framework\MockObject\MockObject $l10n */ diff --git a/tests/lib/Updater/VersionCheckTest.php b/tests/lib/Updater/VersionCheckTest.php index b33829a21553f..94347265427a3 100644 --- a/tests/lib/Updater/VersionCheckTest.php +++ b/tests/lib/Updater/VersionCheckTest.php @@ -63,7 +63,7 @@ protected function setUp(): void { * @return string */ private function buildUpdateUrl($baseUrl) { - return $baseUrl . '?version='.implode('x', Util::getVersion()).'xinstalledatx' . time() . 'x'.\OC_Util::getChannel().'xxx'.PHP_MAJOR_VERSION.'x'.PHP_MINOR_VERSION.'x'.PHP_RELEASE_VERSION.'x0x0'; + return $baseUrl . '?version=' . implode('x', Util::getVersion()) . 'xinstalledatx' . time() . 'x' . \OC_Util::getChannel() . 'xxx' . PHP_MAJOR_VERSION . 'x' . PHP_MINOR_VERSION . 'x' . PHP_RELEASE_VERSION . 'x0x0'; } public function testCheckInCache(): void { diff --git a/tests/preseed-config.php b/tests/preseed-config.php index f9c1593946946..3095690e48369 100644 --- a/tests/preseed-config.php +++ b/tests/preseed-config.php @@ -15,7 +15,7 @@ ], ]; -if (is_dir(OC::$SERVERROOT.'/apps2')) { +if (is_dir(OC::$SERVERROOT . '/apps2')) { $CONFIG['apps_paths'][] = [ 'path' => OC::$SERVERROOT . '/apps2', 'url' => '/apps2', diff --git a/vendor-bin/cs-fixer/composer.json b/vendor-bin/cs-fixer/composer.json index 13cc12d0c8638..c2c3ecc5a46c8 100644 --- a/vendor-bin/cs-fixer/composer.json +++ b/vendor-bin/cs-fixer/composer.json @@ -7,6 +7,6 @@ }, "require": { "friendsofphp/php-cs-fixer": "^3.37", - "nextcloud/coding-standard": "^1.1.1" + "nextcloud/coding-standard": "^1.3.1" } } diff --git a/vendor-bin/cs-fixer/composer.lock b/vendor-bin/cs-fixer/composer.lock index e905331a93a3c..6e6a3ac3e90ad 100644 --- a/vendor-bin/cs-fixer/composer.lock +++ b/vendor-bin/cs-fixer/composer.lock @@ -4,23 +4,70 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "80901a880a6a35944b750b56c0e85620", + "content-hash": "427da07c086c9f916d995f88b29aba1b", "packages": [ + { + "name": "kubawerlos/php-cs-fixer-custom-fixers", + "version": "v3.22.0", + "source": { + "type": "git", + "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", + "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "ext-tokenizer": "*", + "friendsofphp/php-cs-fixer": "^3.61.1", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6.4 || ^10.5.29" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpCsFixerCustomFixers\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kuba Werłos", + "email": "werlos@gmail.com" + } + ], + "description": "A set of custom fixers for PHP CS Fixer", + "support": { + "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", + "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.22.0" + }, + "time": "2024-08-16T20:44:35+00:00" + }, { "name": "nextcloud/coding-standard", - "version": "v1.2.3", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "bc9c53a5306114b60c4363057aff9c2ed10a54da" + "reference": "e88acb0df6217b808d1632286ddfec9267a102e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/bc9c53a5306114b60c4363057aff9c2ed10a54da", - "reference": "bc9c53a5306114b60c4363057aff9c2ed10a54da", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/e88acb0df6217b808d1632286ddfec9267a102e4", + "reference": "e88acb0df6217b808d1632286ddfec9267a102e4", "shasum": "" }, "require": { + "kubawerlos/php-cs-fixer-custom-fixers": "^3.22", "php": "^7.3|^8.0", "php-cs-fixer/shim": "^3.17" }, @@ -43,22 +90,22 @@ "description": "Nextcloud coding standards for the php cs fixer", "support": { "issues": "https://github.com/nextcloud/coding-standard/issues", - "source": "https://github.com/nextcloud/coding-standard/tree/v1.2.3" + "source": "https://github.com/nextcloud/coding-standard/tree/v1.3.1" }, - "time": "2024-08-23T14:32:32+00:00" + "time": "2024-09-19T09:07:10+00:00" }, { "name": "php-cs-fixer/shim", - "version": "v3.62.0", + "version": "v3.64.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "7a91d5ce45c486f5b445d95901228507a02f60ae" + "reference": "81ccfd24baf3a10810dab1152c403981a790b837" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/7a91d5ce45c486f5b445d95901228507a02f60ae", - "reference": "7a91d5ce45c486f5b445d95901228507a02f60ae", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/81ccfd24baf3a10810dab1152c403981a790b837", + "reference": "81ccfd24baf3a10810dab1152c403981a790b837", "shasum": "" }, "require": { @@ -95,9 +142,9 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.62.0" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.64.0" }, - "time": "2024-08-07T17:03:46+00:00" + "time": "2024-08-30T23:10:11+00:00" } ], "packages-dev": [],
t('Authentication')); ?> t('Configuration')); ?> ' . $l->t('Available for') . '