From fb5c9751ca59432cb162d3f0d05f1dcdee5c3f74 Mon Sep 17 00:00:00 2001 From: nextcloud-command Date: Sun, 28 Jun 2026 15:04:08 +0000 Subject: [PATCH] refactor: Apply rector changes Signed-off-by: GitHub --- apps/admin_audit/lib/AppInfo/Application.php | 2 -- apps/dav/lib/CalDAV/CalendarImpl.php | 1 - .../Federation/CalendarFederationConfig.php | 3 +- apps/dav/lib/Connector/Sabre/File.php | 1 - .../CalendarDelegateActionListener.php | 3 +- .../Sabre/CustomPropertiesBackendTest.php | 2 -- apps/encryption/lib/Util.php | 1 - .../Controller/RequestHandlerController.php | 1 - .../lib/FederatedShareProvider.php | 3 +- .../lib/OCM/CloudFederationProviderFiles.php | 1 - .../OCM/CloudFederationProviderFilesTest.php | 5 +-- .../lib/Service/OwnershipTransferService.php | 1 - apps/files_external/lib/MountConfig.php | 1 - .../lib/Controller/ShareAPIController.php | 1 - .../lib/Controller/ShareesAPIController.php | 1 - apps/files_sharing/lib/External/Storage.php | 6 ++-- apps/files_sharing/lib/SharedStorage.php | 1 - .../Controller/ShareAPIControllerTest.php | 1 - apps/files_versions/lib/Storage.php | 1 - .../Controller/AuthSettingsControllerTest.php | 3 +- .../lib/Controller/ConfigAPIController.php | 1 - .../lib/Controller/WizardController.php | 1 - apps/user_ldap/lib/Jobs/Sync.php | 1 - apps/user_ldap/lib/LDAP.php | 1 - apps/user_ldap/tests/User_LDAPTest.php | 33 ++++++++++--------- core/BackgroundJobs/PreviewMigrationJob.php | 1 - core/Command/Encryption/MigrateKeyStorage.php | 1 - core/Controller/ReferenceApiController.php | 1 - .../Version23000Date20210906132259.php | 1 - .../Version24000Date20220404230027.php | 1 - .../Version27000Date20230309104325.php | 1 - .../Version29000Date20231126110901.php | 1 - index.php | 2 +- .../DependencyInjection/DIContainer.php | 1 - .../Authentication/Login/TwoFactorCommand.php | 1 - .../Authentication/Login/UidLoginCommand.php | 1 - lib/private/Avatar/Avatar.php | 1 - lib/private/Calendar/Manager.php | 1 - .../Collaborators/RemoteGroupPlugin.php | 1 - lib/private/DB/MigrationService.php | 1 - lib/private/Files/Cache/Watcher.php | 1 - .../Files/ObjectStore/SwiftFactory.php | 1 - lib/private/Files/Storage/Common.php | 1 - lib/private/Files/Storage/DAV.php | 2 +- lib/private/Files/Storage/Home.php | 1 - .../Files/Storage/Wrapper/Encryption.php | 1 - lib/private/Files/Utils/Scanner.php | 1 - lib/private/Files/View.php | 2 -- .../FilesMetadata/FilesMetadataManager.php | 1 - lib/private/Memcache/Memcached.php | 3 +- lib/private/Memcache/Redis.php | 2 +- lib/private/Preview/BackgroundCleanupJob.php | 1 - lib/private/Preview/Db/Preview.php | 1 - lib/private/TaskProcessing/Manager.php | 5 +-- .../SynchronousBackgroundJob.php | 1 - lib/private/legacy/OC_App.php | 1 - lib/private/legacy/OC_Util.php | 3 +- tests/Core/Command/User/LastSeenTest.php | 4 +-- .../Core/Controller/AvatarControllerTest.php | 1 - tests/lib/Avatar/GuestAvatarTest.php | 1 - tests/lib/BackgroundJob/DummyJob.php | 2 ++ tests/lib/MemoryInfoTest.php | 1 - tests/lib/OCM/OCMSignatoryManagerJwksTest.php | 3 +- .../OCM/OCMSignatoryManagerRotationTest.php | 5 +-- .../RemoteHostValidatorIntegrationTest.php | 1 - .../lib/Security/RemoteHostValidatorTest.php | 1 - .../lib/Support/CrashReport/RegistryTest.php | 1 - 67 files changed, 49 insertions(+), 91 deletions(-) diff --git a/apps/admin_audit/lib/AppInfo/Application.php b/apps/admin_audit/lib/AppInfo/Application.php index 85e215ccbc448..6f6bee985e256 100644 --- a/apps/admin_audit/lib/AppInfo/Application.php +++ b/apps/admin_audit/lib/AppInfo/Application.php @@ -9,8 +9,6 @@ namespace OCA\AdminAudit\AppInfo; -use OCA\AdminAudit\Actions\Auth; -use OCA\AdminAudit\Actions\Console; use OCA\AdminAudit\Actions\Files; use OCA\AdminAudit\Actions\Sharing; use OCA\AdminAudit\Actions\Trashbin; diff --git a/apps/dav/lib/CalDAV/CalendarImpl.php b/apps/dav/lib/CalDAV/CalendarImpl.php index f79406e4852a5..63abfc4cdad17 100644 --- a/apps/dav/lib/CalDAV/CalendarImpl.php +++ b/apps/dav/lib/CalDAV/CalendarImpl.php @@ -29,7 +29,6 @@ use Sabre\VObject\Component\VTimeZone; use Sabre\VObject\ITip\Message; use Sabre\VObject\ParseException; -use Sabre\VObject\Property; use Sabre\VObject\Reader; use function Sabre\Uri\split as uriSplit; diff --git a/apps/dav/lib/CalDAV/Federation/CalendarFederationConfig.php b/apps/dav/lib/CalDAV/Federation/CalendarFederationConfig.php index cfbbbe029e6de..c9d1e77dff2a4 100644 --- a/apps/dav/lib/CalDAV/Federation/CalendarFederationConfig.php +++ b/apps/dav/lib/CalDAV/Federation/CalendarFederationConfig.php @@ -9,12 +9,13 @@ namespace OCA\DAV\CalDAV\Federation; +use OCP\GlobalScale\IConfig; use OCP\IAppConfig; class CalendarFederationConfig { public function __construct( private readonly IAppConfig $appConfig, - private \OCP\GlobalScale\IConfig $gsConfig, + private IConfig $gsConfig, ) { } diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 5b70ccce30f9e..e35f466e63120 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -9,7 +9,6 @@ namespace OCA\DAV\Connector\Sabre; use Icewind\Streams\CallbackWrapper; -use OC\AppFramework\Http\Request; use OC\Files\Filesystem; use OC\Files\Stream\HashWrapper; use OC\Files\View; diff --git a/apps/dav/lib/Listener/CalendarDelegateActionListener.php b/apps/dav/lib/Listener/CalendarDelegateActionListener.php index 475f2fcd3ee35..eaa4d2861633e 100644 --- a/apps/dav/lib/Listener/CalendarDelegateActionListener.php +++ b/apps/dav/lib/Listener/CalendarDelegateActionListener.php @@ -18,6 +18,7 @@ use OCP\Calendar\Events\CalendarObjectUpdatedEvent; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; +use OCP\IL10N; use OCP\IUser; use OCP\IUserManager; use OCP\IUserSession; @@ -210,7 +211,7 @@ private function sendNotification( /** * @return array{0: string, 1: string} [subject, heading] */ - private function subjectAndHeading(\OCP\IL10N $l, string $action, string $actorName, string $summary, string $calendarName): array { + private function subjectAndHeading(IL10N $l, string $action, string $actorName, string $summary, string $calendarName): array { return match ($action) { self::ACTION_CREATE => [ $l->t('%1$s created "%2$s" on your behalf', [$actorName, $summary]), diff --git a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php index cdf4bda8d988c..d5ce8083c7060 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php @@ -10,8 +10,6 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre; use OCA\DAV\CalDAV\DefaultCalendarValidator; -use OCA\DAV\Connector\Sabre\Directory; -use OCA\DAV\Connector\Sabre\File; use OCA\DAV\DAV\CustomPropertiesBackend; use OCA\DAV\Db\PropertyMapper; use OCP\IDBConnection; diff --git a/apps/encryption/lib/Util.php b/apps/encryption/lib/Util.php index a5dd226f28398..9092e4006f634 100644 --- a/apps/encryption/lib/Util.php +++ b/apps/encryption/lib/Util.php @@ -8,7 +8,6 @@ namespace OCA\Encryption; -use OC\Files\Storage\Storage; use OC\Files\View; use OCA\Encryption\Crypto\Crypt; use OCP\Files\Storage\IStorage; diff --git a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php index 219aabaecb599..645abf2b1e514 100644 --- a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php +++ b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php @@ -30,7 +30,6 @@ use OCP\IRequest; use OCP\Log\Audit\CriticalActionPerformedEvent; use OCP\Server; -use OCP\Share; use OCP\Share\Exceptions\ShareNotFound; use Psr\Log\LoggerInterface; diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php index 63751fe26b06d..84d329e4f93c5 100644 --- a/apps/federatedfilesharing/lib/FederatedShareProvider.php +++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php @@ -12,6 +12,7 @@ use OC\Share20\Exception\InvalidShare; use OC\Share20\Share; use OCA\CloudFederationAPI\Db\OcmTokenMapMapper; +use OCP\AppFramework\Db\DoesNotExistException; use OCP\Authentication\Exceptions\InvalidTokenException; use OCP\Authentication\Token\IToken; use OCP\Constants; @@ -749,7 +750,7 @@ public function getShareByToken(string $token): IShare { ->executeQuery(); $data = $cursor->fetch(); - } catch (InvalidTokenException|\OCP\AppFramework\Db\DoesNotExistException) { + } catch (InvalidTokenException|DoesNotExistException) { // Token is not a valid access token or has no mapping, share not found } } diff --git a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php index ba02696991549..0d1a82a205d6b 100644 --- a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php +++ b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php @@ -19,7 +19,6 @@ use OCA\Files_Sharing\External\ExternalShareMapper; use OCA\Files_Sharing\External\Manager; use OCA\GlobalSiteSelector\Service\SlaveService; -use OCA\Polls\Db\Share; use OCP\Activity\IManager as IActivityManager; use OCP\App\IAppManager; use OCP\Constants; diff --git a/apps/federatedfilesharing/tests/OCM/CloudFederationProviderFilesTest.php b/apps/federatedfilesharing/tests/OCM/CloudFederationProviderFilesTest.php index be482490e9d10..d2e540849ce4e 100644 --- a/apps/federatedfilesharing/tests/OCM/CloudFederationProviderFilesTest.php +++ b/apps/federatedfilesharing/tests/OCM/CloudFederationProviderFilesTest.php @@ -24,6 +24,7 @@ use OCP\Federation\ICloudIdManager; use OCP\Files\IFilenameValidator; use OCP\Files\ISetupManager; +use OCP\Http\Client\IClient; use OCP\Http\Client\IClientService; use OCP\Http\Client\IResponse; use OCP\IAppConfig; @@ -261,7 +262,7 @@ public function testShareReceivedMustExchangeTokenStoresAccessToken(): void { 'token_type' => 'Bearer', ])); - $httpClient = $this->createMock(\OCP\Http\Client\IClient::class); + $httpClient = $this->createMock(IClient::class); $httpClient->method('post')->willReturn($response); $this->clientService->method('newClient')->willReturn($httpClient); @@ -343,7 +344,7 @@ public function testShareReceivedOptionalExchangeStoresAccessTokenOnSuccess(): v 'token_type' => 'Bearer', ])); - $httpClient = $this->createMock(\OCP\Http\Client\IClient::class); + $httpClient = $this->createMock(IClient::class); $httpClient->method('post')->willReturn($response); $this->clientService->method('newClient')->willReturn($httpClient); diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php index 3b4a990c569d9..3da79d2dde42e 100644 --- a/apps/files/lib/Service/OwnershipTransferService.php +++ b/apps/files/lib/Service/OwnershipTransferService.php @@ -22,7 +22,6 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Config\IHomeMountProvider; use OCP\Files\Config\IUserMountCache; -use OCP\Files\File; use OCP\Files\FileInfo; use OCP\Files\InvalidPathException; use OCP\Files\IRootFolder; diff --git a/apps/files_external/lib/MountConfig.php b/apps/files_external/lib/MountConfig.php index d1b3d9eafaa9d..6677ed3945113 100644 --- a/apps/files_external/lib/MountConfig.php +++ b/apps/files_external/lib/MountConfig.php @@ -8,7 +8,6 @@ namespace OCA\Files_External; -use OCA\Files_External\Lib\Backend\Backend; use OCA\Files_External\Service\BackendService; use OCA\Files_External\Service\EncryptionService; use OCP\Server; diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index ec7b0c51515c0..8cd44c6644387 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -16,7 +16,6 @@ use OCA\Circles\Api\v1\Circles; use OCA\Deck\Sharing\ShareAPIHelper; use OCA\Federation\TrustedServers; -use OCA\Files\Helper; use OCA\Files_Sharing\Exceptions\SharingRightsException; use OCA\Files_Sharing\External\Storage; use OCA\Files_Sharing\ResponseDefinitions; diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php index 72a8af5cd53cd..0fc49f6c78447 100644 --- a/apps/files_sharing/lib/Controller/ShareesAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php @@ -11,7 +11,6 @@ use Generator; use OC\Collaboration\Collaborators\SearchResult; -use OC\Share\Share; use OCA\FederatedFileSharing\FederatedShareProvider; use OCA\Files_Sharing\ResponseDefinitions; use OCP\App\IAppManager; diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php index d52e9945f0b0a..04ab974425dc3 100644 --- a/apps/files_sharing/lib/External/Storage.php +++ b/apps/files_sharing/lib/External/Storage.php @@ -12,9 +12,9 @@ use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; +use OC\Files\Storage\BearerAuthAwareSabreClient; use OC\Files\Storage\DAV; use OC\ForbiddenException; -use OC\Share\Share; use OCA\Files_Sharing\External\Manager as ExternalShareManager; use OCA\Files_Sharing\ISharedStorage; use OCP\AppFramework\Http; @@ -95,7 +95,7 @@ public function __construct($options) { // Shares created before the exchange-token capability was introduced have no // stored token and must keep using basic auth for backwards compatibility. if (!empty($options['access_token'])) { - $authType = \OC\Files\Storage\BearerAuthAwareSabreClient::AUTH_BEARER; + $authType = BearerAuthAwareSabreClient::AUTH_BEARER; } $host = parse_url($remote, PHP_URL_HOST); @@ -130,7 +130,7 @@ public function __construct($options) { 'root' => $webDavEndpoint, 'user' => $options['token'], 'authType' => $authType, - 'password' => $authType === \OC\Files\Storage\BearerAuthAwareSabreClient::AUTH_BEARER + 'password' => $authType === BearerAuthAwareSabreClient::AUTH_BEARER ? (string)($options['access_token'] ?? '') : (string)($options['password'] ?? ''), 'discoveryService' => $discoveryService, diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index e2cf9abb20cfa..d8525d57f2299 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -21,7 +21,6 @@ use OC\Files\Storage\Wrapper\PermissionsMask; use OC\Files\Storage\Wrapper\Wrapper; use OC\Files\View; -use OC\Share\Share; use OC\User\NoUserException; use OCA\Files_Sharing\ISharedStorage as LegacyISharedStorage; use OCP\Constants; diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index 55cf24d79d788..0765ea047a2da 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -9,7 +9,6 @@ namespace OCA\Files_Sharing\Tests\Controller; use OC\Files\Storage\Wrapper\Wrapper; -use OC\Session\Internal; use OCA\Federation\TrustedServers; use OCA\Files_Sharing\Controller\ShareAPIController; use OCA\Files_Sharing\External\Storage; diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index cf49e5a1d4d26..fb471fd44846a 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -25,7 +25,6 @@ use OCP\AppFramework\Db\DoesNotExistException; use OCP\Command\IBus; use OCP\EventDispatcher\IEventDispatcher; -use OCP\Files; use OCP\Files\FileInfo; use OCP\Files\Folder; use OCP\Files\IMimeTypeDetector; diff --git a/apps/settings/tests/Controller/AuthSettingsControllerTest.php b/apps/settings/tests/Controller/AuthSettingsControllerTest.php index c2e20fdf8ad98..f3503e3c2d7f3 100644 --- a/apps/settings/tests/Controller/AuthSettingsControllerTest.php +++ b/apps/settings/tests/Controller/AuthSettingsControllerTest.php @@ -21,6 +21,7 @@ use OCP\Activity\IManager; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Services\IAppConfig; +use OCP\Authentication\Exceptions\WipeTokenException; use OCP\IConfig; use OCP\IL10N; use OCP\IRequest; @@ -243,7 +244,7 @@ public function testDestroyWipePendingEmitsCancelledSubject(): void { $this->tokenProvider->expects($this->once()) ->method('getTokenById') ->with($tokenId) - ->willThrowException(new \OCP\Authentication\Exceptions\WipeTokenException($token)); + ->willThrowException(new WipeTokenException($token)); // The token is still invalidated (the user opted into cancelling the wipe). $this->tokenProvider->expects($this->once()) diff --git a/apps/user_ldap/lib/Controller/ConfigAPIController.php b/apps/user_ldap/lib/Controller/ConfigAPIController.php index e1faacac902f5..96ee62f6707f1 100644 --- a/apps/user_ldap/lib/Controller/ConfigAPIController.php +++ b/apps/user_ldap/lib/Controller/ConfigAPIController.php @@ -12,7 +12,6 @@ use OCA\User_LDAP\Exceptions\ConfigurationIssueException; use OCA\User_LDAP\Helper; use OCA\User_LDAP\ILDAPWrapper; -use OCA\User_LDAP\LDAP; use OCA\User_LDAP\Settings\Admin; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\ApiRoute; diff --git a/apps/user_ldap/lib/Controller/WizardController.php b/apps/user_ldap/lib/Controller/WizardController.php index a325659ce7c17..36096d7132c9c 100644 --- a/apps/user_ldap/lib/Controller/WizardController.php +++ b/apps/user_ldap/lib/Controller/WizardController.php @@ -9,7 +9,6 @@ namespace OCA\User_LDAP\Controller; -use OCA\User_LDAP\Configuration; use OCA\User_LDAP\ConnectionFactory; use OCA\User_LDAP\Mapping\GroupMapping; use OCA\User_LDAP\Mapping\UserMapping; diff --git a/apps/user_ldap/lib/Jobs/Sync.php b/apps/user_ldap/lib/Jobs/Sync.php index 755c172c35580..df2f422527ef3 100644 --- a/apps/user_ldap/lib/Jobs/Sync.php +++ b/apps/user_ldap/lib/Jobs/Sync.php @@ -12,7 +12,6 @@ use OCA\User_LDAP\Configuration; use OCA\User_LDAP\ConnectionFactory; use OCA\User_LDAP\Helper; -use OCA\User_LDAP\LDAP; use OCA\User_LDAP\Mapping\UserMapping; use OCP\AppFramework\Services\IAppConfig; use OCP\AppFramework\Utility\ITimeFactory; diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php index b9951cf505451..41652d0477a73 100644 --- a/apps/user_ldap/lib/LDAP.php +++ b/apps/user_ldap/lib/LDAP.php @@ -14,7 +14,6 @@ use OCP\IConfig; use OCP\ILogger; use OCP\Profiler\IProfiler; -use OCP\Server; use Psr\Log\LoggerInterface; class LDAP implements ILDAPWrapper { diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php index 325f109ee6c50..b87b5fde55dec 100644 --- a/apps/user_ldap/tests/User_LDAPTest.php +++ b/apps/user_ldap/tests/User_LDAPTest.php @@ -21,6 +21,7 @@ use OCA\User_LDAP\User\User; use OCA\User_LDAP\User_LDAP; use OCA\User_LDAP\UserPluginManager; +use OCP\Accounts\IAccountManager; use OCP\HintException; use OCP\IConfig; use OCP\IGroupManager; @@ -1464,24 +1465,24 @@ public function testImplementsAction(string $configurable, string|int $value, in public static function canEditPropertyProvider(): array { return [ // Display name is always managed by LDAP - [\OCP\Accounts\IAccountManager::PROPERTY_DISPLAYNAME, '', false], - [\OCP\Accounts\IAccountManager::PROPERTY_DISPLAYNAME, 'cn', false], + [IAccountManager::PROPERTY_DISPLAYNAME, '', false], + [IAccountManager::PROPERTY_DISPLAYNAME, 'cn', false], // Fields with no LDAP attribute configured are user-editable - [\OCP\Accounts\IAccountManager::PROPERTY_EMAIL, '', true], - [\OCP\Accounts\IAccountManager::PROPERTY_PHONE, '', true], - [\OCP\Accounts\IAccountManager::PROPERTY_WEBSITE, '', true], - [\OCP\Accounts\IAccountManager::PROPERTY_ADDRESS, '', true], - [\OCP\Accounts\IAccountManager::PROPERTY_FEDIVERSE, '', true], - [\OCP\Accounts\IAccountManager::PROPERTY_ORGANISATION, '', true], - [\OCP\Accounts\IAccountManager::PROPERTY_ROLE, '', true], - [\OCP\Accounts\IAccountManager::PROPERTY_HEADLINE, '', true], - [\OCP\Accounts\IAccountManager::PROPERTY_BIOGRAPHY, '', true], - [\OCP\Accounts\IAccountManager::PROPERTY_BIRTHDATE, '', true], - [\OCP\Accounts\IAccountManager::PROPERTY_PRONOUNS, '', true], + [IAccountManager::PROPERTY_EMAIL, '', true], + [IAccountManager::PROPERTY_PHONE, '', true], + [IAccountManager::PROPERTY_WEBSITE, '', true], + [IAccountManager::PROPERTY_ADDRESS, '', true], + [IAccountManager::PROPERTY_FEDIVERSE, '', true], + [IAccountManager::PROPERTY_ORGANISATION, '', true], + [IAccountManager::PROPERTY_ROLE, '', true], + [IAccountManager::PROPERTY_HEADLINE, '', true], + [IAccountManager::PROPERTY_BIOGRAPHY, '', true], + [IAccountManager::PROPERTY_BIRTHDATE, '', true], + [IAccountManager::PROPERTY_PRONOUNS, '', true], // Fields with an LDAP attribute configured are managed by LDAP, not user-editable - [\OCP\Accounts\IAccountManager::PROPERTY_EMAIL, 'mail', false], - [\OCP\Accounts\IAccountManager::PROPERTY_PHONE, 'telephoneNumber', false], - [\OCP\Accounts\IAccountManager::PROPERTY_WEBSITE, 'labeledURI', false], + [IAccountManager::PROPERTY_EMAIL, 'mail', false], + [IAccountManager::PROPERTY_PHONE, 'telephoneNumber', false], + [IAccountManager::PROPERTY_WEBSITE, 'labeledURI', false], ]; } diff --git a/core/BackgroundJobs/PreviewMigrationJob.php b/core/BackgroundJobs/PreviewMigrationJob.php index 842aa56b1f217..5ca3de9286a35 100644 --- a/core/BackgroundJobs/PreviewMigrationJob.php +++ b/core/BackgroundJobs/PreviewMigrationJob.php @@ -9,7 +9,6 @@ namespace OC\Core\BackgroundJobs; -use OC\Preview\Db\Preview; use OC\Preview\PreviewMigrationService; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\TimedJob; diff --git a/core/Command/Encryption/MigrateKeyStorage.php b/core/Command/Encryption/MigrateKeyStorage.php index 2867f7343290e..bd0e3ddcd0983 100644 --- a/core/Command/Encryption/MigrateKeyStorage.php +++ b/core/Command/Encryption/MigrateKeyStorage.php @@ -9,7 +9,6 @@ namespace OC\Core\Command\Encryption; -use OC\Encryption\Keys\Storage; use OC\Encryption\Util; use OC\Files\View; use OCP\IConfig; diff --git a/core/Controller/ReferenceApiController.php b/core/Controller/ReferenceApiController.php index d4fb753f4041e..cb6c36bc78a73 100644 --- a/core/Controller/ReferenceApiController.php +++ b/core/Controller/ReferenceApiController.php @@ -18,7 +18,6 @@ use OCP\AppFramework\OCSController; use OCP\Collaboration\Reference\IDiscoverableReferenceProvider; use OCP\Collaboration\Reference\IReferenceManager; -use OCP\Collaboration\Reference\Reference; use OCP\IRequest; /** diff --git a/core/Migrations/Version23000Date20210906132259.php b/core/Migrations/Version23000Date20210906132259.php index 6da2b1303893b..d0e245dcb371a 100644 --- a/core/Migrations/Version23000Date20210906132259.php +++ b/core/Migrations/Version23000Date20210906132259.php @@ -10,7 +10,6 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/core/Migrations/Version24000Date20220404230027.php b/core/Migrations/Version24000Date20220404230027.php index d4d65ae7228e8..766f680320fef 100644 --- a/core/Migrations/Version24000Date20220404230027.php +++ b/core/Migrations/Version24000Date20220404230027.php @@ -10,7 +10,6 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/core/Migrations/Version27000Date20230309104325.php b/core/Migrations/Version27000Date20230309104325.php index 540c858519bab..b1d1362a24dfe 100644 --- a/core/Migrations/Version27000Date20230309104325.php +++ b/core/Migrations/Version27000Date20230309104325.php @@ -11,7 +11,6 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\DB\Types; use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/core/Migrations/Version29000Date20231126110901.php b/core/Migrations/Version29000Date20231126110901.php index 6aec37063f81e..a872bb2434a6d 100644 --- a/core/Migrations/Version29000Date20231126110901.php +++ b/core/Migrations/Version29000Date20231126110901.php @@ -10,7 +10,6 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/index.php b/index.php index d4bdd263f79f3..cb59b75b3f7ec 100644 --- a/index.php +++ b/index.php @@ -36,7 +36,7 @@ function resetStaticProperties(): void { Filesystem::reset(); } -$handler = static function () { +$handler = static function (): void { try { resetStaticProperties(); OC::init(); diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 3d599ea5212c6..15a1aff97ea66 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -10,7 +10,6 @@ namespace OC\AppFramework\DependencyInjection; -use OC\AppFramework\App; use OC\AppFramework\Bootstrap\Coordinator; use OC\AppFramework\Http; use OC\AppFramework\Http\Dispatcher; diff --git a/lib/private/Authentication/Login/TwoFactorCommand.php b/lib/private/Authentication/Login/TwoFactorCommand.php index f338edc512395..c8805386b745d 100644 --- a/lib/private/Authentication/Login/TwoFactorCommand.php +++ b/lib/private/Authentication/Login/TwoFactorCommand.php @@ -11,7 +11,6 @@ use OC\Authentication\TwoFactorAuth\Manager; use OC\Authentication\TwoFactorAuth\MandatoryTwoFactor; -use OCP\Authentication\TwoFactorAuth\IProvider; use OCP\IURLGenerator; use function array_pop; use function count; diff --git a/lib/private/Authentication/Login/UidLoginCommand.php b/lib/private/Authentication/Login/UidLoginCommand.php index a4bf1424f6124..bdfae66c78710 100644 --- a/lib/private/Authentication/Login/UidLoginCommand.php +++ b/lib/private/Authentication/Login/UidLoginCommand.php @@ -10,7 +10,6 @@ namespace OC\Authentication\Login; use OC\User\Manager; -use OCP\IUser; class UidLoginCommand extends ALoginCommand { public function __construct( diff --git a/lib/private/Avatar/Avatar.php b/lib/private/Avatar/Avatar.php index 2c674de8b060e..bcf85a58cb312 100644 --- a/lib/private/Avatar/Avatar.php +++ b/lib/private/Avatar/Avatar.php @@ -11,7 +11,6 @@ namespace OC\Avatar; use Imagick; -use OC\User\User; use OCP\Color; use OCP\Files\NotFoundException; use OCP\IAvatar; diff --git a/lib/private/Calendar/Manager.php b/lib/private/Calendar/Manager.php index be7853aee37fe..dff931d4ddc59 100644 --- a/lib/private/Calendar/Manager.php +++ b/lib/private/Calendar/Manager.php @@ -35,7 +35,6 @@ use Sabre\VObject\Component\VEvent; use Sabre\VObject\Component\VFreeBusy; use Sabre\VObject\ParseException; -use Sabre\VObject\Property\VCard\DateTime; use Sabre\VObject\Reader; use Throwable; use function array_map; diff --git a/lib/private/Collaboration/Collaborators/RemoteGroupPlugin.php b/lib/private/Collaboration/Collaborators/RemoteGroupPlugin.php index d6ea7e6cc5733..9923670f5b22d 100644 --- a/lib/private/Collaboration/Collaborators/RemoteGroupPlugin.php +++ b/lib/private/Collaboration/Collaborators/RemoteGroupPlugin.php @@ -12,7 +12,6 @@ use OCP\Collaboration\Collaborators\SearchResultType; use OCP\Federation\ICloudFederationProviderManager; use OCP\Federation\ICloudIdManager; -use OCP\Share; use OCP\Share\IShare; class RemoteGroupPlugin implements ISearchPlugin { diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index a0cb407a94d84..1da41d374f63a 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -17,7 +17,6 @@ use OC\App\InfoParser; use OC\Migration\SimpleOutput; use OCP\App\IAppManager; -use OCP\AppFramework\App; use OCP\DB\ISchemaWrapper; use OCP\DB\Types; use OCP\IConfig; diff --git a/lib/private/Files/Cache/Watcher.php b/lib/private/Files/Cache/Watcher.php index 14769772509cd..97b595cc07a68 100644 --- a/lib/private/Files/Cache/Watcher.php +++ b/lib/private/Files/Cache/Watcher.php @@ -8,7 +8,6 @@ namespace OC\Files\Cache; -use OC\Files\Storage\Storage; use OCP\Files\Cache\ICache; use OCP\Files\Cache\ICacheEntry; use OCP\Files\Cache\IScanner; diff --git a/lib/private/Files/ObjectStore/SwiftFactory.php b/lib/private/Files/ObjectStore/SwiftFactory.php index 0dc49472f7aaa..97eb0caa363a2 100644 --- a/lib/private/Files/ObjectStore/SwiftFactory.php +++ b/lib/private/Files/ObjectStore/SwiftFactory.php @@ -20,7 +20,6 @@ use OpenStack\Common\Auth\Token; use OpenStack\Common\Error\BadResponseError; use OpenStack\Common\Transport\Utils as TransportUtils; -use OpenStack\Identity\v2\Models\Catalog; use OpenStack\Identity\v2\Service as IdentityV2Service; use OpenStack\Identity\v3\Service as IdentityV3Service; use OpenStack\ObjectStore\v1\Models\Container; diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index 02983ac178cbc..31ededf5f1be4 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -21,7 +21,6 @@ use OC\Files\Storage\Wrapper\Jail; use OC\Files\Storage\Wrapper\Wrapper; use OCP\Constants; -use OCP\Files; use OCP\Files\Cache\ICache; use OCP\Files\Cache\IPropagator; use OCP\Files\Cache\IScanner; diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index 08ee02eef4473..efcceba7e6892 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -822,7 +822,7 @@ protected function uploadFile(string $path, string $target): void { $target = $this->cleanPath($target); $this->statCache->remove($target); - $this->withAuthRetry(function () use ($path, $target) { + $this->withAuthRetry(function () use ($path, $target): void { $source = fopen($path, 'r'); $auth = [$this->user, $this->password]; $headers = []; diff --git a/lib/private/Files/Storage/Home.php b/lib/private/Files/Storage/Home.php index 7ed391fa37263..83b225d28de40 100644 --- a/lib/private/Files/Storage/Home.php +++ b/lib/private/Files/Storage/Home.php @@ -10,7 +10,6 @@ use OC\Files\Cache\HomeCache; use OC\Files\Cache\HomePropagator; -use OC\User\User; use OCP\Files\Cache\ICache; use OCP\Files\Cache\IPropagator; use OCP\Files\IHomeStorage; diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index 0683afddc7017..20af8b1d06277 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -23,7 +23,6 @@ use OCP\Encryption\IFile; use OCP\Encryption\IManager; use OCP\Encryption\Keys\IStorage; -use OCP\Files; use OCP\Files\Cache\ICacheEntry; use OCP\Files\GenericFileException; use OCP\Files\Mount\IMountPoint; diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index 2831e4f4d8299..49dccb8430c2d 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -10,7 +10,6 @@ use OC\Files\Cache\Cache; use OC\Files\Filesystem; -use OC\Files\Mount\MountPoint; use OC\Files\SetupManager; use OC\Files\Storage\FailedStorage; use OC\Files\Storage\Home; diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 77472b5474a04..e6c29b2d87be3 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -16,11 +16,9 @@ use OC\Files\Storage\Wrapper\Quota; use OC\Files\Utils\PathHelper; use OC\Lock\NoopLockingProvider; -use OC\Share\Share; use OC\User\LazyUser; use OC\User\Manager as UserManager; use OC\User\NoUserException; -use OC\User\User; use OCA\Files_Sharing\SharedMount; use OCP\Constants; use OCP\Files; diff --git a/lib/private/FilesMetadata/FilesMetadataManager.php b/lib/private/FilesMetadata/FilesMetadataManager.php index b6077f1f27125..c1cf6c3b6ace8 100644 --- a/lib/private/FilesMetadata/FilesMetadataManager.php +++ b/lib/private/FilesMetadata/FilesMetadataManager.php @@ -16,7 +16,6 @@ use OC\FilesMetadata\Service\IndexRequestService; use OC\FilesMetadata\Service\MetadataRequestService; use OCP\BackgroundJob\IJobList; -use OCP\DB\Exception; use OCP\DB\Exception as DBException; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\EventDispatcher\IEventDispatcher; diff --git a/lib/private/Memcache/Memcached.php b/lib/private/Memcache/Memcached.php index b67b0a90a4f6a..6a78eaa648174 100644 --- a/lib/private/Memcache/Memcached.php +++ b/lib/private/Memcache/Memcached.php @@ -9,6 +9,7 @@ namespace OC\Memcache; use OCP\IMemcache; +use OCP\Server; class Memcached extends Cache implements IMemcache { use CASTrait; @@ -19,7 +20,7 @@ class Memcached extends Cache implements IMemcache { public function __construct($prefix = '') { parent::__construct($prefix); - $this->cache = \OCP\Server::get(MemcachedFactory::class)->getInstance(); + $this->cache = Server::get(MemcachedFactory::class)->getInstance(); } /** diff --git a/lib/private/Memcache/Redis.php b/lib/private/Memcache/Redis.php index edf9a80aad497..74124fdc064d6 100644 --- a/lib/private/Memcache/Redis.php +++ b/lib/private/Memcache/Redis.php @@ -50,7 +50,7 @@ public function __construct($prefix = '', string $logFile = '') { */ public function getCache(): \Redis|\RedisCluster { if ($this->cache === null) { - $this->cache = \OCP\Server::get(RedisFactory::class)->getInstance(); + $this->cache = Server::get(RedisFactory::class)->getInstance(); } return $this->cache; } diff --git a/lib/private/Preview/BackgroundCleanupJob.php b/lib/private/Preview/BackgroundCleanupJob.php index b301418aedd20..9535d36d1315e 100644 --- a/lib/private/Preview/BackgroundCleanupJob.php +++ b/lib/private/Preview/BackgroundCleanupJob.php @@ -9,7 +9,6 @@ namespace OC\Preview; -use OC\Preview\Db\Preview; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\TimedJob; use OCP\DB\QueryBuilder\IQueryBuilder; diff --git a/lib/private/Preview/Db/Preview.php b/lib/private/Preview/Db/Preview.php index a55d920cc3404..6d383c4287575 100644 --- a/lib/private/Preview/Db/Preview.php +++ b/lib/private/Preview/Db/Preview.php @@ -10,7 +10,6 @@ namespace OC\Preview\Db; -use OCP\AppFramework\Db\Entity; use OCP\AppFramework\Db\SnowflakeAwareEntity; use OCP\DB\Types; use OCP\Files\IMimeTypeDetector; diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index 04d837e1c0e62..6f90de5605867 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -16,6 +16,7 @@ use OC\TaskProcessing\Db\TaskMapper; use OCA\AppAPI\PublicFunctions; use OCA\Guests\UserBackend; +use OCA\NotifyPush\Queue\IQueue; use OCP\App\IAppManager; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\MultipleObjectsReturnedException; @@ -1197,7 +1198,7 @@ private function notifyTaskStatus(Task $task, int $status): void { ) { try { /** @psalm-suppress UndefinedClass */ - $queue = Server::get(\OCA\NotifyPush\Queue\IQueue::class); + $queue = Server::get(IQueue::class); /** @psalm-suppress UndefinedClass */ $queue->push('notify_custom', [ 'user' => $userId, @@ -1304,7 +1305,7 @@ public function setTaskIntermediateOutput(int $id, array $output): bool { ) { try { /** @psalm-suppress UndefinedClass */ - $queue = Server::get(\OCA\NotifyPush\Queue\IQueue::class); + $queue = Server::get(IQueue::class); /** @psalm-suppress UndefinedClass */ $queue->push('notify_custom', [ 'user' => $userId, diff --git a/lib/private/TaskProcessing/SynchronousBackgroundJob.php b/lib/private/TaskProcessing/SynchronousBackgroundJob.php index 31a15e01a7886..9e431ad44d27c 100644 --- a/lib/private/TaskProcessing/SynchronousBackgroundJob.php +++ b/lib/private/TaskProcessing/SynchronousBackgroundJob.php @@ -14,7 +14,6 @@ use OCP\TaskProcessing\Exception\NotFoundException; use OCP\TaskProcessing\IManager; use OCP\TaskProcessing\ISynchronousProvider; -use OCP\TaskProcessing\Task; use Psr\Log\LoggerInterface; class SynchronousBackgroundJob extends QueuedJob { diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index d240b996bcf77..e99ca2c54c40e 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -8,7 +8,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ use OC\App\AppManager; -use OC\AppFramework\App; use OC\AppFramework\Bootstrap\Coordinator; use OC\Installer; use OC\NeedsUpdateException; diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 3e4b7a7fe9d8b..f9d44d9e802dd 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -13,7 +13,6 @@ use OC\Setup; use OC\SystemConfig; use OCP\App\IAppManager; -use OCP\Files\FileInfo; use OCP\Files\Folder; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; @@ -261,7 +260,7 @@ public static function addHeader($tag, $attributes, $text = null, $prepend = fal * @return array arrays with error messages and hints */ public static function checkServer(SystemConfig $config) { - $l = \OCP\Server::get(IFactory::class)->get('lib'); + $l = Server::get(IFactory::class)->get('lib'); $errors = []; $CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT . '/data'); diff --git a/tests/Core/Command/User/LastSeenTest.php b/tests/Core/Command/User/LastSeenTest.php index 8aa9147096478..e1deeb0d43efd 100644 --- a/tests/Core/Command/User/LastSeenTest.php +++ b/tests/Core/Command/User/LastSeenTest.php @@ -129,7 +129,7 @@ public function testAllUsersWithoutExcludeDisabled(): void { $this->userManager->expects($this->once()) ->method('callForAllUsers') - ->willReturnCallback(function ($callback) use ($enabledUser, $disabledUser) { + ->willReturnCallback(function ($callback) use ($enabledUser, $disabledUser): void { $callback($enabledUser); $callback($disabledUser); }); @@ -176,7 +176,7 @@ public function testAllUsersWithExcludeDisabled(): void { $this->userManager->expects($this->once()) ->method('callForAllUsers') - ->willReturnCallback(function ($callback) use ($enabledUser, $disabledUser) { + ->willReturnCallback(function ($callback) use ($enabledUser, $disabledUser): void { $callback($enabledUser); $callback($disabledUser); }); diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php index 368e929605dad..9a93d90245c97 100644 --- a/tests/Core/Controller/AvatarControllerTest.php +++ b/tests/Core/Controller/AvatarControllerTest.php @@ -22,7 +22,6 @@ function is_uploaded_file($filename) { use OC\Core\Controller\AvatarController; use OC\Core\Controller\GuestAvatarController; use OCP\AppFramework\Http; -use OCP\Files\File; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; diff --git a/tests/lib/Avatar/GuestAvatarTest.php b/tests/lib/Avatar/GuestAvatarTest.php index c50b4b2066ba7..eed41e8221e82 100644 --- a/tests/lib/Avatar/GuestAvatarTest.php +++ b/tests/lib/Avatar/GuestAvatarTest.php @@ -12,7 +12,6 @@ use OC\Avatar\GuestAvatar; use OCP\Files\SimpleFS\InMemoryFile; use OCP\IConfig; -use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Test\TestCase; diff --git a/tests/lib/BackgroundJob/DummyJob.php b/tests/lib/BackgroundJob/DummyJob.php index cf8ab72d71ca9..332fc327fd911 100644 --- a/tests/lib/BackgroundJob/DummyJob.php +++ b/tests/lib/BackgroundJob/DummyJob.php @@ -1,5 +1,7 @@ clientService->method('newClient')->willReturn($this->client); $cacheFactory = $this->createMock(ICacheFactory::class); - $cacheFactory->method('createDistributed')->willReturn(new \OC\Memcache\ArrayCache('')); + $cacheFactory->method('createDistributed')->willReturn(new ArrayCache('')); $this->signatoryManager = new OCMSignatoryManager( $this->appConfig, diff --git a/tests/lib/OCM/OCMSignatoryManagerRotationTest.php b/tests/lib/OCM/OCMSignatoryManagerRotationTest.php index 24d25f4476a49..3c1d7038ee78c 100644 --- a/tests/lib/OCM/OCMSignatoryManagerRotationTest.php +++ b/tests/lib/OCM/OCMSignatoryManagerRotationTest.php @@ -9,6 +9,7 @@ namespace Test\OCM; +use OC\Memcache\ArrayCache; use OC\OCM\OCMSignatoryManager; use OC\Security\IdentityProof\Key; use OC\Security\IdentityProof\Manager as IdentityProofManager; @@ -50,7 +51,7 @@ protected function setUp(): void { ->willReturnCallback(static fn (string $suffix): string => 'https://alice.example/' . ltrim($suffix, '/')); $cacheFactory = $this->createMock(ICacheFactory::class); - $cacheFactory->method('createDistributed')->willReturn(new \OC\Memcache\ArrayCache('')); + $cacheFactory->method('createDistributed')->willReturn(new ArrayCache('')); $this->signatoryManager = new OCMSignatoryManager( $this->appConfig, @@ -194,7 +195,7 @@ public function testSignerReturnsNullWhenIdentityCannotBeDerived(): void { ->willThrowException(new IdentityNotFoundException('no url either')); $cacheFactory = $this->createMock(ICacheFactory::class); - $cacheFactory->method('createDistributed')->willReturn(new \OC\Memcache\ArrayCache('')); + $cacheFactory->method('createDistributed')->willReturn(new ArrayCache('')); $manager = new OCMSignatoryManager( $this->appConfig, diff --git a/tests/lib/Security/RemoteHostValidatorIntegrationTest.php b/tests/lib/Security/RemoteHostValidatorIntegrationTest.php index d10a28a6f8522..c72a73338f6e4 100644 --- a/tests/lib/Security/RemoteHostValidatorIntegrationTest.php +++ b/tests/lib/Security/RemoteHostValidatorIntegrationTest.php @@ -14,7 +14,6 @@ use OC\Security\RemoteHostValidator; use OCP\IConfig; use OCP\Server; -use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\NullLogger; use Test\TestCase; diff --git a/tests/lib/Security/RemoteHostValidatorTest.php b/tests/lib/Security/RemoteHostValidatorTest.php index e9e29174554f8..e152efeb857ed 100644 --- a/tests/lib/Security/RemoteHostValidatorTest.php +++ b/tests/lib/Security/RemoteHostValidatorTest.php @@ -13,7 +13,6 @@ use OC\Net\IpAddressClassifier; use OC\Security\RemoteHostValidator; use OCP\IConfig; -use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Test\TestCase; diff --git a/tests/lib/Support/CrashReport/RegistryTest.php b/tests/lib/Support/CrashReport/RegistryTest.php index 2355d6c732252..b2695a4027e30 100644 --- a/tests/lib/Support/CrashReport/RegistryTest.php +++ b/tests/lib/Support/CrashReport/RegistryTest.php @@ -11,7 +11,6 @@ use Exception; use OC\Support\CrashReport\Registry; -use OCP\AppFramework\QueryException; use OCP\Support\CrashReport\ICollectBreadcrumbs; use OCP\Support\CrashReport\IMessageReporter; use OCP\Support\CrashReport\IReporter;