aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-09-20 17:38:36 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-09-20 17:51:00 +0200
commit1a4978c4ead55daa2726df5967c1377d61a57f7a (patch)
tree88c8a82ed52b8698be9e0cd4e9cef29b3c0d8ea1 /apps/files_sharing
parent6db9cbfdeb7dd475a258c1c2f2c163c41856d6c2 (diff)
downloadnextcloud-server-1a4978c4ead55daa2726df5967c1377d61a57f7a.tar.gz
nextcloud-server-1a4978c4ead55daa2726df5967c1377d61a57f7a.zip
chore: Apply rector configuration to apps folder
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/AppInfo/Application.php8
-rw-r--r--apps/files_sharing/tests/Controller/ShareAPIControllerTest.php6
-rw-r--r--apps/files_sharing/tests/Controller/ShareControllerTest.php4
3 files changed, 9 insertions, 9 deletions
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php
index 98c2d280856..e95723a7b11 100644
--- a/apps/files_sharing/lib/AppInfo/Application.php
+++ b/apps/files_sharing/lib/AppInfo/Application.php
@@ -119,10 +119,10 @@ class Application extends App implements IBootstrap {
}
public function registerEventsScripts(IEventDispatcher $dispatcher): void {
- $dispatcher->addListener(ResourcesLoadAdditionalScriptsEvent::class, function () {
+ $dispatcher->addListener(ResourcesLoadAdditionalScriptsEvent::class, function (): void {
\OCP\Util::addScript('files_sharing', 'collaboration');
});
- $dispatcher->addListener(\OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent::class, function () {
+ $dispatcher->addListener(\OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent::class, function (): void {
/**
* Always add main sharing script
*/
@@ -130,12 +130,12 @@ class Application extends App implements IBootstrap {
});
// notifications api to accept incoming user shares
- $dispatcher->addListener(ShareCreatedEvent::class, function (ShareCreatedEvent $event) {
+ $dispatcher->addListener(ShareCreatedEvent::class, function (ShareCreatedEvent $event): void {
/** @var Listener $listener */
$listener = $this->getContainer()->query(Listener::class);
$listener->shareNotification($event);
});
- $dispatcher->addListener(IGroup::class . '::postAddUser', function ($event) {
+ $dispatcher->addListener(IGroup::class . '::postAddUser', function ($event): void {
if (!$event instanceof OldGenericEvent) {
return;
}
diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
index f741bb64c81..b45e17eefdc 100644
--- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
@@ -181,7 +181,7 @@ class ShareAPIControllerTest extends TestCase {
$this->shareManager
->expects($this->exactly(7))
->method('getShareById')
- ->willReturnCallback(function ($id) {
+ ->willReturnCallback(function ($id): void {
if ($id === 'ocinternal:42' || $id === 'ocRoomShare:42' || $id === 'ocFederatedSharing:42' || $id === 'ocCircleShare:42' || $id === 'ocMailShare:42' || $id === 'deck:42' || $id === 'sciencemesh:42') {
throw new \OCP\Share\Exceptions\ShareNotFound();
} else {
@@ -2416,7 +2416,7 @@ class ShareAPIControllerTest extends TestCase {
~\OCP\Constants::PERMISSION_CREATE,
''
)->willReturnCallback(
- function ($share) {
+ function ($share): void {
$share->setSharedWith('recipientRoom');
$share->setPermissions(
\OCP\Constants::PERMISSION_ALL &
@@ -2532,7 +2532,7 @@ class ShareAPIControllerTest extends TestCase {
~\OCP\Constants::PERMISSION_CREATE,
''
)->willReturnCallback(
- function ($share) {
+ function ($share): void {
throw new OCSNotFoundException('Exception thrown by the helper');
}
);
diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php
index d9acb328f81..45c0d54c918 100644
--- a/apps/files_sharing/tests/Controller/ShareControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php
@@ -317,7 +317,7 @@ class ShareControllerTest extends \Test\TestCase {
$initialState = [];
$this->initialState->expects(self::any())
->method('provideInitialState')
- ->willReturnCallback(function ($key, $value) use (&$initialState) {
+ ->willReturnCallback(function ($key, $value) use (&$initialState): void {
$initialState[$key] = $value;
});
$expectedInitialState = [
@@ -456,7 +456,7 @@ class ShareControllerTest extends \Test\TestCase {
$initialState = [];
$this->initialState->expects(self::any())
->method('provideInitialState')
- ->willReturnCallback(function ($key, $value) use (&$initialState) {
+ ->willReturnCallback(function ($key, $value) use (&$initialState): void {
$initialState[$key] = $value;
});
$expectedInitialState = [