Skip to content

Commit

Permalink
Merge pull request #3731 from nextcloud/dependabot/composer/nextcloud…
Browse files Browse the repository at this point in the history
…/coding-standard-1.3.1

Chore(deps-dev): Bump nextcloud/coding-standard from 1.2.3 to 1.3.1
  • Loading branch information
dartcafe authored Sep 28, 2024
2 parents c230c91 + 45be7ad commit c72f871
Show file tree
Hide file tree
Showing 97 changed files with 188 additions and 133 deletions.
85 changes: 66 additions & 19 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Activity/PollChanges.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class PollChanges implements IFilter {
public function __construct(
protected IL10N $l10n,
protected IURLGenerator $urlGenerator
protected IURLGenerator $urlGenerator,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Command/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Command extends \Symfony\Component\Console\Command\Command {
public function __construct(
) {
parent::__construct();
$this->question = new ConfirmationQuestion('Continue (y/n)? ['. ($this->defaultContinueAnswer ? 'y' : 'n') . '] ', $this->defaultContinueAnswer);
$this->question = new ConfirmationQuestion('Continue (y/n)? [' . ($this->defaultContinueAnswer ? 'y' : 'n') . '] ', $this->defaultContinueAnswer);
}

protected function configure(): void {
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/Db/Purge.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Purge extends Command {

public function __construct(
private IDBConnection $connection,
private TableManager $tableManager
private TableManager $tableManager,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/Poll/TransferOwnership.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class TransferOwnership extends Command {
public function __construct(
private IUserManager $userManager,
private PollService $pollService
private PollService $pollService,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/Share/TShareCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(
private ShareMapper $shareMapper,
private ShareService $shareService,
private IUserManager $userManager,
private IGroupManager $groupManager
private IGroupManager $groupManager,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/BaseApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(
IRequest $request,
string $corsMethods = 'PUT, POST, GET, DELETE',
string $corsAllowedHeaders = 'Authorization, Content-Type, Accept',
int $corsMaxAge = 1728000
int $corsMaxAge = 1728000,
) {
parent::__construct($appName, $request, $corsMethods, $corsAllowedHeaders, $corsMaxAge);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/CommentApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CommentApiController extends BaseApiController {
public function __construct(
string $appName,
IRequest $request,
private CommentService $commentService
private CommentService $commentService,
) {
parent::__construct($appName, $request);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/CommentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CommentController extends BaseController {
public function __construct(
string $appName,
IRequest $request,
private CommentService $commentService
private CommentService $commentService,
) {
parent::__construct($appName, $request);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/OptionApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class OptionApiController extends BaseApiController {
public function __construct(
string $appName,
IRequest $request,
private OptionService $optionService
private OptionService $optionService,
) {
parent::__construct($appName, $request);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/PollApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(
string $appName,
IRequest $request,
private Acl $acl,
private PollService $pollService
private PollService $pollService,
) {
parent::__construct($appName, $request);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/PublicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct(
private SubscriptionService $subscriptionService,
private SystemService $systemService,
private VoteService $voteService,
private WatchService $watchService
private WatchService $watchService,
) {
parent::__construct($appName, $request);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SettingsController extends BaseController {
public function __construct(
string $appName,
IRequest $request,
private SettingsService $settingsService
private SettingsService $settingsService,
) {
parent::__construct($appName, $request);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/ShareApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
string $appName,
IRequest $request,
private MailService $mailService,
private ShareService $shareService
private ShareService $shareService,
) {
parent::__construct($appName, $request);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/SubscriptionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SubscriptionController extends BaseController {
public function __construct(
string $appName,
IRequest $request,
private SubscriptionService $subscriptionService
private SubscriptionService $subscriptionService,
) {
parent::__construct($appName, $request);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/SystemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SystemController extends BaseController {
public function __construct(
string $appName,
IRequest $request,
private SystemService $systemService
private SystemService $systemService,
) {
parent::__construct($appName, $request);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/VoteApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class VoteApiController extends BaseApiController {
public function __construct(
string $appName,
IRequest $request,
private VoteService $voteService
private VoteService $voteService,
) {
parent::__construct($appName, $request);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/WatchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class WatchController extends BaseController {
public function __construct(
string $appName,
IRequest $request,
private WatchService $watchService
private WatchService $watchService,
) {
parent::__construct($appName, $request);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Dashboard/PollWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class PollWidget implements IWidget {
*/
public function __construct(
private IL10N $l10n,
private IURLGenerator $urlGenerator
private IURLGenerator $urlGenerator,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Db/CommentMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function findByPoll(int $pollId, bool $getDeleted = false): array {
/**
* @return void
*/
public function renameUserId(string $userId, string $replacementId, int|null $pollId = null): void {
public function renameUserId(string $userId, string $replacementId, ?int $pollId = null): void {
$query = $this->db->getQueryBuilder();
$query->update($this->getTableName(), self::TABLE)
->set('user_id', $query->createNamedParameter($replacementId))
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/IndexManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function removeGenericIndicesFromTable(string $tableName): array {
*
* @return null|string
*/
public function removeNamedIndexFromTable(string $tableName, string $indexName): string|null {
public function removeNamedIndexFromTable(string $tableName, string $indexName): ?string {
$tableName = $this->dbPrefix . $tableName;
$message = null;
try {
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/OptionMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function findOptionsWithDuration(): array {
return $this->findEntities($qb);
}

public function renameUserId(string $userId, string $replacementName, int|null $pollId = null): void {
public function renameUserId(string $userId, string $replacementName, ?int $pollId = null): void {
$query = $this->db->getQueryBuilder();
$query->update($this->getTableName())
->set('owner', $query->createNamedParameter($replacementName))
Expand Down
14 changes: 7 additions & 7 deletions lib/Db/PollMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ protected function joinUserRole(IQueryBuilder &$qb, string $fromAlias, string $c
$qb->selectAlias($joinAlias . '.locked', 'is_current_user_locked')
->addGroupBy($joinAlias . '.locked');

$qb->addSelect($qb->createFunction('coalesce(' . $joinAlias . '.token, '. $emptyString . ') AS share_token'))
$qb->addSelect($qb->createFunction('coalesce(' . $joinAlias . '.token, ' . $emptyString . ') AS share_token'))
->addGroupBy($joinAlias . '.token');

$qb->leftJoin(
Expand All @@ -234,19 +234,19 @@ protected function joinGroupShares(IQueryBuilder &$qb, string $fromAlias): void
$joinAlias = 'group_shares';

if ($this->db->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$qb->addSelect($qb->createFunction('string_agg(distinct ' . $joinAlias . '.user_id, \''. self::CONCAT_SEPARATOR . '\') AS group_shares'));
$qb->addSelect($qb->createFunction('string_agg(distinct ' . $joinAlias . '.user_id, \'' . self::CONCAT_SEPARATOR . '\') AS group_shares'));

} elseif ($this->db->getDatabasePlatform() instanceof OraclePlatform) {
$qb->addSelect($qb->createFunction('listagg(distinct ' . $joinAlias . '.user_id, \''. self::CONCAT_SEPARATOR . '\') WITHIN GROUP (ORDER BY ' . $joinAlias . '.user_id) AS group_shares'));
$qb->addSelect($qb->createFunction('listagg(distinct ' . $joinAlias . '.user_id, \'' . self::CONCAT_SEPARATOR . '\') WITHIN GROUP (ORDER BY ' . $joinAlias . '.user_id) AS group_shares'));

} elseif ($this->db->getDatabasePlatform() instanceof SqlitePlatform) {
$qb->addSelect($qb->createFunction('group_concat(replace(distinct ' . $joinAlias . '.user_id ,\'\',\'\'), \''. self::CONCAT_SEPARATOR . '\') AS group_shares'));
$qb->addSelect($qb->createFunction('group_concat(replace(distinct ' . $joinAlias . '.user_id ,\'\',\'\'), \'' . self::CONCAT_SEPARATOR . '\') AS group_shares'));

} elseif ($this->db->getDatabasePlatform() instanceof MySQLPlatform) {
$qb->addSelect($qb->createFunction('group_concat(distinct ' . $joinAlias . '.user_id SEPARATOR \''. self::CONCAT_SEPARATOR . '\') AS group_shares'));
$qb->addSelect($qb->createFunction('group_concat(distinct ' . $joinAlias . '.user_id SEPARATOR \'' . self::CONCAT_SEPARATOR . '\') AS group_shares'));

} else {
$qb->addSelect($qb->createFunction('group_concat(distinct ' . $joinAlias . '.user_id SEPARATOR \''. self::CONCAT_SEPARATOR . '\') AS group_shares'));
$qb->addSelect($qb->createFunction('group_concat(distinct ' . $joinAlias . '.user_id SEPARATOR \'' . self::CONCAT_SEPARATOR . '\') AS group_shares'));
}

$qb->leftJoin(
Expand Down Expand Up @@ -274,7 +274,7 @@ protected function joinOptionsForMaxDate(IQueryBuilder &$qb, string $fromAlias):
$zero = $qb->createNamedParameter(0, IQueryBuilder::PARAM_INT);
$saveMin = $qb->createNamedParameter(time(), IQueryBuilder::PARAM_INT);

$qb->addSelect($qb->createFunction('coalesce(MAX(' . $joinAlias . '.timestamp), '. $zero . ') AS max_date'))
$qb->addSelect($qb->createFunction('coalesce(MAX(' . $joinAlias . '.timestamp), ' . $zero . ') AS max_date'))
->addSelect($qb->createFunction('coalesce(MIN(' . $joinAlias . '.timestamp), ' . $saveMin . ') AS min_date'));
$qb->selectAlias($qb->func()->count($joinAlias . '.id'), 'count_options');

Expand Down
Loading

0 comments on commit c72f871

Please sign in to comment.