diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-11-23 11:40:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-23 11:40:02 +0100 |
commit | 3d814b0c36e736f8f9051d6ee6f0d20fc8811640 (patch) | |
tree | 843203cd1346158aab3515687e37a90e78c929e9 /apps/files | |
parent | 09879700aa5a1ff354ce1366638da56720b4aa08 (diff) | |
parent | aa5f037af71c915424c6dcfd5ad2dc82797dc0d6 (diff) | |
download | nextcloud-server-3d814b0c36e736f8f9051d6ee6f0d20fc8811640.tar.gz nextcloud-server-3d814b0c36e736f8f9051d6ee6f0d20fc8811640.zip |
Merge pull request #39271 from nextcloud/bump-coding-standards
Bump CS Fixer rules to follow latest Nextcloud standards
Diffstat (limited to 'apps/files')
33 files changed, 114 insertions, 120 deletions
diff --git a/apps/files/lib/Activity/Provider.php b/apps/files/lib/Activity/Provider.php index 2cfd48ede3b..8b817f92c1e 100644 --- a/apps/files/lib/Activity/Provider.php +++ b/apps/files/lib/Activity/Provider.php @@ -77,13 +77,13 @@ class Provider implements IProvider { protected $fileIsEncrypted = false; public function __construct(IFactory $languageFactory, - IURLGenerator $url, - IManager $activityManager, - IUserManager $userManager, - IRootFolder $rootFolder, - ICloudIdManager $cloudIdManager, - IContactsManager $contactsManager, - IEventMerger $eventMerger) { + IURLGenerator $url, + IManager $activityManager, + IUserManager $userManager, + IRootFolder $rootFolder, + ICloudIdManager $cloudIdManager, + IContactsManager $contactsManager, + IEventMerger $eventMerger) { $this->languageFactory = $languageFactory; $this->url = $url; $this->activityManager = $activityManager; diff --git a/apps/files/lib/AppInfo/Application.php b/apps/files/lib/AppInfo/Application.php index 9099dbaceb2..5934bc1c7ce 100644 --- a/apps/files/lib/AppInfo/Application.php +++ b/apps/files/lib/AppInfo/Application.php @@ -40,7 +40,6 @@ use OCA\Files\Collaboration\Resources\Listener; use OCA\Files\Collaboration\Resources\ResourceProvider; use OCA\Files\Controller\ApiController; use OCA\Files\DirectEditingCapabilities; -use OCA\Files\Event\LoadAdditionalScriptsEvent; use OCA\Files\Event\LoadSidebar; use OCA\Files\Listener\LoadSidebarListener; use OCA\Files\Listener\RenderReferenceEventListener; @@ -58,10 +57,9 @@ use OCP\Collaboration\Reference\RenderReferenceEvent; use OCP\Collaboration\Resources\IProviderManager; use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; -use OCP\IL10N; use OCP\IPreview; -use OCP\ISearch; use OCP\IRequest; +use OCP\ISearch; use OCP\IServerContainer; use OCP\ITagManager; use OCP\IUserSession; diff --git a/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php b/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php index a9b5b1446b2..2f700b8773e 100644 --- a/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php +++ b/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php @@ -36,7 +36,7 @@ class CleanupDirectEditingTokens extends TimedJob { private IManager $manager; public function __construct(ITimeFactory $time, - IManager $manager) { + IManager $manager) { parent::__construct($time); $this->interval = self::INTERVAL_MINUTES; $this->manager = $manager; diff --git a/apps/files/lib/BackgroundJob/CleanupFileLocks.php b/apps/files/lib/BackgroundJob/CleanupFileLocks.php index e0ad72eaaf0..7ff28a50155 100644 --- a/apps/files/lib/BackgroundJob/CleanupFileLocks.php +++ b/apps/files/lib/BackgroundJob/CleanupFileLocks.php @@ -23,9 +23,9 @@ */ namespace OCA\Files\BackgroundJob; +use OC\Lock\DBLockingProvider; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\TimedJob; -use OC\Lock\DBLockingProvider; /** * Clean up all file locks that are expired for the DB file locking provider diff --git a/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php b/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php index d96728fc713..9839bcde5b7 100644 --- a/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php +++ b/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php @@ -26,7 +26,6 @@ declare(strict_types=1); namespace OCA\Files\BackgroundJob; -use OCA\Files\Controller\OpenLocalEditorController; use OCA\Files\Db\OpenLocalEditorMapper; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJob; diff --git a/apps/files/lib/BackgroundJob/TransferOwnership.php b/apps/files/lib/BackgroundJob/TransferOwnership.php index 9103c307b76..1f182b5e999 100644 --- a/apps/files/lib/BackgroundJob/TransferOwnership.php +++ b/apps/files/lib/BackgroundJob/TransferOwnership.php @@ -48,7 +48,7 @@ class TransferOwnership extends QueuedJob { private NotificationManager $notificationManager, private TransferOwnershipMapper $mapper, private IRootFolder $rootFolder, - ) { + ) { parent::__construct($timeFactory); } diff --git a/apps/files/lib/Collaboration/Resources/Listener.php b/apps/files/lib/Collaboration/Resources/Listener.php index e37bf0e9610..a368016523d 100644 --- a/apps/files/lib/Collaboration/Resources/Listener.php +++ b/apps/files/lib/Collaboration/Resources/Listener.php @@ -25,9 +25,9 @@ declare(strict_types=1); */ namespace OCA\Files\Collaboration\Resources; +use OCP\Collaboration\Resources\IManager; use OCP\EventDispatcher\IEventDispatcher; use OCP\Server; -use OCP\Collaboration\Resources\IManager; use OCP\Share\Events\ShareCreatedEvent; use OCP\Share\Events\ShareDeletedEvent; use OCP\Share\Events\ShareDeletedFromSelfEvent; diff --git a/apps/files/lib/Collaboration/Resources/ResourceProvider.php b/apps/files/lib/Collaboration/Resources/ResourceProvider.php index 841a2bdd4f7..4c5afc76b2b 100644 --- a/apps/files/lib/Collaboration/Resources/ResourceProvider.php +++ b/apps/files/lib/Collaboration/Resources/ResourceProvider.php @@ -49,8 +49,8 @@ class ResourceProvider implements IProvider { protected $nodes = []; public function __construct(IRootFolder $rootFolder, - IPreview $preview, - IURLGenerator $urlGenerator) { + IPreview $preview, + IURLGenerator $urlGenerator) { $this->rootFolder = $rootFolder; $this->preview = $preview; $this->urlGenerator = $urlGenerator; diff --git a/apps/files/lib/Command/Copy.php b/apps/files/lib/Command/Copy.php index 678c82a138f..e9a9f764d94 100644 --- a/apps/files/lib/Command/Copy.php +++ b/apps/files/lib/Command/Copy.php @@ -25,7 +25,6 @@ namespace OCA\Files\Command; use OC\Core\Command\Info\FileUtils; use OCP\Files\Folder; -use OCP\Files\File; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputArgument; diff --git a/apps/files/lib/Command/Get.php b/apps/files/lib/Command/Get.php index 6b21f94e8cf..e46ce29f08d 100644 --- a/apps/files/lib/Command/Get.php +++ b/apps/files/lib/Command/Get.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace OCA\Files\Command; - use OC\Core\Command\Info\FileUtils; use OCP\Files\File; use Symfony\Component\Console\Command\Command; diff --git a/apps/files/lib/Command/Move.php b/apps/files/lib/Command/Move.php index ac84dfa19b3..af97563c816 100644 --- a/apps/files/lib/Command/Move.php +++ b/apps/files/lib/Command/Move.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace OCA\Files\Command; use OC\Core\Command\Info\FileUtils; -use OCP\Files\Folder; use OCP\Files\File; +use OCP\Files\Folder; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputArgument; diff --git a/apps/files/lib/Command/Object/Delete.php b/apps/files/lib/Command/Object/Delete.php index 5000eeb6ee5..527292725ab 100644 --- a/apps/files/lib/Command/Object/Delete.php +++ b/apps/files/lib/Command/Object/Delete.php @@ -23,8 +23,6 @@ declare(strict_types=1); namespace OCA\Files\Command\Object; -use OCP\DB\QueryBuilder\IQueryBuilder; -use OCP\IDBConnection; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputArgument; diff --git a/apps/files/lib/Command/Object/Get.php b/apps/files/lib/Command/Object/Get.php index cad1f3d98ac..dfd44341638 100644 --- a/apps/files/lib/Command/Object/Get.php +++ b/apps/files/lib/Command/Object/Get.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace OCA\Files\Command\Object; -use OCP\Files\File; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; diff --git a/apps/files/lib/Command/Object/Put.php b/apps/files/lib/Command/Object/Put.php index 852d7c2225e..b4a7389fb82 100644 --- a/apps/files/lib/Command/Object/Put.php +++ b/apps/files/lib/Command/Object/Put.php @@ -46,7 +46,8 @@ class Put extends Command { ->setDescription('Write a file to the object store') ->addArgument('input', InputArgument::REQUIRED, "Source local path, use - to read from STDIN") ->addArgument('object', InputArgument::REQUIRED, "Object to write") - ->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket where to store the object, only required in cases where it can't be determined from the config");; + ->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket where to store the object, only required in cases where it can't be determined from the config"); + ; } public function execute(InputInterface $input, OutputInterface $output): int { diff --git a/apps/files/lib/Command/Put.php b/apps/files/lib/Command/Put.php index 73261e47fb6..5539c25665a 100644 --- a/apps/files/lib/Command/Put.php +++ b/apps/files/lib/Command/Put.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace OCA\Files\Command; - use OC\Core\Command\Info\FileUtils; use OCP\Files\File; use OCP\Files\Folder; diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php index a78b6cbe8b1..31c410241cf 100644 --- a/apps/files/lib/Command/Scan.php +++ b/apps/files/lib/Command/Scan.php @@ -163,13 +163,13 @@ class Scan extends Base { ++$this->errorsCounter; }); - $this->eventDispatcher->addListener(NodeAddedToCache::class, function() { + $this->eventDispatcher->addListener(NodeAddedToCache::class, function () { ++$this->newCounter; }); - $this->eventDispatcher->addListener(FileCacheUpdated::class, function() { + $this->eventDispatcher->addListener(FileCacheUpdated::class, function () { ++$this->updatedCounter; }); - $this->eventDispatcher->addListener(NodeRemovedFromCache::class, function() { + $this->eventDispatcher->addListener(NodeRemovedFromCache::class, function () { ++$this->removedCounter; }); diff --git a/apps/files/lib/Command/TransferOwnership.php b/apps/files/lib/Command/TransferOwnership.php index 2007c23f256..64f7fbbb95e 100644 --- a/apps/files/lib/Command/TransferOwnership.php +++ b/apps/files/lib/Command/TransferOwnership.php @@ -36,9 +36,9 @@ namespace OCA\Files\Command; use OCA\Files\Exception\TransferOwnershipException; use OCA\Files\Service\OwnershipTransferService; +use OCP\IConfig; use OCP\IUser; use OCP\IUserManager; -use OCP\IConfig; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -85,7 +85,7 @@ class TransferOwnership extends Command { InputOption::VALUE_OPTIONAL, 'transfer incoming user file shares to destination user. Usage: --transfer-incoming-shares=1 (value required)', '2' - ); + ); } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index 6e64d68588f..a82fe7078af 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -74,15 +74,15 @@ class ApiController extends Controller { private ViewConfig $viewConfig; public function __construct(string $appName, - IRequest $request, - IUserSession $userSession, - TagService $tagService, - IPreview $previewManager, - IManager $shareManager, - IConfig $config, - ?Folder $userFolder, - UserConfig $userConfig, - ViewConfig $viewConfig) { + IRequest $request, + IUserSession $userSession, + TagService $tagService, + IPreview $previewManager, + IManager $shareManager, + IConfig $config, + ?Folder $userFolder, + UserConfig $userConfig, + ViewConfig $viewConfig) { parent::__construct($appName, $request); $this->userSession = $userSession; $this->tagService = $tagService; diff --git a/apps/files/lib/Controller/DirectEditingController.php b/apps/files/lib/Controller/DirectEditingController.php index a4b83af3c29..5d2162c69e0 100644 --- a/apps/files/lib/Controller/DirectEditingController.php +++ b/apps/files/lib/Controller/DirectEditingController.php @@ -46,7 +46,7 @@ class DirectEditingController extends OCSController { private IManager $directEditingManager, private DirectEditingService $directEditingService, private LoggerInterface $logger - ) { + ) { parent::__construct($appName, $request, $corsMethods, $corsAllowedHeaders, $corsMaxAge); } diff --git a/apps/files/lib/Controller/TemplateController.php b/apps/files/lib/Controller/TemplateController.php index 1b5873e8fe6..697541fec3b 100644 --- a/apps/files/lib/Controller/TemplateController.php +++ b/apps/files/lib/Controller/TemplateController.php @@ -103,7 +103,7 @@ class TemplateController extends OCSController { $templatePath = $this->templateManager->initializeTemplateDirectory($templatePath, null, $copySystemTemplates); return new DataResponse([ 'template_path' => $templatePath, - 'templates' => array_map(fn(TemplateFileCreator $creator) => $creator->jsonSerialize(), $this->templateManager->listCreators()), + 'templates' => array_map(fn (TemplateFileCreator $creator) => $creator->jsonSerialize(), $this->templateManager->listCreators()), ]); } catch (\Exception $e) { throw new OCSForbiddenException($e->getMessage()); diff --git a/apps/files/lib/Controller/TransferOwnershipController.php b/apps/files/lib/Controller/TransferOwnershipController.php index ce68b28349e..2c46b85f9a0 100644 --- a/apps/files/lib/Controller/TransferOwnershipController.php +++ b/apps/files/lib/Controller/TransferOwnershipController.php @@ -30,13 +30,13 @@ namespace OCA\Files\Controller; use OCA\Files\BackgroundJob\TransferOwnership; use OCA\Files\Db\TransferOwnership as TransferOwnershipEntity; use OCA\Files\Db\TransferOwnershipMapper; -use OCP\Files\IHomeStorage; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCSController; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJobList; +use OCP\Files\IHomeStorage; use OCP\Files\IRootFolder; use OCP\IRequest; use OCP\IUserManager; @@ -60,14 +60,14 @@ class TransferOwnershipController extends OCSController { private $rootFolder; public function __construct(string $appName, - IRequest $request, - string $userId, - NotificationManager $notificationManager, - ITimeFactory $timeFactory, - IJobList $jobList, - TransferOwnershipMapper $mapper, - IUserManager $userManager, - IRootFolder $rootFolder) { + IRequest $request, + string $userId, + NotificationManager $notificationManager, + ITimeFactory $timeFactory, + IJobList $jobList, + TransferOwnershipMapper $mapper, + IUserManager $userManager, + IRootFolder $rootFolder) { parent::__construct($appName, $request); $this->userId = $userId; diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index 38e3858cd38..ca9ac80b9e2 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -35,7 +35,6 @@ */ namespace OCA\Files\Controller; -use OC\AppFramework\Http; use OCA\Files\Activity\Helper; use OCA\Files\AppInfo\Application; use OCA\Files\Event\LoadAdditionalScriptsEvent; @@ -214,7 +213,8 @@ class ViewController extends Controller { if ($fileid !== null && $view !== 'trashbin') { try { return $this->redirectToFileIfInTrashbin((int) $fileid); - } catch (NotFoundException $e) {} + } catch (NotFoundException $e) { + } } // Load the files we need @@ -248,7 +248,7 @@ class ViewController extends Controller { try { // If view is files, we use the directory, otherwise we use the root storage - $storageInfo = $this->getStorageInfo(($view === 'files' && $dir) ? $dir : '/'); + $storageInfo = $this->getStorageInfo(($view === 'files' && $dir) ? $dir : '/'); } catch(\Exception $e) { $storageInfo = $this->getStorageInfo(); } @@ -399,7 +399,8 @@ class ViewController extends Controller { try { $this->redirectToFileIfInTrashbin($fileId); - } catch (NotFoundException $e) {} + } catch (NotFoundException $e) { + } if (!empty($nodes)) { $node = current($nodes); diff --git a/apps/files/lib/Event/LoadAdditionalScriptsEvent.php b/apps/files/lib/Event/LoadAdditionalScriptsEvent.php index 1e2080622f4..2e9e4764807 100644 --- a/apps/files/lib/Event/LoadAdditionalScriptsEvent.php +++ b/apps/files/lib/Event/LoadAdditionalScriptsEvent.php @@ -34,4 +34,5 @@ use OCP\EventDispatcher\Event; * * @since 17.0.0 */ -class LoadAdditionalScriptsEvent extends Event {}
\ No newline at end of file +class LoadAdditionalScriptsEvent extends Event { +} diff --git a/apps/files/lib/Migration/Version12101Date20221011153334.php b/apps/files/lib/Migration/Version12101Date20221011153334.php index 0c1093f50a6..587616ff2d5 100644 --- a/apps/files/lib/Migration/Version12101Date20221011153334.php +++ b/apps/files/lib/Migration/Version12101Date20221011153334.php @@ -38,7 +38,7 @@ class Version12101Date20221011153334 extends SimpleMigrationStep { $schema = $schemaClosure(); $table = $schema->createTable('open_local_editor'); - $table->addColumn('id',Types::BIGINT, [ + $table->addColumn('id', Types::BIGINT, [ 'autoincrement' => true, 'notnull' => true, 'length' => 20, diff --git a/apps/files/lib/Notification/Notifier.php b/apps/files/lib/Notification/Notifier.php index 90784749b27..0968ae15f54 100644 --- a/apps/files/lib/Notification/Notifier.php +++ b/apps/files/lib/Notification/Notifier.php @@ -56,11 +56,11 @@ class Notifier implements INotifier, IDismissableNotifier { private $timeFactory; public function __construct(IFactory $l10nFactory, - IURLGenerator $urlGenerator, - TransferOwnershipMapper $mapper, - IManager $notificationManager, - IUserManager $userManager, - ITimeFactory $timeFactory) { + IURLGenerator $urlGenerator, + TransferOwnershipMapper $mapper, + IManager $notificationManager, + IUserManager $userManager, + ITimeFactory $timeFactory) { $this->l10nFactory = $l10nFactory; $this->urlGenerator = $urlGenerator; $this->mapper = $mapper; diff --git a/apps/files/lib/ResponseDefinitions.php b/apps/files/lib/ResponseDefinitions.php index 8a27ec4bb2f..9d1e5db61e5 100644 --- a/apps/files/lib/ResponseDefinitions.php +++ b/apps/files/lib/ResponseDefinitions.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /** diff --git a/apps/files/lib/Search/FilesSearchProvider.php b/apps/files/lib/Search/FilesSearchProvider.php index d2a30d10674..b587fdf32de 100644 --- a/apps/files/lib/Search/FilesSearchProvider.php +++ b/apps/files/lib/Search/FilesSearchProvider.php @@ -30,30 +30,30 @@ declare(strict_types=1); namespace OCA\Files\Search; use InvalidArgumentException; -use OCP\Files\Search\ISearchOperator; -use OCP\IPreview; -use OCP\Search\FilterDefinition; -use OCP\Search\IFilter; -use OCP\Search\IFilteringProvider; -use OCP\Share\IShare; use OC\Files\Search\SearchBinaryOperator; use OC\Files\Search\SearchComparison; use OC\Files\Search\SearchOrder; use OC\Files\Search\SearchQuery; +use OC\Search\Filter\GroupFilter; +use OC\Search\Filter\UserFilter; use OCP\Files\FileInfo; use OCP\Files\IMimeTypeDetector; use OCP\Files\IRootFolder; use OCP\Files\Node; use OCP\Files\Search\ISearchComparison; +use OCP\Files\Search\ISearchOperator; use OCP\Files\Search\ISearchOrder; use OCP\IL10N; +use OCP\IPreview; use OCP\IURLGenerator; use OCP\IUser; +use OCP\Search\FilterDefinition; +use OCP\Search\IFilter; +use OCP\Search\IFilteringProvider; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; use OCP\Search\SearchResultEntry; -use OC\Search\Filter\GroupFilter; -use OC\Search\Filter\UserFilter; +use OCP\Share\IShare; class FilesSearchProvider implements IFilteringProvider { /** @var IL10N */ diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php index 06c12391df7..3499d809f2c 100644 --- a/apps/files/lib/Service/OwnershipTransferService.php +++ b/apps/files/lib/Service/OwnershipTransferService.php @@ -74,10 +74,10 @@ class OwnershipTransferService { private $userManager; public function __construct(IEncryptionManager $manager, - IShareManager $shareManager, - IMountManager $mountManager, - IUserMountCache $userMountCache, - IUserManager $userManager) { + IShareManager $shareManager, + IMountManager $mountManager, + IUserMountCache $userMountCache, + IUserManager $userManager) { $this->encryptionManager = $manager; $this->shareManager = $shareManager; $this->mountManager = $mountManager; @@ -96,12 +96,12 @@ class OwnershipTransferService { * @throws \OC\User\NoUserException */ public function transfer(IUser $sourceUser, - IUser $destinationUser, - string $path, - ?OutputInterface $output = null, - bool $move = false, - bool $firstLogin = false, - bool $transferIncomingShares = false): void { + IUser $destinationUser, + string $path, + ?OutputInterface $output = null, + bool $move = false, + bool $firstLogin = false, + bool $transferIncomingShares = false): void { $output = $output ?? new NullOutput(); $sourceUid = $sourceUser->getUID(); $destinationUid = $destinationUser->getUID(); @@ -234,10 +234,10 @@ class OwnershipTransferService { * @throws \Exception */ protected function analyse(string $sourceUid, - string $destinationUid, - string $sourcePath, - View $view, - OutputInterface $output): void { + string $destinationUid, + string $sourcePath, + View $view, + OutputInterface $output): void { $output->writeln('Validating quota'); $size = $view->getFileInfo($sourcePath, false)->getSize(false); $freeSpace = $view->free_space($destinationUid . '/files/'); @@ -281,9 +281,9 @@ class OwnershipTransferService { } private function collectUsersShares(string $sourceUid, - OutputInterface $output, - View $view, - string $path): array { + OutputInterface $output, + View $view, + string $path): array { $output->writeln("Collecting all share information for files and folders of $sourceUid ..."); $shares = []; @@ -325,9 +325,9 @@ class OwnershipTransferService { } private function collectIncomingShares(string $sourceUid, - OutputInterface $output, - View $view, - bool $addKeys = false): array { + OutputInterface $output, + View $view, + bool $addKeys = false): array { $output->writeln("Collecting all incoming share information for files and folders of $sourceUid ..."); $shares = []; @@ -363,10 +363,10 @@ class OwnershipTransferService { * @throws TransferOwnershipException */ protected function transferFiles(string $sourceUid, - string $sourcePath, - string $finalTarget, - View $view, - OutputInterface $output): void { + string $sourcePath, + string $finalTarget, + View $view, + OutputInterface $output): void { $output->writeln("Transferring files to $finalTarget ..."); // This change will help user to transfer the folder specified using --path option. @@ -385,9 +385,9 @@ class OwnershipTransferService { } private function restoreShares(string $sourceUid, - string $destinationUid, - array $shares, - OutputInterface $output) { + string $destinationUid, + array $shares, + OutputInterface $output) { $output->writeln("Restoring shares ..."); $progress = new ProgressBar($output, count($shares)); @@ -436,13 +436,13 @@ class OwnershipTransferService { } private function transferIncomingShares(string $sourceUid, - string $destinationUid, - array $sourceShares, - array $destinationShares, - OutputInterface $output, - string $path, - string $finalTarget, - bool $move): void { + string $destinationUid, + array $sourceShares, + array $destinationShares, + OutputInterface $output, + string $path, + string $finalTarget, + bool $move): void { $output->writeln("Restoring incoming shares ..."); $progress = new ProgressBar($output, count($sourceShares)); $prefix = "$destinationUid/files"; diff --git a/apps/files/lib/Service/UserConfig.php b/apps/files/lib/Service/UserConfig.php index be32dce0d63..00569dc6aeb 100644 --- a/apps/files/lib/Service/UserConfig.php +++ b/apps/files/lib/Service/UserConfig.php @@ -28,7 +28,7 @@ use OCP\IUser; use OCP\IUserSession; class UserConfig { - const ALLOWED_CONFIGS = [ + public const ALLOWED_CONFIGS = [ [ // Whether to crop the files previews or not in the files list 'key' => 'crop_image_previews', @@ -68,7 +68,7 @@ class UserConfig { * @return string[] */ public function getAllowedConfigKeys(): array { - return array_map(function($config) { + return array_map(function ($config) { return $config['key']; }, self::ALLOWED_CONFIGS); } @@ -142,7 +142,7 @@ class UserConfig { } $userId = $this->user->getUID(); - $userConfigs = array_map(function(string $key) use ($userId) { + $userConfigs = array_map(function (string $key) use ($userId) { $value = $this->config->getUserValue($userId, Application::APP_ID, $key, $this->getDefaultConfigValue($key)); // If the default is expected to be a boolean, we need to cast the value if (is_bool($this->getDefaultConfigValue($key)) && is_string($value)) { diff --git a/apps/files/lib/Service/ViewConfig.php b/apps/files/lib/Service/ViewConfig.php index 51d90ffdb4e..fefc3f6a7de 100644 --- a/apps/files/lib/Service/ViewConfig.php +++ b/apps/files/lib/Service/ViewConfig.php @@ -28,8 +28,8 @@ use OCP\IUser; use OCP\IUserSession; class ViewConfig { - const CONFIG_KEY = 'files_views_configs'; - const ALLOWED_CONFIGS = [ + public const CONFIG_KEY = 'files_views_configs'; + public const ALLOWED_CONFIGS = [ [ // The default sorting key for the files list view 'key' => 'sorting_mode', @@ -64,7 +64,7 @@ class ViewConfig { * @return string[] */ public function getAllowedConfigKeys(): array { - return array_map(function($config) { + return array_map(function ($config) { return $config['key']; }, self::ALLOWED_CONFIGS); } @@ -155,7 +155,7 @@ class ViewConfig { } // Extend undefined values with defaults - return array_reduce(self::ALLOWED_CONFIGS, function($carry, $config) use ($view, $configs) { + return array_reduce(self::ALLOWED_CONFIGS, function ($carry, $config) use ($view, $configs) { $key = $config['key']; $carry[$key] = $configs[$view][$key] ?? $this->getDefaultConfigValue($key); return $carry; @@ -176,7 +176,7 @@ class ViewConfig { $configs = json_decode($this->config->getUserValue($userId, Application::APP_ID, self::CONFIG_KEY, '[]'), true); $views = array_keys($configs); - return array_reduce($views, function($carry, $view) use ($configs) { + return array_reduce($views, function ($carry, $view) use ($configs) { $carry[$view] = $this->getConfig($view); return $carry; }, []); diff --git a/apps/files/list.php b/apps/files/list.php index c4b93b2e145..5f1bc07f499 100644 --- a/apps/files/list.php +++ b/apps/files/list.php @@ -22,10 +22,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -use OCP\Share\IManager; -use OCP\Server; use OCP\IConfig; use OCP\IUserSession; +use OCP\Server; +use OCP\Share\IManager; $config = Server::get(IConfig::class); $userSession = Server::get(IUserSession::class); diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php index 17409bdb189..d2b57b03eca 100644 --- a/apps/files/templates/appnavigation.php +++ b/apps/files/templates/appnavigation.php @@ -3,9 +3,9 @@ <ul class="with-icon" tabindex="0"> <?php $pinned = 0; - foreach ($_['navigationItems'] as $item) { - $pinned = NavigationListElements($item, $l, $pinned); - } + foreach ($_['navigationItems'] as $item) { + $pinned = NavigationListElements($item, $l, $pinned); + } ?> </ul> </div> @@ -31,8 +31,8 @@ function NavigationListElements($item, $l, $pinned) { <?php if (isset($item['expandedState'])) { ?> data-expandedstate="<?php p($item['expandedState']); ?>" <?php } ?> class="nav-<?php p($item['id']) ?> <?php if (isset($item['classes'])) { - p($item['classes']); - } ?> + p($item['classes']); + } ?> <?php p($pinned === 1 ? 'first-pinned' : '') ?> <?php if (isset($item['defaultExpandedState']) && $item['defaultExpandedState']) { ?> open<?php } ?>" <?php if (isset($item['folderPosition'])) { ?> folderposition="<?php p($item['folderPosition']); ?>" <?php } ?>> @@ -42,7 +42,7 @@ function NavigationListElements($item, $l, $pinned) { <?php - NavigationElementMenu($item); + NavigationElementMenu($item); if (isset($item['sublist'])) { ?> <button class="collapse app-navigation-noclose" aria-expanded="<?= !empty($item['defaultExpandedState']) ? 'true' : 'false' ?>" diff --git a/apps/files/tests/Activity/ProviderTest.php b/apps/files/tests/Activity/ProviderTest.php index 3566d83f415..3598c982ddd 100644 --- a/apps/files/tests/Activity/ProviderTest.php +++ b/apps/files/tests/Activity/ProviderTest.php @@ -32,7 +32,6 @@ use OCP\Federation\ICloudId; use OCP\Federation\ICloudIdManager; use OCP\Files\IRootFolder; use OCP\IURLGenerator; -use OCP\IUser; use OCP\IUserManager; use OCP\L10N\IFactory; use PHPUnit\Framework\MockObject\MockObject; |