refactor: Apply rector changes

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
nextcloud-command 2026-03-15 14:53:03 +00:00 committed by GitHub
parent 52801b995c
commit 5eec4fd69c
3 changed files with 9 additions and 7 deletions

View file

@ -238,14 +238,14 @@ class CalendarMigratorTest extends TestCase {
$exportedData = null;
$exportDestination->method('addFileContents')
->willReturnCallback(function (string $path, string $content) use (&$exportedCalendarsJson) {
->willReturnCallback(function (string $path, string $content) use (&$exportedCalendarsJson): void {
if ($path === 'dav/calendars/calendars.json') {
$exportedCalendarsJson = json_decode($content, true);
}
});
$exportDestination->method('addFileAsStream')
->willReturnCallback(function (string $path, $stream) use (&$exportedData) {
->willReturnCallback(function (string $path, $stream) use (&$exportedData): void {
if (str_ends_with($path, '.data')) {
$exportedData = stream_get_contents($stream);
}
@ -296,11 +296,11 @@ class CalendarMigratorTest extends TestCase {
$exportDestination = $this->createMock(IExportDestination::class);
$exportDestination->method('addFileContents')
->willReturnCallback(function (string $path, string $content) use (&$exportedFiles) {
->willReturnCallback(function (string $path, string $content) use (&$exportedFiles): void {
$exportedFiles[$path] = $content;
});
$exportDestination->method('addFileAsStream')
->willReturnCallback(function (string $path, $stream) use (&$exportedFiles) {
->willReturnCallback(function (string $path, $stream) use (&$exportedFiles): void {
$exportedFiles[$path] = stream_get_contents($stream);
});
@ -469,7 +469,7 @@ class CalendarMigratorTest extends TestCase {
$exportedSubscriptionsJson = null;
$exportDestination->method('addFileContents')
->willReturnCallback(function (string $path, string $content) use (&$exportedSubscriptionsJson) {
->willReturnCallback(function (string $path, string $content) use (&$exportedSubscriptionsJson): void {
if ($path === 'dav/calendars/subscriptions.json') {
$exportedSubscriptionsJson = json_decode($content, true);
}
@ -578,7 +578,7 @@ class CalendarMigratorTest extends TestCase {
$exportDestination = $this->createMock(IExportDestination::class);
$exportDestination->method('addFileContents')
->willReturnCallback(function (string $path, string $content) use (&$exportedFiles) {
->willReturnCallback(function (string $path, string $content) use (&$exportedFiles): void {
$exportedFiles[$path] = $content;
});

View file

@ -468,7 +468,7 @@ class SharedStorage extends Jail implements LegacyISharedStorage, ISharedStorage
*/
public function unshareStorage(): bool {
foreach ($this->groupedShares as $share) {
Server::get(\OCP\Share\IManager::class)->deleteFromSelf($share, $this->user);
Server::get(IShareManager::class)->deleteFromSelf($share, $this->user);
}
return true;
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.