Skip to content

Commit 81d0c73

Browse files
Merge pull request #55360 from nextcloud/refactor/rector
2 parents 16708b1 + 504eae6 commit 81d0c73

32 files changed

Lines changed: 160 additions & 140 deletions

REUSE.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ SPDX-FileCopyrightText = "2023 Nextcloud GmbH and Nextcloud contributors"
250250
SPDX-License-Identifier = "AGPL-3.0-or-later"
251251

252252
[[annotations]]
253-
path = ["apps/dav/lib/ExampleContentFiles/exampleContact.vcf", "tests/data/testvideo-remote-file.mp4"]
253+
path = ["apps/dav/lib/ExampleContentFiles/exampleContact.vcf", "tests/data/testvideo-remote-file.mp4", "tests/lib/AppFramework/Middleware/Mock/UseSessionController.php", "tests/lib/AppFramework/Middleware/Security/Mock/BruteForceMiddlewareController.php", "tests/lib/AppFramework/Middleware/Security/Mock/RateLimitingMiddlewareController.php"]
254254
precedence = "aggregate"
255255
SPDX-FileCopyrightText = "2025 Nextcloud GmbH and Nextcloud contributors"
256256
SPDX-License-Identifier = "AGPL-3.0-or-later"

apps/comments/lib/Search/Result.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ class Result extends BaseResult {
3434
* @deprecated 20.0.0
3535
*/
3636
public $fileName;
37-
/**
38-
* @deprecated 20.0.0
39-
*/
40-
public int $fileId;
4137

4238
/**
4339
* @throws NotFoundException
@@ -51,7 +47,10 @@ public function __construct(
5147
*/
5248
public string $authorName,
5349
string $path,
54-
int $fileId,
50+
/**
51+
* @deprecated 20.0.0
52+
*/
53+
public int $fileId,
5554
) {
5655
parent::__construct(
5756
$comment->getId(),
@@ -63,7 +62,6 @@ public function __construct(
6362
$this->authorId = $comment->getActorId();
6463
$this->fileName = basename($path);
6564
$this->path = $this->getVisiblePath($path);
66-
$this->fileId = $fileId;
6765
}
6866

6967
/**

apps/dav/appinfo/v1/caldav.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use OCP\Accounts\IAccountManager;
2525
use OCP\App\IAppManager;
2626
use OCP\EventDispatcher\IEventDispatcher;
27+
use OCP\ICacheFactory;
2728
use OCP\IConfig;
2829
use OCP\IDBConnection;
2930
use OCP\IGroupManager;
@@ -78,7 +79,7 @@
7879
$config,
7980
Server::get(\OCA\DAV\CalDAV\Sharing\Backend::class),
8081
Server::get(FederatedCalendarMapper::class),
81-
Server::get(\OCP\ICacheFactory::class),
82+
Server::get(ICacheFactory::class),
8283
true
8384
);
8485

apps/dav/lib/CalDAV/Federation/CalendarFederationProvider.php

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

1212
use OCA\DAV\BackgroundJob\FederatedCalendarSyncJob;
1313
use OCA\DAV\CalDAV\Federation\Protocol\CalendarFederationProtocolV1;
14+
use OCA\DAV\CalDAV\Federation\Protocol\CalendarProtocolParseException;
1415
use OCA\DAV\CalDAV\Federation\Protocol\ICalendarFederationProtocol;
1516
use OCA\DAV\DAV\Sharing\Backend as DavSharingBackend;
1617
use OCP\AppFramework\Http;
@@ -74,7 +75,7 @@ public function shareReceived(ICloudFederationShare $share): string {
7475
case CalendarFederationProtocolV1::VERSION:
7576
try {
7677
$protocol = CalendarFederationProtocolV1::parse($rawProtocol);
77-
} catch (Protocol\CalendarProtocolParseException $e) {
78+
} catch (CalendarProtocolParseException $e) {
7879
throw new ProviderCouldNotAddShareException(
7980
'Invalid protocol data (v1)',
8081
'',

apps/dav/lib/DAV/RemoteUserPrincipalBackend.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace OCA\DAV\DAV;
1111

1212
use OCA\DAV\DAV\Sharing\SharingMapper;
13+
use OCP\Federation\ICloudId;
1314
use OCP\Federation\ICloudIdManager;
1415
use Sabre\DAVACL\PrincipalBackend\BackendInterface;
1516

@@ -102,7 +103,7 @@ public function setGroupMemberSet($principal, array $members) {
102103
}
103104

104105
/**
105-
* @return array{'{DAV:}displayname': string, '{http://nextcloud.com/ns}cloud-id': \OCP\Federation\ICloudId, uri: string}
106+
* @return array{'{DAV:}displayname': string, '{http://nextcloud.com/ns}cloud-id': ICloudId, uri: string}
106107
*/
107108
private function principalUriToPrincipal(string $principalUri): array {
108109
[, $name] = \Sabre\Uri\split($principalUri);

apps/dav/tests/unit/Connector/Sabre/PropFindMonitorPluginTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ public static function dataTest(): array {
105105
];
106106
}
107107

108-
/**
109-
* @dataProvider dataTest
110-
*/
108+
#[\PHPUnit\Framework\Attributes\DataProvider('dataTest')]
111109
public function test(array $queries, $expectedLogCalls): void {
112110
$this->plugin->initialize($this->server);
113111
$this->server->expects($this->once())->method('getPluginQueries')

apps/encryption/lib/Controller/RecoveryController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ class RecoveryController extends Controller {
2525
* @param Recovery $recovery
2626
*/
2727
public function __construct(
28-
$AppName,
28+
$appName,
2929
IRequest $request,
3030
private IConfig $config,
3131
private IL10N $l,
3232
private Recovery $recovery,
3333
) {
34-
parent::__construct($AppName, $request);
34+
parent::__construct($appName, $request);
3535
}
3636

3737
/**

apps/encryption/lib/Controller/SettingsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class SettingsController extends Controller {
3737
* @param Util $util
3838
*/
3939
public function __construct(
40-
$AppName,
40+
$appName,
4141
IRequest $request,
4242
private IL10N $l,
4343
private IUserManager $userManager,
@@ -48,7 +48,7 @@ public function __construct(
4848
private ISession $ocSession,
4949
private Util $util,
5050
) {
51-
parent::__construct($AppName, $request);
51+
parent::__construct($appName, $request);
5252
}
5353

5454

apps/encryption/lib/Controller/StatusController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ class StatusController extends Controller {
2525
* @param IManager $encryptionManager
2626
*/
2727
public function __construct(
28-
$AppName,
28+
$appName,
2929
IRequest $request,
3030
private IL10N $l,
3131
private Session $session,
3232
private IManager $encryptionManager,
3333
) {
34-
parent::__construct($AppName, $request);
34+
parent::__construct($appName, $request);
3535
}
3636

3737
/**

apps/federation/lib/Controller/SettingsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222

2323
class SettingsController extends OCSController {
2424
public function __construct(
25-
string $AppName,
25+
string $appName,
2626
IRequest $request,
2727
private IL10N $l,
2828
private TrustedServers $trustedServers,
2929
private LoggerInterface $logger,
3030
) {
31-
parent::__construct($AppName, $request);
31+
parent::__construct($appName, $request);
3232
}
3333

3434

0 commit comments

Comments
 (0)