Skip to content

Commit d3207be

Browse files
refactor: Apply rector changes
Signed-off-by: GitHub <noreply@github.com>
1 parent d108e81 commit d3207be

8 files changed

Lines changed: 31 additions & 23 deletions

File tree

apps/dav/lib/Listener/CalendarDelegateActionListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
1919
use OCP\EventDispatcher\Event;
2020
use OCP\EventDispatcher\IEventListener;
21+
use OCP\IL10N;
2122
use OCP\IUser;
2223
use OCP\IUserManager;
2324
use OCP\IUserSession;
@@ -210,7 +211,7 @@ private function sendNotification(
210211
/**
211212
* @return array{0: string, 1: string} [subject, heading]
212213
*/
213-
private function subjectAndHeading(\OCP\IL10N $l, string $action, string $actorName, string $summary, string $calendarName): array {
214+
private function subjectAndHeading(IL10N $l, string $action, string $actorName, string $summary, string $calendarName): array {
214215
return match ($action) {
215216
self::ACTION_CREATE => [
216217
$l->t('%1$s created "%2$s" on your behalf', [$actorName, $summary]),

apps/settings/tests/Controller/AuthSettingsControllerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use OCP\Activity\IManager;
2222
use OCP\AppFramework\Http\JSONResponse;
2323
use OCP\AppFramework\Services\IAppConfig;
24+
use OCP\Authentication\Exceptions\WipeTokenException;
2425
use OCP\IConfig;
2526
use OCP\IL10N;
2627
use OCP\IRequest;
@@ -243,7 +244,7 @@ public function testDestroyWipePendingEmitsCancelledSubject(): void {
243244
$this->tokenProvider->expects($this->once())
244245
->method('getTokenById')
245246
->with($tokenId)
246-
->willThrowException(new \OCP\Authentication\Exceptions\WipeTokenException($token));
247+
->willThrowException(new WipeTokenException($token));
247248

248249
// The token is still invalidated (the user opted into cancelling the wipe).
249250
$this->tokenProvider->expects($this->once())

apps/user_ldap/tests/User_LDAPTest.php

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use OCA\User_LDAP\User\User;
2222
use OCA\User_LDAP\User_LDAP;
2323
use OCA\User_LDAP\UserPluginManager;
24+
use OCP\Accounts\IAccountManager;
2425
use OCP\HintException;
2526
use OCP\IConfig;
2627
use OCP\IGroupManager;
@@ -1464,24 +1465,24 @@ public function testImplementsAction(string $configurable, string|int $value, in
14641465
public static function canEditPropertyProvider(): array {
14651466
return [
14661467
// Display name is always managed by LDAP
1467-
[\OCP\Accounts\IAccountManager::PROPERTY_DISPLAYNAME, '', false],
1468-
[\OCP\Accounts\IAccountManager::PROPERTY_DISPLAYNAME, 'cn', false],
1468+
[IAccountManager::PROPERTY_DISPLAYNAME, '', false],
1469+
[IAccountManager::PROPERTY_DISPLAYNAME, 'cn', false],
14691470
// Fields with no LDAP attribute configured are user-editable
1470-
[\OCP\Accounts\IAccountManager::PROPERTY_EMAIL, '', true],
1471-
[\OCP\Accounts\IAccountManager::PROPERTY_PHONE, '', true],
1472-
[\OCP\Accounts\IAccountManager::PROPERTY_WEBSITE, '', true],
1473-
[\OCP\Accounts\IAccountManager::PROPERTY_ADDRESS, '', true],
1474-
[\OCP\Accounts\IAccountManager::PROPERTY_FEDIVERSE, '', true],
1475-
[\OCP\Accounts\IAccountManager::PROPERTY_ORGANISATION, '', true],
1476-
[\OCP\Accounts\IAccountManager::PROPERTY_ROLE, '', true],
1477-
[\OCP\Accounts\IAccountManager::PROPERTY_HEADLINE, '', true],
1478-
[\OCP\Accounts\IAccountManager::PROPERTY_BIOGRAPHY, '', true],
1479-
[\OCP\Accounts\IAccountManager::PROPERTY_BIRTHDATE, '', true],
1480-
[\OCP\Accounts\IAccountManager::PROPERTY_PRONOUNS, '', true],
1471+
[IAccountManager::PROPERTY_EMAIL, '', true],
1472+
[IAccountManager::PROPERTY_PHONE, '', true],
1473+
[IAccountManager::PROPERTY_WEBSITE, '', true],
1474+
[IAccountManager::PROPERTY_ADDRESS, '', true],
1475+
[IAccountManager::PROPERTY_FEDIVERSE, '', true],
1476+
[IAccountManager::PROPERTY_ORGANISATION, '', true],
1477+
[IAccountManager::PROPERTY_ROLE, '', true],
1478+
[IAccountManager::PROPERTY_HEADLINE, '', true],
1479+
[IAccountManager::PROPERTY_BIOGRAPHY, '', true],
1480+
[IAccountManager::PROPERTY_BIRTHDATE, '', true],
1481+
[IAccountManager::PROPERTY_PRONOUNS, '', true],
14811482
// Fields with an LDAP attribute configured are managed by LDAP, not user-editable
1482-
[\OCP\Accounts\IAccountManager::PROPERTY_EMAIL, 'mail', false],
1483-
[\OCP\Accounts\IAccountManager::PROPERTY_PHONE, 'telephoneNumber', false],
1484-
[\OCP\Accounts\IAccountManager::PROPERTY_WEBSITE, 'labeledURI', false],
1483+
[IAccountManager::PROPERTY_EMAIL, 'mail', false],
1484+
[IAccountManager::PROPERTY_PHONE, 'telephoneNumber', false],
1485+
[IAccountManager::PROPERTY_WEBSITE, 'labeledURI', false],
14851486
];
14861487
}
14871488

lib/private/Memcache/Memcached.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace OC\Memcache;
1010

1111
use OCP\IMemcache;
12+
use OCP\Server;
1213

1314
class Memcached extends Cache implements IMemcache {
1415
use CASTrait;
@@ -19,7 +20,7 @@ class Memcached extends Cache implements IMemcache {
1920

2021
public function __construct($prefix = '') {
2122
parent::__construct($prefix);
22-
$this->cache = \OCP\Server::get(MemcachedFactory::class)->getInstance();
23+
$this->cache = Server::get(MemcachedFactory::class)->getInstance();
2324
}
2425

2526
/**

lib/private/Memcache/Redis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct($prefix = '', string $logFile = '') {
5050
*/
5151
public function getCache(): \Redis|\RedisCluster {
5252
if ($this->cache === null) {
53-
$this->cache = \OCP\Server::get(RedisFactory::class)->getInstance();
53+
$this->cache = Server::get(RedisFactory::class)->getInstance();
5454
}
5555
return $this->cache;
5656
}

tests/lib/BackgroundJob/DummyJob.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/**
46
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
57
* SPDX-License-Identifier: AGPL-3.0-or-later

tests/lib/OCM/OCMSignatoryManagerJwksTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace Test\OCM;
1111

12+
use OC\Memcache\ArrayCache;
1213
use OC\OCM\OCMSignatoryManager;
1314
use OC\Security\IdentityProof\Manager as IdentityProofManager;
1415
use OCP\Http\Client\IClient;
@@ -54,7 +55,7 @@ protected function setUp(): void {
5455
$this->clientService->method('newClient')->willReturn($this->client);
5556

5657
$cacheFactory = $this->createMock(ICacheFactory::class);
57-
$cacheFactory->method('createDistributed')->willReturn(new \OC\Memcache\ArrayCache(''));
58+
$cacheFactory->method('createDistributed')->willReturn(new ArrayCache(''));
5859

5960
$this->signatoryManager = new OCMSignatoryManager(
6061
$this->appConfig,

tests/lib/OCM/OCMSignatoryManagerRotationTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace Test\OCM;
1111

12+
use OC\Memcache\ArrayCache;
1213
use OC\OCM\OCMSignatoryManager;
1314
use OC\Security\IdentityProof\Key;
1415
use OC\Security\IdentityProof\Manager as IdentityProofManager;
@@ -50,7 +51,7 @@ protected function setUp(): void {
5051
->willReturnCallback(static fn (string $suffix): string => 'https://alice.example/' . ltrim($suffix, '/'));
5152

5253
$cacheFactory = $this->createMock(ICacheFactory::class);
53-
$cacheFactory->method('createDistributed')->willReturn(new \OC\Memcache\ArrayCache(''));
54+
$cacheFactory->method('createDistributed')->willReturn(new ArrayCache(''));
5455

5556
$this->signatoryManager = new OCMSignatoryManager(
5657
$this->appConfig,
@@ -194,7 +195,7 @@ public function testSignerReturnsNullWhenIdentityCannotBeDerived(): void {
194195
->willThrowException(new IdentityNotFoundException('no url either'));
195196

196197
$cacheFactory = $this->createMock(ICacheFactory::class);
197-
$cacheFactory->method('createDistributed')->willReturn(new \OC\Memcache\ArrayCache(''));
198+
$cacheFactory->method('createDistributed')->willReturn(new ArrayCache(''));
198199

199200
$manager = new OCMSignatoryManager(
200201
$this->appConfig,

0 commit comments

Comments
 (0)