diff --git a/build/integration/features/bootstrap/Auth.php b/build/integration/features/bootstrap/Auth.php index a0b02e2b64b0a..8ce72e73b828c 100644 --- a/build/integration/features/bootstrap/Auth.php +++ b/build/integration/features/bootstrap/Auth.php @@ -26,9 +26,9 @@ * */ use GuzzleHttp\Client; +use GuzzleHttp\Cookie\CookieJar; use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Exception\ServerException; -use GuzzleHttp\Cookie\CookieJar; require __DIR__ . '/../../vendor/autoload.php'; diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php index 2a6a509d65f7b..a38ef392e61f0 100644 --- a/build/integration/features/bootstrap/Sharing.php +++ b/build/integration/features/bootstrap/Sharing.php @@ -270,13 +270,13 @@ public function updatingLastShare($body) { } public function createShare($user, - $path = null, - $shareType = null, - $shareWith = null, - $publicUpload = null, - $password = null, - $permissions = null, - $viewOnly = false) { + $path = null, + $shareType = null, + $shareWith = null, + $publicUpload = null, + $password = null, + $permissions = null, + $viewOnly = false) { $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares"; $client = new Client(); $options = [ diff --git a/core/Application.php b/core/Application.php index ca9b6ce2d8c1b..151bcd1a3cb39 100644 --- a/core/Application.php +++ b/core/Application.php @@ -57,10 +57,10 @@ use OCP\Files\Events\Node\NodeDeletedEvent; use OCP\Files\Events\Node\NodeWrittenEvent; use OCP\Files\Events\NodeRemovedFromCache; +use OCP\IConfig; use OCP\User\Events\BeforeUserDeletedEvent; use OCP\User\Events\UserDeletedEvent; use OCP\Util; -use OCP\IConfig; /** * Class Application diff --git a/core/Command/Base.php b/core/Command/Base.php index 2581e273cb91e..f8b864c586456 100644 --- a/core/Command/Base.php +++ b/core/Command/Base.php @@ -26,8 +26,8 @@ namespace OC\Core\Command; use OC\Core\Command\User\ListCommand; -use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareInterface; +use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputInterface; diff --git a/core/Command/Broadcast/Test.php b/core/Command/Broadcast/Test.php index da450f30ca8c8..22a65d86e7b1d 100644 --- a/core/Command/Broadcast/Test.php +++ b/core/Command/Broadcast/Test.php @@ -68,7 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int private $uid; public function __construct(string $name, - string $uid) { + string $uid) { parent::__construct(); $this->name = $name; $this->uid = $uid; diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php index 56dbf8ce8d97a..bd47fea20fe09 100644 --- a/core/Command/Db/AddMissingIndices.php +++ b/core/Command/Db/AddMissingIndices.php @@ -38,8 +38,8 @@ use OCP\DB\Events\AddMissingIndicesEvent; use OCP\EventDispatcher\IEventDispatcher; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; /** diff --git a/core/Command/Db/ConvertFilecacheBigInt.php b/core/Command/Db/ConvertFilecacheBigInt.php index e10382c6fbb53..d73058767f2bd 100644 --- a/core/Command/Db/ConvertFilecacheBigInt.php +++ b/core/Command/Db/ConvertFilecacheBigInt.php @@ -33,9 +33,9 @@ use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Types\Type; -use OCP\DB\Types; use OC\DB\Connection; use OC\DB\SchemaWrapper; +use OCP\DB\Types; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/core/Command/Db/ConvertType.php b/core/Command/Db/ConvertType.php index e95a6f47c1ff1..a1bfbd1fd3ea5 100644 --- a/core/Command/Db/ConvertType.php +++ b/core/Command/Db/ConvertType.php @@ -35,11 +35,11 @@ use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\AbstractAsset; use Doctrine\DBAL\Schema\Table; -use OCP\DB\Types; use OC\DB\Connection; use OC\DB\ConnectionFactory; use OC\DB\MigrationService; use OCP\DB\QueryBuilder\IQueryBuilder; +use OCP\DB\Types; use OCP\IConfig; use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareInterface; use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; diff --git a/core/Command/Info/FileUtils.php b/core/Command/Info/FileUtils.php index 000cb0eb3d67d..694f30f78b470 100644 --- a/core/Command/Info/FileUtils.php +++ b/core/Command/Info/FileUtils.php @@ -30,6 +30,7 @@ use OCP\Constants; use OCP\Files\Config\IUserMountCache; use OCP\Files\FileInfo; +use OCP\Files\Folder; use OCP\Files\IHomeStorage; use OCP\Files\IRootFolder; use OCP\Files\Mount\IMountPoint; @@ -38,7 +39,6 @@ use OCP\Share\IShare; use OCP\Util; use Symfony\Component\Console\Output\OutputInterface; -use OCP\Files\Folder; class FileUtils { public function __construct( diff --git a/core/Command/Maintenance/Repair.php b/core/Command/Maintenance/Repair.php index 6c40ca2820f52..021e83e083355 100644 --- a/core/Command/Maintenance/Repair.php +++ b/core/Command/Maintenance/Repair.php @@ -29,10 +29,6 @@ namespace OC\Core\Command\Maintenance; use Exception; -use OCP\App\IAppManager; -use OCP\EventDispatcher\Event; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\IConfig; use OC\Repair\Events\RepairAdvanceEvent; use OC\Repair\Events\RepairErrorEvent; use OC\Repair\Events\RepairFinishEvent; @@ -40,6 +36,10 @@ use OC\Repair\Events\RepairStartEvent; use OC\Repair\Events\RepairStepEvent; use OC\Repair\Events\RepairWarningEvent; +use OCP\App\IAppManager; +use OCP\EventDispatcher\Event; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\IConfig; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Input\InputInterface; diff --git a/core/Command/Maintenance/RepairShareOwnership.php b/core/Command/Maintenance/RepairShareOwnership.php index e3c8a82c9d6a1..a89b9660a8cba 100644 --- a/core/Command/Maintenance/RepairShareOwnership.php +++ b/core/Command/Maintenance/RepairShareOwnership.php @@ -26,11 +26,11 @@ namespace OC\Core\Command\Maintenance; -use Symfony\Component\Console\Command\Command; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; use OCP\IUser; use OCP\IUserManager; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; diff --git a/core/Command/Preview/Generate.php b/core/Command/Preview/Generate.php index 6697afa537c5f..a885d224fc7e7 100644 --- a/core/Command/Preview/Generate.php +++ b/core/Command/Preview/Generate.php @@ -24,9 +24,9 @@ namespace OC\Core\Command\Preview; use OCP\Files\Config\IUserMountCache; +use OCP\Files\File; use OCP\Files\IRootFolder; use OCP\Files\Node; -use OCP\Files\File; use OCP\Files\NotFoundException; use OCP\IPreview; use Symfony\Component\Console\Command\Command; diff --git a/core/Command/TwoFactorAuth/Enforce.php b/core/Command/TwoFactorAuth/Enforce.php index e747ff99d5927..57b07308afe7b 100644 --- a/core/Command/TwoFactorAuth/Enforce.php +++ b/core/Command/TwoFactorAuth/Enforce.php @@ -26,13 +26,13 @@ */ namespace OC\Core\Command\TwoFactorAuth; -use function implode; use OC\Authentication\TwoFactorAuth\EnforcementState; use OC\Authentication\TwoFactorAuth\MandatoryTwoFactor; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use function implode; class Enforce extends Command { public function __construct( diff --git a/core/Command/TwoFactorAuth/State.php b/core/Command/TwoFactorAuth/State.php index ddae1fe963aa5..5663056b50a4b 100644 --- a/core/Command/TwoFactorAuth/State.php +++ b/core/Command/TwoFactorAuth/State.php @@ -92,7 +92,7 @@ private function filterEnabledDisabledUnknownProviders(array $providerStates): a } private function printProviders(string $title, array $providers, - OutputInterface $output) { + OutputInterface $output) { if (empty($providers)) { // Ignore and don't print anything return; diff --git a/core/Command/Upgrade.php b/core/Command/Upgrade.php index 078f994d0516f..30acd8f7d4d78 100644 --- a/core/Command/Upgrade.php +++ b/core/Command/Upgrade.php @@ -33,10 +33,6 @@ */ namespace OC\Core\Command; -use OCP\EventDispatcher\Event; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\IConfig; -use OCP\Util; use OC\Console\TimestampFormatter; use OC\DB\MigratorExecuteSqlEvent; use OC\Installer; @@ -48,6 +44,10 @@ use OC\Repair\Events\RepairStepEvent; use OC\Repair\Events\RepairWarningEvent; use OC\Updater; +use OCP\EventDispatcher\Event; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\IConfig; +use OCP\Util; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\ProgressBar; diff --git a/core/Command/User/AuthTokens/Delete.php b/core/Command/User/AuthTokens/Delete.php index 8cd6f2e62052f..56bfcf787f843 100644 --- a/core/Command/User/AuthTokens/Delete.php +++ b/core/Command/User/AuthTokens/Delete.php @@ -23,8 +23,8 @@ namespace OC\Core\Command\User\AuthTokens; use DateTimeImmutable; -use OC\Core\Command\Base; use OC\Authentication\Token\IProvider; +use OC\Core\Command\Base; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Input\InputArgument; diff --git a/core/Command/User/AuthTokens/ListCommand.php b/core/Command/User/AuthTokens/ListCommand.php index bfc4960625922..0bcd2e5522558 100644 --- a/core/Command/User/AuthTokens/ListCommand.php +++ b/core/Command/User/AuthTokens/ListCommand.php @@ -22,9 +22,9 @@ */ namespace OC\Core\Command\User\AuthTokens; -use OC\Core\Command\Base; use OC\Authentication\Token\IProvider; use OC\Authentication\Token\IToken; +use OC\Core\Command\Base; use OCP\IUserManager; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php index 0a073a586e42e..07a78ba368b47 100644 --- a/core/Controller/ClientFlowLoginController.php +++ b/core/Controller/ClientFlowLoginController.php @@ -181,8 +181,8 @@ public function showAuthPickerPage(string $clientIdentifier = '', string $user = */ #[UseSession] public function grantPage(string $stateToken = '', - string $clientIdentifier = '', - int $direct = 0): StandaloneTemplateResponse { + string $clientIdentifier = '', + int $direct = 0): StandaloneTemplateResponse { if (!$this->isValidToken($stateToken)) { return $this->stateTokenForbiddenResponse(); } @@ -233,7 +233,7 @@ public function grantPage(string $stateToken = '', */ #[UseSession] public function generateAppPassword(string $stateToken, - string $clientIdentifier = '') { + string $clientIdentifier = '') { if (!$this->isValidToken($stateToken)) { $this->session->remove(self::STATE_NAME); return $this->stateTokenForbiddenResponse(); diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index af43f2d4c4ac5..efaefd60c1da7 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -271,11 +271,11 @@ private function generateRedirect(?string $redirectUrl): RedirectResponse { */ #[UseSession] public function tryLogin(Chain $loginChain, - string $user = '', - string $password = '', - string $redirect_url = null, - string $timezone = '', - string $timezone_offset = ''): RedirectResponse { + string $user = '', + string $password = '', + string $redirect_url = null, + string $timezone = '', + string $timezone_offset = ''): RedirectResponse { if (!$this->request->passesCSRFCheck()) { if ($this->userSession->isLoggedIn()) { // If the user is already logged in and the CSRF check does not pass then diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php index 9a1424c4c4801..56b8b8eadcb87 100644 --- a/core/Controller/LostController.php +++ b/core/Controller/LostController.php @@ -37,6 +37,12 @@ namespace OC\Core\Controller; use Exception; +use OC\Authentication\TwoFactorAuth\Manager; +use OC\Core\Events\BeforePasswordResetEvent; +use OC\Core\Events\PasswordResetEvent; +use OC\Core\Exception\ResetPasswordException; +use OC\Security\RateLimiting\Exception\RateLimitExceededException; +use OC\Security\RateLimiting\Limiter; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI; use OCP\AppFramework\Http\JSONResponse; @@ -54,14 +60,8 @@ use OCP\IUser; use OCP\IUserManager; use OCP\Mail\IMailer; -use OCP\Security\VerificationToken\IVerificationToken; use OCP\Security\VerificationToken\InvalidTokenException; -use OC\Authentication\TwoFactorAuth\Manager; -use OC\Core\Events\BeforePasswordResetEvent; -use OC\Core\Events\PasswordResetEvent; -use OC\Core\Exception\ResetPasswordException; -use OC\Security\RateLimiting\Exception\RateLimitExceededException; -use OC\Security\RateLimiting\Limiter; +use OCP\Security\VerificationToken\IVerificationToken; use Psr\Log\LoggerInterface; use function array_filter; use function count; diff --git a/core/Controller/ProfileApiController.php b/core/Controller/ProfileApiController.php index cc91fb7d5761b..193102c20a7f1 100644 --- a/core/Controller/ProfileApiController.php +++ b/core/Controller/ProfileApiController.php @@ -28,6 +28,7 @@ namespace OC\Core\Controller; use OC\Core\Db\ProfileConfigMapper; +use OC\Profile\ProfileManager; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCS\OCSBadRequestException; @@ -37,7 +38,6 @@ use OCP\IRequest; use OCP\IUserManager; use OCP\IUserSession; -use OC\Profile\ProfileManager; class ProfileApiController extends OCSController { public function __construct( diff --git a/core/Controller/ProfilePageController.php b/core/Controller/ProfilePageController.php index 5034a665684ff..6db1ac5720518 100644 --- a/core/Controller/ProfilePageController.php +++ b/core/Controller/ProfilePageController.php @@ -28,18 +28,18 @@ namespace OC\Core\Controller; use OC\Profile\ProfileManager; -use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI; -use OCP\Profile\BeforeTemplateRenderedEvent; use OCP\AppFramework\Controller; +use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; +use OCP\EventDispatcher\IEventDispatcher; use OCP\IRequest; use OCP\IUser; use OCP\IUserManager; use OCP\IUserSession; +use OCP\Profile\BeforeTemplateRenderedEvent; use OCP\Share\IManager as IShareManager; use OCP\UserStatus\IManager as IUserStatusManager; -use OCP\EventDispatcher\IEventDispatcher; #[IgnoreOpenAPI] class ProfilePageController extends Controller { diff --git a/core/Controller/ReferenceController.php b/core/Controller/ReferenceController.php index cec2dc90cf5ea..8d1ff7f86d290 100644 --- a/core/Controller/ReferenceController.php +++ b/core/Controller/ReferenceController.php @@ -25,11 +25,11 @@ namespace OC\Core\Controller; -use OCP\Collaboration\Reference\IReferenceManager; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataDownloadResponse; use OCP\AppFramework\Http\DataResponse; +use OCP\Collaboration\Reference\IReferenceManager; use OCP\Files\AppData\IAppDataFactory; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; diff --git a/core/Controller/TextProcessingApiController.php b/core/Controller/TextProcessingApiController.php index 8b5175f0e5c77..8dac6861ff253 100644 --- a/core/Controller/TextProcessingApiController.php +++ b/core/Controller/TextProcessingApiController.php @@ -37,10 +37,10 @@ use OCP\Common\Exception\NotFoundException; use OCP\IL10N; use OCP\IRequest; +use OCP\PreConditionNotMetException; +use OCP\TextProcessing\IManager; use OCP\TextProcessing\ITaskType; use OCP\TextProcessing\Task; -use OCP\TextProcessing\IManager; -use OCP\PreConditionNotMetException; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; diff --git a/core/Controller/UnifiedSearchController.php b/core/Controller/UnifiedSearchController.php index 9704850bb1f27..8233c1c8bacf8 100644 --- a/core/Controller/UnifiedSearchController.php +++ b/core/Controller/UnifiedSearchController.php @@ -31,9 +31,9 @@ use OC\Search\SearchComposer; use OC\Search\SearchQuery; use OCA\Core\ResponseDefinitions; -use OCP\AppFramework\OCSController; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; +use OCP\AppFramework\OCSController; use OCP\IRequest; use OCP\IURLGenerator; use OCP\IUserSession; @@ -95,11 +95,11 @@ public function getProviders(string $from = ''): DataResponse { * 400: Searching is not possible */ public function search(string $providerId, - string $term = '', - ?int $sortOrder = null, - ?int $limit = null, - $cursor = null, - string $from = ''): DataResponse { + string $term = '', + ?int $sortOrder = null, + ?int $limit = null, + $cursor = null, + string $from = ''): DataResponse { if (trim($term) === "") { return new DataResponse(null, Http::STATUS_BAD_REQUEST); } diff --git a/core/Db/ProfileConfig.php b/core/Db/ProfileConfig.php index 3ebfe02ca79fa..6cca6b5bc8e5a 100644 --- a/core/Db/ProfileConfig.php +++ b/core/Db/ProfileConfig.php @@ -26,12 +26,12 @@ namespace OC\Core\Db; -use function Safe\json_decode; -use function Safe\json_encode; use \JsonSerializable; use OCP\Accounts\IAccountManager; use OCP\AppFramework\Db\Entity; use OCP\Profile\ParameterDoesNotExistException; +use function Safe\json_decode; +use function Safe\json_encode; /** * @method string getUserId() diff --git a/core/Migrations/Version13000Date20170705121758.php b/core/Migrations/Version13000Date20170705121758.php index 9436502b4a030..922e8a93587c2 100644 --- a/core/Migrations/Version13000Date20170705121758.php +++ b/core/Migrations/Version13000Date20170705121758.php @@ -25,8 +25,8 @@ */ namespace OC\Core\Migrations; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php index f0e489922fbc2..da83b0732d8a5 100644 --- a/core/Migrations/Version13000Date20170718121200.php +++ b/core/Migrations/Version13000Date20170718121200.php @@ -32,8 +32,8 @@ namespace OC\Core\Migrations; use Doctrine\DBAL\Platforms\PostgreSQL94Platform; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -751,7 +751,7 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op 'unsigned' => true, ]); $table->setPrimaryKey(['objecttype', 'objectid', 'systemtagid'], 'som_pk'); -// $table->addUniqueIndex(['objecttype', 'objectid', 'systemtagid'], 'mapping'); + // $table->addUniqueIndex(['objecttype', 'objectid', 'systemtagid'], 'mapping'); $table->addIndex(['systemtagid', 'objecttype'], 'systag_by_tagid'); } @@ -888,25 +888,25 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op ]); $table->addIndex(['object_type', 'object_id'], 'comments_marker_object_index'); $table->setPrimaryKey(['user_id', 'object_type', 'object_id'], 'crm_pk'); -// $table->addUniqueIndex(['user_id', 'object_type', 'object_id'], 'comments_marker_index'); + // $table->addUniqueIndex(['user_id', 'object_type', 'object_id'], 'comments_marker_index'); } -// if (!$schema->hasTable('credentials')) { -// $table = $schema->createTable('credentials'); -// $table->addColumn('user', 'string', [ -// 'notnull' => false, -// 'length' => 64, -// ]); -// $table->addColumn('identifier', 'string', [ -// 'notnull' => true, -// 'length' => 64, -// ]); -// $table->addColumn('credentials', 'text', [ -// 'notnull' => false, -// ]); -// $table->setPrimaryKey(['user', 'identifier']); -// $table->addIndex(['user'], 'credentials_user'); -// } + // if (!$schema->hasTable('credentials')) { + // $table = $schema->createTable('credentials'); + // $table->addColumn('user', 'string', [ + // 'notnull' => false, + // 'length' => 64, + // ]); + // $table->addColumn('identifier', 'string', [ + // 'notnull' => true, + // 'length' => 64, + // ]); + // $table->addColumn('credentials', 'text', [ + // 'notnull' => false, + // ]); + // $table->setPrimaryKey(['user', 'identifier']); + // $table->addIndex(['user'], 'credentials_user'); + // } if (!$schema->hasTable('admin_sections')) { $table = $schema->createTable('admin_sections'); diff --git a/core/Migrations/Version14000Date20180522074438.php b/core/Migrations/Version14000Date20180522074438.php index 57358eca66218..d12750fa77db1 100644 --- a/core/Migrations/Version14000Date20180522074438.php +++ b/core/Migrations/Version14000Date20180522074438.php @@ -33,7 +33,7 @@ class Version14000Date20180522074438 extends SimpleMigrationStep { public function changeSchema(IOutput $output, Closure $schemaClosure, - array $options): ISchemaWrapper { + array $options): ISchemaWrapper { $schema = $schemaClosure(); if (!$schema->hasTable('twofactor_providers')) { diff --git a/core/Migrations/Version14000Date20180710092004.php b/core/Migrations/Version14000Date20180710092004.php index 30ac28ccb6e2e..d04cc30eadfd1 100644 --- a/core/Migrations/Version14000Date20180710092004.php +++ b/core/Migrations/Version14000Date20180710092004.php @@ -29,8 +29,8 @@ */ namespace OC\Core\Migrations; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/core/Migrations/Version16000Date20190207141427.php b/core/Migrations/Version16000Date20190207141427.php index 6dc5a5b1773dc..7729f9203738d 100644 --- a/core/Migrations/Version16000Date20190207141427.php +++ b/core/Migrations/Version16000Date20190207141427.php @@ -29,8 +29,8 @@ namespace OC\Core\Migrations; use Closure; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -76,7 +76,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt ]); $table->setPrimaryKey(['collection_id', 'resource_type', 'resource_id'], 'crr_pk'); -// $table->addUniqueIndex(['collection_id', 'resource_type', 'resource_id'], 'collres_unique_res'); + // $table->addUniqueIndex(['collection_id', 'resource_type', 'resource_id'], 'collres_unique_res'); } if (!$schema->hasTable('collres_accesscache')) { @@ -106,7 +106,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt ]); $table->setPrimaryKey(['user_id', 'collection_id', 'resource_type', 'resource_id'], 'cra_pk'); -// $table->addUniqueIndex(['user_id', 'collection_id', 'resource_type', 'resource_id'], 'collres_unique_user'); + // $table->addUniqueIndex(['user_id', 'collection_id', 'resource_type', 'resource_id'], 'collres_unique_user'); $table->addIndex(['user_id', 'resource_type', 'resource_id'], 'collres_user_res'); $table->addIndex(['user_id', 'collection_id'], 'collres_user_coll'); } diff --git a/core/Migrations/Version16000Date20190212081545.php b/core/Migrations/Version16000Date20190212081545.php index 00ca7f845920e..a1cda37c3a14d 100644 --- a/core/Migrations/Version16000Date20190212081545.php +++ b/core/Migrations/Version16000Date20190212081545.php @@ -29,8 +29,8 @@ namespace OC\Core\Migrations; 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/core/Migrations/Version16000Date20190428150708.php b/core/Migrations/Version16000Date20190428150708.php index 61d5ee0d2fa0e..5513df828a74a 100644 --- a/core/Migrations/Version16000Date20190428150708.php +++ b/core/Migrations/Version16000Date20190428150708.php @@ -29,8 +29,8 @@ namespace OC\Core\Migrations; 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/core/Migrations/Version17000Date20190514105811.php b/core/Migrations/Version17000Date20190514105811.php index 6e081f7214d7c..5e7551fea9102 100644 --- a/core/Migrations/Version17000Date20190514105811.php +++ b/core/Migrations/Version17000Date20190514105811.php @@ -30,8 +30,8 @@ namespace OC\Core\Migrations; use Closure; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -67,7 +67,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt 'default' => 0, ]); $table->setPrimaryKey(['fileid'], 'fce_pk'); -// $table->addUniqueIndex(['fileid'], 'fce_fileid_idx'); + // $table->addUniqueIndex(['fileid'], 'fce_fileid_idx'); $table->addIndex(['creation_time'], 'fce_ctime_idx'); $table->addIndex(['upload_time'], 'fce_utime_idx'); } diff --git a/core/Migrations/Version18000Date20190920085628.php b/core/Migrations/Version18000Date20190920085628.php index 2d28468fd0bb8..8576d6b987321 100644 --- a/core/Migrations/Version18000Date20190920085628.php +++ b/core/Migrations/Version18000Date20190920085628.php @@ -29,8 +29,8 @@ namespace OC\Core\Migrations; use Closure; -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/core/Migrations/Version18000Date20191014105105.php b/core/Migrations/Version18000Date20191014105105.php index b659977d55f35..2404f8b79b5dc 100644 --- a/core/Migrations/Version18000Date20191014105105.php +++ b/core/Migrations/Version18000Date20191014105105.php @@ -29,11 +29,11 @@ namespace OC\Core\Migrations; use Closure; -use OCP\DB\Types; use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; use OCP\IDBConnection; -use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; class Version18000Date20191014105105 extends SimpleMigrationStep { public function __construct( diff --git a/core/Migrations/Version18000Date20191204114856.php b/core/Migrations/Version18000Date20191204114856.php index 1c5c623e7be51..618fa46b5ab58 100644 --- a/core/Migrations/Version18000Date20191204114856.php +++ b/core/Migrations/Version18000Date20191204114856.php @@ -28,8 +28,8 @@ use Closure; use OCP\DB\ISchemaWrapper; use OCP\IDBConnection; -use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; class Version18000Date20191204114856 extends SimpleMigrationStep { public function __construct( diff --git a/core/Migrations/Version20000Date20201109081915.php b/core/Migrations/Version20000Date20201109081915.php index 6e23c0b4bfd12..c99650b783d6a 100644 --- a/core/Migrations/Version20000Date20201109081915.php +++ b/core/Migrations/Version20000Date20201109081915.php @@ -43,7 +43,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $result = $this->ensureColumnIsNullable($schema, 'share', 'password_by_talk'); $result = $this->ensureColumnIsNullable($schema, 'share', 'hide_download') || $result; -// $result = $this->ensureColumnIsNullable($schema, 'credentials', 'user') || $result; + // $result = $this->ensureColumnIsNullable($schema, 'credentials', 'user') || $result; $result = $this->ensureColumnIsNullable($schema, 'authtoken', 'password_invalid') || $result; $result = $this->ensureColumnIsNullable($schema, 'collres_accesscache', 'access') || $result; diff --git a/core/Migrations/Version20000Date20201109081918.php b/core/Migrations/Version20000Date20201109081918.php index 5c275ed2c3a03..d060d7e306a3c 100644 --- a/core/Migrations/Version20000Date20201109081918.php +++ b/core/Migrations/Version20000Date20201109081918.php @@ -28,8 +28,8 @@ namespace OC\Core\Migrations; use Closure; -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/core/Migrations/Version21000Date20201202095923.php b/core/Migrations/Version21000Date20201202095923.php index c087447f05022..f6473c07715f0 100644 --- a/core/Migrations/Version21000Date20201202095923.php +++ b/core/Migrations/Version21000Date20201202095923.php @@ -27,8 +27,8 @@ namespace OC\Core\Migrations; 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/core/Migrations/Version23000Date20210721100600.php b/core/Migrations/Version23000Date20210721100600.php index 1169ca4039eb9..0218ebaaa4109 100644 --- a/core/Migrations/Version23000Date20210721100600.php +++ b/core/Migrations/Version23000Date20210721100600.php @@ -26,8 +26,8 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; class Version23000Date20210721100600 extends SimpleMigrationStep { /** diff --git a/core/Migrations/Version23000Date20210906132259.php b/core/Migrations/Version23000Date20210906132259.php index d4476a4d36d94..fa52f172ece9f 100644 --- a/core/Migrations/Version23000Date20210906132259.php +++ b/core/Migrations/Version23000Date20210906132259.php @@ -23,24 +23,24 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt * Therefore it was dropped with Version24000Date20211213081506 * and then recreated with a primary key in Version24000Date20211213081604 */ -// /** @var ISchemaWrapper $schema */ -// $schema = $schemaClosure(); -// -// $hasTable = $schema->hasTable(self::TABLE_NAME); -// -// if (!$hasTable) { -// $table = $schema->createTable(self::TABLE_NAME); -// $table->addColumn('hash', Types::STRING, [ -// 'notnull' => true, -// 'length' => 128, -// ]); -// $table->addColumn('delete_after', Types::DATETIME, [ -// 'notnull' => true, -// ]); -// $table->addIndex(['hash'], 'ratelimit_hash'); -// $table->addIndex(['delete_after'], 'ratelimit_delete_after'); -// return $schema; -// } + // /** @var ISchemaWrapper $schema */ + // $schema = $schemaClosure(); + // + // $hasTable = $schema->hasTable(self::TABLE_NAME); + // + // if (!$hasTable) { + // $table = $schema->createTable(self::TABLE_NAME); + // $table->addColumn('hash', Types::STRING, [ + // 'notnull' => true, + // 'length' => 128, + // ]); + // $table->addColumn('delete_after', Types::DATETIME, [ + // 'notnull' => true, + // ]); + // $table->addIndex(['hash'], 'ratelimit_hash'); + // $table->addIndex(['delete_after'], 'ratelimit_delete_after'); + // return $schema; + // } return null; } diff --git a/core/ajax/update.php b/core/ajax/update.php index bc7d8b67fc6da..a826b6b7e7a19 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -30,12 +30,6 @@ * along with this program. If not, see * */ -use OCP\EventDispatcher\Event; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\IEventSource; -use OCP\IEventSourceFactory; -use OCP\IL10N; -use OCP\ILogger; use OC\DB\MigratorExecuteSqlEvent; use OC\Repair\Events\RepairAdvanceEvent; use OC\Repair\Events\RepairErrorEvent; @@ -44,6 +38,12 @@ use OC\Repair\Events\RepairStartEvent; use OC\Repair\Events\RepairStepEvent; use OC\Repair\Events\RepairWarningEvent; +use OCP\EventDispatcher\Event; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\IEventSource; +use OCP\IEventSourceFactory; +use OCP\IL10N; +use OCP\ILogger; use OCP\L10N\IFactory; if (!str_contains(@ini_get('disable_functions'), 'set_time_limit')) { diff --git a/core/templates/publicshareauth.php b/core/templates/publicshareauth.php index 516795852b29f..896048454c60b 100644 --- a/core/templates/publicshareauth.php +++ b/core/templates/publicshareauth.php @@ -1,10 +1,10 @@ +/** @var array $_ */ +/** @var \OCP\IL10N $l */ +\OCP\Util::addStyle('core', 'guest'); +\OCP\Util::addStyle('core', 'publicshareauth'); +\OCP\Util::addScript('core', 'publicshareauth'); +?>
diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php index 3e33e783635fe..97156a027e61e 100644 --- a/lib/private/Accounts/AccountManager.php +++ b/lib/private/Accounts/AccountManager.php @@ -38,15 +38,15 @@ use Exception; use InvalidArgumentException; use OC\Profile\TProfileHelper; -use OCP\Accounts\UserUpdatedEvent; -use OCP\Cache\CappedMemoryCache; use OCA\Settings\BackgroundJobs\VerifyUserData; use OCP\Accounts\IAccount; use OCP\Accounts\IAccountManager; use OCP\Accounts\IAccountProperty; use OCP\Accounts\IAccountPropertyCollection; use OCP\Accounts\PropertyDoesNotExistException; +use OCP\Accounts\UserUpdatedEvent; use OCP\BackgroundJob\IJobList; +use OCP\Cache\CappedMemoryCache; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Defaults; use OCP\EventDispatcher\IEventDispatcher; diff --git a/lib/private/Activity/Manager.php b/lib/private/Activity/Manager.php index a7d24510d530e..14069260c6cfb 100644 --- a/lib/private/Activity/Manager.php +++ b/lib/private/Activity/Manager.php @@ -70,11 +70,11 @@ class Manager implements IManager { protected $l10n; public function __construct( - IRequest $request, - IUserSession $session, - IConfig $config, - IValidator $validator, - IL10N $l10n + IRequest $request, + IUserSession $session, + IConfig $config, + IValidator $validator, + IL10N $l10n ) { $this->request = $request; $this->session = $session; diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index ccbb2143133d2..3ccf069ba1eac 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -47,10 +47,10 @@ use OCP\App\Events\AppEnableEvent; use OCP\App\IAppManager; use OCP\App\ManagerEvent; -use OCP\EventDispatcher\IEventDispatcher; use OCP\Collaboration\AutoComplete\IManager as IAutoCompleteManager; use OCP\Collaboration\Collaborators\ISearch as ICollaboratorSearch; use OCP\Diagnostics\IEventLogger; +use OCP\EventDispatcher\IEventDispatcher; use OCP\ICacheFactory; use OCP\IConfig; use OCP\IGroup; @@ -104,12 +104,12 @@ class AppManager implements IAppManager { private array $loadedApps = []; public function __construct(IUserSession $userSession, - IConfig $config, - AppConfig $appConfig, - IGroupManager $groupManager, - ICacheFactory $memCacheFactory, - IEventDispatcher $dispatcher, - LoggerInterface $logger) { + IConfig $config, + AppConfig $appConfig, + IGroupManager $groupManager, + ICacheFactory $memCacheFactory, + IEventDispatcher $dispatcher, + LoggerInterface $logger) { $this->userSession = $userSession; $this->config = $config; $this->appConfig = $appConfig; diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index 47bdece372db3..f9fbd05855b8d 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -49,12 +49,12 @@ class AppFetcher extends Fetcher { private $ignoreMaxVersion; public function __construct(Factory $appDataFactory, - IClientService $clientService, - ITimeFactory $timeFactory, - IConfig $config, - CompareVersion $compareVersion, - LoggerInterface $logger, - IRegistry $registry) { + IClientService $clientService, + ITimeFactory $timeFactory, + IConfig $config, + CompareVersion $compareVersion, + LoggerInterface $logger, + IRegistry $registry) { parent::__construct( $appDataFactory, $clientService, diff --git a/lib/private/App/AppStore/Fetcher/CategoryFetcher.php b/lib/private/App/AppStore/Fetcher/CategoryFetcher.php index afe051e6281a0..d1bbe4f7b0434 100644 --- a/lib/private/App/AppStore/Fetcher/CategoryFetcher.php +++ b/lib/private/App/AppStore/Fetcher/CategoryFetcher.php @@ -35,11 +35,11 @@ class CategoryFetcher extends Fetcher { public function __construct(Factory $appDataFactory, - IClientService $clientService, - ITimeFactory $timeFactory, - IConfig $config, - LoggerInterface $logger, - IRegistry $registry) { + IClientService $clientService, + ITimeFactory $timeFactory, + IConfig $config, + LoggerInterface $logger, + IRegistry $registry) { parent::__construct( $appDataFactory, $clientService, diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php index 095b026cb4488..3e76ab2d5dae7 100644 --- a/lib/private/App/AppStore/Fetcher/Fetcher.php +++ b/lib/private/App/AppStore/Fetcher/Fetcher.php @@ -68,11 +68,11 @@ abstract class Fetcher { protected $channel = null; public function __construct(Factory $appDataFactory, - IClientService $clientService, - ITimeFactory $timeFactory, - IConfig $config, - LoggerInterface $logger, - IRegistry $registry) { + IClientService $clientService, + ITimeFactory $timeFactory, + IConfig $config, + LoggerInterface $logger, + IRegistry $registry) { $this->appData = $appDataFactory->get('appstore'); $this->clientService = $clientService; $this->timeFactory = $timeFactory; diff --git a/lib/private/App/InfoParser.php b/lib/private/App/InfoParser.php index 79d051fd2a1f6..22ec2687a7494 100644 --- a/lib/private/App/InfoParser.php +++ b/lib/private/App/InfoParser.php @@ -272,7 +272,7 @@ public function xmlToArray($xml) { } else { $array[$element] = $data; } - // Just a value + // Just a value } else { if ($totalElement > 1) { $array[$element][] = $this->xmlToArray($node); diff --git a/lib/private/App/Platform.php b/lib/private/App/Platform.php index 1cab740bebbad..daff247d1bd7d 100644 --- a/lib/private/App/Platform.php +++ b/lib/private/App/Platform.php @@ -25,8 +25,8 @@ */ namespace OC\App; -use OCP\IConfig; use OCP\IBinaryFinder; +use OCP\IConfig; /** * Class Platform diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php index ffd77da888ed5..b18c95a2f0db6 100644 --- a/lib/private/AppFramework/App.php +++ b/lib/private/AppFramework/App.php @@ -34,16 +34,16 @@ use OC\AppFramework\DependencyInjection\DIContainer; use OC\AppFramework\Http\Dispatcher; use OC\AppFramework\Http\Request; -use OCP\App\IAppManager; -use OCP\Profiler\IProfiler; use OC\Profiler\RoutingDataCollector; -use OCP\AppFramework\QueryException; +use OCP\App\IAppManager; use OCP\AppFramework\Http; use OCP\AppFramework\Http\ICallbackResponse; use OCP\AppFramework\Http\IOutput; +use OCP\AppFramework\QueryException; use OCP\Diagnostics\IEventLogger; use OCP\HintException; use OCP\IRequest; +use OCP\Profiler\IProfiler; /** * Entry point for every request in your app. You can consider this as your @@ -257,7 +257,7 @@ public static function main(string $controllerName, string $methodName, DIContai * @param DIContainer $container an instance of a pimple container. */ public static function part(string $controllerName, string $methodName, array $urlParams, - DIContainer $container) { + DIContainer $container) { $container['urlParams'] = $urlParams; $controller = $container[$controllerName]; diff --git a/lib/private/AppFramework/Bootstrap/Coordinator.php b/lib/private/AppFramework/Bootstrap/Coordinator.php index f41b734a25bca..8526a3dc1a1ee 100644 --- a/lib/private/AppFramework/Bootstrap/Coordinator.php +++ b/lib/private/AppFramework/Bootstrap/Coordinator.php @@ -30,20 +30,20 @@ namespace OC\AppFramework\Bootstrap; -use OCP\Diagnostics\IEventLogger; -use function class_exists; -use function class_implements; -use function in_array; -use OC_App; use OC\Support\CrashReport\Registry; +use OC_App; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\QueryException; use OCP\Dashboard\IManager; +use OCP\Diagnostics\IEventLogger; use OCP\EventDispatcher\IEventDispatcher; use OCP\IServerContainer; use Psr\Log\LoggerInterface; use Throwable; +use function class_exists; +use function class_implements; +use function in_array; class Coordinator { /** @var IServerContainer */ diff --git a/lib/private/AppFramework/Bootstrap/EventListenerRegistration.php b/lib/private/AppFramework/Bootstrap/EventListenerRegistration.php index 2ad410be26f05..12801e6276335 100644 --- a/lib/private/AppFramework/Bootstrap/EventListenerRegistration.php +++ b/lib/private/AppFramework/Bootstrap/EventListenerRegistration.php @@ -37,9 +37,9 @@ class EventListenerRegistration extends ServiceRegistration { private $priority; public function __construct(string $appId, - string $event, - string $service, - int $priority) { + string $event, + string $service, + int $priority) { parent::__construct($appId, $service); $this->event = $event; $this->priority = $priority; diff --git a/lib/private/AppFramework/Bootstrap/ParameterRegistration.php b/lib/private/AppFramework/Bootstrap/ParameterRegistration.php index b501a757abdce..958f24cb60036 100644 --- a/lib/private/AppFramework/Bootstrap/ParameterRegistration.php +++ b/lib/private/AppFramework/Bootstrap/ParameterRegistration.php @@ -36,8 +36,8 @@ final class ParameterRegistration extends ARegistration { private $value; public function __construct(string $appId, - string $name, - $value) { + string $name, + $value) { parent::__construct($appId); $this->name = $name; $this->value = $value; diff --git a/lib/private/AppFramework/Bootstrap/PreviewProviderRegistration.php b/lib/private/AppFramework/Bootstrap/PreviewProviderRegistration.php index 36c5cae7db37d..e4d75f75bc8cf 100644 --- a/lib/private/AppFramework/Bootstrap/PreviewProviderRegistration.php +++ b/lib/private/AppFramework/Bootstrap/PreviewProviderRegistration.php @@ -34,8 +34,8 @@ class PreviewProviderRegistration extends ServiceRegistration { private $mimeTypeRegex; public function __construct(string $appId, - string $service, - string $mimeTypeRegex) { + string $service, + string $mimeTypeRegex) { parent::__construct($appId, $service); $this->mimeTypeRegex = $mimeTypeRegex; } diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index 5aea2a7a744b0..bf315da5cdf67 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -30,15 +30,6 @@ namespace OC\AppFramework\Bootstrap; use Closure; -use OCP\Calendar\Resource\IBackend as IResourceBackend; -use OCP\Calendar\Room\IBackend as IRoomBackend; -use OCP\Collaboration\Reference\IReferenceProvider; -use OCP\TextProcessing\IProvider as ITextProcessingProvider; -use OCP\SpeechToText\ISpeechToTextProvider; -use OCP\Talk\ITalkBackend; -use OCP\Translation\ITranslationProvider; -use RuntimeException; -use function array_shift; use OC\Support\CrashReport\Registry; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IRegistrationContext; @@ -46,7 +37,10 @@ use OCP\AppFramework\Services\InitialStateProvider; use OCP\Authentication\IAlternativeLogin; use OCP\Calendar\ICalendarProvider; +use OCP\Calendar\Resource\IBackend as IResourceBackend; +use OCP\Calendar\Room\IBackend as IRoomBackend; use OCP\Capabilities\ICapability; +use OCP\Collaboration\Reference\IReferenceProvider; use OCP\Dashboard\IManager; use OCP\Dashboard\IWidget; use OCP\EventDispatcher\IEventDispatcher; @@ -56,10 +50,16 @@ use OCP\Profile\ILinkAction; use OCP\Search\IProvider; use OCP\Share\IPublicShareTemplateProvider; +use OCP\SpeechToText\ISpeechToTextProvider; use OCP\Support\CrashReport\IReporter; +use OCP\Talk\ITalkBackend; +use OCP\TextProcessing\IProvider as ITextProcessingProvider; +use OCP\Translation\ITranslationProvider; use OCP\UserMigration\IMigrator as IUserMigrator; use Psr\Log\LoggerInterface; +use RuntimeException; use Throwable; +use function array_shift; class RegistrationContext { /** @var ServiceRegistration[] */ diff --git a/lib/private/AppFramework/Bootstrap/ServiceAliasRegistration.php b/lib/private/AppFramework/Bootstrap/ServiceAliasRegistration.php index e2b115e0353b2..62c7169a7ee1b 100644 --- a/lib/private/AppFramework/Bootstrap/ServiceAliasRegistration.php +++ b/lib/private/AppFramework/Bootstrap/ServiceAliasRegistration.php @@ -46,8 +46,8 @@ class ServiceAliasRegistration extends ARegistration { * @paslm-param string|class-string $target */ public function __construct(string $appId, - string $alias, - string $target) { + string $alias, + string $target) { parent::__construct($appId); $this->alias = $alias; $this->target = $target; diff --git a/lib/private/AppFramework/Bootstrap/ServiceFactoryRegistration.php b/lib/private/AppFramework/Bootstrap/ServiceFactoryRegistration.php index b6658e552396a..9d166526d945d 100644 --- a/lib/private/AppFramework/Bootstrap/ServiceFactoryRegistration.php +++ b/lib/private/AppFramework/Bootstrap/ServiceFactoryRegistration.php @@ -45,9 +45,9 @@ class ServiceFactoryRegistration extends ARegistration { private $shared; public function __construct(string $appId, - string $alias, - callable $target, - bool $shared) { + string $alias, + callable $target, + bool $shared) { parent::__construct($appId); $this->name = $alias; $this->factory = $target; diff --git a/lib/private/AppFramework/Http/Dispatcher.php b/lib/private/AppFramework/Http/Dispatcher.php index 13b391eb28741..7ff7f7a9cc044 100644 --- a/lib/private/AppFramework/Http/Dispatcher.php +++ b/lib/private/AppFramework/Http/Dispatcher.php @@ -88,14 +88,14 @@ class Dispatcher { * @param IEventLogger $eventLogger */ public function __construct(Http $protocol, - MiddlewareDispatcher $middlewareDispatcher, - ControllerMethodReflector $reflector, - IRequest $request, - IConfig $config, - ConnectionAdapter $connection, - LoggerInterface $logger, - IEventLogger $eventLogger, - ContainerInterface $appContainer) { + MiddlewareDispatcher $middlewareDispatcher, + ControllerMethodReflector $reflector, + IRequest $request, + IConfig $config, + ConnectionAdapter $connection, + LoggerInterface $logger, + IEventLogger $eventLogger, + ContainerInterface $appContainer) { $this->protocol = $protocol; $this->middlewareDispatcher = $middlewareDispatcher; $this->reflector = $reflector; diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index 26a76e0da2718..1c2cc607fe83c 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -118,10 +118,10 @@ class Request implements \ArrayAccess, \Countable, IRequest { * @see https://www.php.net/manual/en/reserved.variables.php */ public function __construct(array $vars, - IRequestId $requestId, - IConfig $config, - CsrfTokenManager $csrfTokenManager = null, - string $stream = 'php://input') { + IRequestId $requestId, + IConfig $config, + CsrfTokenManager $csrfTokenManager = null, + string $stream = 'php://input') { $this->inputStream = $stream; $this->items['params'] = []; $this->requestId = $requestId; @@ -431,8 +431,8 @@ protected function decodeContent() { $this->items['post'] = $params; } } - // Handle application/x-www-form-urlencoded for methods other than GET - // or post correctly + // Handle application/x-www-form-urlencoded for methods other than GET + // or post correctly } elseif ($this->method !== 'GET' && $this->method !== 'POST' && str_contains($this->getHeader('Content-Type'), 'application/x-www-form-urlencoded')) { diff --git a/lib/private/AppFramework/Http/RequestId.php b/lib/private/AppFramework/Http/RequestId.php index 70032873a757b..a6b24c0a2ff75 100644 --- a/lib/private/AppFramework/Http/RequestId.php +++ b/lib/private/AppFramework/Http/RequestId.php @@ -31,7 +31,7 @@ class RequestId implements IRequestId { protected string $requestId; public function __construct(string $uniqueId, - ISecureRandom $secureRandom) { + ISecureRandom $secureRandom) { $this->requestId = $uniqueId; $this->secureRandom = $secureRandom; } diff --git a/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php b/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php index f0d6ece8a93fb..fef9632487ec8 100644 --- a/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php @@ -59,9 +59,9 @@ class CORSMiddleware extends Middleware { private $throttler; public function __construct(IRequest $request, - ControllerMethodReflector $reflector, - Session $session, - IThrottler $throttler) { + ControllerMethodReflector $reflector, + Session $session, + IThrottler $throttler) { $this->request = $request; $this->reflector = $reflector; $this->session = $session; diff --git a/lib/private/AppFramework/Middleware/Security/CSPMiddleware.php b/lib/private/AppFramework/Middleware/Security/CSPMiddleware.php index ae0dc1f134e63..60a7cef8fa1d2 100644 --- a/lib/private/AppFramework/Middleware/Security/CSPMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/CSPMiddleware.php @@ -44,8 +44,8 @@ class CSPMiddleware extends Middleware { private $csrfTokenManager; public function __construct(ContentSecurityPolicyManager $policyManager, - ContentSecurityPolicyNonceManager $cspNonceManager, - CsrfTokenManager $csrfTokenManager) { + ContentSecurityPolicyNonceManager $cspNonceManager, + CsrfTokenManager $csrfTokenManager) { $this->contentSecurityPolicyManager = $policyManager; $this->cspNonceManager = $cspNonceManager; $this->csrfTokenManager = $csrfTokenManager; diff --git a/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php b/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php index a72a7a4001623..351f47ea92459 100644 --- a/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/PasswordConfirmationMiddleware.php @@ -55,9 +55,9 @@ class PasswordConfirmationMiddleware extends Middleware { * @param ITimeFactory $timeFactory */ public function __construct(ControllerMethodReflector $reflector, - ISession $session, - IUserSession $userSession, - ITimeFactory $timeFactory) { + ISession $session, + IUserSession $userSession, + ITimeFactory $timeFactory) { $this->reflector = $reflector; $this->session = $session; $this->userSession = $userSession; diff --git a/lib/private/AppFramework/Middleware/Security/SameSiteCookieMiddleware.php b/lib/private/AppFramework/Middleware/Security/SameSiteCookieMiddleware.php index e6d35dc66f274..870efdd44faf6 100644 --- a/lib/private/AppFramework/Middleware/Security/SameSiteCookieMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/SameSiteCookieMiddleware.php @@ -38,7 +38,7 @@ class SameSiteCookieMiddleware extends Middleware { private $reflector; public function __construct(Request $request, - ControllerMethodReflector $reflector) { + ControllerMethodReflector $reflector) { $this->request = $request; $this->reflector = $reflector; } diff --git a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php index db6c7a02c7777..a97876fd9ab22 100644 --- a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php @@ -104,18 +104,18 @@ class SecurityMiddleware extends Middleware { private $userSession; public function __construct(IRequest $request, - ControllerMethodReflector $reflector, - INavigationManager $navigationManager, - IURLGenerator $urlGenerator, - LoggerInterface $logger, - string $appName, - bool $isLoggedIn, - bool $isAdminUser, - bool $isSubAdmin, - IAppManager $appManager, - IL10N $l10n, - AuthorizedGroupMapper $mapper, - IUserSession $userSession + ControllerMethodReflector $reflector, + INavigationManager $navigationManager, + IURLGenerator $urlGenerator, + LoggerInterface $logger, + string $appName, + bool $isLoggedIn, + bool $isAdminUser, + bool $isSubAdmin, + IAppManager $appManager, + IL10N $l10n, + AuthorizedGroupMapper $mapper, + IUserSession $userSession ) { $this->navigationManager = $navigationManager; $this->request = $request; diff --git a/lib/private/AppFramework/Middleware/SessionMiddleware.php b/lib/private/AppFramework/Middleware/SessionMiddleware.php index 39f85915901d6..0acdcf8b7ef02 100644 --- a/lib/private/AppFramework/Middleware/SessionMiddleware.php +++ b/lib/private/AppFramework/Middleware/SessionMiddleware.php @@ -44,7 +44,7 @@ class SessionMiddleware extends Middleware { private $session; public function __construct(ControllerMethodReflector $reflector, - ISession $session) { + ISession $session) { $this->reflector = $reflector; $this->session = $session; } diff --git a/lib/private/AppFramework/OCS/BaseResponse.php b/lib/private/AppFramework/OCS/BaseResponse.php index 123b73d302c6f..3cfe8177ae78a 100644 --- a/lib/private/AppFramework/OCS/BaseResponse.php +++ b/lib/private/AppFramework/OCS/BaseResponse.php @@ -64,10 +64,10 @@ abstract class BaseResponse extends Response { * @param int|null $itemsPerPage */ public function __construct(DataResponse $dataResponse, - $format = 'xml', - $statusMessage = null, - $itemsCount = null, - $itemsPerPage = null) { + $format = 'xml', + $statusMessage = null, + $itemsCount = null, + $itemsPerPage = null) { parent::__construct(); $this->format = $format; diff --git a/lib/private/AppFramework/ScopedPsrLogger.php b/lib/private/AppFramework/ScopedPsrLogger.php index 4ed91cdb6c02f..1cb58da11ef27 100644 --- a/lib/private/AppFramework/ScopedPsrLogger.php +++ b/lib/private/AppFramework/ScopedPsrLogger.php @@ -37,7 +37,7 @@ class ScopedPsrLogger implements LoggerInterface { private $appId; public function __construct(LoggerInterface $inner, - string $appId) { + string $appId) { $this->inner = $inner; $this->appId = $appId; } diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php index 7aa5cb8392613..7dcac2ec88d4e 100644 --- a/lib/private/AppFramework/Utility/SimpleContainer.php +++ b/lib/private/AppFramework/Utility/SimpleContainer.php @@ -37,8 +37,8 @@ use Psr\Container\ContainerInterface; use ReflectionClass; use ReflectionException; -use ReflectionParameter; use ReflectionNamedType; +use ReflectionParameter; use function class_exists; /** diff --git a/lib/private/AppScriptSort.php b/lib/private/AppScriptSort.php index c42d02d485d8d..2e36034d04fb8 100644 --- a/lib/private/AppScriptSort.php +++ b/lib/private/AppScriptSort.php @@ -46,10 +46,10 @@ public function __construct(LoggerInterface $logger) { * @param array $sortedScriptDeps */ private function topSortVisit( - AppScriptDependency $app, - array &$parents, - array &$scriptDeps, - array &$sortedScriptDeps): void { + AppScriptDependency $app, + array &$parents, + array &$scriptDeps, + array &$sortedScriptDeps): void { // Detect and log circular dependencies if (isset($parents[$app->getId()])) { $this->logger->error('Circular dependency in app scripts at app ' . $app->getId()); diff --git a/lib/private/Authentication/Listeners/RemoteWipeActivityListener.php b/lib/private/Authentication/Listeners/RemoteWipeActivityListener.php index edebb2a2641a9..3e8348f075a4c 100644 --- a/lib/private/Authentication/Listeners/RemoteWipeActivityListener.php +++ b/lib/private/Authentication/Listeners/RemoteWipeActivityListener.php @@ -46,7 +46,7 @@ class RemoteWipeActivityListener implements IEventListener { private $logger; public function __construct(IActvityManager $activityManager, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->activityManager = $activityManager; $this->logger = $logger; } diff --git a/lib/private/Authentication/Listeners/RemoteWipeEmailListener.php b/lib/private/Authentication/Listeners/RemoteWipeEmailListener.php index cba2b18358984..fb3f771d1e42f 100644 --- a/lib/private/Authentication/Listeners/RemoteWipeEmailListener.php +++ b/lib/private/Authentication/Listeners/RemoteWipeEmailListener.php @@ -57,9 +57,9 @@ class RemoteWipeEmailListener implements IEventListener { private $logger; public function __construct(IMailer $mailer, - IUserManager $userManager, - IL10nFactory $l10nFactory, - LoggerInterface $logger) { + IUserManager $userManager, + IL10nFactory $l10nFactory, + LoggerInterface $logger) { $this->mailer = $mailer; $this->userManager = $userManager; $this->l10n = $l10nFactory->get('core'); diff --git a/lib/private/Authentication/Listeners/RemoteWipeNotificationsListener.php b/lib/private/Authentication/Listeners/RemoteWipeNotificationsListener.php index 81feab32746f0..37732ecf5f254 100644 --- a/lib/private/Authentication/Listeners/RemoteWipeNotificationsListener.php +++ b/lib/private/Authentication/Listeners/RemoteWipeNotificationsListener.php @@ -45,7 +45,7 @@ class RemoteWipeNotificationsListener implements IEventListener { private $timeFactory; public function __construct(INotificationManager $notificationManager, - ITimeFactory $timeFactory) { + ITimeFactory $timeFactory) { $this->notificationManager = $notificationManager; $this->timeFactory = $timeFactory; } diff --git a/lib/private/Authentication/Listeners/UserDeletedTokenCleanupListener.php b/lib/private/Authentication/Listeners/UserDeletedTokenCleanupListener.php index a09a08568d545..f4f08a50add8a 100644 --- a/lib/private/Authentication/Listeners/UserDeletedTokenCleanupListener.php +++ b/lib/private/Authentication/Listeners/UserDeletedTokenCleanupListener.php @@ -44,7 +44,7 @@ class UserDeletedTokenCleanupListener implements IEventListener { private $logger; public function __construct(Manager $manager, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->manager = $manager; $this->logger = $logger; } diff --git a/lib/private/Authentication/Login/Chain.php b/lib/private/Authentication/Login/Chain.php index 3c3179472c4f4..60ecd004388fb 100644 --- a/lib/private/Authentication/Login/Chain.php +++ b/lib/private/Authentication/Login/Chain.php @@ -63,17 +63,17 @@ class Chain { private $finishRememberedLoginCommand; public function __construct(PreLoginHookCommand $preLoginHookCommand, - UserDisabledCheckCommand $userDisabledCheckCommand, - UidLoginCommand $uidLoginCommand, - EmailLoginCommand $emailLoginCommand, - LoggedInCheckCommand $loggedInCheckCommand, - CompleteLoginCommand $completeLoginCommand, - CreateSessionTokenCommand $createSessionTokenCommand, - ClearLostPasswordTokensCommand $clearLostPasswordTokensCommand, - UpdateLastPasswordConfirmCommand $updateLastPasswordConfirmCommand, - SetUserTimezoneCommand $setUserTimezoneCommand, - TwoFactorCommand $twoFactorCommand, - FinishRememberedLoginCommand $finishRememberedLoginCommand + UserDisabledCheckCommand $userDisabledCheckCommand, + UidLoginCommand $uidLoginCommand, + EmailLoginCommand $emailLoginCommand, + LoggedInCheckCommand $loggedInCheckCommand, + CompleteLoginCommand $completeLoginCommand, + CreateSessionTokenCommand $createSessionTokenCommand, + ClearLostPasswordTokensCommand $clearLostPasswordTokensCommand, + UpdateLastPasswordConfirmCommand $updateLastPasswordConfirmCommand, + SetUserTimezoneCommand $setUserTimezoneCommand, + TwoFactorCommand $twoFactorCommand, + FinishRememberedLoginCommand $finishRememberedLoginCommand ) { $this->preLoginHookCommand = $preLoginHookCommand; $this->userDisabledCheckCommand = $userDisabledCheckCommand; diff --git a/lib/private/Authentication/Login/CreateSessionTokenCommand.php b/lib/private/Authentication/Login/CreateSessionTokenCommand.php index ba237dfbf205c..41616e6dad3df 100644 --- a/lib/private/Authentication/Login/CreateSessionTokenCommand.php +++ b/lib/private/Authentication/Login/CreateSessionTokenCommand.php @@ -39,7 +39,7 @@ class CreateSessionTokenCommand extends ALoginCommand { private $userSession; public function __construct(IConfig $config, - Session $userSession) { + Session $userSession) { $this->config = $config; $this->userSession = $userSession; } diff --git a/lib/private/Authentication/Login/LoggedInCheckCommand.php b/lib/private/Authentication/Login/LoggedInCheckCommand.php index dc1a4d2d88328..6b241d7974691 100644 --- a/lib/private/Authentication/Login/LoggedInCheckCommand.php +++ b/lib/private/Authentication/Login/LoggedInCheckCommand.php @@ -39,7 +39,7 @@ class LoggedInCheckCommand extends ALoginCommand { private $dispatcher; public function __construct(LoggerInterface $logger, - IEventDispatcher $dispatcher) { + IEventDispatcher $dispatcher) { $this->logger = $logger; $this->dispatcher = $dispatcher; } diff --git a/lib/private/Authentication/Login/LoginData.php b/lib/private/Authentication/Login/LoginData.php index 240a1dc647612..0ce11cf70fcea 100644 --- a/lib/private/Authentication/Login/LoginData.php +++ b/lib/private/Authentication/Login/LoginData.php @@ -55,11 +55,11 @@ class LoginData { private $rememberLogin = true; public function __construct(IRequest $request, - string $username, - ?string $password, - string $redirectUrl = null, - string $timeZone = '', - string $timeZoneOffset = '') { + string $username, + ?string $password, + string $redirectUrl = null, + string $timeZone = '', + string $timeZoneOffset = '') { $this->request = $request; $this->username = $username; $this->password = $password; diff --git a/lib/private/Authentication/Login/SetUserTimezoneCommand.php b/lib/private/Authentication/Login/SetUserTimezoneCommand.php index f68fce1771e26..881e1c451a9ba 100644 --- a/lib/private/Authentication/Login/SetUserTimezoneCommand.php +++ b/lib/private/Authentication/Login/SetUserTimezoneCommand.php @@ -36,7 +36,7 @@ class SetUserTimezoneCommand extends ALoginCommand { private $session; public function __construct(IConfig $config, - ISession $session) { + ISession $session) { $this->config = $config; $this->session = $session; } diff --git a/lib/private/Authentication/Login/TwoFactorCommand.php b/lib/private/Authentication/Login/TwoFactorCommand.php index 256d88ffa811b..aa5a2ff96f483 100644 --- a/lib/private/Authentication/Login/TwoFactorCommand.php +++ b/lib/private/Authentication/Login/TwoFactorCommand.php @@ -26,12 +26,12 @@ */ namespace OC\Authentication\Login; -use function array_pop; -use function count; use OC\Authentication\TwoFactorAuth\Manager; use OC\Authentication\TwoFactorAuth\MandatoryTwoFactor; use OCP\Authentication\TwoFactorAuth\IProvider; use OCP\IURLGenerator; +use function array_pop; +use function count; class TwoFactorCommand extends ALoginCommand { /** @var Manager */ @@ -44,8 +44,8 @@ class TwoFactorCommand extends ALoginCommand { private $urlGenerator; public function __construct(Manager $twoFactorManager, - MandatoryTwoFactor $mandatoryTwoFactor, - IURLGenerator $urlGenerator) { + MandatoryTwoFactor $mandatoryTwoFactor, + IURLGenerator $urlGenerator) { $this->twoFactorManager = $twoFactorManager; $this->mandatoryTwoFactor = $mandatoryTwoFactor; $this->urlGenerator = $urlGenerator; diff --git a/lib/private/Authentication/Login/UserDisabledCheckCommand.php b/lib/private/Authentication/Login/UserDisabledCheckCommand.php index 7cf4c7235ec19..8354457b56a2b 100644 --- a/lib/private/Authentication/Login/UserDisabledCheckCommand.php +++ b/lib/private/Authentication/Login/UserDisabledCheckCommand.php @@ -38,7 +38,7 @@ class UserDisabledCheckCommand extends ALoginCommand { private $logger; public function __construct(IUserManager $userManager, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->userManager = $userManager; $this->logger = $logger; } diff --git a/lib/private/Authentication/Login/WebAuthnChain.php b/lib/private/Authentication/Login/WebAuthnChain.php index f3ebc313a443f..d0fcf691d4659 100644 --- a/lib/private/Authentication/Login/WebAuthnChain.php +++ b/lib/private/Authentication/Login/WebAuthnChain.php @@ -57,15 +57,15 @@ class WebAuthnChain { private $webAuthnLoginCommand; public function __construct(UserDisabledCheckCommand $userDisabledCheckCommand, - WebAuthnLoginCommand $webAuthnLoginCommand, - LoggedInCheckCommand $loggedInCheckCommand, - CompleteLoginCommand $completeLoginCommand, - CreateSessionTokenCommand $createSessionTokenCommand, - ClearLostPasswordTokensCommand $clearLostPasswordTokensCommand, - UpdateLastPasswordConfirmCommand $updateLastPasswordConfirmCommand, - SetUserTimezoneCommand $setUserTimezoneCommand, - TwoFactorCommand $twoFactorCommand, - FinishRememberedLoginCommand $finishRememberedLoginCommand + WebAuthnLoginCommand $webAuthnLoginCommand, + LoggedInCheckCommand $loggedInCheckCommand, + CompleteLoginCommand $completeLoginCommand, + CreateSessionTokenCommand $createSessionTokenCommand, + ClearLostPasswordTokensCommand $clearLostPasswordTokensCommand, + UpdateLastPasswordConfirmCommand $updateLastPasswordConfirmCommand, + SetUserTimezoneCommand $setUserTimezoneCommand, + TwoFactorCommand $twoFactorCommand, + FinishRememberedLoginCommand $finishRememberedLoginCommand ) { $this->userDisabledCheckCommand = $userDisabledCheckCommand; $this->webAuthnLoginCommand = $webAuthnLoginCommand; diff --git a/lib/private/Authentication/LoginCredentials/Store.php b/lib/private/Authentication/LoginCredentials/Store.php index 3a09e983ee8e6..e1e2994644619 100644 --- a/lib/private/Authentication/LoginCredentials/Store.php +++ b/lib/private/Authentication/LoginCredentials/Store.php @@ -48,8 +48,8 @@ class Store implements IStore { private $tokenProvider; public function __construct(ISession $session, - LoggerInterface $logger, - IProvider $tokenProvider = null) { + LoggerInterface $logger, + IProvider $tokenProvider = null) { $this->session = $session; $this->logger = $logger; $this->tokenProvider = $tokenProvider; diff --git a/lib/private/Authentication/Token/IProvider.php b/lib/private/Authentication/Token/IProvider.php index a12d3ba34d993..4af5e2b25c343 100644 --- a/lib/private/Authentication/Token/IProvider.php +++ b/lib/private/Authentication/Token/IProvider.php @@ -49,12 +49,12 @@ interface IProvider { * @throws \RuntimeException when OpenSSL reports a problem */ public function generateToken(string $token, - string $uid, - string $loginName, - ?string $password, - string $name, - int $type = IToken::TEMPORARY_TOKEN, - int $remember = IToken::DO_NOT_REMEMBER): IToken; + string $uid, + string $loginName, + ?string $password, + string $name, + int $type = IToken::TEMPORARY_TOKEN, + int $remember = IToken::DO_NOT_REMEMBER): IToken; /** * Get a token by token id diff --git a/lib/private/Authentication/Token/Manager.php b/lib/private/Authentication/Token/Manager.php index 6a1c7d4c1e7a5..18ec687cac29a 100644 --- a/lib/private/Authentication/Token/Manager.php +++ b/lib/private/Authentication/Token/Manager.php @@ -55,12 +55,12 @@ public function __construct(PublicKeyTokenProvider $publicKeyTokenProvider) { * @return IToken */ public function generateToken(string $token, - string $uid, - string $loginName, - $password, - string $name, - int $type = IToken::TEMPORARY_TOKEN, - int $remember = IToken::DO_NOT_REMEMBER): IToken { + string $uid, + string $loginName, + $password, + string $name, + int $type = IToken::TEMPORARY_TOKEN, + int $remember = IToken::DO_NOT_REMEMBER): IToken { if (mb_strlen($name) > 128) { $name = mb_substr($name, 0, 120) . '…'; } diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php index 3fb1161107608..a88194726ae78 100644 --- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php +++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php @@ -31,13 +31,13 @@ use OC\Authentication\Exceptions\ExpiredTokenException; use OC\Authentication\Exceptions\InvalidTokenException; -use OC\Authentication\Exceptions\TokenPasswordExpiredException; use OC\Authentication\Exceptions\PasswordlessTokenException; +use OC\Authentication\Exceptions\TokenPasswordExpiredException; use OC\Authentication\Exceptions\WipeTokenException; -use OCP\AppFramework\Db\TTransactional; -use OCP\Cache\CappedMemoryCache; use OCP\AppFramework\Db\DoesNotExistException; +use OCP\AppFramework\Db\TTransactional; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\Cache\CappedMemoryCache; use OCP\IConfig; use OCP\IDBConnection; use OCP\IUserManager; @@ -73,12 +73,12 @@ class PublicKeyTokenProvider implements IProvider { private IHasher $hasher; public function __construct(PublicKeyTokenMapper $mapper, - ICrypto $crypto, - IConfig $config, - IDBConnection $db, - LoggerInterface $logger, - ITimeFactory $time, - IHasher $hasher) { + ICrypto $crypto, + IConfig $config, + IDBConnection $db, + LoggerInterface $logger, + ITimeFactory $time, + IHasher $hasher) { $this->mapper = $mapper; $this->crypto = $crypto; $this->config = $config; @@ -94,12 +94,12 @@ public function __construct(PublicKeyTokenMapper $mapper, * {@inheritDoc} */ public function generateToken(string $token, - string $uid, - string $loginName, - ?string $password, - string $name, - int $type = IToken::TEMPORARY_TOKEN, - int $remember = IToken::DO_NOT_REMEMBER): IToken { + string $uid, + string $loginName, + ?string $password, + string $name, + int $type = IToken::TEMPORARY_TOKEN, + int $remember = IToken::DO_NOT_REMEMBER): IToken { if (strlen($token) < self::TOKEN_MIN_LENGTH) { $exception = new InvalidTokenException('Token is too short, minimum of ' . self::TOKEN_MIN_LENGTH . ' characters is required, ' . strlen($token) . ' characters given'); $this->logger->error('Invalid token provided when generating new token', ['exception' => $exception]); @@ -425,12 +425,12 @@ private function hashTokenWithEmptySecret(string $token): string { * @throws \RuntimeException when OpenSSL reports a problem */ private function newToken(string $token, - string $uid, - string $loginName, - $password, - string $name, - int $type, - int $remember): PublicKeyToken { + string $uid, + string $loginName, + $password, + string $name, + int $type, + int $remember): PublicKeyToken { $dbToken = new PublicKeyToken(); $dbToken->setUid($uid); $dbToken->setLoginName($loginName); diff --git a/lib/private/Authentication/Token/RemoteWipe.php b/lib/private/Authentication/Token/RemoteWipe.php index 5fd01cfbe879c..e4882f678d979 100644 --- a/lib/private/Authentication/Token/RemoteWipe.php +++ b/lib/private/Authentication/Token/RemoteWipe.php @@ -27,14 +27,14 @@ */ namespace OC\Authentication\Token; -use Psr\Log\LoggerInterface; -use function array_filter; use OC\Authentication\Events\RemoteWipeFinished; use OC\Authentication\Events\RemoteWipeStarted; use OC\Authentication\Exceptions\InvalidTokenException; use OC\Authentication\Exceptions\WipeTokenException; use OCP\EventDispatcher\IEventDispatcher; use OCP\IUser; +use Psr\Log\LoggerInterface; +use function array_filter; class RemoteWipe { /** @var IProvider */ @@ -47,8 +47,8 @@ class RemoteWipe { private $logger; public function __construct(IProvider $tokenProvider, - IEventDispatcher $eventDispatcher, - LoggerInterface $logger) { + IEventDispatcher $eventDispatcher, + LoggerInterface $logger) { $this->tokenProvider = $tokenProvider; $this->eventDispatcher = $eventDispatcher; $this->logger = $logger; diff --git a/lib/private/Authentication/TwoFactorAuth/EnforcementState.php b/lib/private/Authentication/TwoFactorAuth/EnforcementState.php index b95128c1e0fe2..91f133d6ad02e 100644 --- a/lib/private/Authentication/TwoFactorAuth/EnforcementState.php +++ b/lib/private/Authentication/TwoFactorAuth/EnforcementState.php @@ -45,8 +45,8 @@ class EnforcementState implements JsonSerializable { * @param string[] $excludedGroups */ public function __construct(bool $enforced, - array $enforcedGroups = [], - array $excludedGroups = []) { + array $enforcedGroups = [], + array $excludedGroups = []) { $this->enforced = $enforced; $this->enforcedGroups = $enforcedGroups; $this->excludedGroups = $excludedGroups; diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php index ff0c33445a2ad..b0bb73c3115b5 100644 --- a/lib/private/Authentication/TwoFactorAuth/Manager.php +++ b/lib/private/Authentication/TwoFactorAuth/Manager.php @@ -89,15 +89,15 @@ class Manager { private $userIsTwoFactorAuthenticated = []; public function __construct(ProviderLoader $providerLoader, - IRegistry $providerRegistry, - MandatoryTwoFactor $mandatoryTwoFactor, - ISession $session, - IConfig $config, - IManager $activityManager, - LoggerInterface $logger, - TokenProvider $tokenProvider, - ITimeFactory $timeFactory, - IEventDispatcher $eventDispatcher) { + IRegistry $providerRegistry, + MandatoryTwoFactor $mandatoryTwoFactor, + ISession $session, + IConfig $config, + IManager $activityManager, + LoggerInterface $logger, + TokenProvider $tokenProvider, + ITimeFactory $timeFactory, + IEventDispatcher $eventDispatcher) { $this->providerLoader = $providerLoader; $this->providerRegistry = $providerRegistry; $this->mandatoryTwoFactor = $mandatoryTwoFactor; diff --git a/lib/private/Authentication/TwoFactorAuth/ProviderSet.php b/lib/private/Authentication/TwoFactorAuth/ProviderSet.php index af270fb83c8b9..4d39fd82bc690 100644 --- a/lib/private/Authentication/TwoFactorAuth/ProviderSet.php +++ b/lib/private/Authentication/TwoFactorAuth/ProviderSet.php @@ -25,9 +25,9 @@ */ namespace OC\Authentication\TwoFactorAuth; -use function array_filter; use OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider; use OCP\Authentication\TwoFactorAuth\IProvider; +use function array_filter; /** * Contains all two-factor provider information for the two-factor login challenge diff --git a/lib/private/Authentication/TwoFactorAuth/Registry.php b/lib/private/Authentication/TwoFactorAuth/Registry.php index 482c025e14415..db7722655836f 100644 --- a/lib/private/Authentication/TwoFactorAuth/Registry.php +++ b/lib/private/Authentication/TwoFactorAuth/Registry.php @@ -45,7 +45,7 @@ class Registry implements IRegistry { private $dispatcher; public function __construct(ProviderUserAssignmentDao $assignmentDao, - IEventDispatcher $dispatcher) { + IEventDispatcher $dispatcher) { $this->assignmentDao = $assignmentDao; $this->dispatcher = $dispatcher; } diff --git a/lib/private/Authentication/WebAuthn/Manager.php b/lib/private/Authentication/WebAuthn/Manager.php index 744a3fa354acf..5a97a573b9945 100644 --- a/lib/private/Authentication/WebAuthn/Manager.php +++ b/lib/private/Authentication/WebAuthn/Manager.php @@ -91,7 +91,7 @@ public function startRegistration(IUser $user, string $serverHost): PublicKeyCre $user->getUID(), //Name $user->getUID(), //ID $user->getDisplayName() //Display name -// 'https://foo.example.co/avatar/123e4567-e89b-12d3-a456-426655440000' //Icon + // 'https://foo.example.co/avatar/123e4567-e89b-12d3-a456-426655440000' //Icon ); $challenge = random_bytes(32); diff --git a/lib/private/Avatar/GuestAvatar.php b/lib/private/Avatar/GuestAvatar.php index 26614cf6cfafe..106e159d192e5 100644 --- a/lib/private/Avatar/GuestAvatar.php +++ b/lib/private/Avatar/GuestAvatar.php @@ -26,8 +26,8 @@ */ namespace OC\Avatar; -use OCP\Files\SimpleFS\ISimpleFile; use OCP\Files\SimpleFS\InMemoryFile; +use OCP\Files\SimpleFS\ISimpleFile; use Psr\Log\LoggerInterface; /** diff --git a/lib/private/BinaryFinder.php b/lib/private/BinaryFinder.php index a7ef55237dba0..17427e9261932 100644 --- a/lib/private/BinaryFinder.php +++ b/lib/private/BinaryFinder.php @@ -22,9 +22,9 @@ namespace OC; +use OCP\IBinaryFinder; use OCP\ICache; use OCP\ICacheFactory; -use OCP\IBinaryFinder; use Symfony\Component\Process\ExecutableFinder; /** diff --git a/lib/private/CapabilitiesManager.php b/lib/private/CapabilitiesManager.php index 7885a98869d6f..6b34b50cb9863 100644 --- a/lib/private/CapabilitiesManager.php +++ b/lib/private/CapabilitiesManager.php @@ -30,8 +30,8 @@ use OCP\AppFramework\QueryException; use OCP\Capabilities\ICapability; -use OCP\Capabilities\IPublicCapability; use OCP\Capabilities\IInitialStateExcludedCapability; +use OCP\Capabilities\IPublicCapability; use Psr\Log\LoggerInterface; class CapabilitiesManager { diff --git a/lib/private/Collaboration/Collaborators/MailPlugin.php b/lib/private/Collaboration/Collaborators/MailPlugin.php index cbdd84efbb368..37ebf2fb129a0 100644 --- a/lib/private/Collaboration/Collaborators/MailPlugin.php +++ b/lib/private/Collaboration/Collaborators/MailPlugin.php @@ -37,8 +37,8 @@ use OCP\IGroupManager; use OCP\IUser; use OCP\IUserSession; -use OCP\Share\IShare; use OCP\Mail\IMailer; +use OCP\Share\IShare; class MailPlugin implements ISearchPlugin { protected bool $shareWithGroupOnly; diff --git a/lib/private/Command/ClosureJob.php b/lib/private/Command/ClosureJob.php index 7216bcc762aed..f7b0ee1a3d3fc 100644 --- a/lib/private/Command/ClosureJob.php +++ b/lib/private/Command/ClosureJob.php @@ -22,8 +22,8 @@ */ namespace OC\Command; -use OC\BackgroundJob\QueuedJob; use Laravel\SerializableClosure\SerializableClosure as LaravelClosure; +use OC\BackgroundJob\QueuedJob; class ClosureJob extends QueuedJob { protected function run($argument) { diff --git a/lib/private/Command/CronBus.php b/lib/private/Command/CronBus.php index 8749ad0bff598..42ff458a95c35 100644 --- a/lib/private/Command/CronBus.php +++ b/lib/private/Command/CronBus.php @@ -25,8 +25,8 @@ */ namespace OC\Command; -use OCP\Command\ICommand; use Laravel\SerializableClosure\SerializableClosure; +use OCP\Command\ICommand; class CronBus extends AsyncBus { /** diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index 725febef85d0d..e92cfddc60b47 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -40,8 +40,8 @@ use OCP\IConfig; use OCP\IDBConnection; use OCP\IEmojiHelper; -use OCP\IUser; use OCP\IInitialStateService; +use OCP\IUser; use OCP\PreConditionNotMetException; use OCP\Util; use Psr\Log\LoggerInterface; @@ -66,11 +66,11 @@ class Manager implements ICommentsManager { protected array $displayNameResolvers = []; public function __construct(IDBConnection $dbConn, - LoggerInterface $logger, - IConfig $config, - ITimeFactory $timeFactory, - IEmojiHelper $emojiHelper, - IInitialStateService $initialStateService) { + LoggerInterface $logger, + IConfig $config, + ITimeFactory $timeFactory, + IEmojiHelper $emojiHelper, + IInitialStateService $initialStateService) { $this->dbConn = $dbConn; $this->logger = $logger; $this->config = $config; @@ -536,8 +536,8 @@ public function getCommentsWithVerbForObjectSinceComment( * @param int $id the comment to look for */ protected function getLastKnownComment(string $objectType, - string $objectId, - int $id): ?IComment { + string $objectId, + int $id): ?IComment { $query = $this->dbConn->getQueryBuilder(); $query->select('*') ->from('comments') diff --git a/lib/private/Console/Application.php b/lib/private/Console/Application.php index a0306c9798ccc..900b2c57f413f 100644 --- a/lib/private/Console/Application.php +++ b/lib/private/Console/Application.php @@ -55,10 +55,10 @@ class Application { private MemoryInfo $memoryInfo; public function __construct(IConfig $config, - IEventDispatcher $dispatcher, - IRequest $request, - LoggerInterface $logger, - MemoryInfo $memoryInfo) { + IEventDispatcher $dispatcher, + IRequest $request, + LoggerInterface $logger, + MemoryInfo $memoryInfo) { $defaults = \OC::$server->getThemingDefaults(); $this->config = $config; $this->application = new SymfonyApplication($defaults->getName(), \OC_Util::getVersionString()); diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index df35e0b5e0dc3..6e2724ca5abc1 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -46,13 +46,13 @@ use Doctrine\DBAL\Result; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Statement; +use OC\DB\QueryBuilder\QueryBuilder; +use OC\SystemConfig; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Diagnostics\IEventLogger; use OCP\IRequestId; use OCP\PreConditionNotMetException; use OCP\Profiler\IProfiler; -use OC\DB\QueryBuilder\QueryBuilder; -use OC\SystemConfig; use Psr\Log\LoggerInterface; class Connection extends \Doctrine\DBAL\Connection { diff --git a/lib/private/DB/Migrator.php b/lib/private/DB/Migrator.php index 1d960e72dc52f..7cf95b040004c 100644 --- a/lib/private/DB/Migrator.php +++ b/lib/private/DB/Migrator.php @@ -35,9 +35,9 @@ use Doctrine\DBAL\Schema\SchemaDiff; use Doctrine\DBAL\Types\StringType; use Doctrine\DBAL\Types\Type; +use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use function preg_match; -use OCP\EventDispatcher\IEventDispatcher; class Migrator { /** @var Connection */ @@ -52,8 +52,8 @@ class Migrator { private $noEmit = false; public function __construct(Connection $connection, - IConfig $config, - ?IEventDispatcher $dispatcher = null) { + IConfig $config, + ?IEventDispatcher $dispatcher = null) { $this->connection = $connection; $this->config = $config; $this->dispatcher = $dispatcher; diff --git a/lib/private/Dashboard/Manager.php b/lib/private/Dashboard/Manager.php index afe28872e6946..5a7e4f3c6dce4 100644 --- a/lib/private/Dashboard/Manager.php +++ b/lib/private/Dashboard/Manager.php @@ -33,8 +33,8 @@ use OCP\Dashboard\IWidget; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; -use Throwable; use Psr\Log\LoggerInterface; +use Throwable; class Manager implements IManager { /** @var array */ diff --git a/lib/private/DirectEditing/Manager.php b/lib/private/DirectEditing/Manager.php index 2dd2abe54085b..d1be1f50330c9 100644 --- a/lib/private/DirectEditing/Manager.php +++ b/lib/private/DirectEditing/Manager.php @@ -25,8 +25,9 @@ */ namespace OC\DirectEditing; -use Doctrine\DBAL\FetchMode; +use \OCP\DirectEditing\IManager; use \OCP\Files\Folder; +use Doctrine\DBAL\FetchMode; use OCP\AppFramework\Http\NotFoundResponse; use OCP\AppFramework\Http\Response; use OCP\AppFramework\Http\TemplateResponse; @@ -34,7 +35,6 @@ use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\DirectEditing\ACreateFromTemplate; use OCP\DirectEditing\IEditor; -use \OCP\DirectEditing\IManager; use OCP\DirectEditing\IToken; use OCP\Encryption\IManager as EncryptionManager; use OCP\Files\File; diff --git a/lib/private/Encryption/EncryptionWrapper.php b/lib/private/Encryption/EncryptionWrapper.php index e58b36565932c..a6bc72ef18f8e 100644 --- a/lib/private/Encryption/EncryptionWrapper.php +++ b/lib/private/Encryption/EncryptionWrapper.php @@ -53,8 +53,8 @@ class EncryptionWrapper { * EncryptionWrapper constructor. */ public function __construct(ArrayCache $arrayCache, - Manager $manager, - LoggerInterface $logger + Manager $manager, + LoggerInterface $logger ) { $this->arrayCache = $arrayCache; $this->manager = $manager; diff --git a/lib/private/Encryption/File.php b/lib/private/Encryption/File.php index daab097ce7c6b..f2b1de2323472 100644 --- a/lib/private/Encryption/File.php +++ b/lib/private/Encryption/File.php @@ -27,9 +27,9 @@ */ namespace OC\Encryption; -use OCP\Cache\CappedMemoryCache; use OCA\Files_External\Service\GlobalStoragesService; use OCP\App\IAppManager; +use OCP\Cache\CappedMemoryCache; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; use OCP\Share\IManager; @@ -47,8 +47,8 @@ class File implements \OCP\Encryption\IFile { private ?IAppManager $appManager = null; public function __construct(Util $util, - IRootFolder $rootFolder, - IManager $shareManager) { + IRootFolder $rootFolder, + IManager $shareManager) { $this->util = $util; $this->cache = new CappedMemoryCache(); $this->rootFolder = $rootFolder; diff --git a/lib/private/Encryption/HookManager.php b/lib/private/Encryption/HookManager.php index 5081bcccf948d..afcb7ce376316 100644 --- a/lib/private/Encryption/HookManager.php +++ b/lib/private/Encryption/HookManager.php @@ -24,8 +24,8 @@ namespace OC\Encryption; use OC\Files\Filesystem; -use OC\Files\View; use OC\Files\SetupManager; +use OC\Files\View; use Psr\Log\LoggerInterface; class HookManager { diff --git a/lib/private/Encryption/Update.php b/lib/private/Encryption/Update.php index 2e390177baf33..1d9ec8510d047 100644 --- a/lib/private/Encryption/Update.php +++ b/lib/private/Encryption/Update.php @@ -62,14 +62,14 @@ class Update { * @param string $uid */ public function __construct( - View $view, - Util $util, - Mount\Manager $mountManager, - Manager $encryptionManager, - File $file, - LoggerInterface $logger, - $uid - ) { + View $view, + Util $util, + Mount\Manager $mountManager, + Manager $encryptionManager, + File $file, + LoggerInterface $logger, + $uid + ) { $this->view = $view; $this->util = $util; $this->mountManager = $mountManager; diff --git a/lib/private/EventDispatcher/EventDispatcher.php b/lib/private/EventDispatcher/EventDispatcher.php index 88c6b2cf32c9b..14c13d516c0e2 100644 --- a/lib/private/EventDispatcher/EventDispatcher.php +++ b/lib/private/EventDispatcher/EventDispatcher.php @@ -27,17 +27,17 @@ */ namespace OC\EventDispatcher; -use OC\Log; -use Psr\Log\LoggerInterface; -use function get_class; use OC\Broadcast\Events\BroadcastEvent; +use OC\Log; use OCP\Broadcast\Events\IBroadcastEvent; use OCP\EventDispatcher\ABroadcastedEvent; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventDispatcher; use OCP\IContainer; use OCP\IServerContainer; +use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcher as SymfonyDispatcher; +use function get_class; class EventDispatcher implements IEventDispatcher { /** @var SymfonyDispatcher */ @@ -50,8 +50,8 @@ class EventDispatcher implements IEventDispatcher { private $logger; public function __construct(SymfonyDispatcher $dispatcher, - IServerContainer $container, - LoggerInterface $logger) { + IServerContainer $container, + LoggerInterface $logger) { $this->dispatcher = $dispatcher; $this->container = $container; $this->logger = $logger; @@ -64,19 +64,19 @@ public function __construct(SymfonyDispatcher $dispatcher, } public function addListener(string $eventName, - callable $listener, - int $priority = 0): void { + callable $listener, + int $priority = 0): void { $this->dispatcher->addListener($eventName, $listener, $priority); } public function removeListener(string $eventName, - callable $listener): void { + callable $listener): void { $this->dispatcher->removeListener($eventName, $listener); } public function addServiceListener(string $eventName, - string $className, - int $priority = 0): void { + string $className, + int $priority = 0): void { $listener = new ServiceEventListener( $this->container, $className, @@ -90,7 +90,7 @@ public function addServiceListener(string $eventName, * @deprecated */ public function dispatch(string $eventName, - Event $event): void { + Event $event): void { $this->dispatcher->dispatch($event, $eventName); if ($event instanceof ABroadcastedEvent && !$event->isPropagationStopped()) { diff --git a/lib/private/EventDispatcher/ServiceEventListener.php b/lib/private/EventDispatcher/ServiceEventListener.php index 21cdf7f8cc21e..a7bbbcd82aa98 100644 --- a/lib/private/EventDispatcher/ServiceEventListener.php +++ b/lib/private/EventDispatcher/ServiceEventListener.php @@ -54,8 +54,8 @@ final class ServiceEventListener { private $service; public function __construct(IServerContainer $container, - string $class, - LoggerInterface $logger) { + string $class, + LoggerInterface $logger) { $this->container = $container; $this->class = $class; $this->logger = $logger; diff --git a/lib/private/Federation/CloudFederationShare.php b/lib/private/Federation/CloudFederationShare.php index 0f79ba521eab6..4b741b28bee0a 100644 --- a/lib/private/Federation/CloudFederationShare.php +++ b/lib/private/Federation/CloudFederationShare.php @@ -57,16 +57,16 @@ class CloudFederationShare implements ICloudFederationShare { * @param string $sharedSecret */ public function __construct($shareWith = '', - $name = '', - $description = '', - $providerId = '', - $owner = '', - $ownerDisplayName = '', - $sharedBy = '', - $sharedByDisplayName = '', - $shareType = '', - $resourceType = '', - $sharedSecret = '' + $name = '', + $description = '', + $providerId = '', + $owner = '', + $ownerDisplayName = '', + $sharedBy = '', + $sharedByDisplayName = '', + $shareType = '', + $resourceType = '', + $sharedSecret = '' ) { $this->setShareWith($shareWith); $this->setResourceName($name); diff --git a/lib/private/Files/AppData/AppData.php b/lib/private/Files/AppData/AppData.php index 237fcb42e0376..1c632c3062f7c 100644 --- a/lib/private/Files/AppData/AppData.php +++ b/lib/private/Files/AppData/AppData.php @@ -26,9 +26,9 @@ */ namespace OC\Files\AppData; -use OCP\Cache\CappedMemoryCache; use OC\Files\SimpleFS\SimpleFolder; use OC\SystemConfig; +use OCP\Cache\CappedMemoryCache; use OCP\Files\Folder; use OCP\Files\IAppData; use OCP\Files\IRootFolder; @@ -53,8 +53,8 @@ class AppData implements IAppData { * @param string $appId */ public function __construct(IRootFolder $rootFolder, - SystemConfig $systemConfig, - string $appId) { + SystemConfig $systemConfig, + string $appId) { $this->rootFolder = $rootFolder; $this->config = $systemConfig; $this->appId = $appId; diff --git a/lib/private/Files/AppData/Factory.php b/lib/private/Files/AppData/Factory.php index 03f8fdedcbd72..a16c3df327dc8 100644 --- a/lib/private/Files/AppData/Factory.php +++ b/lib/private/Files/AppData/Factory.php @@ -39,7 +39,7 @@ class Factory implements IAppDataFactory { private array $folders = []; public function __construct(IRootFolder $rootFolder, - SystemConfig $systemConfig) { + SystemConfig $systemConfig) { $this->rootFolder = $rootFolder; $this->config = $systemConfig; } diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 67d01bb699907..e88725e7ee7f0 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -47,9 +47,9 @@ use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Cache\CacheEntryInsertedEvent; +use OCP\Files\Cache\CacheEntryRemovedEvent; use OCP\Files\Cache\CacheEntryUpdatedEvent; use OCP\Files\Cache\CacheInsertEvent; -use OCP\Files\Cache\CacheEntryRemovedEvent; use OCP\Files\Cache\CacheUpdateEvent; use OCP\Files\Cache\ICache; use OCP\Files\Cache\ICacheEntry; diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php index 074e88e76391f..2711fc8ad19cd 100644 --- a/lib/private/Files/Cache/Scanner.php +++ b/lib/private/Files/Cache/Scanner.php @@ -37,14 +37,14 @@ use Doctrine\DBAL\Exception; use OC\Files\Storage\Wrapper\Encryption; +use OC\Files\Storage\Wrapper\Jail; +use OC\Hooks\BasicEmitter; use OCP\Files\Cache\IScanner; use OCP\Files\ForbiddenException; use OCP\Files\NotFoundException; use OCP\Files\Storage\IReliableEtagStorage; use OCP\IDBConnection; use OCP\Lock\ILockingProvider; -use OC\Files\Storage\Wrapper\Jail; -use OC\Hooks\BasicEmitter; use Psr\Log\LoggerInterface; /** diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 8a6b818d4134d..c53022f229150 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -28,8 +28,8 @@ */ namespace OC\Files\Config; -use OCP\Cache\CappedMemoryCache; use OCA\Files_Sharing\SharedMount; +use OCP\Cache\CappedMemoryCache; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Diagnostics\IEventLogger; use OCP\Files\Config\ICachedMountFileInfo; diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php index 5f7c0c403db6f..9f0d89052be70 100644 --- a/lib/private/Files/Filesystem.php +++ b/lib/private/Files/Filesystem.php @@ -37,9 +37,9 @@ */ namespace OC\Files; -use OCP\Cache\CappedMemoryCache; use OC\Files\Mount\MountPoint; use OC\User\NoUserException; +use OCP\Cache\CappedMemoryCache; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Events\Node\FilesystemTornDownEvent; use OCP\Files\Mount\IMountManager; diff --git a/lib/private/Files/Mount/Manager.php b/lib/private/Files/Mount/Manager.php index 805cce658a678..8f51fb392123d 100644 --- a/lib/private/Files/Mount/Manager.php +++ b/lib/private/Files/Mount/Manager.php @@ -29,10 +29,10 @@ namespace OC\Files\Mount; -use OCP\Cache\CappedMemoryCache; use OC\Files\Filesystem; use OC\Files\SetupManager; use OC\Files\SetupManagerFactory; +use OCP\Cache\CappedMemoryCache; use OCP\Files\Mount\IMountManager; use OCP\Files\Mount\IMountPoint; use OCP\Files\NotFoundException; diff --git a/lib/private/Files/Node/LazyFolder.php b/lib/private/Files/Node/LazyFolder.php index f13cdc0c4f98f..aeae0ed11ef6a 100644 --- a/lib/private/Files/Node/LazyFolder.php +++ b/lib/private/Files/Node/LazyFolder.php @@ -28,8 +28,8 @@ use OC\Files\Filesystem; use OC\Files\Utils\PathHelper; -use OCP\Files\Folder; use OCP\Constants; +use OCP\Files\Folder; use OCP\Files\IRootFolder; use OCP\Files\Mount\IMountPoint; use OCP\Files\NotPermittedException; diff --git a/lib/private/Files/Node/LazyUserFolder.php b/lib/private/Files/Node/LazyUserFolder.php index 503b0af89214e..917ab80f3666f 100644 --- a/lib/private/Files/Node/LazyUserFolder.php +++ b/lib/private/Files/Node/LazyUserFolder.php @@ -23,13 +23,13 @@ namespace OC\Files\Node; -use OCP\Files\FileInfo; use OCP\Constants; +use OCP\Files\File; +use OCP\Files\FileInfo; +use OCP\Files\Folder; use OCP\Files\IRootFolder; use OCP\Files\Mount\IMountManager; use OCP\Files\NotFoundException; -use OCP\Files\Folder; -use OCP\Files\File; use OCP\IUser; use Psr\Log\LoggerInterface; diff --git a/lib/private/Files/Node/Root.php b/lib/private/Files/Node/Root.php index 7bd88981ff2f3..4d024a674701c 100644 --- a/lib/private/Files/Node/Root.php +++ b/lib/private/Files/Node/Root.php @@ -32,7 +32,6 @@ namespace OC\Files\Node; -use OCP\Cache\CappedMemoryCache; use OC\Files\FileInfo; use OC\Files\Mount\Manager; use OC\Files\Mount\MountPoint; @@ -40,6 +39,7 @@ use OC\Files\View; use OC\Hooks\PublicEmitter; use OC\User\NoUserException; +use OCP\Cache\CappedMemoryCache; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Config\IUserMountCache; use OCP\Files\Events\Node\FilesystemTornDownEvent; diff --git a/lib/private/Files/SimpleFS/SimpleFolder.php b/lib/private/Files/SimpleFS/SimpleFolder.php index 4d24aa138c13c..2c1f23f8e44f9 100644 --- a/lib/private/Files/SimpleFS/SimpleFolder.php +++ b/lib/private/Files/SimpleFS/SimpleFolder.php @@ -28,8 +28,8 @@ use OCP\Files\Folder; use OCP\Files\Node; use OCP\Files\NotFoundException; -use OCP\Files\SimpleFS\ISimpleFolder; use OCP\Files\SimpleFS\ISimpleFile; +use OCP\Files\SimpleFS\ISimpleFolder; class SimpleFolder implements ISimpleFolder { /** @var Folder */ diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index 2d2bb52635be1..35add2c606b42 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -55,11 +55,11 @@ use OCP\IConfig; use OCP\Util; use Psr\Http\Message\ResponseInterface; +use Psr\Log\LoggerInterface; use Sabre\DAV\Client; use Sabre\DAV\Xml\Property\ResourceType; use Sabre\HTTP\ClientException; use Sabre\HTTP\ClientHttpException; -use Psr\Log\LoggerInterface; use Sabre\HTTP\RequestInterface; /** diff --git a/lib/private/Files/Storage/Wrapper/Encoding.php b/lib/private/Files/Storage/Wrapper/Encoding.php index 6633cbf41e340..1bdb0e39f1433 100644 --- a/lib/private/Files/Storage/Wrapper/Encoding.php +++ b/lib/private/Files/Storage/Wrapper/Encoding.php @@ -28,8 +28,8 @@ */ namespace OC\Files\Storage\Wrapper; -use OCP\Cache\CappedMemoryCache; use OC\Files\Filesystem; +use OCP\Cache\CappedMemoryCache; use OCP\Files\Storage\IStorage; use OCP\ICache; diff --git a/lib/private/Files/Stream/Encryption.php b/lib/private/Files/Stream/Encryption.php index bcf0a10740b87..895126653f783 100644 --- a/lib/private/Files/Stream/Encryption.php +++ b/lib/private/Files/Stream/Encryption.php @@ -153,18 +153,18 @@ public function __construct() { * @throws \BadMethodCallException */ public static function wrap($source, $internalPath, $fullPath, array $header, - $uid, - \OCP\Encryption\IEncryptionModule $encryptionModule, - \OC\Files\Storage\Storage $storage, - \OC\Files\Storage\Wrapper\Encryption $encStorage, - \OC\Encryption\Util $util, - \OC\Encryption\File $file, - $mode, - $size, - $unencryptedSize, - $headerSize, - $signed, - $wrapper = Encryption::class) { + $uid, + \OCP\Encryption\IEncryptionModule $encryptionModule, + \OC\Files\Storage\Storage $storage, + \OC\Files\Storage\Wrapper\Encryption $encStorage, + \OC\Encryption\Util $util, + \OC\Encryption\File $file, + $mode, + $size, + $unencryptedSize, + $headerSize, + $signed, + $wrapper = Encryption::class) { $context = stream_context_create([ 'ocencryption' => [ 'source' => $source, @@ -321,7 +321,7 @@ public function stream_read($count) { $result .= substr($this->cache, $blockPosition, $remainingLength); $this->position += $remainingLength; $count = 0; - // otherwise remainder of current block is fetched, the block is flushed and the position updated + // otherwise remainder of current block is fetched, the block is flushed and the position updated } else { $result .= substr($this->cache, $blockPosition); $this->flush(); @@ -389,8 +389,8 @@ public function stream_write($data) { $this->position += $remainingLength; $length += $remainingLength; $data = ''; - // if $data doesn't fit the current block, the fill the current block and reiterate - // after the block is filled, it is flushed and $data is updatedxxx + // if $data doesn't fit the current block, the fill the current block and reiterate + // after the block is filled, it is flushed and $data is updatedxxx } else { $this->cache = substr($this->cache, 0, $blockPosition) . substr($data, 0, $this->unencryptedBlockSize - $blockPosition); diff --git a/lib/private/Files/Template/TemplateManager.php b/lib/private/Files/Template/TemplateManager.php index bf72e9e23e808..0323785bfc411 100644 --- a/lib/private/Files/Template/TemplateManager.php +++ b/lib/private/Files/Template/TemplateManager.php @@ -31,8 +31,8 @@ use OC\Files\Cache\Scanner; use OC\Files\Filesystem; use OCP\EventDispatcher\IEventDispatcher; -use OCP\Files\Folder; use OCP\Files\File; +use OCP\Files\Folder; use OCP\Files\GenericFileException; use OCP\Files\IRootFolder; use OCP\Files\Node; diff --git a/lib/private/Files/Type/Detection.php b/lib/private/Files/Type/Detection.php index 9a61aa93b9580..71b8cb986d71a 100644 --- a/lib/private/Files/Type/Detection.php +++ b/lib/private/Files/Type/Detection.php @@ -75,9 +75,9 @@ class Detection implements IMimeTypeDetector { private $defaultConfigDir; public function __construct(IURLGenerator $urlGenerator, - LoggerInterface $logger, - string $customConfigDir, - string $defaultConfigDir) { + LoggerInterface $logger, + string $customConfigDir, + string $defaultConfigDir) { $this->urlGenerator = $urlGenerator; $this->logger = $logger; $this->customConfigDir = $customConfigDir; @@ -96,8 +96,8 @@ public function __construct(IURLGenerator $urlGenerator, * @param string|null $secureMimeType */ public function registerType(string $extension, - string $mimetype, - ?string $secureMimeType = null): void { + string $mimetype, + ?string $secureMimeType = null): void { $this->mimetypes[$extension] = [$mimetype, $secureMimeType]; $this->secureMimeTypes[$mimetype] = $secureMimeType ?: $mimetype; } diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index b7f6972ee1082..226e5462b3409 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -41,11 +41,11 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Events\BeforeFileScannedEvent; use OCP\Files\Events\BeforeFolderScannedEvent; -use OCP\Files\Events\NodeAddedToCache; use OCP\Files\Events\FileCacheUpdated; -use OCP\Files\Events\NodeRemovedFromCache; use OCP\Files\Events\FileScannedEvent; use OCP\Files\Events\FolderScannedEvent; +use OCP\Files\Events\NodeAddedToCache; +use OCP\Files\Events\NodeRemovedFromCache; use OCP\Files\NotFoundException; use OCP\Files\Storage\IStorage; use OCP\Files\StorageNotAvailableException; diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 86651ab3e1a86..15edc4b61f39d 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -49,10 +49,10 @@ use Icewind\Streams\CallbackWrapper; use OC\Files\Mount\MoveableMount; use OC\Files\Storage\Storage; -use OC\User\LazyUser; use OC\Share\Share; -use OC\User\User; +use OC\User\LazyUser; use OC\User\Manager as UserManager; +use OC\User\User; use OCA\Files_Sharing\SharedMount; use OCP\Constants; use OCP\Files\Cache\ICacheEntry; @@ -798,14 +798,14 @@ public function rename($source, $target) { } else { $result = false; } - // moving a file/folder within the same mount point + // moving a file/folder within the same mount point } elseif ($storage1 === $storage2) { if ($storage1) { $result = $storage1->rename($internalPath1, $internalPath2); } else { $result = false; } - // moving a file/folder between storages (from $storage1 to $storage2) + // moving a file/folder between storages (from $storage1 to $storage2) } else { $result = $storage2->moveFromStorage($storage1, $internalPath1, $internalPath2); } diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php index 55792ce1dff19..13837eef55294 100644 --- a/lib/private/Group/Database.php +++ b/lib/private/Group/Database.php @@ -30,6 +30,7 @@ namespace OC\Group; use Doctrine\DBAL\Exception\UniqueConstraintViolationException; +use OC\User\LazyUser; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Group\Backend\ABackend; use OCP\Group\Backend\IAddToGroupBackend; @@ -40,13 +41,12 @@ use OCP\Group\Backend\IDeleteGroupBackend; use OCP\Group\Backend\IGetDisplayNameBackend; use OCP\Group\Backend\IGroupDetailsBackend; +use OCP\Group\Backend\INamedBackend; use OCP\Group\Backend\IRemoveFromGroupBackend; use OCP\Group\Backend\ISearchableGroupBackend; use OCP\Group\Backend\ISetDisplayNameBackend; -use OCP\Group\Backend\INamedBackend; use OCP\IDBConnection; use OCP\IUserManager; -use OC\User\LazyUser; /** * Class for group management in a SQL Database (e.g. MySQL, SQLite) diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php index 441ee64604d5d..f19a8aebe6a9f 100644 --- a/lib/private/Group/Group.php +++ b/lib/private/Group/Group.php @@ -35,13 +35,6 @@ use OC\Hooks\PublicEmitter; use OC\User\LazyUser; use OCP\EventDispatcher\IEventDispatcher; -use OCP\Group\Events\BeforeGroupDeletedEvent; -use OCP\Group\Events\BeforeUserAddedEvent; -use OCP\Group\Events\BeforeUserRemovedEvent; -use OCP\Group\Events\GroupDeletedEvent; -use OCP\Group\Events\UserAddedEvent; -use OCP\Group\Events\UserRemovedEvent; -use OCP\GroupInterface; use OCP\Group\Backend\ICountDisabledInGroup; use OCP\Group\Backend\IGetDisplayNameBackend; use OCP\Group\Backend\IHideFromCollaborationBackend; @@ -49,7 +42,14 @@ use OCP\Group\Backend\ISearchableGroupBackend; use OCP\Group\Backend\ISetDisplayNameBackend; use OCP\Group\Events\BeforeGroupChangedEvent; +use OCP\Group\Events\BeforeGroupDeletedEvent; +use OCP\Group\Events\BeforeUserAddedEvent; +use OCP\Group\Events\BeforeUserRemovedEvent; use OCP\Group\Events\GroupChangedEvent; +use OCP\Group\Events\GroupDeletedEvent; +use OCP\Group\Events\UserAddedEvent; +use OCP\Group\Events\UserRemovedEvent; +use OCP\GroupInterface; use OCP\IGroup; use OCP\IUser; use OCP\IUserManager; diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index 47475121ea0cf..35f686bcbd4d5 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -89,9 +89,9 @@ class Manager extends PublicEmitter implements IGroupManager { private DisplayNameCache $displayNameCache; public function __construct(\OC\User\Manager $userManager, - IEventDispatcher $dispatcher, - LoggerInterface $logger, - ICacheFactory $cacheFactory) { + IEventDispatcher $dispatcher, + LoggerInterface $logger, + ICacheFactory $cacheFactory) { $this->userManager = $userManager; $this->dispatcher = $dispatcher; $this->logger = $logger; diff --git a/lib/private/Group/MetaData.php b/lib/private/Group/MetaData.php index a58d7e78bfcdc..973db13472874 100644 --- a/lib/private/Group/MetaData.php +++ b/lib/private/Group/MetaData.php @@ -57,11 +57,11 @@ class MetaData { * @param bool $isAdmin whether the current users is an admin */ public function __construct( - string $user, - bool $isAdmin, - IGroupManager $groupManager, - IUserSession $userSession - ) { + string $user, + bool $isAdmin, + IGroupManager $groupManager, + IUserSession $userSession + ) { $this->user = $user; $this->isAdmin = $isAdmin; $this->groupManager = $groupManager; diff --git a/lib/private/Http/CookieHelper.php b/lib/private/Http/CookieHelper.php index 720a1e9185d5e..eedb6e05c39aa 100644 --- a/lib/private/Http/CookieHelper.php +++ b/lib/private/Http/CookieHelper.php @@ -33,13 +33,13 @@ class CookieHelper { public const SAMESITE_STRICT = 2; public static function setCookie(string $name, - string $value = '', - int $maxAge = 0, - string $path = '', - string $domain = '', - bool $secure = false, - bool $httponly = false, - int $samesite = self::SAMESITE_NONE) { + string $value = '', + int $maxAge = 0, + string $path = '', + string $domain = '', + bool $secure = false, + bool $httponly = false, + int $samesite = self::SAMESITE_NONE) { $header = sprintf( 'Set-Cookie: %s=%s', $name, diff --git a/lib/private/Http/WellKnown/RequestManager.php b/lib/private/Http/WellKnown/RequestManager.php index b83ff2ada5091..783b04c0f5d2e 100644 --- a/lib/private/Http/WellKnown/RequestManager.php +++ b/lib/private/Http/WellKnown/RequestManager.php @@ -49,8 +49,8 @@ class RequestManager { private $logger; public function __construct(Coordinator $coordinator, - IServerContainer $container, - LoggerInterface $logger) { + IServerContainer $container, + LoggerInterface $logger) { $this->coordinator = $coordinator; $this->container = $container; $this->logger = $logger; diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php index a2ff62e407070..a5dec637bdba8 100644 --- a/lib/private/IntegrityCheck/Checker.php +++ b/lib/private/IntegrityCheck/Checker.php @@ -83,12 +83,12 @@ class Checker { * @param IMimeTypeDetector $mimeTypeDetector */ public function __construct(EnvironmentHelper $environmentHelper, - FileAccessHelper $fileAccessHelper, - AppLocator $appLocator, - ?IConfig $config, - ICacheFactory $cacheFactory, - ?IAppManager $appManager, - IMimeTypeDetector $mimeTypeDetector) { + FileAccessHelper $fileAccessHelper, + AppLocator $appLocator, + ?IConfig $config, + ICacheFactory $cacheFactory, + ?IAppManager $appManager, + IMimeTypeDetector $mimeTypeDetector) { $this->environmentHelper = $environmentHelper; $this->fileAccessHelper = $fileAccessHelper; $this->appLocator = $appLocator; @@ -161,7 +161,7 @@ private function getFolderIterator(string $folderToIterate, string $root = ''): * @return array Array of hashes. */ private function generateHashes(\RecursiveIteratorIterator $iterator, - string $path): array { + string $path): array { $hashes = []; $baseDirectoryLength = \strlen($path); @@ -223,8 +223,8 @@ private function generateHashes(\RecursiveIteratorIterator $iterator, * @return array */ private function createSignatureData(array $hashes, - X509 $certificate, - RSA $privateKey): array { + X509 $certificate, + RSA $privateKey): array { ksort($hashes); $privateKey->setSignatureMode(RSA::SIGNATURE_PSS); @@ -249,8 +249,8 @@ private function createSignatureData(array $hashes, * @throws \Exception */ public function writeAppSignature($path, - X509 $certificate, - RSA $privateKey) { + X509 $certificate, + RSA $privateKey) { $appInfoDir = $path . '/appinfo'; try { $this->fileAccessHelper->assertDirectoryExists($appInfoDir); @@ -279,8 +279,8 @@ public function writeAppSignature($path, * @throws \Exception */ public function writeCoreSignature(X509 $certificate, - RSA $rsa, - $path) { + RSA $rsa, + $path) { $coreDir = $path . '/core'; try { $this->fileAccessHelper->assertDirectoryExists($coreDir); diff --git a/lib/private/Log.php b/lib/private/Log.php index d6750491d92a8..edce5004fb7c8 100644 --- a/lib/private/Log.php +++ b/lib/private/Log.php @@ -38,6 +38,8 @@ use Exception; use Nextcloud\LogNormalizer\Normalizer; +use OC\AppFramework\Bootstrap\Coordinator; +use OC\Log\ExceptionSerializer; use OCP\EventDispatcher\IEventDispatcher; use OCP\ILogger; use OCP\IUserSession; @@ -46,8 +48,6 @@ use OCP\Log\IFileBased; use OCP\Log\IWriter; use OCP\Support\CrashReport\IRegistry; -use OC\AppFramework\Bootstrap\Coordinator; -use OC\Log\ExceptionSerializer; use Throwable; use function array_merge; use function strtr; diff --git a/lib/private/Memcache/Factory.php b/lib/private/Memcache/Factory.php index 788a7c2e8c91a..93b33b56a53f6 100644 --- a/lib/private/Memcache/Factory.php +++ b/lib/private/Memcache/Factory.php @@ -31,10 +31,10 @@ */ namespace OC\Memcache; -use OCP\Profiler\IProfiler; use OCP\ICache; use OCP\ICacheFactory; use OCP\IMemcache; +use OCP\Profiler\IProfiler; use Psr\Log\LoggerInterface; class Factory implements ICacheFactory { diff --git a/lib/private/Metadata/FileEventListener.php b/lib/private/Metadata/FileEventListener.php index 162e85ff3aa9d..904142bfc6295 100644 --- a/lib/private/Metadata/FileEventListener.php +++ b/lib/private/Metadata/FileEventListener.php @@ -28,9 +28,9 @@ use OCP\Files\Events\Node\NodeWrittenEvent; use OCP\Files\Events\NodeRemovedFromCache; use OCP\Files\File; +use OCP\Files\FileInfo; use OCP\Files\Node; use OCP\Files\NotFoundException; -use OCP\Files\FileInfo; use Psr\Log\LoggerInterface; /** diff --git a/lib/private/Metadata/FileMetadataMapper.php b/lib/private/Metadata/FileMetadataMapper.php index 003ab13126e88..fcdf58ad6443e 100644 --- a/lib/private/Metadata/FileMetadataMapper.php +++ b/lib/private/Metadata/FileMetadataMapper.php @@ -23,9 +23,9 @@ namespace OC\Metadata; use OCP\AppFramework\Db\DoesNotExistException; +use OCP\AppFramework\Db\Entity; use OCP\AppFramework\Db\MultipleObjectsReturnedException; use OCP\AppFramework\Db\QBMapper; -use OCP\AppFramework\Db\Entity; use OCP\DB\Exception; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; diff --git a/lib/private/Migration/BackgroundRepair.php b/lib/private/Migration/BackgroundRepair.php index 579ba494e589c..da3da51fc5f31 100644 --- a/lib/private/Migration/BackgroundRepair.php +++ b/lib/private/Migration/BackgroundRepair.php @@ -26,13 +26,13 @@ */ namespace OC\Migration; +use OC\NeedsUpdateException; +use OC\Repair; +use OC_App; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJobList; use OCP\BackgroundJob\TimedJob; use OCP\EventDispatcher\IEventDispatcher; -use OC\NeedsUpdateException; -use OC\Repair; -use OC_App; use Psr\Log\LoggerInterface; /** diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php index a651cde379d7f..418f8fc96724a 100644 --- a/lib/private/NavigationManager.php +++ b/lib/private/NavigationManager.php @@ -67,11 +67,11 @@ class NavigationManager implements INavigationManager { private $config; public function __construct(IAppManager $appManager, - IURLGenerator $urlGenerator, - IFactory $l10nFac, - IUserSession $userSession, - IGroupManager $groupManager, - IConfig $config) { + IURLGenerator $urlGenerator, + IFactory $l10nFac, + IUserSession $userSession, + IGroupManager $groupManager, + IConfig $config) { $this->appManager = $appManager; $this->urlGenerator = $urlGenerator; $this->l10nFac = $l10nFac; diff --git a/lib/private/Notification/Manager.php b/lib/private/Notification/Manager.php index 3d77f643d935f..e81b6c4fa3563 100644 --- a/lib/private/Notification/Manager.php +++ b/lib/private/Notification/Manager.php @@ -74,11 +74,11 @@ class Manager implements IManager { private $parsedRegistrationContext; public function __construct(IValidator $validator, - IUserManager $userManager, - ICacheFactory $cacheFactory, - IRegistry $subscription, - LoggerInterface $logger, - Coordinator $coordinator) { + IUserManager $userManager, + ICacheFactory $cacheFactory, + IRegistry $subscription, + LoggerInterface $logger, + Coordinator $coordinator) { $this->validator = $validator; $this->userManager = $userManager; $this->cache = $cacheFactory->createDistributed('notifications'); diff --git a/lib/private/OCS/DiscoveryService.php b/lib/private/OCS/DiscoveryService.php index 8f98ff7d5aeb7..f53d39465e8fc 100644 --- a/lib/private/OCS/DiscoveryService.php +++ b/lib/private/OCS/DiscoveryService.php @@ -47,7 +47,7 @@ class DiscoveryService implements IDiscoveryService { * @param IClientService $clientService */ public function __construct(ICacheFactory $cacheFactory, - IClientService $clientService + IClientService $clientService ) { $this->cache = $cacheFactory->createDistributed('ocs-discovery'); $this->client = $clientService->newClient(); diff --git a/lib/private/OCS/Provider.php b/lib/private/OCS/Provider.php index 5e7a86a134118..83219c018f8d1 100644 --- a/lib/private/OCS/Provider.php +++ b/lib/private/OCS/Provider.php @@ -34,8 +34,8 @@ class Provider extends \OCP\AppFramework\Controller { * @param \OCP\App\IAppManager $appManager */ public function __construct($appName, - \OCP\IRequest $request, - \OCP\App\IAppManager $appManager) { + \OCP\IRequest $request, + \OCP\App\IAppManager $appManager) { parent::__construct($appName, $request); $this->appManager = $appManager; } diff --git a/lib/private/Preview/BackgroundCleanupJob.php b/lib/private/Preview/BackgroundCleanupJob.php index 4eba96d1a827d..4376cc06eca27 100644 --- a/lib/private/Preview/BackgroundCleanupJob.php +++ b/lib/private/Preview/BackgroundCleanupJob.php @@ -48,10 +48,10 @@ class BackgroundCleanupJob extends TimedJob { private $mimeTypeLoader; public function __construct(ITimeFactory $timeFactory, - IDBConnection $connection, - Root $previewFolder, - IMimeTypeLoader $mimeTypeLoader, - bool $isCLI) { + IDBConnection $connection, + Root $previewFolder, + IMimeTypeLoader $mimeTypeLoader, + bool $isCLI) { parent::__construct($timeFactory); // Run at most once an hour $this->setInterval(3600); diff --git a/lib/private/Preview/Imaginary.php b/lib/private/Preview/Imaginary.php index 7184f7e9e76a3..273f861a321da 100644 --- a/lib/private/Preview/Imaginary.php +++ b/lib/private/Preview/Imaginary.php @@ -23,13 +23,13 @@ namespace OC\Preview; +use OC\StreamImage; use OCP\Files\File; use OCP\Http\Client\IClientService; use OCP\IConfig; use OCP\IImage; -use OCP\Image; -use OC\StreamImage; +use OCP\Image; use Psr\Log\LoggerInterface; class Imaginary extends ProviderV2 { diff --git a/lib/private/Preview/WatcherConnector.php b/lib/private/Preview/WatcherConnector.php index ffbdf825211f1..b11a6ab86daf7 100644 --- a/lib/private/Preview/WatcherConnector.php +++ b/lib/private/Preview/WatcherConnector.php @@ -43,7 +43,7 @@ class WatcherConnector { * @param SystemConfig $config */ public function __construct(IRootFolder $root, - SystemConfig $config) { + SystemConfig $config) { $this->root = $root; $this->config = $config; } diff --git a/lib/private/Profile/Actions/FediverseAction.php b/lib/private/Profile/Actions/FediverseAction.php index 30682ba6b2a0c..5c5fd7c275ddd 100644 --- a/lib/private/Profile/Actions/FediverseAction.php +++ b/lib/private/Profile/Actions/FediverseAction.php @@ -26,12 +26,12 @@ namespace OC\Profile\Actions; -use function Safe\substr; use OCP\Accounts\IAccountManager; use OCP\IURLGenerator; use OCP\IUser; use OCP\L10N\IFactory; use OCP\Profile\ILinkAction; +use function Safe\substr; class FediverseAction implements ILinkAction { private string $value = ''; diff --git a/lib/private/Profile/Actions/TwitterAction.php b/lib/private/Profile/Actions/TwitterAction.php index 178bd04c78679..d9a17d5fab51b 100644 --- a/lib/private/Profile/Actions/TwitterAction.php +++ b/lib/private/Profile/Actions/TwitterAction.php @@ -26,12 +26,12 @@ namespace OC\Profile\Actions; -use function Safe\substr; use OCP\Accounts\IAccountManager; use OCP\IURLGenerator; use OCP\IUser; use OCP\L10N\IFactory; use OCP\Profile\ILinkAction; +use function Safe\substr; class TwitterAction implements ILinkAction { private string $value = ''; diff --git a/lib/private/Profile/ProfileManager.php b/lib/private/Profile/ProfileManager.php index 8fa652712055e..54d33ebe99a8f 100644 --- a/lib/private/Profile/ProfileManager.php +++ b/lib/private/Profile/ProfileManager.php @@ -26,28 +26,28 @@ namespace OC\Profile; -use function Safe\array_flip; -use function Safe\usort; use OC\AppFramework\Bootstrap\Coordinator; use OC\Core\Db\ProfileConfig; use OC\Core\Db\ProfileConfigMapper; use OC\KnownUser\KnownUserService; use OC\Profile\Actions\EmailAction; +use OC\Profile\Actions\FediverseAction; use OC\Profile\Actions\PhoneAction; use OC\Profile\Actions\TwitterAction; -use OC\Profile\Actions\FediverseAction; use OC\Profile\Actions\WebsiteAction; use OCP\Accounts\IAccountManager; use OCP\Accounts\PropertyDoesNotExistException; use OCP\App\IAppManager; use OCP\AppFramework\Db\DoesNotExistException; +use OCP\Cache\CappedMemoryCache; use OCP\IConfig; use OCP\IUser; use OCP\L10N\IFactory; use OCP\Profile\ILinkAction; -use OCP\Cache\CappedMemoryCache; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; +use function Safe\array_flip; +use function Safe\usort; class ProfileManager { /** @var ILinkAction[] */ diff --git a/lib/private/Profiler/Profiler.php b/lib/private/Profiler/Profiler.php index 40050b7bf4388..d6749c55e3c20 100644 --- a/lib/private/Profiler/Profiler.php +++ b/lib/private/Profiler/Profiler.php @@ -27,11 +27,11 @@ namespace OC\Profiler; use OC\AppFramework\Http\Request; +use OC\SystemConfig; use OCP\AppFramework\Http\Response; use OCP\DataCollector\IDataCollector; -use OCP\Profiler\IProfiler; use OCP\Profiler\IProfile; -use OC\SystemConfig; +use OCP\Profiler\IProfiler; class Profiler implements IProfiler { /** @var array */ @@ -95,7 +95,7 @@ public function collect(Request $request, Response $response): IProfile { * @return array[] */ public function find(?string $url, ?int $limit, ?string $method, ?int $start, ?int $end, - string $statusCode = null): array { + string $statusCode = null): array { if ($this->storage) { return $this->storage->find($url, $limit, $method, $start, $end, $statusCode); } else { diff --git a/lib/private/Repair.php b/lib/private/Repair.php index 5c68c1069938e..5e828ea85451a 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -34,19 +34,13 @@ */ namespace OC; -use OC\Repair\AddRemoveOldTasksBackgroundJob; -use OC\Repair\CleanUpAbandonedApps; -use OCP\AppFramework\QueryException; -use OCP\AppFramework\Utility\ITimeFactory; -use OCP\Collaboration\Resources\IManager; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\Migration\IOutput; -use OCP\Migration\IRepairStep; use OC\DB\Connection; use OC\DB\ConnectionAdapter; use OC\Repair\AddBruteForceCleanupJob; use OC\Repair\AddCleanupUpdaterBackupsJob; +use OC\Repair\AddRemoveOldTasksBackgroundJob; use OC\Repair\CleanTags; +use OC\Repair\CleanUpAbandonedApps; use OC\Repair\ClearFrontendCaches; use OC\Repair\ClearGeneratedAvatarCache; use OC\Repair\Collation; @@ -85,6 +79,12 @@ use OC\Repair\RepairInvalidShares; use OC\Repair\RepairMimeTypes; use OC\Template\JSCombiner; +use OCP\AppFramework\QueryException; +use OCP\AppFramework\Utility\ITimeFactory; +use OCP\Collaboration\Resources\IManager; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\Migration\IOutput; +use OCP\Migration\IRepairStep; use Psr\Log\LoggerInterface; use Throwable; diff --git a/lib/private/Repair/ClearFrontendCaches.php b/lib/private/Repair/ClearFrontendCaches.php index bf94e5bfbffae..3661560c5f6ba 100644 --- a/lib/private/Repair/ClearFrontendCaches.php +++ b/lib/private/Repair/ClearFrontendCaches.php @@ -37,7 +37,7 @@ class ClearFrontendCaches implements IRepairStep { protected $jsCombiner; public function __construct(ICacheFactory $cacheFactory, - JSCombiner $JSCombiner) { + JSCombiner $JSCombiner) { $this->cacheFactory = $cacheFactory; $this->jsCombiner = $JSCombiner; } diff --git a/lib/private/Repair/ClearGeneratedAvatarCache.php b/lib/private/Repair/ClearGeneratedAvatarCache.php index fb3b42847dcc6..88b2b07ead554 100644 --- a/lib/private/Repair/ClearGeneratedAvatarCache.php +++ b/lib/private/Repair/ClearGeneratedAvatarCache.php @@ -25,8 +25,8 @@ namespace OC\Repair; use OC\Avatar\AvatarManager; -use OCP\IConfig; use OCP\BackgroundJob\IJobList; +use OCP\IConfig; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; diff --git a/lib/private/Repair/ClearGeneratedAvatarCacheJob.php b/lib/private/Repair/ClearGeneratedAvatarCacheJob.php index e8513e7a933d7..5caa74638e5a7 100644 --- a/lib/private/Repair/ClearGeneratedAvatarCacheJob.php +++ b/lib/private/Repair/ClearGeneratedAvatarCacheJob.php @@ -20,9 +20,9 @@ */ namespace OC\Repair; -use OCP\BackgroundJob\QueuedJob; -use OCP\AppFramework\Utility\ITimeFactory; use OC\Avatar\AvatarManager; +use OCP\AppFramework\Utility\ITimeFactory; +use OCP\BackgroundJob\QueuedJob; class ClearGeneratedAvatarCacheJob extends QueuedJob { protected AvatarManager $avatarManager; diff --git a/lib/private/Repair/NC18/ResetGeneratedAvatarFlag.php b/lib/private/Repair/NC18/ResetGeneratedAvatarFlag.php index d5ae1d7ab63a9..185ff3be1be99 100644 --- a/lib/private/Repair/NC18/ResetGeneratedAvatarFlag.php +++ b/lib/private/Repair/NC18/ResetGeneratedAvatarFlag.php @@ -37,7 +37,7 @@ class ResetGeneratedAvatarFlag implements IRepairStep { private $connection; public function __construct(IConfig $config, - IDBConnection $connection) { + IDBConnection $connection) { $this->config = $config; $this->connection = $connection; } diff --git a/lib/private/Repair/NC20/EncryptionLegacyCipher.php b/lib/private/Repair/NC20/EncryptionLegacyCipher.php index a7d008e87beda..42a8778662b18 100644 --- a/lib/private/Repair/NC20/EncryptionLegacyCipher.php +++ b/lib/private/Repair/NC20/EncryptionLegacyCipher.php @@ -38,7 +38,7 @@ class EncryptionLegacyCipher implements IRepairStep { private $manager; public function __construct(IConfig $config, - IManager $manager) { + IManager $manager) { $this->config = $config; $this->manager = $manager; } diff --git a/lib/private/Repair/NC20/EncryptionMigration.php b/lib/private/Repair/NC20/EncryptionMigration.php index 239a62c271806..dea51b1b57eaf 100644 --- a/lib/private/Repair/NC20/EncryptionMigration.php +++ b/lib/private/Repair/NC20/EncryptionMigration.php @@ -38,7 +38,7 @@ class EncryptionMigration implements IRepairStep { private $manager; public function __construct(IConfig $config, - IManager $manager) { + IManager $manager) { $this->config = $config; $this->manager = $manager; } diff --git a/lib/private/Repair/NC21/ValidatePhoneNumber.php b/lib/private/Repair/NC21/ValidatePhoneNumber.php index b3534dbeae8d4..51120c9d1399d 100644 --- a/lib/private/Repair/NC21/ValidatePhoneNumber.php +++ b/lib/private/Repair/NC21/ValidatePhoneNumber.php @@ -42,8 +42,8 @@ class ValidatePhoneNumber implements IRepairStep { private $accountManager; public function __construct(IUserManager $userManager, - IAccountManager $accountManager, - IConfig $config) { + IAccountManager $accountManager, + IConfig $config) { $this->config = $config; $this->userManager = $userManager; $this->accountManager = $accountManager; diff --git a/lib/private/Repair/Owncloud/CleanPreviews.php b/lib/private/Repair/Owncloud/CleanPreviews.php index 853a94c8adccf..2020ae8bfc11d 100644 --- a/lib/private/Repair/Owncloud/CleanPreviews.php +++ b/lib/private/Repair/Owncloud/CleanPreviews.php @@ -47,8 +47,8 @@ class CleanPreviews implements IRepairStep { * @param IConfig $config */ public function __construct(IJobList $jobList, - IUserManager $userManager, - IConfig $config) { + IUserManager $userManager, + IConfig $config) { $this->jobList = $jobList; $this->userManager = $userManager; $this->config = $config; diff --git a/lib/private/Repair/Owncloud/CleanPreviewsBackgroundJob.php b/lib/private/Repair/Owncloud/CleanPreviewsBackgroundJob.php index 7f4bbc35c175a..4ba9ad083e3d9 100644 --- a/lib/private/Repair/Owncloud/CleanPreviewsBackgroundJob.php +++ b/lib/private/Repair/Owncloud/CleanPreviewsBackgroundJob.php @@ -51,10 +51,10 @@ class CleanPreviewsBackgroundJob extends QueuedJob { * CleanPreviewsBackgroundJob constructor. */ public function __construct(IRootFolder $rootFolder, - LoggerInterface $logger, - IJobList $jobList, - ITimeFactory $timeFactory, - IUserManager $userManager) { + LoggerInterface $logger, + IJobList $jobList, + ITimeFactory $timeFactory, + IUserManager $userManager) { $this->rootFolder = $rootFolder; $this->logger = $logger; $this->jobList = $jobList; diff --git a/lib/private/Repair/Owncloud/MigrateOauthTables.php b/lib/private/Repair/Owncloud/MigrateOauthTables.php index 5bf0816d8deb1..ae2b46e19496c 100644 --- a/lib/private/Repair/Owncloud/MigrateOauthTables.php +++ b/lib/private/Repair/Owncloud/MigrateOauthTables.php @@ -20,11 +20,11 @@ */ namespace OC\Repair\Owncloud; -use OCP\Migration\IOutput; -use OCP\Migration\IRepairStep; use OC\DB\Connection; use OC\DB\SchemaWrapper; use OCP\DB\QueryBuilder\IQueryBuilder; +use OCP\Migration\IOutput; +use OCP\Migration\IRepairStep; class MigrateOauthTables implements IRepairStep { /** @var Connection */ diff --git a/lib/private/Repair/Owncloud/MoveAvatars.php b/lib/private/Repair/Owncloud/MoveAvatars.php index 44ba9b7643b11..1ec08710b3a48 100644 --- a/lib/private/Repair/Owncloud/MoveAvatars.php +++ b/lib/private/Repair/Owncloud/MoveAvatars.php @@ -41,7 +41,7 @@ class MoveAvatars implements IRepairStep { * @param IConfig $config */ public function __construct(IJobList $jobList, - IConfig $config) { + IConfig $config) { $this->jobList = $jobList; $this->config = $config; } diff --git a/lib/private/Repair/Owncloud/UpdateLanguageCodes.php b/lib/private/Repair/Owncloud/UpdateLanguageCodes.php index e08a0b55a9a84..ae8e8bb07437a 100644 --- a/lib/private/Repair/Owncloud/UpdateLanguageCodes.php +++ b/lib/private/Repair/Owncloud/UpdateLanguageCodes.php @@ -40,7 +40,7 @@ class UpdateLanguageCodes implements IRepairStep { * @param IConfig $config */ public function __construct(IDBConnection $connection, - IConfig $config) { + IConfig $config) { $this->connection = $connection; $this->config = $config; } diff --git a/lib/private/Repair/RemoveLinkShares.php b/lib/private/Repair/RemoveLinkShares.php index b45a1d83a56c0..3e47e3233a2dd 100644 --- a/lib/private/Repair/RemoveLinkShares.php +++ b/lib/private/Repair/RemoveLinkShares.php @@ -54,10 +54,10 @@ class RemoveLinkShares implements IRepairStep { private $timeFactory; public function __construct(IDBConnection $connection, - IConfig $config, - IGroupManager $groupManager, - IManager $notificationManager, - ITimeFactory $timeFactory) { + IConfig $config, + IGroupManager $groupManager, + IManager $notificationManager, + ITimeFactory $timeFactory) { $this->connection = $connection; $this->config = $config; $this->groupManager = $groupManager; diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index ee5a84ad65c13..5be09db01153d 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -49,7 +49,7 @@ class RepairMimeTypes implements IRepairStep { protected $folderMimeTypeId; public function __construct(IConfig $config, - IDBConnection $connection) { + IDBConnection $connection) { $this->config = $config; $this->connection = $connection; } diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php index 5ce6c7c5c8f49..65bbf602be0d6 100644 --- a/lib/private/Route/Router.php +++ b/lib/private/Route/Router.php @@ -230,9 +230,9 @@ public function getCurrentCollection() { * @return \OC\Route\Route */ public function create($name, - $pattern, - array $defaults = [], - array $requirements = []) { + $pattern, + array $defaults = [], + array $requirements = []) { $route = new Route($pattern, $defaults, $requirements); $this->collection->add($name, $route); return $route; @@ -354,8 +354,8 @@ public function getGenerator() { * @return string */ public function generate($name, - $parameters = [], - $absolute = false) { + $parameters = [], + $absolute = false) { $referenceType = UrlGenerator::ABSOLUTE_URL; if ($absolute === false) { $referenceType = UrlGenerator::ABSOLUTE_PATH; diff --git a/lib/private/Search/SearchComposer.php b/lib/private/Search/SearchComposer.php index 4ec73ec54e976..95470bf870ce2 100644 --- a/lib/private/Search/SearchComposer.php +++ b/lib/private/Search/SearchComposer.php @@ -28,13 +28,13 @@ namespace OC\Search; use InvalidArgumentException; +use OC\AppFramework\Bootstrap\Coordinator; use OCP\AppFramework\QueryException; use OCP\IServerContainer; use OCP\IUser; use OCP\Search\IProvider; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; -use OC\AppFramework\Bootstrap\Coordinator; use Psr\Log\LoggerInterface; use function array_map; @@ -70,8 +70,8 @@ class SearchComposer { private LoggerInterface $logger; public function __construct(Coordinator $bootstrapCoordinator, - IServerContainer $container, - LoggerInterface $logger) { + IServerContainer $container, + LoggerInterface $logger) { $this->container = $container; $this->logger = $logger; $this->bootstrapCoordinator = $bootstrapCoordinator; @@ -148,8 +148,8 @@ public function getProviders(string $route, array $routeParameters): array { * @throws InvalidArgumentException when the $providerId does not correspond to a registered provider */ public function search(IUser $user, - string $providerId, - ISearchQuery $query): SearchResult { + string $providerId, + ISearchQuery $query): SearchResult { $this->loadLazyProviders(); $provider = $this->providers[$providerId] ?? null; diff --git a/lib/private/Search/SearchQuery.php b/lib/private/Search/SearchQuery.php index c89446d59703b..d4c7a3ddf3f7e 100644 --- a/lib/private/Search/SearchQuery.php +++ b/lib/private/Search/SearchQuery.php @@ -59,11 +59,11 @@ class SearchQuery implements ISearchQuery { * @param array $routeParameters */ public function __construct(string $term, - int $sortOrder = ISearchQuery::SORT_DATE_DESC, - int $limit = self::LIMIT_DEFAULT, - $cursor = null, - string $route = '', - array $routeParameters = []) { + int $sortOrder = ISearchQuery::SORT_DATE_DESC, + int $limit = self::LIMIT_DEFAULT, + $cursor = null, + string $route = '', + array $routeParameters = []) { $this->term = $term; $this->sortOrder = $sortOrder; $this->limit = $limit; diff --git a/lib/private/Security/Bruteforce/Capabilities.php b/lib/private/Security/Bruteforce/Capabilities.php index b50eea0b7af8e..add2bb8d8b517 100644 --- a/lib/private/Security/Bruteforce/Capabilities.php +++ b/lib/private/Security/Bruteforce/Capabilities.php @@ -29,8 +29,8 @@ */ namespace OC\Security\Bruteforce; -use OCP\Capabilities\IPublicCapability; use OCP\Capabilities\IInitialStateExcludedCapability; +use OCP\Capabilities\IPublicCapability; use OCP\IRequest; use OCP\Security\Bruteforce\IThrottler; diff --git a/lib/private/Security/Bruteforce/Throttler.php b/lib/private/Security/Bruteforce/Throttler.php index 5316071f25cfc..7e5f1daa28cbd 100644 --- a/lib/private/Security/Bruteforce/Throttler.php +++ b/lib/private/Security/Bruteforce/Throttler.php @@ -72,8 +72,8 @@ public function __construct( * {@inheritDoc} */ public function registerAttempt(string $action, - string $ip, - array $metadata = []): void { + string $ip, + array $metadata = []): void { // No need to log if the bruteforce protection is disabled if (!$this->config->getSystemValueBool('auth.bruteforce.protection.enabled', true)) { return; diff --git a/lib/private/Security/VerificationToken/CleanUpJob.php b/lib/private/Security/VerificationToken/CleanUpJob.php index 1f4af04645176..9c1b27d344d22 100644 --- a/lib/private/Security/VerificationToken/CleanUpJob.php +++ b/lib/private/Security/VerificationToken/CleanUpJob.php @@ -27,10 +27,10 @@ namespace OC\Security\VerificationToken; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\IConfig; -use OCP\IUserManager; use OCP\BackgroundJob\IJobList; use OCP\BackgroundJob\Job; +use OCP\IConfig; +use OCP\IUserManager; use OCP\Security\VerificationToken\InvalidTokenException; use OCP\Security\VerificationToken\IVerificationToken; diff --git a/lib/private/Server.php b/lib/private/Server.php index d2a1d890ccd25..9382d78adc743 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -109,8 +109,8 @@ use OC\IntegrityCheck\Helpers\AppLocator; use OC\IntegrityCheck\Helpers\EnvironmentHelper; use OC\IntegrityCheck\Helpers\FileAccessHelper; -use OC\LDAP\NullLDAPProviderFactory; use OC\KnownUser\KnownUserService; +use OC\LDAP\NullLDAPProviderFactory; use OC\Lock\DBLockingProvider; use OC\Lock\MemcacheLockingProvider; use OC\Lock\NoopLockingProvider; @@ -129,6 +129,7 @@ use OC\Preview\GeneratorHelper; use OC\Preview\IMagickSupport; use OC\Preview\MimeIconProvider; +use OC\Profiler\Profiler; use OC\Remote\Api\ApiFactory; use OC\Remote\InstanceFactory; use OC\RichObjectStrings\Validator; @@ -161,6 +162,10 @@ use OC\User\Listeners\BeforeUserDeletedListener; use OC\User\Listeners\UserChangedListener; use OC\User\Session; +use OCA\Files_External\Service\BackendService; +use OCA\Files_External\Service\GlobalStoragesService; +use OCA\Files_External\Service\UserGlobalStoragesService; +use OCA\Files_External\Service\UserStoragesService; use OCA\Theming\ImageManager; use OCA\Theming\ThemingDefaults; use OCA\Theming\Util; @@ -199,10 +204,10 @@ use OCP\Http\Client\IClientService; use OCP\IAppConfig; use OCP\IAvatarManager; +use OCP\IBinaryFinder; use OCP\ICache; use OCP\ICacheFactory; use OCP\ICertificateManager; -use OCP\IBinaryFinder; use OCP\IDateTimeFormatter; use OCP\IDateTimeZone; use OCP\IDBConnection; @@ -232,6 +237,8 @@ use OCP\Log\ILogFactory; use OCP\Mail\IMailer; use OCP\OCM\IOCMDiscoveryService; +use OCP\Preview\IMimeIconProvider; +use OCP\Profiler\IProfiler; use OCP\Remote\Api\IApiFactory; use OCP\Remote\IInstanceFactory; use OCP\RichObjectStrings\IValidator; @@ -263,13 +270,6 @@ use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; -use OCA\Files_External\Service\UserStoragesService; -use OCA\Files_External\Service\UserGlobalStoragesService; -use OCA\Files_External\Service\GlobalStoragesService; -use OCA\Files_External\Service\BackendService; -use OCP\Profiler\IProfiler; -use OC\Profiler\Profiler; -use OCP\Preview\IMimeIconProvider; /** * Class Server diff --git a/lib/private/Session/CryptoSessionData.php b/lib/private/Session/CryptoSessionData.php index 1eb6987fc18f7..abd972a358dce 100644 --- a/lib/private/Session/CryptoSessionData.php +++ b/lib/private/Session/CryptoSessionData.php @@ -57,8 +57,8 @@ class CryptoSessionData implements \ArrayAccess, ISession { * @param string $passphrase */ public function __construct(ISession $session, - ICrypto $crypto, - string $passphrase) { + ICrypto $crypto, + string $passphrase) { $this->crypto = $crypto; $this->session = $session; $this->passphrase = $passphrase; diff --git a/lib/private/Session/CryptoWrapper.php b/lib/private/Session/CryptoWrapper.php index e98aac3b8bf21..5004ebf82cf4a 100644 --- a/lib/private/Session/CryptoWrapper.php +++ b/lib/private/Session/CryptoWrapper.php @@ -68,9 +68,9 @@ class CryptoWrapper { * @param IRequest $request */ public function __construct(IConfig $config, - ICrypto $crypto, - ISecureRandom $random, - IRequest $request) { + ICrypto $crypto, + ISecureRandom $random, + IRequest $request) { $this->crypto = $crypto; $this->config = $config; $this->random = $random; diff --git a/lib/private/Setup.php b/lib/private/Setup.php index f167d19adebb0..b8da8b245481d 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -53,9 +53,9 @@ use InvalidArgumentException; use OC\Authentication\Token\PublicKeyTokenProvider; use OC\Authentication\Token\TokenCleanupJob; -use OC\TextProcessing\RemoveOldTasksBackgroundJob; use OC\Log\Rotate; use OC\Preview\BackgroundCleanupJob; +use OC\TextProcessing\RemoveOldTasksBackgroundJob; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Defaults; use OCP\IGroup; diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php index 50f566728a957..0d672f324eb75 100644 --- a/lib/private/Setup/MySQL.php +++ b/lib/private/Setup/MySQL.php @@ -29,10 +29,10 @@ */ namespace OC\Setup; +use Doctrine\DBAL\Platforms\MySQL80Platform; use OC\DB\ConnectionAdapter; use OC\DB\MySqlTools; use OCP\IDBConnection; -use Doctrine\DBAL\Platforms\MySQL80Platform; use OCP\Security\ISecureRandom; class MySQL extends AbstractDatabase { diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 8d14f293e5a1e..3aa01b3cf299f 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -243,7 +243,7 @@ public static function getItemSharedWithUser(string $itemType, string $itemSourc * * defacto $parameters and $format is always the default and therefore is removed in the subsequent call */ public static function getItemShared($itemType, $itemSource, $format = self::FORMAT_NONE, - $parameters = null, $includeCollections = false) { + $parameters = null, $includeCollections = false) { return self::getItems($itemType, $itemSource, null, null, \OC_User::getUser(), self::FORMAT_NONE, null, -1, $includeCollections); } @@ -349,8 +349,8 @@ private static function getCollectionItemTypes(string $itemType) { * * defacto $limit, $itemsShareWithBySource, $checkExpireDate, $parameters and $format is always the default and therefore is removed in the subsequent call */ public static function getItems($itemType, ?string $item = null, ?int $shareType = null, $shareWith = null, - $uidOwner = null, $format = self::FORMAT_NONE, $parameters = null, $limit = -1, - $includeCollections = false, $itemShareWithBySource = false, $checkExpireDate = true) { + $uidOwner = null, $format = self::FORMAT_NONE, $parameters = null, $limit = -1, + $includeCollections = false, $itemShareWithBySource = false, $checkExpireDate = true) { if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_enabled', 'yes') != 'yes') { return []; } diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 4606101b7e681..0188c0897d9d3 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -880,12 +880,12 @@ public function createShare(IShare $share) { * @param \DateTime|null $expiration */ protected function sendMailNotification(IL10N $l, - $filename, - $link, - $initiator, - $shareWith, - \DateTime $expiration = null, - $note = '') { + $filename, + $link, + $initiator, + $shareWith, + \DateTime $expiration = null, + $note = '') { $initiatorUser = $this->userManager->get($initiator); $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; diff --git a/lib/private/Share20/PublicShareTemplateFactory.php b/lib/private/Share20/PublicShareTemplateFactory.php index 222f327496ac0..0e9642c306ea1 100644 --- a/lib/private/Share20/PublicShareTemplateFactory.php +++ b/lib/private/Share20/PublicShareTemplateFactory.php @@ -27,9 +27,9 @@ use OC\AppFramework\Bootstrap\Coordinator; use OCA\Files_Sharing\DefaultPublicShareTemplateProvider; use OCP\Server; -use OCP\Share\IShare; use OCP\Share\IPublicShareTemplateFactory; use OCP\Share\IPublicShareTemplateProvider; +use OCP\Share\IShare; class PublicShareTemplateFactory implements IPublicShareTemplateFactory { public function __construct( diff --git a/lib/private/Share20/Share.php b/lib/private/Share20/Share.php index 0a50fa0ccfb52..c80d332e9dba2 100644 --- a/lib/private/Share20/Share.php +++ b/lib/private/Share20/Share.php @@ -29,8 +29,8 @@ */ namespace OC\Share20; -use OCP\Files\File; use OCP\Files\Cache\ICacheEntry; +use OCP\Files\File; use OCP\Files\FileInfo; use OCP\Files\IRootFolder; use OCP\Files\Node; diff --git a/lib/private/StreamImage.php b/lib/private/StreamImage.php index 33078310d279e..e2f854bc2336d 100644 --- a/lib/private/StreamImage.php +++ b/lib/private/StreamImage.php @@ -23,8 +23,8 @@ namespace OC; -use OCP\IStreamImage; use OCP\IImage; +use OCP\IStreamImage; /** * Only useful when dealing with transferring streamed previews from an external diff --git a/lib/private/SubAdmin.php b/lib/private/SubAdmin.php index 54f14b8ab8870..9f079d30e0467 100644 --- a/lib/private/SubAdmin.php +++ b/lib/private/SubAdmin.php @@ -60,9 +60,9 @@ class SubAdmin extends PublicEmitter implements ISubAdmin { * @param IDBConnection $dbConn */ public function __construct(IUserManager $userManager, - IGroupManager $groupManager, - IDBConnection $dbConn, - IEventDispatcher $eventDispatcher) { + IGroupManager $groupManager, + IDBConnection $dbConn, + IEventDispatcher $eventDispatcher) { $this->userManager = $userManager; $this->groupManager = $groupManager; $this->dbConn = $dbConn; diff --git a/lib/private/Support/Subscription/Registry.php b/lib/private/Support/Subscription/Registry.php index eba76ca103ead..008cded5dd327 100644 --- a/lib/private/Support/Subscription/Registry.php +++ b/lib/private/Support/Subscription/Registry.php @@ -62,10 +62,10 @@ class Registry implements IRegistry { private $logger; public function __construct(IConfig $config, - IServerContainer $container, - IUserManager $userManager, - IGroupManager $groupManager, - LoggerInterface $logger) { + IServerContainer $container, + IUserManager $userManager, + IGroupManager $groupManager, + LoggerInterface $logger) { $this->config = $config; $this->container = $container; $this->userManager = $userManager; diff --git a/lib/private/TagManager.php b/lib/private/TagManager.php index 82c4dd2188d8d..552113f89dc0d 100644 --- a/lib/private/TagManager.php +++ b/lib/private/TagManager.php @@ -27,6 +27,7 @@ namespace OC; use OC\Tagging\TagMapper; +use OCP\Db\Exception as DBException; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; @@ -35,7 +36,6 @@ use OCP\ITags; use OCP\IUserSession; use OCP\User\Events\UserDeletedEvent; -use OCP\Db\Exception as DBException; use Psr\Log\LoggerInterface; /** diff --git a/lib/private/Tagging/TagMapper.php b/lib/private/Tagging/TagMapper.php index 1ee9c33acf7f7..ab227de5f7fc9 100644 --- a/lib/private/Tagging/TagMapper.php +++ b/lib/private/Tagging/TagMapper.php @@ -27,8 +27,8 @@ use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\QBMapper; -use OCP\IDBConnection; use OCP\DB\QueryBuilder\IQueryBuilder; +use OCP\IDBConnection; /** * Mapper for Tag entity diff --git a/lib/private/Talk/Broker.php b/lib/private/Talk/Broker.php index 12e6c5fb34b6c..451e782279022 100644 --- a/lib/private/Talk/Broker.php +++ b/lib/private/Talk/Broker.php @@ -48,8 +48,8 @@ class Broker implements IBroker { private ?ITalkBackend $backend = null; public function __construct(Coordinator $coordinator, - IServerContainer $container, - LoggerInterface $logger) { + IServerContainer $container, + LoggerInterface $logger) { $this->coordinator = $coordinator; $this->container = $container; $this->logger = $logger; @@ -94,8 +94,8 @@ public function newConversationOptions(): IConversationOptions { } public function createConversation(string $name, - array $moderators, - IConversationOptions $options = null): IConversation { + array $moderators, + IConversationOptions $options = null): IConversation { if (!$this->hasBackend()) { throw new NoBackendException("The Talk broker has no registered backend"); } diff --git a/lib/private/Template/JSCombiner.php b/lib/private/Template/JSCombiner.php index b87829360d508..fad69a76ae052 100644 --- a/lib/private/Template/JSCombiner.php +++ b/lib/private/Template/JSCombiner.php @@ -55,10 +55,10 @@ class JSCombiner { private $cacheFactory; public function __construct(IAppData $appData, - IURLGenerator $urlGenerator, - ICacheFactory $cacheFactory, - SystemConfig $config, - LoggerInterface $logger) { + IURLGenerator $urlGenerator, + ICacheFactory $cacheFactory, + SystemConfig $config, + LoggerInterface $logger) { $this->appData = $appData; $this->urlGenerator = $urlGenerator; $this->cacheFactory = $cacheFactory; diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php index 7b6d0a6a34648..057caaaf2fea4 100644 --- a/lib/private/Template/JSConfigHelper.php +++ b/lib/private/Template/JSConfigHelper.php @@ -45,9 +45,9 @@ use OCP\IGroupManager; use OCP\IInitialStateService; use OCP\IL10N; +use OCP\ILogger; use OCP\ISession; use OCP\IURLGenerator; -use OCP\ILogger; use OCP\IUser; use OCP\User\Backend\IPasswordConfirmationBackend; use OCP\Util; @@ -69,16 +69,16 @@ class JSConfigHelper { private $excludedUserBackEnds = ['user_saml' => true, 'user_globalsiteselector' => true]; public function __construct(IL10N $l, - Defaults $defaults, - IAppManager $appManager, - ISession $session, - ?IUser $currentUser, - IConfig $config, - IGroupManager $groupManager, - IniGetWrapper $iniWrapper, - IURLGenerator $urlGenerator, - CapabilitiesManager $capabilitiesManager, - IInitialStateService $initialStateService) { + Defaults $defaults, + IAppManager $appManager, + ISession $session, + ?IUser $currentUser, + IConfig $config, + IGroupManager $groupManager, + IniGetWrapper $iniWrapper, + IURLGenerator $urlGenerator, + CapabilitiesManager $capabilitiesManager, + IInitialStateService $initialStateService) { $this->l = $l; $this->defaults = $defaults; $this->appManager = $appManager; diff --git a/lib/private/TextProcessing/Manager.php b/lib/private/TextProcessing/Manager.php index b9cb06c298e25..921b3bb485968 100644 --- a/lib/private/TextProcessing/Manager.php +++ b/lib/private/TextProcessing/Manager.php @@ -27,19 +27,19 @@ use OC\AppFramework\Bootstrap\Coordinator; use OC\TextProcessing\Db\Task as DbTask; -use OCP\IConfig; -use OCP\TextProcessing\Task; -use OCP\TextProcessing\Task as OCPTask; use OC\TextProcessing\Db\TaskMapper; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\MultipleObjectsReturnedException; use OCP\BackgroundJob\IJobList; use OCP\Common\Exception\NotFoundException; use OCP\DB\Exception; +use OCP\IConfig; use OCP\IServerContainer; +use OCP\PreConditionNotMetException; use OCP\TextProcessing\IManager; use OCP\TextProcessing\IProvider; -use OCP\PreConditionNotMetException; +use OCP\TextProcessing\Task; +use OCP\TextProcessing\Task as OCPTask; use Psr\Log\LoggerInterface; use RuntimeException; use Throwable; diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index 57bafc3e18dae..09fec9b24ee8e 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -70,10 +70,10 @@ class URLGenerator implements IURLGenerator { private ?IAppManager $appManager = null; public function __construct(IConfig $config, - IUserSession $userSession, - ICacheFactory $cacheFactory, - IRequest $request, - Router $router + IUserSession $userSession, + ICacheFactory $cacheFactory, + IRequest $request, + Router $router ) { $this->config = $config; $this->userSession = $userSession; diff --git a/lib/private/Updater.php b/lib/private/Updater.php index 5a14bb1750779..018e4797232ac 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -40,13 +40,6 @@ */ namespace OC; -use OCP\App\IAppManager; -use OCP\EventDispatcher\Event; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\HintException; -use OCP\IConfig; -use OCP\ILogger; -use OCP\Util; use OC\App\AppManager; use OC\DB\Connection; use OC\DB\MigrationService; @@ -61,6 +54,13 @@ use OC\Repair\Events\RepairStepEvent; use OC\Repair\Events\RepairWarningEvent; use OC_App; +use OCP\App\IAppManager; +use OCP\EventDispatcher\Event; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\HintException; +use OCP\IConfig; +use OCP\ILogger; +use OCP\Util; use Psr\Log\LoggerInterface; /** @@ -94,9 +94,9 @@ class Updater extends BasicEmitter { ]; public function __construct(IConfig $config, - Checker $checker, - ?LoggerInterface $log, - Installer $installer) { + Checker $checker, + ?LoggerInterface $log, + Installer $installer) { $this->log = $log; $this->config = $config; $this->checker = $checker; diff --git a/lib/private/User/Listeners/BeforeUserDeletedListener.php b/lib/private/User/Listeners/BeforeUserDeletedListener.php index ec1f80c5413a8..8978c341a13f6 100644 --- a/lib/private/User/Listeners/BeforeUserDeletedListener.php +++ b/lib/private/User/Listeners/BeforeUserDeletedListener.php @@ -25,9 +25,9 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; -use OCP\User\Events\BeforeUserDeletedEvent; use OCP\Files\NotFoundException; use OCP\IAvatarManager; +use OCP\User\Events\BeforeUserDeletedEvent; use Psr\Log\LoggerInterface; /** diff --git a/lib/private/User/Listeners/UserChangedListener.php b/lib/private/User/Listeners/UserChangedListener.php index a561db2423dcc..0fa5ceeb0ed8c 100644 --- a/lib/private/User/Listeners/UserChangedListener.php +++ b/lib/private/User/Listeners/UserChangedListener.php @@ -25,9 +25,9 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; -use OCP\User\Events\UserChangedEvent; use OCP\Files\NotFoundException; use OCP\IAvatarManager; +use OCP\User\Events\UserChangedEvent; /** * @template-implements IEventListener diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index fb1afb6582564..e0a104683eb8d 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -48,10 +48,10 @@ use OCP\L10N\IFactory; use OCP\Server; use OCP\Support\Subscription\IAssertion; -use OCP\User\Backend\IGetRealUIDBackend; -use OCP\User\Backend\ISearchKnownUsersBackend; use OCP\User\Backend\ICheckPasswordBackend; use OCP\User\Backend\ICountUsersBackend; +use OCP\User\Backend\IGetRealUIDBackend; +use OCP\User\Backend\ISearchKnownUsersBackend; use OCP\User\Events\BeforeUserCreatedEvent; use OCP\User\Events\UserCreatedEvent; use OCP\UserInterface; @@ -96,8 +96,8 @@ class Manager extends PublicEmitter implements IUserManager { private DisplayNameCache $displayNameCache; public function __construct(IConfig $config, - ICacheFactory $cacheFactory, - IEventDispatcher $eventDispatcher) { + ICacheFactory $cacheFactory, + IEventDispatcher $eventDispatcher) { $this->config = $config; $this->cache = new WithLocalCache($cacheFactory->createDistributed('user_backend_map')); $cachedUsers = &$this->cachedUsers; diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index b654387d17a45..3caa431d99822 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -120,14 +120,14 @@ class Session implements IUserSession, Emitter { private $dispatcher; public function __construct(Manager $manager, - ISession $session, - ITimeFactory $timeFactory, - ?IProvider $tokenProvider, - IConfig $config, - ISecureRandom $random, - ILockdownManager $lockdownManager, - LoggerInterface $logger, - IEventDispatcher $dispatcher + ISession $session, + ITimeFactory $timeFactory, + ?IProvider $tokenProvider, + IConfig $config, + ISecureRandom $random, + ILockdownManager $lockdownManager, + LoggerInterface $logger, + IEventDispatcher $dispatcher ) { $this->manager = $manager; $this->session = $session; @@ -425,9 +425,9 @@ public function completeLogin(IUser $user, array $loginDetails, $regenerateSessi * @return boolean */ public function logClientIn($user, - $password, - IRequest $request, - IThrottler $throttler) { + $password, + IRequest $request, + IThrottler $throttler) { $remoteAddress = $request->getRemoteAddress(); $currentDelay = $throttler->sleepDelayOrThrowOnMax($remoteAddress, 'login'); @@ -576,7 +576,7 @@ protected function prepareUserLogin($firstTimeLogin, $refreshCsrfToken = true) { * @return boolean if the login was successful */ public function tryBasicAuthLogin(IRequest $request, - IThrottler $throttler) { + IThrottler $throttler) { if (!empty($request->server['PHP_AUTH_USER']) && !empty($request->server['PHP_AUTH_PW'])) { try { if ($this->logClientIn($request->server['PHP_AUTH_USER'], $request->server['PHP_AUTH_PW'], $request, $throttler)) { diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 69ef82f3e8599..3d582a296c4ec 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -49,17 +49,17 @@ use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserBackend; +use OCP\User\Backend\IGetHomeBackend; +use OCP\User\Backend\IProvideAvatarBackend; +use OCP\User\Backend\IProvideEnabledStateBackend; +use OCP\User\Backend\ISetDisplayNameBackend; +use OCP\User\Backend\ISetPasswordBackend; use OCP\User\Events\BeforePasswordUpdatedEvent; use OCP\User\Events\BeforeUserDeletedEvent; use OCP\User\Events\PasswordUpdatedEvent; use OCP\User\Events\UserChangedEvent; use OCP\User\Events\UserDeletedEvent; use OCP\User\GetQuotaEvent; -use OCP\User\Backend\ISetDisplayNameBackend; -use OCP\User\Backend\ISetPasswordBackend; -use OCP\User\Backend\IProvideAvatarBackend; -use OCP\User\Backend\IProvideEnabledStateBackend; -use OCP\User\Backend\IGetHomeBackend; use OCP\UserInterface; use function json_decode; use function json_encode; diff --git a/lib/private/UserStatus/Manager.php b/lib/private/UserStatus/Manager.php index 89a1bb455c7cc..e255e24c70e17 100644 --- a/lib/private/UserStatus/Manager.php +++ b/lib/private/UserStatus/Manager.php @@ -51,7 +51,7 @@ class Manager implements IManager { * @param LoggerInterface $logger */ public function __construct(IServerContainer $container, - LoggerInterface $logger) { + LoggerInterface $logger) { $this->container = $container; $this->logger = $logger; } diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index 23e0b099e9112..d68ba6d22e053 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -51,18 +51,18 @@ * */ -use OCP\App\Events\AppUpdateEvent; -use OCP\App\IAppManager; -use OCP\App\ManagerEvent; -use OCP\Authentication\IAlternativeLogin; -use OCP\EventDispatcher\IEventDispatcher; -use OC\AppFramework\Bootstrap\Coordinator; use OC\App\DependencyAnalyzer; use OC\App\Platform; +use OC\AppFramework\Bootstrap\Coordinator; use OC\DB\MigrationService; use OC\Installer; use OC\Repair; use OC\Repair\Events\RepairErrorEvent; +use OCP\App\Events\AppUpdateEvent; +use OCP\App\IAppManager; +use OCP\App\ManagerEvent; +use OCP\Authentication\IAlternativeLogin; +use OCP\EventDispatcher\IEventDispatcher; use Psr\Container\ContainerExceptionInterface; use Psr\Log\LoggerInterface; @@ -251,7 +251,7 @@ public static function getEnabledApps(bool $forceRefresh = false, bool $all = fa * This function set an app as enabled in appconfig. */ public function enable(string $appId, - array $groups = []) { + array $groups = []) { // Check if app is already downloaded /** @var Installer $installer */ $installer = \OCP\Server::get(Installer::class); diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php index 911c713f840a9..23b82a0428272 100644 --- a/lib/private/legacy/OC_Files.php +++ b/lib/private/legacy/OC_Files.php @@ -43,10 +43,10 @@ use bantu\IniGetWrapper\IniGetWrapper; use OC\Files\View; use OC\Streamer; -use OCP\Lock\ILockingProvider; -use OCP\Files\Events\BeforeZipCreatedEvent; -use OCP\Files\Events\BeforeDirectFileDownloadEvent; use OCP\EventDispatcher\IEventDispatcher; +use OCP\Files\Events\BeforeDirectFileDownloadEvent; +use OCP\Files\Events\BeforeZipCreatedEvent; +use OCP\Lock\ILockingProvider; /** * Class for file server access @@ -87,7 +87,7 @@ private static function sendHeaders($filename, $name, array $rangeArray): void { header('Accept-Ranges: bytes', true); if (count($rangeArray) > 1) { $type = 'multipart/byteranges; boundary='.self::getBoundary(); - // no Content-Length header here + // no Content-Length header here } else { header(sprintf('Content-Range: bytes %d-%d/%d', $rangeArray[0]['from'], $rangeArray[0]['to'], $fileSize), true); OC_Response::setContentLengthHeader($rangeArray[0]['to'] - $rangeArray[0]['from'] + 1); diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index cf39d045ae900..37fbf7f5f8fa0 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -46,8 +46,8 @@ use bantu\IniGetWrapper\IniGetWrapper; use OC\Files\Filesystem; use OCP\Files\Mount\IMountPoint; -use OCP\ICacheFactory; use OCP\IBinaryFinder; +use OCP\ICacheFactory; use OCP\IUser; use OCP\Util; use Psr\Log\LoggerInterface; diff --git a/lib/public/AppFramework/ApiController.php b/lib/public/AppFramework/ApiController.php index 66c278e62d844..9505af0b2e2da 100644 --- a/lib/public/AppFramework/ApiController.php +++ b/lib/public/AppFramework/ApiController.php @@ -52,10 +52,10 @@ abstract class ApiController extends Controller { * @since 7.0.0 */ public function __construct($appName, - IRequest $request, - $corsMethods = 'PUT, POST, GET, DELETE, PATCH', - $corsAllowedHeaders = 'Authorization, Content-Type, Accept', - $corsMaxAge = 1728000) { + IRequest $request, + $corsMethods = 'PUT, POST, GET, DELETE, PATCH', + $corsAllowedHeaders = 'Authorization, Content-Type, Accept', + $corsMaxAge = 1728000) { parent::__construct($appName, $request); $this->corsMethods = $corsMethods; $this->corsAllowedHeaders = $corsAllowedHeaders; diff --git a/lib/public/AppFramework/AuthPublicShareController.php b/lib/public/AppFramework/AuthPublicShareController.php index 78dd45551ed9c..847f1823db885 100644 --- a/lib/public/AppFramework/AuthPublicShareController.php +++ b/lib/public/AppFramework/AuthPublicShareController.php @@ -57,9 +57,9 @@ abstract class AuthPublicShareController extends PublicShareController { * @since 14.0.0 */ public function __construct(string $appName, - IRequest $request, - ISession $session, - IURLGenerator $urlGenerator) { + IRequest $request, + ISession $session, + IURLGenerator $urlGenerator) { parent::__construct($appName, $request, $session); $this->urlGenerator = $urlGenerator; diff --git a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php index 720803a78d170..661630dcb5886 100644 --- a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php +++ b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php @@ -37,10 +37,10 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Template\ICustomTemplateProvider; use OCP\IContainer; -use OCP\TextProcessing\IProvider as ITextProcessingProvider; use OCP\Notification\INotifier; use OCP\Preview\IProviderV2; use OCP\SpeechToText\ISpeechToTextProvider; +use OCP\TextProcessing\IProvider as ITextProcessingProvider; use OCP\Translation\ITranslationProvider; /** diff --git a/lib/public/AppFramework/Controller.php b/lib/public/AppFramework/Controller.php index e8500d5ae1af8..12e1c31626b64 100644 --- a/lib/public/AppFramework/Controller.php +++ b/lib/public/AppFramework/Controller.php @@ -65,7 +65,7 @@ abstract class Controller { * @since 6.0.0 - parameter $appName was added in 7.0.0 - parameter $app was removed in 7.0.0 */ public function __construct($appName, - IRequest $request) { + IRequest $request) { $this->appName = $appName; $this->request = $request; diff --git a/lib/public/AppFramework/Http/TooManyRequestsResponse.php b/lib/public/AppFramework/Http/TooManyRequestsResponse.php index 043ae0161e957..688fb6cc38539 100644 --- a/lib/public/AppFramework/Http/TooManyRequestsResponse.php +++ b/lib/public/AppFramework/Http/TooManyRequestsResponse.php @@ -26,8 +26,8 @@ */ namespace OCP\AppFramework\Http; -use OCP\Template; use OCP\AppFramework\Http; +use OCP\Template; /** * A generic 429 response showing an 404 error page as well to the end-user diff --git a/lib/public/AppFramework/OCSController.php b/lib/public/AppFramework/OCSController.php index 51c71ad4e64eb..68c88915b1cd8 100644 --- a/lib/public/AppFramework/OCSController.php +++ b/lib/public/AppFramework/OCSController.php @@ -59,10 +59,10 @@ abstract class OCSController extends ApiController { * @since 8.1.0 */ public function __construct($appName, - IRequest $request, - $corsMethods = 'PUT, POST, GET, DELETE, PATCH', - $corsAllowedHeaders = 'Authorization, Content-Type, Accept, OCS-APIRequest', - $corsMaxAge = 1728000) { + IRequest $request, + $corsMethods = 'PUT, POST, GET, DELETE, PATCH', + $corsAllowedHeaders = 'Authorization, Content-Type, Accept, OCS-APIRequest', + $corsMaxAge = 1728000) { parent::__construct($appName, $request, $corsMethods, $corsAllowedHeaders, $corsMaxAge); $this->registerResponder('json', function ($data) { diff --git a/lib/public/AppFramework/PublicShareController.php b/lib/public/AppFramework/PublicShareController.php index 52acbe841b420..7c3725c9290a4 100644 --- a/lib/public/AppFramework/PublicShareController.php +++ b/lib/public/AppFramework/PublicShareController.php @@ -53,8 +53,8 @@ abstract class PublicShareController extends Controller { * @since 14.0.0 */ public function __construct(string $appName, - IRequest $request, - ISession $session) { + IRequest $request, + ISession $session) { parent::__construct($appName, $request); $this->session = $session; diff --git a/lib/public/Comments/ICommentsManager.php b/lib/public/Comments/ICommentsManager.php index 8d7ffd164b3af..152c8deeaf37d 100644 --- a/lib/public/Comments/ICommentsManager.php +++ b/lib/public/Comments/ICommentsManager.php @@ -114,11 +114,11 @@ public function getTree($id, $limit = 0, $offset = 0); * @since 9.0.0 */ public function getForObject( - $objectType, - $objectId, - $limit = 0, - $offset = 0, - \DateTime $notOlderThan = null + $objectType, + $objectId, + $limit = 0, + $offset = 0, + \DateTime $notOlderThan = null ); /** diff --git a/lib/public/Dashboard/Model/WidgetItem.php b/lib/public/Dashboard/Model/WidgetItem.php index 1c54d2bd426fb..22235053b5d22 100644 --- a/lib/public/Dashboard/Model/WidgetItem.php +++ b/lib/public/Dashboard/Model/WidgetItem.php @@ -70,11 +70,11 @@ final class WidgetItem implements JsonSerializable { * @since 22.0.0 */ public function __construct(string $title = '', - string $subtitle = '', - string $link = '', - string $iconUrl = '', - string $sinceId = '', - string $overlayIconUrl = '') { + string $subtitle = '', + string $link = '', + string $iconUrl = '', + string $sinceId = '', + string $overlayIconUrl = '') { $this->title = $title; $this->subtitle = $subtitle; $this->iconUrl = $iconUrl; diff --git a/lib/public/Files/Events/FileCacheUpdated.php b/lib/public/Files/Events/FileCacheUpdated.php index 18d6318f2f493..2669c51088e85 100644 --- a/lib/public/Files/Events/FileCacheUpdated.php +++ b/lib/public/Files/Events/FileCacheUpdated.php @@ -44,7 +44,7 @@ class FileCacheUpdated extends Event { * @since 18.0.0 */ public function __construct(IStorage $storage, - string $path) { + string $path) { parent::__construct(); $this->storage = $storage; $this->path = $path; diff --git a/lib/public/Files/Events/NodeAddedToCache.php b/lib/public/Files/Events/NodeAddedToCache.php index 6986b4b59899d..3a1947e7a1611 100644 --- a/lib/public/Files/Events/NodeAddedToCache.php +++ b/lib/public/Files/Events/NodeAddedToCache.php @@ -44,7 +44,7 @@ class NodeAddedToCache extends Event { * @since 18.0.0 */ public function __construct(IStorage $storage, - string $path) { + string $path) { parent::__construct(); $this->storage = $storage; $this->path = $path; diff --git a/lib/public/Files/Events/NodeRemovedFromCache.php b/lib/public/Files/Events/NodeRemovedFromCache.php index 9f67cb71371e9..83c4bd1653111 100644 --- a/lib/public/Files/Events/NodeRemovedFromCache.php +++ b/lib/public/Files/Events/NodeRemovedFromCache.php @@ -44,7 +44,7 @@ class NodeRemovedFromCache extends Event { * @since 18.0.0 */ public function __construct(IStorage $storage, - string $path) { + string $path) { parent::__construct(); $this->storage = $storage; $this->path = $path; diff --git a/lib/public/Files/Node.php b/lib/public/Files/Node.php index b49b4a0f83d83..ecf1427fa1a16 100644 --- a/lib/public/Files/Node.php +++ b/lib/public/Files/Node.php @@ -30,8 +30,8 @@ namespace OCP\Files; -use OCP\Lock\LockedException; use OCP\Files\Storage\IStorage; +use OCP\Lock\LockedException; /** * Interface Node diff --git a/lib/public/Http/WellKnown/JrdResponse.php b/lib/public/Http/WellKnown/JrdResponse.php index 7a25f8fe0c3c4..077b58dc1d9db 100644 --- a/lib/public/Http/WellKnown/JrdResponse.php +++ b/lib/public/Http/WellKnown/JrdResponse.php @@ -127,10 +127,10 @@ public function addProperty(string $property, ?string $value): self { * @since 21.0.0 */ public function addLink(string $rel, - ?string $type, - ?string $href, - ?array $titles = [], - ?array $properties = []): self { + ?string $type, + ?string $href, + ?array $titles = [], + ?array $properties = []): self { $this->links[] = array_filter([ 'rel' => $rel, 'type' => $type, diff --git a/lib/public/Log/Audit/CriticalActionPerformedEvent.php b/lib/public/Log/Audit/CriticalActionPerformedEvent.php index 79c67e5b8bd8f..45786a5c980f7 100644 --- a/lib/public/Log/Audit/CriticalActionPerformedEvent.php +++ b/lib/public/Log/Audit/CriticalActionPerformedEvent.php @@ -49,8 +49,8 @@ class CriticalActionPerformedEvent extends Event { * @since 22.0.0 */ public function __construct(string $logMessage, - array $parameters = [], - bool $obfuscateParameters = false) { + array $parameters = [], + bool $obfuscateParameters = false) { parent::__construct(); $this->logMessage = $logMessage; $this->parameters = $parameters; diff --git a/lib/public/Search/SearchResult.php b/lib/public/Search/SearchResult.php index 9ac8b28fb8ba7..892c60777b367 100644 --- a/lib/public/Search/SearchResult.php +++ b/lib/public/Search/SearchResult.php @@ -54,9 +54,9 @@ final class SearchResult implements JsonSerializable { * @since 20.0.0 */ private function __construct(string $name, - bool $isPaginated, - array $entries, - $cursor = null) { + bool $isPaginated, + array $entries, + $cursor = null) { $this->name = $name; $this->isPaginated = $isPaginated; $this->entries = $entries; @@ -87,8 +87,8 @@ public static function complete(string $name, array $entries): self { * @since 20.0.0 */ public static function paginated(string $name, - array $entries, - $cursor): self { + array $entries, + $cursor): self { return new self( $name, true, diff --git a/lib/public/Search/SearchResultEntry.php b/lib/public/Search/SearchResultEntry.php index 86a3f08cfe6e6..f4ff1ec2a5c14 100644 --- a/lib/public/Search/SearchResultEntry.php +++ b/lib/public/Search/SearchResultEntry.php @@ -98,11 +98,11 @@ class SearchResultEntry implements JsonSerializable { * @since 20.0.0 */ public function __construct(string $thumbnailUrl, - string $title, - string $subline, - string $resourceUrl, - string $icon = '', - bool $rounded = false) { + string $title, + string $subline, + string $resourceUrl, + string $icon = '', + bool $rounded = false) { $this->thumbnailUrl = $thumbnailUrl; $this->title = $title; $this->subline = $subline; diff --git a/lib/public/Security/ISecureRandom.php b/lib/public/Security/ISecureRandom.php index 3634ebf99f7f0..48013b2cca7e8 100644 --- a/lib/public/Security/ISecureRandom.php +++ b/lib/public/Security/ISecureRandom.php @@ -64,5 +64,5 @@ interface ISecureRandom { * @since 8.0.0 */ public function generate(int $length, - string $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'): string; + string $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'): string; } diff --git a/lib/public/Security/RateLimiting/ILimiter.php b/lib/public/Security/RateLimiting/ILimiter.php index 275746b0b491a..cfc7387664d48 100644 --- a/lib/public/Security/RateLimiting/ILimiter.php +++ b/lib/public/Security/RateLimiting/ILimiter.php @@ -50,9 +50,9 @@ interface ILimiter { * */ public function registerAnonRequest(string $identifier, - int $anonLimit, - int $anonPeriod, - string $ip): void; + int $anonLimit, + int $anonPeriod, + string $ip): void; /** * Registers attempt for an authenticated request @@ -66,7 +66,7 @@ public function registerAnonRequest(string $identifier, * */ public function registerUserRequest(string $identifier, - int $userLimit, - int $userPeriod, - IUser $user): void; + int $userLimit, + int $userPeriod, + IUser $user): void; } diff --git a/lib/public/Share.php b/lib/public/Share.php index 9499cdb14b690..225f252c2a980 100644 --- a/lib/public/Share.php +++ b/lib/public/Share.php @@ -116,7 +116,7 @@ public static function getItemsShared($itemType, $format = self::FORMAT_NONE, $p * * defacto $parameters and $format is always the default and therefore is removed in the subsequent call */ public static function getItemShared($itemType, $itemSource, $format = self::FORMAT_NONE, - $parameters = null, $includeCollections = false) { + $parameters = null, $includeCollections = false) { return \OC\Share\Share::getItemShared($itemType, $itemSource, self::FORMAT_NONE, null, $includeCollections); } diff --git a/lib/public/Share/Events/VerifyMountPointEvent.php b/lib/public/Share/Events/VerifyMountPointEvent.php index 650f4ad224500..af71314930b10 100644 --- a/lib/public/Share/Events/VerifyMountPointEvent.php +++ b/lib/public/Share/Events/VerifyMountPointEvent.php @@ -44,8 +44,8 @@ class VerifyMountPointEvent extends Event { * @since 19.0.0 */ public function __construct(IShare $share, - View $view, - string $parent) { + View $view, + string $parent) { parent::__construct(); $this->share = $share; diff --git a/lib/public/Share/IShareProvider.php b/lib/public/Share/IShareProvider.php index b6e0c4ba38bf9..2a37508d4490a 100644 --- a/lib/public/Share/IShareProvider.php +++ b/lib/public/Share/IShareProvider.php @@ -70,7 +70,7 @@ public function update(\OCP\Share\IShare $share); * @return IShare The share object * @since 17.0.0 */ -// public function acceptShare(IShare $share, string $recipient): IShare; + // public function acceptShare(IShare $share, string $recipient): IShare; /** * Delete a share diff --git a/lib/public/Talk/IBroker.php b/lib/public/Talk/IBroker.php index d3b6e1429e612..f2b512ea4a8ee 100644 --- a/lib/public/Talk/IBroker.php +++ b/lib/public/Talk/IBroker.php @@ -68,8 +68,8 @@ public function newConversationOptions(): IConversationOptions; * @since 24.0.0 */ public function createConversation(string $name, - array $moderators, - IConversationOptions $options = null): IConversation; + array $moderators, + IConversationOptions $options = null): IConversation; /** * Delete a conversation by id diff --git a/lib/public/Talk/ITalkBackend.php b/lib/public/Talk/ITalkBackend.php index 3ee995576a4ec..a2f4d9620192b 100644 --- a/lib/public/Talk/ITalkBackend.php +++ b/lib/public/Talk/ITalkBackend.php @@ -46,8 +46,8 @@ interface ITalkBackend { * @since 24.0.0 */ public function createConversation(string $name, - array $moderators, - IConversationOptions $options): IConversation; + array $moderators, + IConversationOptions $options): IConversation; /** * Delete a conversation by id diff --git a/lib/public/User/Events/BeforePasswordUpdatedEvent.php b/lib/public/User/Events/BeforePasswordUpdatedEvent.php index 11eb5ad9dd048..ee228ae01e75f 100644 --- a/lib/public/User/Events/BeforePasswordUpdatedEvent.php +++ b/lib/public/User/Events/BeforePasswordUpdatedEvent.php @@ -51,8 +51,8 @@ class BeforePasswordUpdatedEvent extends Event { * @since 18.0.0 */ public function __construct(IUser $user, - string $password, - string $recoveryPassword = null) { + string $password, + string $recoveryPassword = null) { parent::__construct(); $this->user = $user; $this->password = $password; diff --git a/lib/public/User/Events/BeforeUserCreatedEvent.php b/lib/public/User/Events/BeforeUserCreatedEvent.php index 67e9177b34dfd..ee33239a12c2a 100644 --- a/lib/public/User/Events/BeforeUserCreatedEvent.php +++ b/lib/public/User/Events/BeforeUserCreatedEvent.php @@ -44,7 +44,7 @@ class BeforeUserCreatedEvent extends Event { * @since 18.0.0 */ public function __construct(string $uid, - string $password) { + string $password) { parent::__construct(); $this->uid = $uid; $this->password = $password; diff --git a/lib/public/User/Events/PasswordUpdatedEvent.php b/lib/public/User/Events/PasswordUpdatedEvent.php index 41d510553b5be..782d6d270ead3 100644 --- a/lib/public/User/Events/PasswordUpdatedEvent.php +++ b/lib/public/User/Events/PasswordUpdatedEvent.php @@ -51,8 +51,8 @@ class PasswordUpdatedEvent extends Event { * @since 18.0.0 */ public function __construct(IUser $user, - string $password, - string $recoveryPassword = null) { + string $password, + string $recoveryPassword = null) { parent::__construct(); $this->user = $user; $this->password = $password; diff --git a/lib/public/User/Events/UserChangedEvent.php b/lib/public/User/Events/UserChangedEvent.php index f48dd3914e69e..870b0326920aa 100644 --- a/lib/public/User/Events/UserChangedEvent.php +++ b/lib/public/User/Events/UserChangedEvent.php @@ -43,9 +43,9 @@ class UserChangedEvent extends Event { * @since 18.0.0 */ public function __construct(IUser $user, - string $feature, - $value, - $oldValue = null) { + string $feature, + $value, + $oldValue = null) { parent::__construct(); $this->user = $user; $this->feature = $feature; diff --git a/lib/public/User/Events/UserCreatedEvent.php b/lib/public/User/Events/UserCreatedEvent.php index 7d343bfd5b8cd..b0a734be0cb2f 100644 --- a/lib/public/User/Events/UserCreatedEvent.php +++ b/lib/public/User/Events/UserCreatedEvent.php @@ -45,7 +45,7 @@ class UserCreatedEvent extends Event { * @since 18.0.0 */ public function __construct(IUser $user, - string $password) { + string $password) { parent::__construct(); $this->user = $user; $this->password = $password; diff --git a/lib/public/User/Events/UserLiveStatusEvent.php b/lib/public/User/Events/UserLiveStatusEvent.php index d04c3b61e240f..8b6207d685d7c 100644 --- a/lib/public/User/Events/UserLiveStatusEvent.php +++ b/lib/public/User/Events/UserLiveStatusEvent.php @@ -60,8 +60,8 @@ class UserLiveStatusEvent extends Event { * @since 20.0.0 */ public function __construct(IUser $user, - string $status, - int $timestamp) { + string $status, + int $timestamp) { parent::__construct(); $this->user = $user; $this->status = $status; diff --git a/lib/public/Util.php b/lib/public/Util.php index cabb84c0cf663..488eddbaf4b95 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -46,9 +46,9 @@ namespace OCP; +use bantu\IniGetWrapper\IniGetWrapper; use OC\AppScriptDependency; use OC\AppScriptSort; -use bantu\IniGetWrapper\IniGetWrapper; use OCP\Share\IManager; use Psr\Container\ContainerExceptionInterface; diff --git a/ocs/v1.php b/ocs/v1.php index 055398993729a..f1f19fb5ee49b 100644 --- a/ocs/v1.php +++ b/ocs/v1.php @@ -41,8 +41,8 @@ exit; } -use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\Routing\Exception\MethodNotAllowedException; +use Symfony\Component\Routing\Exception\ResourceNotFoundException; /* * Try the appframework routes diff --git a/remote.php b/remote.php index 0c33fabc762aa..03575627dc504 100644 --- a/remote.php +++ b/remote.php @@ -34,9 +34,9 @@ require_once __DIR__ . '/lib/versioncheck.php'; use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin; +use Psr\Log\LoggerInterface; use Sabre\DAV\Exception\ServiceUnavailable; use Sabre\DAV\Server; -use Psr\Log\LoggerInterface; /** * Class RemoteException diff --git a/tests/Core/Command/Preview/RepairTest.php b/tests/Core/Command/Preview/RepairTest.php index fd4af61534038..550dad1ef2f8c 100644 --- a/tests/Core/Command/Preview/RepairTest.php +++ b/tests/Core/Command/Preview/RepairTest.php @@ -10,11 +10,11 @@ use OCP\IConfig; use OCP\Lock\ILockingProvider; use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use Symfony\Component\Console\Formatter\OutputFormatterInterface; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; -use Psr\Log\LoggerInterface; class RepairTest extends TestCase { /** @var IConfig|MockObject */ diff --git a/tests/Core/Command/User/AuthTokens/DeleteTest.php b/tests/Core/Command/User/AuthTokens/DeleteTest.php index 528d4c6869bdc..e11bf938dc929 100644 --- a/tests/Core/Command/User/AuthTokens/DeleteTest.php +++ b/tests/Core/Command/User/AuthTokens/DeleteTest.php @@ -22,8 +22,8 @@ */ namespace Tests\Core\Command\User\AuthTokens; -use OC\Core\Command\User\AuthTokens\Delete; use OC\Authentication\Token\IProvider; +use OC\Core\Command\User\AuthTokens\Delete; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Input\InputInterface; diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php index 333baf0aa86f5..7d82e256c1751 100644 --- a/tests/Core/Controller/LoginControllerTest.php +++ b/tests/Core/Controller/LoginControllerTest.php @@ -314,7 +314,7 @@ public function passwordResetDataProvider(): array { * @dataProvider passwordResetDataProvider */ public function testShowLoginFormWithPasswordResetOption($canChangePassword, - $expectedResult) { + $expectedResult) { $this->userSession ->expects($this->once()) ->method('isLoggedIn') diff --git a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php index 57443ca13280e..7ca389946d8f5 100644 --- a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php +++ b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php @@ -27,8 +27,8 @@ use OC\Authentication\Token\IToken; use OC\Core\Data\LoginFlowV2Credentials; use OC\Core\Data\LoginFlowV2Tokens; -use OC\Core\Db\LoginFlowV2Mapper; use OC\Core\Db\LoginFlowV2; +use OC\Core\Db\LoginFlowV2Mapper; use OC\Core\Exception\LoginFlowV2NotFoundException; use OC\Core\Service\LoginFlowV2Service; use OCP\AppFramework\Db\DoesNotExistException; diff --git a/tests/acceptance/features/core/NextcloudTestServerContext.php b/tests/acceptance/features/core/NextcloudTestServerContext.php index d0dc0c32181d8..2de6fd8e57ebd 100644 --- a/tests/acceptance/features/core/NextcloudTestServerContext.php +++ b/tests/acceptance/features/core/NextcloudTestServerContext.php @@ -73,7 +73,7 @@ class NextcloudTestServerContext implements Context { * constructor of the $nextcloudTestServerHelper class. */ public function __construct($nextcloudTestServerHelper = "NextcloudTestServerLocalBuiltInHelper", - $nextcloudTestServerHelperParameters = [ ]) { + $nextcloudTestServerHelperParameters = [ ]) { $nextcloudTestServerHelperClass = new ReflectionClass($nextcloudTestServerHelper); if ($nextcloudTestServerHelperParameters === null) { diff --git a/tests/lib/App/AppStore/Version/VersionParserTest.php b/tests/lib/App/AppStore/Version/VersionParserTest.php index edb48dc41304f..a81dbecf32c17 100644 --- a/tests/lib/App/AppStore/Version/VersionParserTest.php +++ b/tests/lib/App/AppStore/Version/VersionParserTest.php @@ -77,7 +77,7 @@ public function versionProvider() { * @param Version $expected */ public function testGetVersion($input, - Version $expected) { + Version $expected) { $this->assertEquals($expected, $this->versionParser->getVersion($input)); } diff --git a/tests/lib/App/InfoParserTest.php b/tests/lib/App/InfoParserTest.php index bc56161150153..c34d2775faf90 100644 --- a/tests/lib/App/InfoParserTest.php +++ b/tests/lib/App/InfoParserTest.php @@ -10,8 +10,8 @@ use OC; use OC\App\InfoParser; -use Test\TestCase; use OCP\Cache\CappedMemoryCache; +use Test\TestCase; class InfoParserTest extends TestCase { /** @var OCP\Cache\CappedMemoryCache */ diff --git a/tests/lib/AppFramework/Controller/ControllerTest.php b/tests/lib/AppFramework/Controller/ControllerTest.php index cb6fc777deed2..e435bbc44e376 100644 --- a/tests/lib/AppFramework/Controller/ControllerTest.php +++ b/tests/lib/AppFramework/Controller/ControllerTest.php @@ -23,6 +23,7 @@ namespace Test\AppFramework\Controller; +use OC\AppFramework\DependencyInjection\DIContainer; use OC\AppFramework\Http\Request; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataResponse; @@ -30,7 +31,6 @@ use OCP\IConfig; use OCP\IRequest; use OCP\IRequestId; -use OC\AppFramework\DependencyInjection\DIContainer; class ChildController extends Controller { public function __construct($appName, $request) { diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php index 7f81701a8b3de..bb7541c4d22a9 100644 --- a/tests/lib/AppFramework/Http/DispatcherTest.php +++ b/tests/lib/AppFramework/Http/DispatcherTest.php @@ -35,10 +35,10 @@ use OCP\Diagnostics\IEventLogger; use OCP\IConfig; use OCP\IRequest; +use OCP\IRequestId; use PHPUnit\Framework\MockObject\MockObject; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; -use OCP\IRequestId; class TestController extends Controller { /** diff --git a/tests/lib/AppFramework/Middleware/MiddlewareTest.php b/tests/lib/AppFramework/Middleware/MiddlewareTest.php index f9e775269d4eb..e4980009b0956 100644 --- a/tests/lib/AppFramework/Middleware/MiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/MiddlewareTest.php @@ -23,13 +23,13 @@ namespace Test\AppFramework\Middleware; +use OC\AppFramework\DependencyInjection\DIContainer; use OC\AppFramework\Http\Request; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Response; use OCP\AppFramework\Middleware; use OCP\IConfig; use OCP\IRequestId; -use OC\AppFramework\DependencyInjection\DIContainer; class ChildMiddleware extends Middleware { }; diff --git a/tests/lib/AppFramework/Routing/RoutingTest.php b/tests/lib/AppFramework/Routing/RoutingTest.php index d7fde02dbcb1d..c9812a5dfb73f 100644 --- a/tests/lib/AppFramework/Routing/RoutingTest.php +++ b/tests/lib/AppFramework/Routing/RoutingTest.php @@ -267,14 +267,14 @@ private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, * @param string $postfix */ private function assertSimpleOCSRoute($routes, - $name, - $verb, - $url, - $controllerName, - $actionName, - array $requirements = [], - array $defaults = [], - $postfix = '') { + $name, + $verb, + $url, + $controllerName, + $actionName, + array $requirements = [], + array $defaults = [], + $postfix = '') { if ($postfix) { $name .= $postfix; } diff --git a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php index 7647e3bda7df1..3c82878065e65 100644 --- a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php +++ b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php @@ -39,8 +39,8 @@ use OCP\IUser; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; -use function reset; use Test\TestCase; +use function reset; class ManagerTest extends TestCase { /** @var IUser|MockObject */ diff --git a/tests/lib/Avatar/AvatarManagerTest.php b/tests/lib/Avatar/AvatarManagerTest.php index 06ff4086f7233..b35fb2f23a8ab 100644 --- a/tests/lib/Avatar/AvatarManagerTest.php +++ b/tests/lib/Avatar/AvatarManagerTest.php @@ -29,6 +29,7 @@ use OC\Avatar\UserAvatar; use OC\KnownUser\KnownUserService; use OC\User\Manager; +use OC\User\User; use OCP\Accounts\IAccount; use OCP\Accounts\IAccountManager; use OCP\Accounts\IAccountProperty; @@ -37,7 +38,6 @@ use OCP\IConfig; use OCP\IL10N; use OCP\IUser; -use OC\User\User; use OCP\IUserSession; use Psr\Log\LoggerInterface; diff --git a/tests/lib/Collaboration/Collaborators/MailPluginTest.php b/tests/lib/Collaboration/Collaborators/MailPluginTest.php index 3cf76c562a12c..804e5385a9de8 100644 --- a/tests/lib/Collaboration/Collaborators/MailPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/MailPluginTest.php @@ -38,8 +38,8 @@ use OCP\IUser; use OCP\IUserManager; use OCP\IUserSession; -use OCP\Share\IShare; use OCP\Mail\IMailer; +use OCP\Share\IShare; use Test\TestCase; class MailPluginTest extends TestCase { diff --git a/tests/lib/Collaboration/Collaborators/UserPluginTest.php b/tests/lib/Collaboration/Collaborators/UserPluginTest.php index 0d9d89c7f8b60..6a8cf17111cfb 100644 --- a/tests/lib/Collaboration/Collaborators/UserPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/UserPluginTest.php @@ -23,6 +23,9 @@ namespace Test\Collaboration\Collaborators; +use OC\Collaboration\Collaborators\SearchResult; +use OC\Collaboration\Collaborators\UserPlugin; +use OC\KnownUser\KnownUserService; use OCP\Collaboration\Collaborators\ISearchResult; use OCP\IConfig; use OCP\IGroup; @@ -32,9 +35,6 @@ use OCP\IUserSession; use OCP\Share\IShare; use OCP\UserStatus\IManager as IUserStatusManager; -use OC\Collaboration\Collaborators\SearchResult; -use OC\Collaboration\Collaborators\UserPlugin; -use OC\KnownUser\KnownUserService; use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; diff --git a/tests/lib/Diagnostics/EventLoggerTest.php b/tests/lib/Diagnostics/EventLoggerTest.php index 18cd3a91b1a1a..006d0b8b3ea00 100644 --- a/tests/lib/Diagnostics/EventLoggerTest.php +++ b/tests/lib/Diagnostics/EventLoggerTest.php @@ -21,10 +21,10 @@ namespace Test\Diagnostics; -use Psr\Log\LoggerInterface; use OC\Diagnostics\EventLogger; use OC\Log; use OC\SystemConfig; +use Psr\Log\LoggerInterface; use Test\TestCase; class EventLoggerTest extends TestCase { diff --git a/tests/lib/Encryption/ManagerTest.php b/tests/lib/Encryption/ManagerTest.php index 4e354ad518c58..5d8cf02f94d64 100644 --- a/tests/lib/Encryption/ManagerTest.php +++ b/tests/lib/Encryption/ManagerTest.php @@ -193,63 +193,63 @@ public function testSetDefaultEncryptionModule() { $this->assertEquals('ID1', $this->manager->getDefaultEncryptionModuleId()); } -// /** -// * @expectedException \OC\Encryption\Exceptions\ModuleAlreadyExistsException -// * @expectedExceptionMessage Id "0" already used by encryption module "TestDummyModule0" -// */ -// public function testModuleRegistration() { -// $config = $this->createMock(IConfig::class); -// $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); -// $em = $this->createMock(IEncryptionModule::class); -// $em->expects($this->any())->method('getId')->willReturn(0); -// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); -// $m = new Manager($config); -// $m->registerEncryptionModule($em); -// $this->assertTrue($m->isEnabled()); -// $m->registerEncryptionModule($em); -// } -// -// public function testModuleUnRegistration() { -// $config = $this->createMock(IConfig::class); -// $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); -// $em = $this->createMock(IEncryptionModule::class); -// $em->expects($this->any())->method('getId')->willReturn(0); -// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); -// $m = new Manager($config); -// $m->registerEncryptionModule($em); -// $this->assertTrue($m->isEnabled()); -// $m->unregisterEncryptionModule($em); -// $this->assertFalse($m->isEnabled()); -// } -// -// /** -// * @expectedException \OC\Encryption\Exceptions\ModuleDoesNotExistsException -// * @expectedExceptionMessage Module with ID: unknown does not exist. -// */ -// public function testGetEncryptionModuleUnknown() { -// $config = $this->createMock(IConfig::class); -// $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); -// $em = $this->createMock(IEncryptionModule::class); -// $em->expects($this->any())->method('getId')->willReturn(0); -// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); -// $m = new Manager($config); -// $m->registerEncryptionModule($em); -// $this->assertTrue($m->isEnabled()); -// $m->getEncryptionModule('unknown'); -// } -// -// public function testGetEncryptionModule() { -// $config = $this->createMock(IConfig::class); -// $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); -// $em = $this->createMock(IEncryptionModule::class); -// $em->expects($this->any())->method('getId')->willReturn(0); -// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); -// $m = new Manager($config); -// $m->registerEncryptionModule($em); -// $this->assertTrue($m->isEnabled()); -// $en0 = $m->getEncryptionModule(0); -// $this->assertEquals(0, $en0->getId()); -// } + // /** + // * @expectedException \OC\Encryption\Exceptions\ModuleAlreadyExistsException + // * @expectedExceptionMessage Id "0" already used by encryption module "TestDummyModule0" + // */ + // public function testModuleRegistration() { + // $config = $this->createMock(IConfig::class); + // $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); + // $em = $this->createMock(IEncryptionModule::class); + // $em->expects($this->any())->method('getId')->willReturn(0); + // $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); + // $m = new Manager($config); + // $m->registerEncryptionModule($em); + // $this->assertTrue($m->isEnabled()); + // $m->registerEncryptionModule($em); + // } + // + // public function testModuleUnRegistration() { + // $config = $this->createMock(IConfig::class); + // $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); + // $em = $this->createMock(IEncryptionModule::class); + // $em->expects($this->any())->method('getId')->willReturn(0); + // $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); + // $m = new Manager($config); + // $m->registerEncryptionModule($em); + // $this->assertTrue($m->isEnabled()); + // $m->unregisterEncryptionModule($em); + // $this->assertFalse($m->isEnabled()); + // } + // + // /** + // * @expectedException \OC\Encryption\Exceptions\ModuleDoesNotExistsException + // * @expectedExceptionMessage Module with ID: unknown does not exist. + // */ + // public function testGetEncryptionModuleUnknown() { + // $config = $this->createMock(IConfig::class); + // $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); + // $em = $this->createMock(IEncryptionModule::class); + // $em->expects($this->any())->method('getId')->willReturn(0); + // $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); + // $m = new Manager($config); + // $m->registerEncryptionModule($em); + // $this->assertTrue($m->isEnabled()); + // $m->getEncryptionModule('unknown'); + // } + // + // public function testGetEncryptionModule() { + // $config = $this->createMock(IConfig::class); + // $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); + // $em = $this->createMock(IEncryptionModule::class); + // $em->expects($this->any())->method('getId')->willReturn(0); + // $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); + // $m = new Manager($config); + // $m->registerEncryptionModule($em); + // $this->assertTrue($m->isEnabled()); + // $en0 = $m->getEncryptionModule(0); + // $this->assertEquals(0, $en0->getId()); + // } protected function addNewEncryptionModule(Manager $manager, $id) { $encryptionModule = $this->createMock(IEncryptionModule::class); diff --git a/tests/lib/Encryption/UpdateTest.php b/tests/lib/Encryption/UpdateTest.php index df7d137f0b6c5..209acbc7d4703 100644 --- a/tests/lib/Encryption/UpdateTest.php +++ b/tests/lib/Encryption/UpdateTest.php @@ -21,14 +21,14 @@ namespace Test\Encryption; +use OC\Encryption\File; use OC\Encryption\Update; use OC\Encryption\Util; use OC\Files\Mount\Manager; use OC\Files\View; +use OCP\Encryption\IEncryptionModule; use Psr\Log\LoggerInterface; use Test\TestCase; -use OC\Encryption\File; -use OCP\Encryption\IEncryptionModule; class UpdateTest extends TestCase { /** @var \OC\Encryption\Update */ diff --git a/tests/lib/Files/Cache/UpdaterLegacyTest.php b/tests/lib/Files/Cache/UpdaterLegacyTest.php index be0390db15e80..ad6e7cff1232a 100644 --- a/tests/lib/Files/Cache/UpdaterLegacyTest.php +++ b/tests/lib/Files/Cache/UpdaterLegacyTest.php @@ -262,14 +262,14 @@ public function testRenameWithMountPoints() { $this->assertIsString($cachedData['etag']); $this->assertNotSame($oldEtag, $cachedData['etag']); // rename can cause mtime change - invalid assert -// $this->assertEquals($mtime, $cachedData['mtime']); + // $this->assertEquals($mtime, $cachedData['mtime']); $cachedData = $view->getFileInfo('folder'); $this->assertIsString($folderCachedData['etag']); $this->assertIsString($cachedData['etag']); $this->assertNotSame($oldEtag, $cachedData['etag']); // rename can cause mtime change - invalid assert -// $this->assertEquals($mtime, $cachedData['mtime']); + // $this->assertEquals($mtime, $cachedData['mtime']); } public function testTouch() { diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php index ccad4671ae91a..3e509a6f6416d 100644 --- a/tests/lib/Files/Config/UserMountCacheTest.php +++ b/tests/lib/Files/Config/UserMountCacheTest.php @@ -11,8 +11,8 @@ use OC\DB\QueryBuilder\Literal; use OC\Files\Mount\MountPoint; use OC\Files\Storage\Storage; -use OCP\Cache\CappedMemoryCache; use OC\User\Manager; +use OCP\Cache\CappedMemoryCache; use OCP\Diagnostics\IEventLogger; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Config\ICachedMountInfo; diff --git a/tests/lib/Files/EtagTest.php b/tests/lib/Files/EtagTest.php index b9583a6ac7cec..a71bfa1e57298 100644 --- a/tests/lib/Files/EtagTest.php +++ b/tests/lib/Files/EtagTest.php @@ -9,8 +9,8 @@ namespace Test\Files; use OC\Files\Filesystem; -use OCP\EventDispatcher\IEventDispatcher; use OCA\Files_Sharing\AppInfo\Application; +use OCP\EventDispatcher\IEventDispatcher; use Psr\Log\LoggerInterface; /** diff --git a/tests/lib/Files/FilesystemTest.php b/tests/lib/Files/FilesystemTest.php index 96fcab77474e5..5473f164cef52 100644 --- a/tests/lib/Files/FilesystemTest.php +++ b/tests/lib/Files/FilesystemTest.php @@ -325,14 +325,14 @@ public function testHooks() { $rootView->mkdir('/' . $user); $rootView->mkdir('/' . $user . '/files'); -// \OC\Files\Filesystem::file_put_contents('/foo', 'foo'); + // \OC\Files\Filesystem::file_put_contents('/foo', 'foo'); \OC\Files\Filesystem::mkdir('/bar'); -// \OC\Files\Filesystem::file_put_contents('/bar//foo', 'foo'); + // \OC\Files\Filesystem::file_put_contents('/bar//foo', 'foo'); $tmpFile = \OC::$server->getTempManager()->getTemporaryFile(); file_put_contents($tmpFile, 'foo'); $fh = fopen($tmpFile, 'r'); -// \OC\Files\Filesystem::file_put_contents('/bar//foo', $fh); + // \OC\Files\Filesystem::file_put_contents('/bar//foo', $fh); } /** diff --git a/tests/lib/Files/Node/RootTest.php b/tests/lib/Files/Node/RootTest.php index aab658c3c36c6..e24283f0931ac 100644 --- a/tests/lib/Files/Node/RootTest.php +++ b/tests/lib/Files/Node/RootTest.php @@ -8,11 +8,11 @@ namespace Test\Files\Node; -use OCP\Cache\CappedMemoryCache; use OC\Files\FileInfo; use OC\Files\Mount\Manager; use OC\Files\Node\Folder; use OC\Files\View; +use OCP\Cache\CappedMemoryCache; use OCP\EventDispatcher\IEventDispatcher; use OCP\IUser; use OCP\IUserManager; diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php index ec815950d3c97..be5f191c6eb14 100644 --- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php @@ -422,9 +422,9 @@ public function dataTestVerifyUnencryptedSize() { * @param boolean $renameKeysReturn */ public function testRename($source, - $target, - $encryptionEnabled, - $renameKeysReturn) { + $target, + $encryptionEnabled, + $renameKeysReturn) { if ($encryptionEnabled) { $this->keyStore ->expects($this->once()) @@ -790,10 +790,10 @@ public function testCopyBetweenStorage($encryptionEnabled, $mountPointEncryption ->method('isEnabled') ->willReturn($encryptionEnabled); // FIXME can not overwrite the return after definition -// $this->mount->expects($this->at(0)) -// ->method('getOption') -// ->with('encrypt', true) -// ->willReturn($mountPointEncryptionEnabled); + // $this->mount->expects($this->at(0)) + // ->method('getOption') + // ->with('encrypt', true) + // ->willReturn($mountPointEncryptionEnabled); global $mockedMountPointEncryptionEnabled; $mockedMountPointEncryptionEnabled = $mountPointEncryptionEnabled; diff --git a/tests/lib/Files/Stream/EncryptionTest.php b/tests/lib/Files/Stream/EncryptionTest.php index 8cdb379512a8d..3d45ff2fc3ced 100644 --- a/tests/lib/Files/Stream/EncryptionTest.php +++ b/tests/lib/Files/Stream/EncryptionTest.php @@ -78,13 +78,13 @@ protected function getStream($fileName, $mode, $unencryptedSize, $wrapper = self * @dataProvider dataProviderStreamOpen() */ public function testStreamOpen($isMasterKeyUsed, - $mode, - $fullPath, - $fileExists, - $expectedSharePath, - $expectedSize, - $expectedUnencryptedSize, - $expectedReadOnly) { + $mode, + $fullPath, + $fileExists, + $expectedSharePath, + $expectedSize, + $expectedUnencryptedSize, + $expectedReadOnly) { // build mocks $encryptionModuleMock = $this->getMockBuilder('\OCP\Encryption\IEncryptionModule') ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index 18629f69a1302..b9dd49d71fe28 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -7,8 +7,6 @@ namespace Test\Files; -use OC\Share20\ShareDisableChecker; -use OCP\Cache\CappedMemoryCache; use OC\Files\Cache\Watcher; use OC\Files\Filesystem; use OC\Files\Mount\MountPoint; @@ -17,6 +15,8 @@ use OC\Files\Storage\Storage; use OC\Files\Storage\Temporary; use OC\Files\View; +use OC\Share20\ShareDisableChecker; +use OCP\Cache\CappedMemoryCache; use OCP\Constants; use OCP\Files\Config\IMountProvider; use OCP\Files\FileInfo; diff --git a/tests/lib/Group/ManagerTest.php b/tests/lib/Group/ManagerTest.php index 06875f8653691..142532a5f4feb 100644 --- a/tests/lib/Group/ManagerTest.php +++ b/tests/lib/Group/ManagerTest.php @@ -24,11 +24,11 @@ namespace Test\Group; use OC\Group\Database; -use OC\User\User; use OC\User\Manager; +use OC\User\User; use OCP\EventDispatcher\IEventDispatcher; -use OCP\GroupInterface; use OCP\Group\Backend\ISearchableGroupBackend; +use OCP\GroupInterface; use OCP\ICacheFactory; use OCP\IUser; use PHPUnit\Framework\MockObject\MockObject; diff --git a/tests/lib/InitialStateServiceTest.php b/tests/lib/InitialStateServiceTest.php index 554478e123ff4..5af09afb4c09b 100644 --- a/tests/lib/InitialStateServiceTest.php +++ b/tests/lib/InitialStateServiceTest.php @@ -25,14 +25,14 @@ namespace Test; +use JsonSerializable; use OC\AppFramework\Bootstrap\Coordinator; +use OC\InitialStateService; use OCP\IServerContainer; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; -use function json_encode; -use JsonSerializable; -use OC\InitialStateService; use stdClass; +use function json_encode; class InitialStateServiceTest extends TestCase { /** @var InitialStateService */ diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php index 5ffba9392841e..418bfe35c6e57 100644 --- a/tests/lib/Mail/MailerTest.php +++ b/tests/lib/Mail/MailerTest.php @@ -21,13 +21,13 @@ use OCP\IURLGenerator; use OCP\L10N\IFactory; use OCP\Mail\Events\BeforeMessageSent; -use Psr\Log\LoggerInterface; -use Test\TestCase; use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use Symfony\Component\Mailer\Mailer as SymfonyMailer; -use Symfony\Component\Mime\Email; -use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; use Symfony\Component\Mailer\Transport\SendmailTransport; +use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; +use Symfony\Component\Mime\Email; +use Test\TestCase; class MailerTest extends TestCase { /** @var IConfig|MockObject */ diff --git a/tests/lib/Mail/MessageTest.php b/tests/lib/Mail/MessageTest.php index 2becc4d2081a7..1d309ca742dc2 100644 --- a/tests/lib/Mail/MessageTest.php +++ b/tests/lib/Mail/MessageTest.php @@ -11,13 +11,13 @@ use OC\Mail\Message; use OCP\Mail\Headers\AutoSubmitted; use OCP\Mail\IEMailTemplate; +use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Mime\Address; use Symfony\Component\Mime\Email; use Symfony\Component\Mime\Exception\RfcComplianceException; use Symfony\Component\Mime\Header\HeaderInterface; use Symfony\Component\Mime\Header\Headers; use Test\TestCase; -use PHPUnit\Framework\MockObject\MockObject; class MessageTest extends TestCase { /** @var Email */ diff --git a/tests/lib/Memcache/FactoryTest.php b/tests/lib/Memcache/FactoryTest.php index 9cdd7058ffac2..3384157e6425c 100644 --- a/tests/lib/Memcache/FactoryTest.php +++ b/tests/lib/Memcache/FactoryTest.php @@ -22,8 +22,8 @@ namespace Test\Memcache; use OC\Memcache\NullCache; -use Psr\Log\LoggerInterface; use OCP\Profiler\IProfiler; +use Psr\Log\LoggerInterface; class Test_Factory_Available_Cache1 extends NullCache { public function __construct($prefix = '') { diff --git a/tests/lib/Metadata/FileMetadataMapperTest.php b/tests/lib/Metadata/FileMetadataMapperTest.php index 4f7708ab9a92a..a1e7a8943062d 100644 --- a/tests/lib/Metadata/FileMetadataMapperTest.php +++ b/tests/lib/Metadata/FileMetadataMapperTest.php @@ -22,8 +22,8 @@ namespace Test\Metadata; -use OC\Metadata\FileMetadataMapper; use OC\Metadata\FileMetadata; +use OC\Metadata\FileMetadataMapper; use PHPUnit\Framework\MockObject\MockObject; /** diff --git a/tests/lib/Migration/BackgroundRepairTest.php b/tests/lib/Migration/BackgroundRepairTest.php index 2e68924a96d7a..fbabaa099021c 100644 --- a/tests/lib/Migration/BackgroundRepairTest.php +++ b/tests/lib/Migration/BackgroundRepairTest.php @@ -21,14 +21,14 @@ namespace Test\Migration; -use OCP\AppFramework\Utility\ITimeFactory; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\Migration\IOutput; -use OCP\Migration\IRepairStep; use OC\BackgroundJob\JobList; use OC\Migration\BackgroundRepair; use OC\NeedsUpdateException; use OC\Repair\Events\RepairStepEvent; +use OCP\AppFramework\Utility\ITimeFactory; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\Migration\IOutput; +use OCP\Migration\IRepairStep; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Test\TestCase; diff --git a/tests/lib/Repair/RepairDavSharesTest.php b/tests/lib/Repair/RepairDavSharesTest.php index 394fc9854690d..0e9fdca7cdd67 100644 --- a/tests/lib/Repair/RepairDavSharesTest.php +++ b/tests/lib/Repair/RepairDavSharesTest.php @@ -32,9 +32,9 @@ use OCP\IConfig; use OCP\IDBConnection; use OCP\IGroupManager; +use OCP\Migration\IOutput; use Psr\Log\LoggerInterface; use Test\TestCase; -use OCP\Migration\IOutput; use function in_array; class RepairDavSharesTest extends TestCase { diff --git a/tests/lib/RepairTest.php b/tests/lib/RepairTest.php index 1a2fd620e49fe..53bf9520a7c4a 100644 --- a/tests/lib/RepairTest.php +++ b/tests/lib/RepairTest.php @@ -8,13 +8,13 @@ namespace Test; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\Migration\IRepairStep; use OC\Repair; +use OC\Repair\Events\RepairErrorEvent; use OC\Repair\Events\RepairInfoEvent; use OC\Repair\Events\RepairStepEvent; use OC\Repair\Events\RepairWarningEvent; -use OC\Repair\Events\RepairErrorEvent; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\Migration\IRepairStep; use Psr\Log\LoggerInterface; class TestRepairStep implements IRepairStep { diff --git a/tests/lib/Security/Bruteforce/ThrottlerTest.php b/tests/lib/Security/Bruteforce/ThrottlerTest.php index e368a0912b10a..473aa374d39b3 100644 --- a/tests/lib/Security/Bruteforce/ThrottlerTest.php +++ b/tests/lib/Security/Bruteforce/ThrottlerTest.php @@ -160,9 +160,9 @@ public function dataIsIPWhitelisted() { * @param bool $enabled */ private function isIpWhiteListedHelper($ip, - $whitelists, - $isWhiteListed, - $enabled) { + $whitelists, + $isWhiteListed, + $enabled) { $this->config->method('getAppKeys') ->with($this->equalTo('bruteForce')) ->willReturn(array_keys($whitelists)); @@ -197,8 +197,8 @@ private function isIpWhiteListedHelper($ip, * @param bool $isWhiteListed */ public function testIsIpWhiteListedWithEnabledProtection($ip, - $whitelists, - $isWhiteListed) { + $whitelists, + $isWhiteListed) { $this->isIpWhiteListedHelper( $ip, $whitelists, @@ -215,8 +215,8 @@ public function testIsIpWhiteListedWithEnabledProtection($ip, * @param bool $isWhiteListed */ public function testIsIpWhiteListedWithDisabledProtection($ip, - $whitelists, - $isWhiteListed) { + $whitelists, + $isWhiteListed) { $this->isIpWhiteListedHelper( $ip, $whitelists, diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php index 6ad8231a61de3..08cbfa9e22199 100644 --- a/tests/lib/Security/CertificateManagerTest.php +++ b/tests/lib/Security/CertificateManagerTest.php @@ -146,9 +146,9 @@ public function testGetCertificateBundle() { * @param bool $expected */ public function testNeedRebundling($CaBundleMtime, - $targetBundleMtime, - $targetBundleExists, - $expected + $targetBundleMtime, + $targetBundleExists, + $expected ) { $view = $this->getMockBuilder(View::class) ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/Security/VerificationToken/VerificationTokenTest.php b/tests/lib/Security/VerificationToken/VerificationTokenTest.php index a71d2b09f713e..182bd533f84f1 100644 --- a/tests/lib/Security/VerificationToken/VerificationTokenTest.php +++ b/tests/lib/Security/VerificationToken/VerificationTokenTest.php @@ -34,8 +34,8 @@ use OCP\Security\ICrypto; use OCP\Security\ISecureRandom; use OCP\Security\VerificationToken\InvalidTokenException; -use Test\TestCase; use PHPUnit\Framework\MockObject\MockObject; +use Test\TestCase; class VerificationTokenTest extends TestCase { /** @var VerificationToken */ diff --git a/tests/lib/Settings/ManagerTest.php b/tests/lib/Settings/ManagerTest.php index cc13479b1d0c1..93d57c37806e4 100644 --- a/tests/lib/Settings/ManagerTest.php +++ b/tests/lib/Settings/ManagerTest.php @@ -34,9 +34,9 @@ use OCP\L10N\IFactory; use OCP\Settings\ISettings; use OCP\Settings\ISubAdminSettings; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Test\TestCase; -use PHPUnit\Framework\MockObject\MockObject; class ManagerTest extends TestCase { /** @var Manager|MockObject */ diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index 0ce96102a30d2..f977619b7b246 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -133,8 +133,8 @@ protected function tearDown(): void { * @return int */ private function addShareToDB($shareType, $sharedWith, $sharedBy, $shareOwner, - $itemType, $fileSource, $fileTarget, $permissions, $token, $expiration, - $parent = null) { + $itemType, $fileSource, $fileTarget, $permissions, $token, $expiration, + $parent = null) { $qb = $this->dbConn->getQueryBuilder(); $qb->insert('share'); diff --git a/tests/lib/TextProcessing/TextProcessingTest.php b/tests/lib/TextProcessing/TextProcessingTest.php index 15f36cb2452cc..193c5d4c39d01 100644 --- a/tests/lib/TextProcessing/TextProcessingTest.php +++ b/tests/lib/TextProcessing/TextProcessingTest.php @@ -24,13 +24,13 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use OCP\IServerContainer; +use OCP\PreConditionNotMetException; use OCP\TextProcessing\Events\TaskFailedEvent; use OCP\TextProcessing\Events\TaskSuccessfulEvent; use OCP\TextProcessing\FreePromptTaskType; use OCP\TextProcessing\IManager; use OCP\TextProcessing\IProvider; use OCP\TextProcessing\SummaryTaskType; -use OCP\PreConditionNotMetException; use OCP\TextProcessing\Task; use OCP\TextProcessing\TopicsTaskType; use PHPUnit\Framework\Constraint\IsInstanceOf; diff --git a/tests/lib/Updater/ChangesCheckTest.php b/tests/lib/Updater/ChangesCheckTest.php index e96406622f474..4afb9f05a5b3e 100644 --- a/tests/lib/Updater/ChangesCheckTest.php +++ b/tests/lib/Updater/ChangesCheckTest.php @@ -26,15 +26,15 @@ namespace Test\Updater; +use OC\Updater\Changes; use OC\Updater\ChangesCheck; use OC\Updater\ChangesMapper; -use OC\Updater\Changes; use OCP\AppFramework\Db\DoesNotExistException; use OCP\Http\Client\IClient; use OCP\Http\Client\IClientService; use OCP\Http\Client\IResponse; -use Test\TestCase; use Psr\Log\LoggerInterface; +use Test\TestCase; class ChangesCheckTest extends TestCase { /** @var IClientService|\PHPUnit\Framework\MockObject\MockObject */ diff --git a/tests/lib/UpdaterTest.php b/tests/lib/UpdaterTest.php index 579761208db16..02b2189cdccb8 100644 --- a/tests/lib/UpdaterTest.php +++ b/tests/lib/UpdaterTest.php @@ -22,12 +22,12 @@ namespace Test; -use PHPUnit\Framework\MockObject\MockObject; -use Psr\Log\LoggerInterface; use OC\Installer; use OC\IntegrityCheck\Checker; use OC\Updater; use OCP\IConfig; +use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; class UpdaterTest extends TestCase { /** @var IConfig|MockObject */ diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php index b6ac7a69fed55..d6db17d9d45cd 100644 --- a/tests/lib/User/SessionTest.php +++ b/tests/lib/User/SessionTest.php @@ -14,6 +14,7 @@ use OC\Authentication\Exceptions\PasswordLoginForbiddenException; use OC\Authentication\Token\IProvider; use OC\Authentication\Token\IToken; +use OC\Security\CSRF\CsrfTokenManager; use OC\Session\Memory; use OC\User\LoginException; use OC\User\Manager; @@ -34,7 +35,6 @@ use OCP\User\Events\PostLoginEvent; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; -use OC\Security\CSRF\CsrfTokenManager; /** * @group DB diff --git a/tests/lib/Util/Group/Dummy.php b/tests/lib/Util/Group/Dummy.php index a864c8ce9d992..fd784e4fa46a5 100644 --- a/tests/lib/Util/Group/Dummy.php +++ b/tests/lib/Util/Group/Dummy.php @@ -29,13 +29,13 @@ namespace Test\Util\Group; -use Test\Util\User\Dummy as DummyUser; use OCP\Group\Backend\ABackend; -use OCP\Group\Backend\IDeleteGroupBackend; use OCP\Group\Backend\IAddToGroupBackend; -use OCP\Group\Backend\IRemoveFromGroupBackend; -use OCP\Group\Backend\ICreateGroupBackend; use OCP\Group\Backend\ICountUsersBackend; +use OCP\Group\Backend\ICreateGroupBackend; +use OCP\Group\Backend\IDeleteGroupBackend; +use OCP\Group\Backend\IRemoveFromGroupBackend; +use Test\Util\User\Dummy as DummyUser; /** * Dummy group backend, does not keep state, only for testing use