Skip to content

Commit e11e7f1

Browse files
nextcloud-commandsusnux
authored andcommitted
refactor: Apply rector changes
Signed-off-by: GitHub <noreply@github.com>
1 parent e53533c commit e11e7f1

7 files changed

Lines changed: 18 additions & 16 deletions

File tree

apps/dav/tests/unit/CalDAV/Schedule/IMipServiceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,7 +2519,7 @@ public function testAddBulletListMaintainsHtmlProperties(): void {
25192519
$actualHtmlValues = [];
25202520
$template
25212521
->method('addBodyListItem')
2522-
->willReturnCallback(function (string $html) use (&$actualHtmlValues) {
2522+
->willReturnCallback(function (string $html) use (&$actualHtmlValues): void {
25232523
$actualHtmlValues[] = $html;
25242524
});
25252525

@@ -2558,7 +2558,7 @@ public function testAddBulletListEscapesNonHtmlProperties(): void {
25582558
$actualHtmlValues = [];
25592559
$template
25602560
->method('addBodyListItem')
2561-
->willReturnCallback(function (string $html) use (&$actualHtmlValues) {
2561+
->willReturnCallback(function (string $html) use (&$actualHtmlValues): void {
25622562
$actualHtmlValues[] = $html;
25632563
});
25642564

apps/dav/tests/unit/CardDAV/SyncServiceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,12 @@ public function testFullSyncWithOrphanElement(): void {
303303
->method('createCard');
304304
$this->backend->expects($this->exactly(1))
305305
->method('updateCard')
306-
->willReturnCallback(function ($id, $uri) use (&$pendingCards) {
306+
->willReturnCallback(function ($id, $uri) use (&$pendingCards): void {
307307
unset($pendingCards[$uri]);
308308
});
309309
$this->backend->expects($this->exactly(1))
310310
->method('markCardsAsPending')
311-
->willReturnCallback(function ($id) use (&$pendingCards) {
311+
->willReturnCallback(function ($id) use (&$pendingCards): void {
312312
$cards = array_values($this->backend->getCards($id));
313313
$uris = array_map(fn ($card) => $card['uri'], $cards);
314314
$pendingCards = array_combine($uris, $cards);

apps/files/lib/Listener/UserFirstTimeLoggedInListener.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function __construct(
2626
) {
2727
}
2828

29+
#[\Override()]
2930
public function handle(Event $event): void {
3031
if (!$event instanceof UserFirstTimeLoggedInEvent) {
3132
return;

apps/files_sharing/lib/Listener/SharesUpdatedListener.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function handle(Event $event): void {
9292
}
9393

9494
if ($share->getSharedBy() !== $user->getUID()) {
95-
$this->markOrRun($user, function () use ($user, $share) {
95+
$this->markOrRun($user, function () use ($user, $share): void {
9696
$this->shareUpdater->updateForAddedShare($user, $share);
9797
});
9898
// Share target validation might have changed the target, restore it for the next user
@@ -106,7 +106,7 @@ public function handle(Event $event): void {
106106

107107
// don't trigger if the share is moved as part of the conflict resolution
108108
if (!$this->shareUpdater->isInUpdate($user)) {
109-
$this->markOrRun($user, function () use ($user, $share) {
109+
$this->markOrRun($user, function () use ($user, $share): void {
110110
$this->shareUpdater->updateForMovedShare($user, $share);
111111
});
112112
}
@@ -118,7 +118,7 @@ public function handle(Event $event): void {
118118
continue;
119119
}
120120

121-
$this->markOrRun($user, function () use ($user, $share) {
121+
$this->markOrRun($user, function () use ($user, $share): void {
122122
$this->shareUpdater->updateForDeletedShare($user, $share);
123123
});
124124
}
@@ -139,7 +139,7 @@ private function markOrRun(IUser $user, callable $callback): void {
139139
}
140140

141141
private function updateOrMarkUser(IUser $user): void {
142-
$this->markOrRun($user, function () use ($user) {
142+
$this->markOrRun($user, function () use ($user): void {
143143
$this->shareUpdater->updateForUser($user);
144144
});
145145
}

apps/files_sharing/tests/SharesUpdatedListenerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function testShareAdded() {
8484
$this->shareRecipientUpdater
8585
->expects($this->exactly(2))
8686
->method('updateForAddedShare')
87-
->willReturnCallback(function (IUser $user, IShare $eventShare) use ($user1, $user2, $share) {
87+
->willReturnCallback(function (IUser $user, IShare $eventShare) use ($user1, $user2, $share): void {
8888
$this->assertContains($user, [$user1, $user2]);
8989
$this->assertEquals($share, $eventShare);
9090
});
@@ -107,7 +107,7 @@ public function testShareAddedFilterOwner() {
107107
$this->shareRecipientUpdater
108108
->expects($this->exactly(1))
109109
->method('updateForAddedShare')
110-
->willReturnCallback(function (IUser $user, IShare $eventShare) use ($user2, $share) {
110+
->willReturnCallback(function (IUser $user, IShare $eventShare) use ($user2, $share): void {
111111
$this->assertEquals($user, $user2);
112112
$this->assertEquals($share, $eventShare);
113113
});
@@ -124,7 +124,7 @@ public function testShareAccessUpdated() {
124124
$this->shareRecipientUpdater
125125
->expects($this->exactly(2))
126126
->method('updateForUser')
127-
->willReturnCallback(function (IUser $user) use ($user1, $user2) {
127+
->willReturnCallback(function (IUser $user) use ($user1, $user2): void {
128128
$this->assertContains($user, [$user1, $user2]);
129129
});
130130

@@ -144,7 +144,7 @@ public function testShareDeleted() {
144144
$this->shareRecipientUpdater
145145
->expects($this->exactly(2))
146146
->method('updateForDeletedShare')
147-
->willReturnCallback(function (IUser $user) use ($user1, $user2, $share) {
147+
->willReturnCallback(function (IUser $user) use ($user1, $user2, $share): void {
148148
$this->assertContains($user, [$user1, $user2]);
149149
});
150150

build/integration/features/bootstrap/Sharing.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
66
* SPDX-License-Identifier: AGPL-3.0-or-later
77
*/
8-
98
use Behat\Gherkin\Node\TableNode;
109
use GuzzleHttp\Client;
10+
use OCA\Files_Sharing\MountProvider;
1111
use PHPUnit\Framework\Assert;
1212
use Psr\Http\Message\ResponseInterface;
1313

@@ -805,7 +805,7 @@ public function checkShareMounts(string $user, ?TableNode $body) {
805805
}
806806
$this->runOcc(['files:mount:list', '--output', 'json', '--cached-only', $user]);
807807
$mounts = json_decode($this->lastStdOut, true)['cached'];
808-
$shareMounts = array_filter($mounts, fn (array $data) => $data['provider'] === \OCA\Files_Sharing\MountProvider::class);
808+
$shareMounts = array_filter($mounts, fn (array $data) => $data['provider'] === MountProvider::class);
809809
$actual = array_values(array_map(fn (array $data) => $data['mountpoint'], $shareMounts));
810810
Assert::assertEquals($expected, $actual);
811811
}
@@ -817,7 +817,7 @@ public function checkShareMounts(string $user, ?TableNode $body) {
817817
public function checkShareMountsEmpty(string $user) {
818818
$this->runOcc(['files:mount:list', '--output', 'json', '--cached-only', $user]);
819819
$mounts = json_decode($this->lastStdOut, true)['cached'];
820-
$shareMounts = array_filter($mounts, fn (array $data) => $data['provider'] === \OCA\Files_Sharing\MountProvider::class);
820+
$shareMounts = array_filter($mounts, fn (array $data) => $data['provider'] === MountProvider::class);
821821
$actual = array_values(array_map(fn (array $data) => $data['mountpoint'], $shareMounts));
822822
Assert::assertEquals([], $actual);
823823
}

tests/lib/TestMoveableMountPoint.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/**
46
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
57
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
68
* SPDX-License-Identifier: AGPL-3.0-only
79
*/
8-
910
namespace Test;
1011

1112
use OC\Files\Mount\MountPoint;

0 commit comments

Comments
 (0)