diff options
author | Joas Schilling <coding@schilljs.com> | 2023-11-23 10:22:34 +0100 |
---|---|---|
committer | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2023-11-23 10:36:13 +0100 |
commit | aa5f037af71c915424c6dcfd5ad2dc82797dc0d6 (patch) | |
tree | 843203cd1346158aab3515687e37a90e78c929e9 /apps/files_sharing | |
parent | 272719ed1cba6836ea0a597bb9767754eeb1e0d4 (diff) | |
download | nextcloud-server-aa5f037af71c915424c6dcfd5ad2dc82797dc0d6.tar.gz nextcloud-server-aa5f037af71c915424c6dcfd5ad2dc82797dc0d6.zip |
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'apps/files_sharing')
41 files changed, 120 insertions, 130 deletions
diff --git a/apps/files_sharing/lib/Activity/Providers/Base.php b/apps/files_sharing/lib/Activity/Providers/Base.php index e9e1d870f9a..01d730242c9 100644 --- a/apps/files_sharing/lib/Activity/Providers/Base.php +++ b/apps/files_sharing/lib/Activity/Providers/Base.php @@ -63,12 +63,12 @@ abstract class Base implements IProvider { protected $displayNames = []; public function __construct(IFactory $languageFactory, - IURLGenerator $url, - IManager $activityManager, - IUserManager $userManager, - ICloudIdManager $cloudIdManager, - IContactsManager $contactsManager, - IEventMerger $eventMerger) { + IURLGenerator $url, + IManager $activityManager, + IUserManager $userManager, + ICloudIdManager $cloudIdManager, + IContactsManager $contactsManager, + IEventMerger $eventMerger) { $this->languageFactory = $languageFactory; $this->url = $url; $this->activityManager = $activityManager; diff --git a/apps/files_sharing/lib/Activity/Providers/Groups.php b/apps/files_sharing/lib/Activity/Providers/Groups.php index b9cc2e6b579..a6e6fae3e9b 100644 --- a/apps/files_sharing/lib/Activity/Providers/Groups.php +++ b/apps/files_sharing/lib/Activity/Providers/Groups.php @@ -51,13 +51,13 @@ class Groups extends Base { protected $groupDisplayNames = []; public function __construct(IFactory $languageFactory, - IURLGenerator $url, - IManager $activityManager, - IUserManager $userManager, - ICloudIdManager $cloudIdManager, - IContactsManager $contactsManager, - IEventMerger $eventMerger, - IGroupManager $groupManager) { + IURLGenerator $url, + IManager $activityManager, + IUserManager $userManager, + ICloudIdManager $cloudIdManager, + IContactsManager $contactsManager, + IEventMerger $eventMerger, + IGroupManager $groupManager) { parent::__construct($languageFactory, $url, $activityManager, $userManager, $cloudIdManager, $contactsManager, $eventMerger); $this->groupManager = $groupManager; } diff --git a/apps/files_sharing/lib/Activity/Providers/RemoteShares.php b/apps/files_sharing/lib/Activity/Providers/RemoteShares.php index e24645f8a26..b46db3105e9 100644 --- a/apps/files_sharing/lib/Activity/Providers/RemoteShares.php +++ b/apps/files_sharing/lib/Activity/Providers/RemoteShares.php @@ -40,12 +40,12 @@ class RemoteShares extends Base { public const SUBJECT_REMOTE_SHARE_UNSHARED = 'remote_share_unshared'; public function __construct(IFactory $languageFactory, - IURLGenerator $url, - IManager $activityManager, - IUserManager $userManager, - ICloudIdManager $cloudIdManager, - IContactsManager $contactsManager, - IEventMerger $eventMerger) { + IURLGenerator $url, + IManager $activityManager, + IUserManager $userManager, + ICloudIdManager $cloudIdManager, + IContactsManager $contactsManager, + IEventMerger $eventMerger) { parent::__construct($languageFactory, $url, $activityManager, $userManager, $cloudIdManager, $contactsManager, $eventMerger); } diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php index 603527310ae..fc305e58dbe 100644 --- a/apps/files_sharing/lib/AppInfo/Application.php +++ b/apps/files_sharing/lib/AppInfo/Application.php @@ -32,8 +32,9 @@ namespace OCA\Files_Sharing\AppInfo; use OC\Group\DisplayNameCache as GroupDisplayNameCache; use OC\Share\Share; use OC\User\DisplayNameCache; +use OCA\Files\Event\LoadAdditionalScriptsEvent; +use OCA\Files\Event\LoadSidebar; use OCA\Files_Sharing\Capabilities; -use OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent; use OCA\Files_Sharing\External\Manager; use OCA\Files_Sharing\External\MountProvider as ExternalMountProvider; use OCA\Files_Sharing\Helper; @@ -48,8 +49,6 @@ use OCA\Files_Sharing\Middleware\SharingCheckMiddleware; use OCA\Files_Sharing\MountProvider; use OCA\Files_Sharing\Notification\Listener; use OCA\Files_Sharing\Notification\Notifier; -use OCA\Files\Event\LoadAdditionalScriptsEvent; -use OCA\Files\Event\LoadSidebar; use OCA\Files_Sharing\ShareBackend\File; use OCA\Files_Sharing\ShareBackend\Folder; use OCA\Files_Sharing\ViewOnly; diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php index af8e722c609..3011bc64669 100644 --- a/apps/files_sharing/lib/Cache.php +++ b/apps/files_sharing/lib/Cache.php @@ -39,8 +39,6 @@ use OCP\Files\Search\ISearchBinaryOperator; use OCP\Files\Search\ISearchComparison; use OCP\Files\Search\ISearchOperator; use OCP\Files\StorageNotAvailableException; -use OCP\ICacheFactory; -use OCP\IUserManager; use OCP\Share\IShare; /** diff --git a/apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php b/apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php index 2fd35b20a0f..4ed30f44020 100644 --- a/apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php +++ b/apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php @@ -24,7 +24,6 @@ namespace OCA\Files_Sharing\Collaboration; use OCP\Collaboration\AutoComplete\ISorter; -use OCP\Files\Folder; use OCP\Files\IRootFolder; use OCP\Files\Node; use OCP\IUserSession; diff --git a/apps/files_sharing/lib/Command/DeleteOrphanShares.php b/apps/files_sharing/lib/Command/DeleteOrphanShares.php index 310f27ebfa3..57158774758 100644 --- a/apps/files_sharing/lib/Command/DeleteOrphanShares.php +++ b/apps/files_sharing/lib/Command/DeleteOrphanShares.php @@ -23,14 +23,13 @@ declare(strict_types=1); namespace OCA\Files_Sharing\Command; - -use Symfony\Component\Console\Question\ConfirmationQuestion; use OC\Core\Command\Base; use OCA\Files_Sharing\OrphanHelper; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; class DeleteOrphanShares extends Base { private OrphanHelper $orphanHelper; diff --git a/apps/files_sharing/lib/Command/ExiprationNotification.php b/apps/files_sharing/lib/Command/ExiprationNotification.php index e77b41b1835..b0311e09221 100644 --- a/apps/files_sharing/lib/Command/ExiprationNotification.php +++ b/apps/files_sharing/lib/Command/ExiprationNotification.php @@ -46,9 +46,9 @@ class ExiprationNotification extends Command { private $shareManager; public function __construct(ITimeFactory $time, - NotificationManager $notificationManager, - IDBConnection $connection, - ShareManager $shareManager) { + NotificationManager $notificationManager, + IDBConnection $connection, + ShareManager $shareManager) { parent::__construct(); $this->notificationManager = $notificationManager; @@ -67,7 +67,7 @@ class ExiprationNotification extends Command { //Current time $minTime = $this->time->getDateTime(); $minTime->add(new \DateInterval('P1D')); - $minTime->setTime(0,0,0); + $minTime->setTime(0, 0, 0); $maxTime = clone $minTime; $maxTime->setTime(23, 59, 59); diff --git a/apps/files_sharing/lib/Controller/DeletedShareAPIController.php b/apps/files_sharing/lib/Controller/DeletedShareAPIController.php index aec011aa7ac..6b54a3489c6 100644 --- a/apps/files_sharing/lib/Controller/DeletedShareAPIController.php +++ b/apps/files_sharing/lib/Controller/DeletedShareAPIController.php @@ -77,14 +77,14 @@ class DeletedShareAPIController extends OCSController { private $serverContainer; public function __construct(string $appName, - IRequest $request, - ShareManager $shareManager, - string $UserId, - IUserManager $userManager, - IGroupManager $groupManager, - IRootFolder $rootFolder, - IAppManager $appManager, - IServerContainer $serverContainer) { + IRequest $request, + ShareManager $shareManager, + string $UserId, + IUserManager $userManager, + IGroupManager $groupManager, + IRootFolder $rootFolder, + IAppManager $appManager, + IServerContainer $serverContainer) { parent::__construct($appName, $request); $this->shareManager = $shareManager; diff --git a/apps/files_sharing/lib/Controller/PublicPreviewController.php b/apps/files_sharing/lib/Controller/PublicPreviewController.php index 089610f711f..54a1a321665 100644 --- a/apps/files_sharing/lib/Controller/PublicPreviewController.php +++ b/apps/files_sharing/lib/Controller/PublicPreviewController.php @@ -51,10 +51,10 @@ class PublicPreviewController extends PublicShareController { private $share; public function __construct(string $appName, - IRequest $request, - ShareManager $shareManger, - ISession $session, - IPreview $previewManager) { + IRequest $request, + ShareManager $shareManger, + ISession $session, + IPreview $previewManager) { parent::__construct($appName, $request, $session); $this->shareManager = $shareManger; diff --git a/apps/files_sharing/lib/Controller/SettingsController.php b/apps/files_sharing/lib/Controller/SettingsController.php index 00d627095b8..ff087d4a196 100644 --- a/apps/files_sharing/lib/Controller/SettingsController.php +++ b/apps/files_sharing/lib/Controller/SettingsController.php @@ -41,8 +41,8 @@ class SettingsController extends Controller { private $userId; public function __construct(IRequest $request, - IConfig $config, - string $userId) { + IConfig $config, + string $userId) { parent::__construct(Application::APP_ID, $request); $this->config = $config; diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 5b69d522545..98423e7dd1f 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -260,7 +260,7 @@ class ShareAPIController extends OCSController { $result['share_with'] = $share->getSharedWith(); $result['share_with_displayname'] = $sharedWith !== null ? $sharedWith->getDisplayName() : $share->getSharedWith(); $result['share_with_displayname_unique'] = $sharedWith !== null ? ( - !empty($sharedWith->getSystemEMailAddress()) ? $sharedWith->getSystemEMailAddress() : $sharedWith->getUID() + !empty($sharedWith->getSystemEMailAddress()) ? $sharedWith->getSystemEMailAddress() : $sharedWith->getUID() ) : $share->getSharedWith(); $userStatuses = $this->userStatusManager->getUserStatuses([$share->getSharedWith()]); @@ -364,7 +364,7 @@ class ShareAPIController extends OCSController { $result['attributes'] = null; if ($attributes = $share->getAttributes()) { - $result['attributes'] = (string)\json_encode($attributes->toArray()); + $result['attributes'] = (string)\json_encode($attributes->toArray()); } return $result; @@ -1314,8 +1314,8 @@ class ShareAPIController extends OCSController { } if (!$this->hasPermission($newPermissions, Constants::PERMISSION_READ) && ( - $this->hasPermission($newPermissions, Constants::PERMISSION_UPDATE) || $this->hasPermission($newPermissions, Constants::PERMISSION_DELETE) - )) { + $this->hasPermission($newPermissions, Constants::PERMISSION_UPDATE) || $this->hasPermission($newPermissions, Constants::PERMISSION_DELETE) + )) { throw new OCSBadRequestException($this->l->t('Share must have READ permission if UPDATE or DELETE permission is set')); } } diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index dc60463dac7..835d08c446c 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -71,8 +71,8 @@ use OCP\Security\ISecureRandom; use OCP\Share; use OCP\Share\Exceptions\ShareNotFound; use OCP\Share\IManager as ShareManager; -use OCP\Share\IShare; use OCP\Share\IPublicShareTemplateFactory; +use OCP\Share\IShare; use OCP\Template; /** @@ -569,10 +569,10 @@ class ShareController extends AuthPublicShareController { * @param string $filePath */ protected function publishActivity($subject, - array $parameters, - $affectedUser, - $fileId, - $filePath) { + array $parameters, + $affectedUser, + $fileId, + $filePath) { $event = $this->activityManager->generateEvent(); $event->setApp('files_sharing') ->setType('public_links') diff --git a/apps/files_sharing/lib/Controller/ShareInfoController.php b/apps/files_sharing/lib/Controller/ShareInfoController.php index 720705121d2..a1379a63d9a 100644 --- a/apps/files_sharing/lib/Controller/ShareInfoController.php +++ b/apps/files_sharing/lib/Controller/ShareInfoController.php @@ -53,8 +53,8 @@ class ShareInfoController extends ApiController { * @param IManager $shareManager */ public function __construct(string $appName, - IRequest $request, - IManager $shareManager) { + IRequest $request, + IManager $shareManager) { parent::__construct($appName, $request); $this->shareManager = $shareManager; diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php index c151ab53327..00bc85e4a96 100644 --- a/apps/files_sharing/lib/Controller/ShareesAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php @@ -38,9 +38,6 @@ declare(strict_types=1); */ namespace OCA\Files_Sharing\Controller; -use OCP\Constants; -use function array_slice; -use function array_values; use Generator; use OC\Collaboration\Collaborators\SearchResult; use OCA\Files_Sharing\ResponseDefinitions; @@ -51,11 +48,14 @@ use OCP\AppFramework\OCSController; use OCP\Collaboration\Collaborators\ISearch; use OCP\Collaboration\Collaborators\ISearchResult; use OCP\Collaboration\Collaborators\SearchResultType; +use OCP\Constants; use OCP\IConfig; use OCP\IRequest; use OCP\IURLGenerator; -use OCP\Share\IShare; use OCP\Share\IManager; +use OCP\Share\IShare; +use function array_slice; +use function array_values; use function usort; /** diff --git a/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php b/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php index 9c95428d7b7..8af1c803e18 100644 --- a/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php +++ b/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php @@ -39,7 +39,6 @@ use OCP\Defaults; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\FileInfo; use OCP\Files\Folder; -use OCP\Files\NotFoundException; use OCP\IConfig; use OCP\IL10N; use OCP\IPreview; @@ -47,8 +46,8 @@ use OCP\IRequest; use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserManager; -use OCP\Share\IShare; use OCP\Share\IPublicShareTemplateProvider; +use OCP\Share\IShare; use OCP\Template; use OCP\Util; diff --git a/apps/files_sharing/lib/External/MountProvider.php b/apps/files_sharing/lib/External/MountProvider.php index 5b315e81f69..169bf6ed3d7 100644 --- a/apps/files_sharing/lib/External/MountProvider.php +++ b/apps/files_sharing/lib/External/MountProvider.php @@ -24,11 +24,11 @@ */ namespace OCA\Files_Sharing\External; +use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Federation\ICloudIdManager; use OCP\Files\Config\IMountProvider; use OCP\Files\Storage\IStorageFactory; use OCP\IDBConnection; -use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IUser; class MountProvider implements IMountProvider { diff --git a/apps/files_sharing/lib/Listener/LoadAdditionalListener.php b/apps/files_sharing/lib/Listener/LoadAdditionalListener.php index e2122cb6ee2..a15eade79fd 100644 --- a/apps/files_sharing/lib/Listener/LoadAdditionalListener.php +++ b/apps/files_sharing/lib/Listener/LoadAdditionalListener.php @@ -25,8 +25,8 @@ declare(strict_types=1); */ namespace OCA\Files_Sharing\Listener; -use OCA\Files_Sharing\AppInfo\Application; use OCA\Files\Event\LoadAdditionalScriptsEvent; +use OCA\Files_Sharing\AppInfo\Application; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\Share\IManager; diff --git a/apps/files_sharing/lib/Listener/LoadSidebarListener.php b/apps/files_sharing/lib/Listener/LoadSidebarListener.php index c6a3c4c2683..b88c3ccf0d8 100644 --- a/apps/files_sharing/lib/Listener/LoadSidebarListener.php +++ b/apps/files_sharing/lib/Listener/LoadSidebarListener.php @@ -26,26 +26,23 @@ declare(strict_types=1); namespace OCA\Files_Sharing\Listener; -use OCA\Files_Sharing\AppInfo\Application; use OCA\Files\Event\LoadSidebar; +use OCA\Files_Sharing\AppInfo\Application; +use OCP\AppFramework\Services\IInitialState; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; -use OCP\Util; -use OCP\AppFramework\Services\IInitialState; use OCP\Share\IManager; +use OCP\Util; /** * @template-implements IEventListener<Event> */ -class LoadSidebarListener implements IEventListener -{ +class LoadSidebarListener implements IEventListener { - public function __construct(private IInitialState $initialState, private IManager $shareManager) - { + public function __construct(private IInitialState $initialState, private IManager $shareManager) { } - public function handle(Event $event): void - { + public function handle(Event $event): void { if (!($event instanceof LoadSidebar)) { return; } diff --git a/apps/files_sharing/lib/Middleware/OCSShareAPIMiddleware.php b/apps/files_sharing/lib/Middleware/OCSShareAPIMiddleware.php index 1c961ffed34..aba6124f415 100644 --- a/apps/files_sharing/lib/Middleware/OCSShareAPIMiddleware.php +++ b/apps/files_sharing/lib/Middleware/OCSShareAPIMiddleware.php @@ -39,7 +39,7 @@ class OCSShareAPIMiddleware extends Middleware { private $l; public function __construct(IManager $shareManager, - IL10N $l) { + IL10N $l) { $this->shareManager = $shareManager; $this->l = $l; } diff --git a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php index b9bab169d1d..005fc75c849 100644 --- a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php +++ b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php @@ -64,12 +64,12 @@ class SharingCheckMiddleware extends Middleware { protected $request; public function __construct(string $appName, - IConfig $config, - IAppManager $appManager, - IControllerMethodReflector $reflector, - IManager $shareManager, - IRequest $request - ) { + IConfig $config, + IAppManager $appManager, + IControllerMethodReflector $reflector, + IManager $shareManager, + IRequest $request + ) { $this->appName = $appName; $this->config = $config; $this->appManager = $appManager; diff --git a/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php b/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php index d1ba645f93d..57b441172ee 100644 --- a/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php +++ b/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php @@ -68,7 +68,7 @@ class OwncloudGuestShareType implements IRepairStep { $query = $this->connection->getQueryBuilder(); $query->update('share') - ->set('share_type', $query->createNamedParameter(IShare::TYPE_GUEST)) + ->set('share_type', $query->createNamedParameter(IShare::TYPE_GUEST)) ->where($query->expr()->eq('share_type', $query->createNamedParameter(IShare::TYPE_EMAIL))); $query->execute(); } diff --git a/apps/files_sharing/lib/Migration/Version11300Date20201120141438.php b/apps/files_sharing/lib/Migration/Version11300Date20201120141438.php index 50d0cd9e066..ec514c9154f 100644 --- a/apps/files_sharing/lib/Migration/Version11300Date20201120141438.php +++ b/apps/files_sharing/lib/Migration/Version11300Date20201120141438.php @@ -29,8 +29,8 @@ namespace OCA\Files_Sharing\Migration; use Closure; use Doctrine\DBAL\Types\Type; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/apps/files_sharing/lib/Migration/Version21000Date20201223143245.php b/apps/files_sharing/lib/Migration/Version21000Date20201223143245.php index ff7722eaa58..c393295a367 100644 --- a/apps/files_sharing/lib/Migration/Version21000Date20201223143245.php +++ b/apps/files_sharing/lib/Migration/Version21000Date20201223143245.php @@ -27,8 +27,8 @@ declare(strict_types=1); namespace OCA\Files_Sharing\Migration; use Closure; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/apps/files_sharing/lib/Migration/Version24000Date20220208195521.php b/apps/files_sharing/lib/Migration/Version24000Date20220208195521.php index d5f938dde6d..8b95e32eb4f 100644 --- a/apps/files_sharing/lib/Migration/Version24000Date20220208195521.php +++ b/apps/files_sharing/lib/Migration/Version24000Date20220208195521.php @@ -26,8 +26,8 @@ declare(strict_types=1); namespace OCA\Files_Sharing\Migration; use Closure; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php index d4cc13842a3..dce67b7ef98 100644 --- a/apps/files_sharing/lib/MountProvider.php +++ b/apps/files_sharing/lib/MountProvider.php @@ -28,9 +28,9 @@ */ namespace OCA\Files_Sharing; -use OCP\Cache\CappedMemoryCache; use OC\Files\View; use OCA\Files_Sharing\Event\ShareMountedEvent; +use OCP\Cache\CappedMemoryCache; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Config\IMountProvider; use OCP\Files\Storage\IStorageFactory; diff --git a/apps/files_sharing/lib/Notification/Notifier.php b/apps/files_sharing/lib/Notification/Notifier.php index d339c484dd7..20ad9c7e755 100644 --- a/apps/files_sharing/lib/Notification/Notifier.php +++ b/apps/files_sharing/lib/Notification/Notifier.php @@ -61,11 +61,11 @@ class Notifier implements INotifier { protected $url; public function __construct(IFactory $l10nFactory, - IManager $shareManager, - IRootFolder $rootFolder, - IGroupManager $groupManager, - IUserManager $userManager, - IURLGenerator $url) { + IManager $shareManager, + IRootFolder $rootFolder, + IGroupManager $groupManager, + IUserManager $userManager, + IURLGenerator $url) { $this->l10nFactory = $l10nFactory; $this->shareManager = $shareManager; $this->rootFolder = $rootFolder; diff --git a/apps/files_sharing/lib/ResponseDefinitions.php b/apps/files_sharing/lib/ResponseDefinitions.php index 19993572c2e..aa1ee004971 100644 --- a/apps/files_sharing/lib/ResponseDefinitions.php +++ b/apps/files_sharing/lib/ResponseDefinitions.php @@ -1,4 +1,5 @@ <?php + declare(strict_types=1); /** diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php index a9d5bf82935..7dc24936d6b 100644 --- a/apps/files_sharing/lib/SharedMount.php +++ b/apps/files_sharing/lib/SharedMount.php @@ -29,11 +29,11 @@ namespace OCA\Files_Sharing; -use OCP\Cache\CappedMemoryCache; use OC\Files\Filesystem; use OC\Files\Mount\MountPoint; use OC\Files\Mount\MoveableMount; use OC\Files\View; +use OCP\Cache\CappedMemoryCache; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Events\InvalidateMountCacheEvent; use OCP\Files\Storage\IStorageFactory; diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index c56bcaebb12..de49e3c4294 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -37,18 +37,18 @@ use OC\Files\Cache\NullWatcher; use OC\Files\Cache\Watcher; use OC\Files\ObjectStore\HomeObjectStoreStorage; use OC\Files\Storage\Common; -use OC\Files\Storage\Home; -use OC\User\DisplayNameCache; -use OCP\Files\Folder; -use OCP\Files\IHomeStorage; -use OCP\Files\Node; use OC\Files\Storage\FailedStorage; +use OC\Files\Storage\Home; use OC\Files\Storage\Wrapper\PermissionsMask; +use OC\User\DisplayNameCache; use OC\User\NoUserException; use OCA\Files_External\Config\ExternalMountPoint; use OCP\Constants; use OCP\Files\Cache\ICacheEntry; +use OCP\Files\Folder; +use OCP\Files\IHomeStorage; use OCP\Files\IRootFolder; +use OCP\Files\Node; use OCP\Files\NotFoundException; use OCP\Files\Storage\IDisableEncryptionStorage; use OCP\Files\Storage\IStorage; diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php index 59e06e60299..95a5c9d9166 100644 --- a/apps/files_sharing/lib/Updater.php +++ b/apps/files_sharing/lib/Updater.php @@ -28,8 +28,8 @@ namespace OCA\Files_Sharing; use OC\Files\Mount\MountPoint; use OCP\Constants; -use OCP\Share\IShare; use OCP\Files\Folder; +use OCP\Share\IShare; class Updater { diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index fa4d34dd6f1..4d840169b69 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -120,7 +120,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size); echo $l->t('By uploading files, you agree to the %1$sterms of service%2$s.', [ '<span id="show-terms-dialog">', '</span>' ]); - ?> + ?> </div> <?php } ?> </div> diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index f77a22dc0ad..a50bfe5bee4 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -37,7 +37,6 @@ namespace OCA\Files_Sharing\Tests; use OC\Files\Cache\Scanner; use OC\Files\Filesystem; -use OC\Files\SetupManager; use OCA\Files_Sharing\Controller\ShareAPIController; use OCP\App\IAppManager; use OCP\AppFramework\OCS\OCSBadRequestException; diff --git a/apps/files_sharing/tests/ApplicationTest.php b/apps/files_sharing/tests/ApplicationTest.php index d16aed61bf7..270a56504f9 100644 --- a/apps/files_sharing/tests/ApplicationTest.php +++ b/apps/files_sharing/tests/ApplicationTest.php @@ -22,14 +22,13 @@ */ namespace OCA\Files_Sharing\Tests; -use OCP\Files\Events\BeforeDirectFileDownloadEvent; -use OCP\Files\Events\BeforeZipCreatedEvent; -use Psr\Log\LoggerInterface; -use OC\Share20\Manager; use OC\EventDispatcher\EventDispatcher; +use OC\Share20\Manager; use OCA\Files_Sharing\AppInfo\Application; use OCA\Files_Sharing\SharedStorage; use OCP\EventDispatcher\IEventDispatcher; +use OCP\Files\Events\BeforeDirectFileDownloadEvent; +use OCP\Files\Events\BeforeZipCreatedEvent; use OCP\Files\File; use OCP\Files\Folder; use OCP\Files\IRootFolder; @@ -39,6 +38,7 @@ use OCP\IUser; use OCP\IUserSession; use OCP\Share\IAttributes; use OCP\Share\IShare; +use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcher as SymfonyDispatcher; use Test\TestCase; diff --git a/apps/files_sharing/tests/CacheTest.php b/apps/files_sharing/tests/CacheTest.php index 50e5433d10f..729b701b1a0 100644 --- a/apps/files_sharing/tests/CacheTest.php +++ b/apps/files_sharing/tests/CacheTest.php @@ -244,7 +244,7 @@ class CacheTest extends TestCase { public function testGetFolderContentsInRoot() { $results = $this->user2View->getDirectoryContent('/'); - $results = (array_filter($results, function($file) { + $results = (array_filter($results, function ($file) { return $file->getName() !== 'welcome.txt'; })); @@ -334,7 +334,7 @@ class CacheTest extends TestCase { self::assertEquals([ 'welcome.txt', 'simplefile.txt' - ], array_map(function($node) { + ], array_map(function ($node) { return $node->getFileInfo()['name']; }, $recents)); } diff --git a/apps/files_sharing/tests/Controller/ExternalShareControllerTest.php b/apps/files_sharing/tests/Controller/ExternalShareControllerTest.php index ff6001e0ced..c4906b9119b 100644 --- a/apps/files_sharing/tests/Controller/ExternalShareControllerTest.php +++ b/apps/files_sharing/tests/Controller/ExternalShareControllerTest.php @@ -24,14 +24,14 @@ namespace OCA\Files_Sharing\Tests\Controllers; use OCA\Files_Sharing\Controller\ExternalSharesController; +use OCA\Files_Sharing\External\Manager; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\JSONResponse; +use OCP\Http\Client\IClient; use OCP\Http\Client\IClientService; +use OCP\Http\Client\IResponse; use OCP\IConfig; use OCP\IRequest; -use OCP\Http\Client\IResponse; -use OCP\Http\Client\IClient; -use OCA\Files_Sharing\External\Manager; use PHPUnit\Framework\MockObject\MockObject; /** diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index a4b77c3ea94..bfc6a97bd86 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -46,7 +46,6 @@ use OCP\Files\IRootFolder; use OCP\Files\Mount\IMountPoint; use OCP\Files\NotFoundException; use OCP\Files\Storage; -use OCP\Files\Storage\IStorage; use OCP\IConfig; use OCP\IGroup; use OCP\IGroupManager; @@ -62,8 +61,8 @@ use OCP\Share\Exceptions\GenericShareException; use OCP\Share\IAttributes as IShareAttributes; use OCP\Share\IManager; use OCP\Share\IShare; -use Test\TestCase; use OCP\UserStatus\IManager as IUserStatusManager; +use Test\TestCase; /** * Class ShareAPIControllerTest @@ -523,8 +522,8 @@ class ShareAPIControllerTest extends TestCase { */ public function createShare($id, $shareType, $sharedWith, $sharedBy, $shareOwner, $path, $permissions, - $shareTime, $expiration, $parent, $target, $mail_send, $note = '', $token = null, - $password = null, $label = '', $attributes = null) { + $shareTime, $expiration, $parent, $target, $mail_send, $note = '', $token = null, + $password = null, $label = '', $attributes = null) { $share = $this->getMockBuilder(IShare::class)->getMock(); $share->method('getId')->willReturn($id); $share->method('getShareType')->willReturn($shareType); @@ -2184,7 +2183,7 @@ class ShareAPIControllerTest extends TestCase { $this->shareManager->expects($this->once())->method('createShare')->with( $this->callback(function (\OCP\Share\IShare $share) use ($path) { $date = new \DateTime('2000-01-01'); - $date->setTime(0,0,0); + $date->setTime(0, 0, 0); return $share->getNode() === $path && $share->getShareType() === IShare::TYPE_LINK && @@ -2743,7 +2742,7 @@ class ShareAPIControllerTest extends TestCase { $this->shareManager->expects($this->once())->method('updateShare')->with( $this->callback(function (\OCP\Share\IShare $share) { $date = new \DateTime('2000-01-01'); - $date->setTime(0,0,0); + $date->setTime(0, 0, 0); return $share->getPermissions() === (\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE) && $share->getPassword() === 'password' && @@ -3029,7 +3028,7 @@ class ShareAPIControllerTest extends TestCase { $ocs = $this->mockFormatShare(); $date = new \DateTime('2000-01-01'); - $date->setTime(0,0,0); + $date->setTime(0, 0, 0); [$userFolder, $node] = $this->getNonSharedUserFolder(); $node->method('getId')->willReturn(42); @@ -3081,7 +3080,7 @@ class ShareAPIControllerTest extends TestCase { $ocs = $this->mockFormatShare(); $date = new \DateTime('2000-01-01'); - $date->setTime(0,0,0); + $date->setTime(0, 0, 0); [$userFolder, $node] = $this->getNonSharedUserFolder(); $userFolder->method('getById') @@ -3139,7 +3138,7 @@ class ShareAPIControllerTest extends TestCase { $ocs = $this->mockFormatShare(); $date = new \DateTime('2000-01-01'); - $date->setTime(0,0,0); + $date->setTime(0, 0, 0); [$userFolder, $node] = $this->getNonSharedUserFolder(); $userFolder->method('getById') @@ -3179,7 +3178,7 @@ class ShareAPIControllerTest extends TestCase { $ocs = $this->mockFormatShare(); $date = new \DateTime('2000-01-01'); - $date->setTime(0,0,0); + $date->setTime(0, 0, 0); [$userFolder, $node] = $this->getNonSharedUserFolder(); $userFolder->method('getById') @@ -3233,7 +3232,7 @@ class ShareAPIControllerTest extends TestCase { $ocs = $this->mockFormatShare(); $date = new \DateTime('2000-01-01'); - $date->setTime(0,0,0); + $date->setTime(0, 0, 0); [$userFolder, $node] = $this->getNonSharedUserFolder(); $node->method('getId') @@ -3328,7 +3327,7 @@ class ShareAPIControllerTest extends TestCase { $this->shareManager->expects($this->once())->method('updateShare')->with( $this->callback(function (\OCP\Share\IShare $share) { $date = new \DateTime('2010-12-23'); - $date->setTime(0,0,0); + $date->setTime(0, 0, 0); return $share->getPermissions() === \OCP\Constants::PERMISSION_ALL && $share->getPassword() === 'password' && diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php index 2a9ab1a3b08..3a73862bf77 100644 --- a/apps/files_sharing/tests/Controller/ShareControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php @@ -37,19 +37,24 @@ namespace OCA\Files_Sharing\Tests\Controllers; use OC\Files\Filesystem; use OC\Files\Node\Folder; +use OC\Share20\Manager; use OCA\FederatedFileSharing\FederatedShareProvider; use OCA\Files_Sharing\Controller\ShareController; +use OCA\Files_Sharing\DefaultPublicShareTemplateProvider; use OCP\Accounts\IAccount; use OCP\Accounts\IAccountManager; use OCP\Accounts\IAccountProperty; +use OCP\Activity\IManager; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\Template\ExternalShareMenuAction; use OCP\AppFramework\Http\Template\LinkMenuAction; use OCP\AppFramework\Http\Template\PublicTemplateResponse; use OCP\AppFramework\Http\Template\SimpleMenuAction; use OCP\Constants; +use OCP\Defaults; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\File; +use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; use OCP\Files\Storage; use OCP\IConfig; @@ -62,14 +67,9 @@ use OCP\IUser; use OCP\IUserManager; use OCP\Security\ISecureRandom; use OCP\Share\Exceptions\ShareNotFound; +use OCP\Share\IPublicShareTemplateFactory; use OCP\Share\IShare; use PHPUnit\Framework\MockObject\MockObject; -use OCP\Activity\IManager; -use OCP\Files\IRootFolder; -use OCP\Defaults; -use OC\Share20\Manager; -use OCA\Files_Sharing\DefaultPublicShareTemplateProvider; -use OCP\Share\IPublicShareTemplateFactory; /** * @group DB diff --git a/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php index b73b605f410..5953ab0d890 100644 --- a/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php @@ -38,8 +38,8 @@ use OCP\Collaboration\Collaborators\ISearch; use OCP\IConfig; use OCP\IRequest; use OCP\IURLGenerator; -use OCP\Share\IShare; use OCP\Share\IManager; +use OCP\Share\IShare; use PHPUnit\Framework\MockObject\MockObject; /** diff --git a/apps/files_sharing/tests/SharedMountTest.php b/apps/files_sharing/tests/SharedMountTest.php index 2e169f878ce..e320b85cb22 100644 --- a/apps/files_sharing/tests/SharedMountTest.php +++ b/apps/files_sharing/tests/SharedMountTest.php @@ -377,14 +377,14 @@ class SharedMountTest extends TestCase { $caches = []; $cacheFactory = $this->createMock(ICacheFactory::class); $cacheFactory->method('createLocal') - ->willReturnCallback(function(string $prefix) use (&$caches) { + ->willReturnCallback(function (string $prefix) use (&$caches) { if (!isset($caches[$prefix])) { $caches[$prefix] = new ArrayCache($prefix); } return $caches[$prefix]; }); $cacheFactory->method('createDistributed') - ->willReturnCallback(function(string $prefix) use (&$caches) { + ->willReturnCallback(function (string $prefix) use (&$caches) { if (!isset($caches[$prefix])) { $caches[$prefix] = new ArrayCache($prefix); } diff --git a/apps/files_sharing/tests/TestCase.php b/apps/files_sharing/tests/TestCase.php index 2bd83d6c9c2..84e436b17cd 100644 --- a/apps/files_sharing/tests/TestCase.php +++ b/apps/files_sharing/tests/TestCase.php @@ -33,13 +33,13 @@ namespace OCA\Files_Sharing\Tests; use OC\Files\Filesystem; +use OC\User\DisplayNameCache; use OCA\Files_Sharing\AppInfo\Application; use OCA\Files_Sharing\External\MountProvider as ExternalMountProvider; use OCA\Files_Sharing\MountProvider; use OCP\Files\Config\IMountProviderCollection; use OCP\Share\IShare; use Test\Traits\MountProviderTrait; -use OC\User\DisplayNameCache; /** * Class TestCase |