Skip to content

Commit

Permalink
Fix code style according to latest Nextcloud coding standards
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Gaussorgues <[email protected]>
  • Loading branch information
Altahrim committed Jul 18, 2023
1 parent 7d74481 commit 5d8d31b
Show file tree
Hide file tree
Showing 292 changed files with 912 additions and 938 deletions.
2 changes: 1 addition & 1 deletion build/integration/features/bootstrap/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
14 changes: 7 additions & 7 deletions build/integration/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion core/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
use OCP\Files\Events\Node\NodeDeletedEvent;
use OCP\Files\Events\Node\NodeWrittenEvent;
use OCP\Files\Events\NodeRemovedFromCache;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\User\Events\BeforeUserDeletedEvent;
use OCP\User\Events\UserDeletedEvent;
use OCP\Util;
use OCP\IConfig;
use Symfony\Component\EventDispatcher\GenericEvent;

/**
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Broadcast/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Db/AddMissingIndices.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IDBConnection;
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;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Db/ConvertFilecacheBigInt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Db/ConvertType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Info/FileUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions core/Command/Maintenance/Repair.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
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;
use OC\Repair\Events\RepairInfoEvent;
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;
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Maintenance/RepairShareOwnership.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Preview/Generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion core/Command/TwoFactorAuth/Enforce.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion core/Command/TwoFactorAuth/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions core/Command/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions core/Controller/ClientFlowLoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,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();
}
Expand Down Expand Up @@ -231,7 +231,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();
Expand Down
10 changes: 5 additions & 5 deletions core/Controller/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions core/Controller/LostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion core/Controller/ProfileApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -37,7 +38,6 @@
use OCP\IRequest;
use OCP\IUserManager;
use OCP\IUserSession;
use OC\Profile\ProfileManager;

class ProfileApiController extends OCSController {
public function __construct(
Expand Down
6 changes: 3 additions & 3 deletions core/Controller/ProfilePageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/Controller/ReferenceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions core/Controller/UnifiedSearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -93,11 +93,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 (empty(trim($term))) {
return new DataResponse(null, Http::STATUS_BAD_REQUEST);
}
Expand Down
4 changes: 2 additions & 2 deletions core/Db/ProfileConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion core/Migrations/Version13000Date20170705121758.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading

0 comments on commit 5d8d31b

Please sign in to comment.