diff --git a/apps/dav/lib/Listener/CalendarDelegateActionListener.php b/apps/dav/lib/Listener/CalendarDelegateActionListener.php index 475f2fcd3ee..eaa4d286163 100644 --- a/apps/dav/lib/Listener/CalendarDelegateActionListener.php +++ b/apps/dav/lib/Listener/CalendarDelegateActionListener.php @@ -18,6 +18,7 @@ use OCP\Calendar\Events\CalendarObjectRestoredEvent; 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 @@ class CalendarDelegateActionListener implements IEventListener { /** * @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/settings/tests/Controller/AuthSettingsControllerTest.php b/apps/settings/tests/Controller/AuthSettingsControllerTest.php index c2e20fdf8ad..f3503e3c2d7 100644 --- a/apps/settings/tests/Controller/AuthSettingsControllerTest.php +++ b/apps/settings/tests/Controller/AuthSettingsControllerTest.php @@ -21,6 +21,7 @@ use OCP\Activity\IEvent; 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 @@ class AuthSettingsControllerTest extends TestCase { $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/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php index 325f109ee6c..b87b5fde55d 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\OfflineUser; 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 @@ class User_LDAPTest extends TestCase { 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/lib/private/Memcache/Memcached.php b/lib/private/Memcache/Memcached.php index b67b0a90a4f..6a78eaa6481 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 3558264b525..5bca6a22538 100644 --- a/lib/private/Memcache/Redis.php +++ b/lib/private/Memcache/Redis.php @@ -50,7 +50,7 @@ class Redis extends Cache implements IMemcacheTTL { */ 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/tests/lib/BackgroundJob/DummyJob.php b/tests/lib/BackgroundJob/DummyJob.php index cf8ab72d71c..332fc327fd9 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 24d25f4476a..3c1d7038ee7 100644 --- a/tests/lib/OCM/OCMSignatoryManagerRotationTest.php +++ b/tests/lib/OCM/OCMSignatoryManagerRotationTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); 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 @@ class OCMSignatoryManagerRotationTest extends TestCase { ->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 @@ class OCMSignatoryManagerRotationTest extends TestCase { ->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,