aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external
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_external
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_external')
-rw-r--r--apps/files_external/lib/AppInfo/Application.php4
-rw-r--r--apps/files_external/lib/BackgroundJob/CredentialsCleanup.php2
-rw-r--r--apps/files_external/lib/Command/Notify.php2
-rw-r--r--apps/files_external/lib/Command/Scan.php4
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php6
-rw-r--r--apps/files_external/lib/Lib/Storage/FTP.php4
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTP.php2
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php4
-rw-r--r--apps/files_external/lib/Lib/Storage/Swift.php2
-rw-r--r--apps/files_external/tests/Auth/Password/GlobalAuth.php2
10 files changed, 16 insertions, 16 deletions
diff --git a/apps/files_external/lib/AppInfo/Application.php b/apps/files_external/lib/AppInfo/Application.php
index fc4f012cd02..4ba0e40ce46 100644
--- a/apps/files_external/lib/AppInfo/Application.php
+++ b/apps/files_external/lib/AppInfo/Application.php
@@ -75,10 +75,10 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide
}
public function boot(IBootContext $context): void {
- $context->injectFn(function (IMountProviderCollection $mountProviderCollection, ConfigAdapter $configAdapter) {
+ $context->injectFn(function (IMountProviderCollection $mountProviderCollection, ConfigAdapter $configAdapter): void {
$mountProviderCollection->registerProvider($configAdapter);
});
- $context->injectFn(function (BackendService $backendService, UserPlaceholderHandler $userConfigHandler) {
+ $context->injectFn(function (BackendService $backendService, UserPlaceholderHandler $userConfigHandler): void {
$backendService->registerBackendProvider($this);
$backendService->registerAuthMechanismProvider($this);
$backendService->registerConfigHandler('user', function () use ($userConfigHandler) {
diff --git a/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php b/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php
index 5fd233d232e..36eaa2d51ce 100644
--- a/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php
+++ b/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php
@@ -41,7 +41,7 @@ class CredentialsCleanup extends TimedJob {
}
protected function run($argument) {
- $this->userManager->callForSeenUsers(function (IUser $user) {
+ $this->userManager->callForSeenUsers(function (IUser $user): void {
$storages = $this->userGlobalStoragesService->getAllStoragesForUser($user);
$usesLoginCredentials = array_reduce($storages, function (bool $uses, StorageConfig $storage) {
diff --git a/apps/files_external/lib/Command/Notify.php b/apps/files_external/lib/Command/Notify.php
index 09be70ecd16..cd1889264b3 100644
--- a/apps/files_external/lib/Command/Notify.php
+++ b/apps/files_external/lib/Command/Notify.php
@@ -95,7 +95,7 @@ class Notify extends StorageAuthBase {
$this->selfTest($storage, $notifyHandler, $output);
}
- $notifyHandler->listen(function (IChange $change) use ($mount, $output, $dryRun) {
+ $notifyHandler->listen(function (IChange $change) use ($mount, $output, $dryRun): void {
$this->logUpdate($change, $output);
if ($change instanceof IRenameChange) {
$this->markParentAsOutdated($mount->getId(), $change->getTargetPath(), $output, $dryRun);
diff --git a/apps/files_external/lib/Command/Scan.php b/apps/files_external/lib/Command/Scan.php
index 374566ce211..bd54415df55 100644
--- a/apps/files_external/lib/Command/Scan.php
+++ b/apps/files_external/lib/Command/Scan.php
@@ -70,13 +70,13 @@ class Scan extends StorageAuthBase {
/** @var Scanner $scanner */
$scanner = $storage->getScanner();
- $scanner->listen('\OC\Files\Cache\Scanner', 'scanFile', function (string $path) use ($output) {
+ $scanner->listen('\OC\Files\Cache\Scanner', 'scanFile', function (string $path) use ($output): void {
$output->writeln("\tFile\t<info>$path</info>", OutputInterface::VERBOSITY_VERBOSE);
++$this->filesCounter;
$this->abortIfInterrupted();
});
- $scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function (string $path) use ($output) {
+ $scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function (string $path) use ($output): void {
$output->writeln("\tFolder\t<info>$path</info>", OutputInterface::VERBOSITY_VERBOSE);
++$this->foldersCounter;
$this->abortIfInterrupted();
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index 43646ac681a..5325b25a66b 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -474,7 +474,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
$tmpFile = \OC::$server->getTempManager()->getTemporaryFile();
$handle = fopen($tmpFile, 'w');
- return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
+ return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile): void {
$this->writeBack($tmpFile, $path);
});
case 'a':
@@ -499,7 +499,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
$handle = fopen($tmpFile, $mode);
- return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
+ return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile): void {
$this->writeBack($tmpFile, $path);
});
}
@@ -760,7 +760,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
if ($size === null) {
$size = 0;
// track the number of bytes read from the input stream to return as the number of written bytes.
- $stream = CountWrapper::wrap($stream, function (int $writtenSize) use (&$size) {
+ $stream = CountWrapper::wrap($stream, function (int $writtenSize) use (&$size): void {
$size = $writtenSize;
});
}
diff --git a/apps/files_external/lib/Lib/Storage/FTP.php b/apps/files_external/lib/Lib/Storage/FTP.php
index d1f67c5a741..a7a348cbf43 100644
--- a/apps/files_external/lib/Lib/Storage/FTP.php
+++ b/apps/files_external/lib/Lib/Storage/FTP.php
@@ -277,7 +277,7 @@ class FTP extends Common {
$tmpFile = \OC::$server->getTempManager()->getTemporaryFile();
}
$source = fopen($tmpFile, $mode);
- return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $path) {
+ return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $path): void {
$this->writeStream($path, fopen($tmpFile, 'r'));
unlink($tmpFile);
});
@@ -287,7 +287,7 @@ class FTP extends Common {
public function writeStream(string $path, $stream, ?int $size = null): int {
if ($size === null) {
- $stream = CountWrapper::wrap($stream, function ($writtenSize) use (&$size) {
+ $stream = CountWrapper::wrap($stream, function ($writtenSize) use (&$size): void {
$size = $writtenSize;
});
}
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php
index acc531341d9..a6a28245214 100644
--- a/apps/files_external/lib/Lib/Storage/SFTP.php
+++ b/apps/files_external/lib/Lib/Storage/SFTP.php
@@ -478,7 +478,7 @@ class SFTP extends Common {
public function writeStream(string $path, $stream, ?int $size = null): int {
if ($size === null) {
- $stream = CountWrapper::wrap($stream, function (int $writtenSize) use (&$size) {
+ $stream = CountWrapper::wrap($stream, function (int $writtenSize) use (&$size): void {
$size = $writtenSize;
});
if (!$stream) {
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index bd871626bd9..7517c180e37 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -458,7 +458,7 @@ class SMB extends Common implements INotifyStorage {
case 'w':
case 'wb':
$source = $this->share->write($fullPath);
- return CallBackWrapper::wrap($source, null, null, function () use ($fullPath) {
+ return CallBackWrapper::wrap($source, null, null, function () use ($fullPath): void {
unset($this->statCache[$fullPath]);
});
case 'a':
@@ -490,7 +490,7 @@ class SMB extends Common implements INotifyStorage {
}
$source = fopen($tmpFile, $mode);
$share = $this->share;
- return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) {
+ return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share): void {
unset($this->statCache[$fullPath]);
$share->put($tmpFile, $fullPath);
unlink($tmpFile);
diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php
index 64b3179efef..9aabf5b56b4 100644
--- a/apps/files_external/lib/Lib/Storage/Swift.php
+++ b/apps/files_external/lib/Lib/Storage/Swift.php
@@ -414,7 +414,7 @@ class Swift extends \OC\Files\Storage\Common {
file_put_contents($tmpFile, $source);
}
$handle = fopen($tmpFile, $mode);
- return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
+ return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile): void {
$this->writeBack($tmpFile, $path);
});
}
diff --git a/apps/files_external/tests/Auth/Password/GlobalAuth.php b/apps/files_external/tests/Auth/Password/GlobalAuth.php
index 9f7aa0ef03a..823b66702ab 100644
--- a/apps/files_external/tests/Auth/Password/GlobalAuth.php
+++ b/apps/files_external/tests/Auth/Password/GlobalAuth.php
@@ -53,7 +53,7 @@ class GlobalAuthTest extends TestCase {
});
$storageConfig->expects($this->any())
->method('setBackendOption')
- ->willReturnCallback(function ($key, $value) use (&$config) {
+ ->willReturnCallback(function ($key, $value) use (&$config): void {
$config[$key] = $value;
});