Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/dav/tests/unit/CalDAV/Schedule/IMipServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2519,7 +2519,7 @@ public function testAddBulletListMaintainsHtmlProperties(): void {
$actualHtmlValues = [];
$template
->method('addBodyListItem')
->willReturnCallback(function (string $html) use (&$actualHtmlValues) {
->willReturnCallback(function (string $html) use (&$actualHtmlValues): void {
$actualHtmlValues[] = $html;
});

Expand Down Expand Up @@ -2558,7 +2558,7 @@ public function testAddBulletListEscapesNonHtmlProperties(): void {
$actualHtmlValues = [];
$template
->method('addBodyListItem')
->willReturnCallback(function (string $html) use (&$actualHtmlValues) {
->willReturnCallback(function (string $html) use (&$actualHtmlValues): void {
$actualHtmlValues[] = $html;
});

Expand Down
4 changes: 2 additions & 2 deletions apps/dav/tests/unit/CardDAV/SyncServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,12 @@ public function testFullSyncWithOrphanElement(): void {
->method('createCard');
$this->backend->expects($this->exactly(1))
->method('updateCard')
->willReturnCallback(function ($id, $uri) use (&$pendingCards) {
->willReturnCallback(function ($id, $uri) use (&$pendingCards): void {
unset($pendingCards[$uri]);
});
$this->backend->expects($this->exactly(1))
->method('markCardsAsPending')
->willReturnCallback(function ($id) use (&$pendingCards) {
->willReturnCallback(function ($id) use (&$pendingCards): void {
$cards = array_values($this->backend->getCards($id));
$uris = array_map(fn ($card) => $card['uri'], $cards);
$pendingCards = array_combine($uris, $cards);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function __construct(
) {
}

#[\Override()]
public function handle(Event $event): void {
if (!$event instanceof UserFirstTimeLoggedInEvent) {
return;
Expand Down
8 changes: 4 additions & 4 deletions apps/files_sharing/lib/Listener/SharesUpdatedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function handle(Event $event): void {
}

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

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

$this->markOrRun($user, function () use ($user, $share) {
$this->markOrRun($user, function () use ($user, $share): void {
$this->shareUpdater->updateForDeletedShare($user, $share);
});
}
Expand All @@ -139,7 +139,7 @@ private function markOrRun(IUser $user, callable $callback): void {
}

private function updateOrMarkUser(IUser $user): void {
$this->markOrRun($user, function () use ($user) {
$this->markOrRun($user, function () use ($user): void {
$this->shareUpdater->updateForUser($user);
});
}
Expand Down
8 changes: 4 additions & 4 deletions apps/files_sharing/tests/SharesUpdatedListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function testShareAdded() {
$this->shareRecipientUpdater
->expects($this->exactly(2))
->method('updateForAddedShare')
->willReturnCallback(function (IUser $user, IShare $eventShare) use ($user1, $user2, $share) {
->willReturnCallback(function (IUser $user, IShare $eventShare) use ($user1, $user2, $share): void {
$this->assertContains($user, [$user1, $user2]);
$this->assertEquals($share, $eventShare);
});
Expand All @@ -107,7 +107,7 @@ public function testShareAddedFilterOwner() {
$this->shareRecipientUpdater
->expects($this->exactly(1))
->method('updateForAddedShare')
->willReturnCallback(function (IUser $user, IShare $eventShare) use ($user2, $share) {
->willReturnCallback(function (IUser $user, IShare $eventShare) use ($user2, $share): void {
$this->assertEquals($user, $user2);
$this->assertEquals($share, $eventShare);
});
Expand All @@ -124,7 +124,7 @@ public function testShareAccessUpdated() {
$this->shareRecipientUpdater
->expects($this->exactly(2))
->method('updateForUser')
->willReturnCallback(function (IUser $user) use ($user1, $user2) {
->willReturnCallback(function (IUser $user) use ($user1, $user2): void {
$this->assertContains($user, [$user1, $user2]);
});

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

Expand Down
6 changes: 3 additions & 3 deletions build/integration/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

use Behat\Gherkin\Node\TableNode;
use GuzzleHttp\Client;
use OCA\Files_Sharing\MountProvider;
use PHPUnit\Framework\Assert;
use Psr\Http\Message\ResponseInterface;

Expand Down Expand Up @@ -805,7 +805,7 @@ public function checkShareMounts(string $user, ?TableNode $body) {
}
$this->runOcc(['files:mount:list', '--output', 'json', '--cached-only', $user]);
$mounts = json_decode($this->lastStdOut, true)['cached'];
$shareMounts = array_filter($mounts, fn (array $data) => $data['provider'] === \OCA\Files_Sharing\MountProvider::class);
$shareMounts = array_filter($mounts, fn (array $data) => $data['provider'] === MountProvider::class);
$actual = array_values(array_map(fn (array $data) => $data['mountpoint'], $shareMounts));
Assert::assertEquals($expected, $actual);
}
Expand All @@ -817,7 +817,7 @@ public function checkShareMounts(string $user, ?TableNode $body) {
public function checkShareMountsEmpty(string $user) {
$this->runOcc(['files:mount:list', '--output', 'json', '--cached-only', $user]);
$mounts = json_decode($this->lastStdOut, true)['cached'];
$shareMounts = array_filter($mounts, fn (array $data) => $data['provider'] === \OCA\Files_Sharing\MountProvider::class);
$shareMounts = array_filter($mounts, fn (array $data) => $data['provider'] === MountProvider::class);
$actual = array_values(array_map(fn (array $data) => $data['mountpoint'], $shareMounts));
Assert::assertEquals([], $actual);
}
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/TestMoveableMountPoint.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/

namespace Test;

use OC\Files\Mount\MountPoint;
Expand Down
Loading