Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps-dev): Bump nextcloud/coding-standard from 1.2.1 to 1.3.2 #366

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 59 additions & 12 deletions composer.lock

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

18 changes: 9 additions & 9 deletions lib/Command/Lock.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Lock extends Base {
*/
public function __construct(
IUserManager $userManager, LocksRequest $locksRequest, FileService $fileService,
LockService $lockService, ConfigService $configService
LockService $lockService, ConfigService $configService,
) {
parent::__construct();

Expand All @@ -80,14 +80,14 @@ public function __construct(
protected function configure() {
parent::configure();
$this->setName('files:lock')
->addOption('unlock', 'u', InputOption::VALUE_NONE, 'unlock a file')
->addOption(
'uninstall', '', InputOption::VALUE_NONE, 'fully uninstall the app from your Nextcloud'
)
->addOption('status', 's', InputOption::VALUE_NONE, 'returns lock status of the file')
->addArgument('file_id', InputArgument::OPTIONAL, 'Id of the locked file', 0)
->addArgument('user_id', InputArgument::OPTIONAL, 'owner of the lock', '')
->setDescription('lock a file to a user');
->addOption('unlock', 'u', InputOption::VALUE_NONE, 'unlock a file')
->addOption(
'uninstall', '', InputOption::VALUE_NONE, 'fully uninstall the app from your Nextcloud'
)
->addOption('status', 's', InputOption::VALUE_NONE, 'returns lock status of the file')
->addArgument('file_id', InputArgument::OPTIONAL, 'Id of the locked file', 0)
->addArgument('user_id', InputArgument::OPTIONAL, 'owner of the lock', '')
->setDescription('lock a file to a user');
}


Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/LockController.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ protected function fail(
Exception $e,
array $more = [],
int $status = Http::STATUS_INTERNAL_SERVER_ERROR,
bool $log = true
bool $log = true,
): DataResponse {
$data = array_merge(
$more,
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/LockBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class LockBackend implements BackendInterface {
public function __construct(
private FileService $fileService,
private LockService $lockService,
private bool $absolute
private bool $absolute,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/LockPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private function cacheDirectory(Directory $directory): void {
$ids[] = (string)$id;
}

$ids[] = (string) $directory->getId();
$ids[] = (string)$directory->getId();
// the lock service will take care of the caching
$this->lockService->getLockForNodeIds($ids);
}
Expand Down
10 changes: 5 additions & 5 deletions lib/Db/LocksRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class LocksRequest extends LocksRequestBuilder {
public function save(FileLock $lock) {
$qb = $this->getLocksInsertSql();
$qb->setValue('user_id', $qb->createNamedParameter($lock->getOwner()))
->setValue('file_id', $qb->createNamedParameter($lock->getFileId()))
->setValue('token', $qb->createNamedParameter($lock->getToken()))
->setValue('creation', $qb->createNamedParameter($lock->getCreatedAt()))
->setValue('type', $qb->createNamedParameter($lock->getType()))
->setValue('ttl', $qb->createNamedParameter($lock->getTimeout()));
->setValue('file_id', $qb->createNamedParameter($lock->getFileId()))
->setValue('token', $qb->createNamedParameter($lock->getToken()))
->setValue('creation', $qb->createNamedParameter($lock->getCreatedAt()))
->setValue('type', $qb->createNamedParameter($lock->getType()))
->setValue('ttl', $qb->createNamedParameter($lock->getTimeout()));

try {
$qb->execute();
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/LocksRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function getLocksSelectSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();

$qb->select('l.id', 'l.user_id', 'l.file_id', 'l.token', 'l.creation', 'l.type', 'l.ttl', 'l.owner')
->from(self::TABLE_LOCKS, 'l');
->from(self::TABLE_LOCKS, 'l');

$qb->setDefaultSelectAlias('l');

Expand Down
8 changes: 4 additions & 4 deletions lib/Service/FileService.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(IUserSession $userSession, IRootFolder $rootFolder)
*/
public function getFileFromId(string $userId, int $fileId): Node {
$files = $this->rootFolder->getUserFolder($userId)
->getById($fileId);
->getById($fileId);

if (sizeof($files) === 0) {
throw new NotFoundException();
Expand All @@ -71,7 +71,7 @@ public function getFileFromPath(string $userId, string $path): Node {

$path = '/' . substr($path, 6);
$file = $this->rootFolder->getUserFolder($userId)
->get($path);
->get($path);

return $file;
}
Expand All @@ -93,7 +93,7 @@ public function getFileFromUri(string $uri): Node {

$path = '/' . $uri;
$file = $this->rootFolder->getUserFolder($userId)
->get($path);
->get($path);

return $file;
}
Expand All @@ -114,7 +114,7 @@ public function getFileFromAbsoluteUri(string $uri): Node {
}
$path = '/' . $path;
$file = $this->rootFolder->getUserFolder($userId)
->get($path);
->get($path);

return $file;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Storage/LockWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected function isLocked(string $ownerId, string $path, string $viewerId, &$l
return true;
}
}
} catch (NoLockProviderException | LockNotFoundException | InvalidPathException | NotFoundException $e) {
} catch (NoLockProviderException|LockNotFoundException|InvalidPathException|NotFoundException $e) {
}

return false;
Expand Down
24 changes: 12 additions & 12 deletions lib/Tools/Db/ExtendedQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public function searchInDBField(string $field, string $value): void {
* @deprecated - should be removed
*/
public function exprFieldWithinJsonFormat(
IQueryBuilder $qb, string $field, string $fieldRight, string $alias = ''
IQueryBuilder $qb, string $field, string $fieldRight, string $alias = '',
): string {
$func = $qb->func();
$expr = $qb->expr();
Expand Down Expand Up @@ -212,7 +212,7 @@ public function exprFieldWithinJsonFormat(
* @deprecated - should be removed
*/
public function exprValueWithinJsonFormat(
IQueryBuilder $qb, string $field, string $value, bool $eq = true, bool $cs = true
IQueryBuilder $qb, string $field, string $value, bool $eq = true, bool $cs = true,
): string {
$dbConn = $this->getConnection();
$expr = $qb->expr();
Expand Down Expand Up @@ -434,7 +434,7 @@ public function exprLimitBool(string $field, bool $value, string $alias = ''): s
public function exprLimitEmpty(
string $field,
bool $orNull = false,
string $alias = ''
string $alias = '',
): ICompositeExpression {
if ($this->getType() === DBALQueryBuilder::SELECT) {
$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
Expand All @@ -460,7 +460,7 @@ public function exprLimitEmpty(
public function exprLimitNull(
string $field,
bool $orEmpty = false,
string $alias = ''
string $alias = '',
): ICompositeExpression {
if ($this->getType() === DBALQueryBuilder::SELECT) {
$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
Expand Down Expand Up @@ -489,7 +489,7 @@ public function exprLimitArray(
string $field,
array $values,
string $alias = '',
bool $cs = true
bool $cs = true,
): ICompositeExpression {
if ($this->getType() === DBALQueryBuilder::SELECT) {
$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
Expand Down Expand Up @@ -785,7 +785,7 @@ public function exprFilterBool(string $field, bool $value, string $alias = ''):
public function exprFilterEmpty(
string $field,
bool $norNull = false,
string $alias = ''
string $alias = '',
): ICompositeExpression {
if ($this->getType() === DBALQueryBuilder::SELECT) {
$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
Expand All @@ -811,7 +811,7 @@ public function exprFilterEmpty(
public function exprFilterNull(
string $field,
bool $norEmpty = false,
string $alias = ''
string $alias = '',
): ICompositeExpression {
if ($this->getType() === DBALQueryBuilder::SELECT) {
$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
Expand Down Expand Up @@ -840,7 +840,7 @@ public function exprFilterArray(
string $field,
array $values,
string $alias = '',
bool $cs = true
bool $cs = true,
): ICompositeExpression {
if ($this->getType() === DBALQueryBuilder::SELECT) {
$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
Expand Down Expand Up @@ -933,7 +933,7 @@ private function parseSimpleSelectSql(
array $data,
ExtendedQueryBuilder $qb,
string $object,
array $params
array $params,
): IQueryRow {
$fromField = $this->get('modelFromField', $params);
if ($fromField !== '') {
Expand Down Expand Up @@ -1010,7 +1010,7 @@ public function generateSelect(
string $table,
array $fields,
string $alias = '',
bool $distinct = false
bool $distinct = false,
): self {
$selectFields = array_map(
function (string $item) use ($alias) {
Expand All @@ -1029,7 +1029,7 @@ function (string $item) use ($alias) {
}

$this->from($table, $alias)
->setDefaultSelectAlias($alias);
->setDefaultSelectAlias($alias);

return $this;
}
Expand All @@ -1047,7 +1047,7 @@ public function generateSelectAlias(
array $fields,
string $alias,
string $prefix,
array $default = []
array $default = [],
): self {
$prefix = trim($prefix) . '_';
$grouping = true;
Expand Down
Loading
Loading