diff --git a/apps/dav/tests/unit/CalDAV/Schedule/IMipServiceTest.php b/apps/dav/tests/unit/CalDAV/Schedule/IMipServiceTest.php index 3b2334c426085..c1fab03b5172d 100644 --- a/apps/dav/tests/unit/CalDAV/Schedule/IMipServiceTest.php +++ b/apps/dav/tests/unit/CalDAV/Schedule/IMipServiceTest.php @@ -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; }); @@ -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; }); diff --git a/apps/dav/tests/unit/CardDAV/SyncServiceTest.php b/apps/dav/tests/unit/CardDAV/SyncServiceTest.php index 630d61672ee94..e76d5d929f83b 100644 --- a/apps/dav/tests/unit/CardDAV/SyncServiceTest.php +++ b/apps/dav/tests/unit/CardDAV/SyncServiceTest.php @@ -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); diff --git a/apps/files_sharing/lib/Listener/SharesUpdatedListener.php b/apps/files_sharing/lib/Listener/SharesUpdatedListener.php index 9cb3740671051..2e07438eebb29 100644 --- a/apps/files_sharing/lib/Listener/SharesUpdatedListener.php +++ b/apps/files_sharing/lib/Listener/SharesUpdatedListener.php @@ -91,7 +91,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 @@ -105,7 +105,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); }); } @@ -117,7 +117,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); }); } @@ -138,7 +138,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); }); } diff --git a/apps/files_sharing/tests/SharesUpdatedListenerTest.php b/apps/files_sharing/tests/SharesUpdatedListenerTest.php index 3598f6cfb5b09..ec27bfdb08b75 100644 --- a/apps/files_sharing/tests/SharesUpdatedListenerTest.php +++ b/apps/files_sharing/tests/SharesUpdatedListenerTest.php @@ -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); }); @@ -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); }); @@ -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]); }); @@ -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]); }); diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php index 4aca7ae697c2d..4a12fbe5cc43a 100644 --- a/build/integration/features/bootstrap/Sharing.php +++ b/build/integration/features/bootstrap/Sharing.php @@ -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; @@ -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); } @@ -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); }