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

cleaning and fixing #1090

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions lib/Command/CirclesConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ protected function configure() {
->setDescription('edit config/type of a Circle')
->addArgument('circle_id', InputArgument::REQUIRED, 'ID of the circle')
->addArgument(
'config', InputArgument::IS_ARRAY,
'list of value to change in the configuration of the Circle'
'config', InputArgument::IS_ARRAY,
'list of value to change in the configuration of the Circle'
)
->addOption('initiator', '', InputOption::VALUE_REQUIRED, 'set an initiator to the request', '')
->addOption('initiator-type', '', InputOption::VALUE_REQUIRED, 'set initiator type', '0')
->addOption(
'super-session', '',
InputOption::VALUE_NONE, 'use super session to bypass some condition'
'super-session', '',
InputOption::VALUE_NONE, 'use super session to bypass some condition'
)
->addOption('status-code', '', InputOption::VALUE_NONE, 'display status code on exception');
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Command/CirclesCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ protected function configure() {
->addOption('local', '', InputOption::VALUE_NONE, 'create a local circle')
->addOption('status-code', '', InputOption::VALUE_NONE, 'display status code on exception')
->addOption(
'type', '', InputOption::VALUE_REQUIRED, 'type of the owner',
Member::$TYPE[Member::TYPE_SINGLE]
'type', '', InputOption::VALUE_REQUIRED, 'type of the owner',
Member::$TYPE[Member::TYPE_SINGLE]
);
}

Expand Down
8 changes: 4 additions & 4 deletions lib/Command/CirclesMaintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ protected function configure() {
->setDescription('Clean stuff, keeps the app running')
->addOption('level', '', InputOption::VALUE_REQUIRED, 'level of maintenance', '3')
->addOption(
'reset', '', InputOption::VALUE_NONE, 'reset Circles; remove all data related to the App'
'reset', '', InputOption::VALUE_NONE, 'reset Circles; remove all data related to the App'
)
->addOption(
'clean-shares', '', InputOption::VALUE_NONE, 'remove Circles\' shares'
'clean-shares', '', InputOption::VALUE_NONE, 'remove Circles\' shares'
)
->addOption(
'uninstall', '', InputOption::VALUE_NONE,
'Uninstall the apps and everything related to the app from the database'
'uninstall', '', InputOption::VALUE_NONE,
'Uninstall the apps and everything related to the app from the database'
);
}

Expand Down
14 changes: 7 additions & 7 deletions lib/Command/CirclesMemberships.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ protected function configure() {
// ->addOption('reset', '', InputOption::VALUE_NONE, 'reset memberships')
->addOption('all', '', InputOption::VALUE_NONE, 'refresh memberships for all entities')
->addOption(
'type', '', InputOption::VALUE_REQUIRED, 'type of the user',
Member::$TYPE[Member::TYPE_SINGLE]
'type', '', InputOption::VALUE_REQUIRED, 'type of the user',
Member::$TYPE[Member::TYPE_SINGLE]
);
}

Expand Down Expand Up @@ -273,11 +273,11 @@ private function generateTree(string $id, TreeNode $tree, array $knownIds = [])

$item = new TreeNode(
$tree, new SimpleDataStore(
[
'member' => $member,
'cycling' => in_array($member->getCircleId(), $knownIds)
]
)
[
'member' => $member,
'cycling' => in_array($member->getCircleId(), $knownIds)
]
)
);
$this->generateTree($member->getCircleId(), $item, $knownIds);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Command/CirclesRemote.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ protected function configure() {
->setDescription('remote features')
->addArgument('host', InputArgument::OPTIONAL, 'host of the remote instance of Nextcloud')
->addOption(
'type', '', InputOption::VALUE_REQUIRED, 'set type of remote', RemoteInstance::TYPE_UNKNOWN
'type', '', InputOption::VALUE_REQUIRED, 'set type of remote', RemoteInstance::TYPE_UNKNOWN
)
->addOption(
'iface', '', InputOption::VALUE_REQUIRED, 'set interface to use to contact remote',
InterfaceService::$LIST_IFACE[InterfaceService::IFACE_FRONTAL]
'iface', '', InputOption::VALUE_REQUIRED, 'set interface to use to contact remote',
InterfaceService::$LIST_IFACE[InterfaceService::IFACE_FRONTAL]
)
->addOption('yes', '', InputOption::VALUE_NONE, 'silently add the remote instance')
->addOption('all', '', InputOption::VALUE_NONE, 'display all information');
Expand Down
4 changes: 2 additions & 2 deletions lib/Command/CirclesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ protected function configure() {
->setDescription('testing some features')
->addArgument('deprecated', InputArgument::OPTIONAL, '')
->addOption(
'are-you-aware-this-will-delete-all-my-data', '', InputOption::VALUE_REQUIRED,
'Well, are you ?', ''
'are-you-aware-this-will-delete-all-my-data', '', InputOption::VALUE_REQUIRED,
'Well, are you ?', ''
)
->addOption('skip-init', '', InputOption::VALUE_NONE, 'Bypass Initialisation')
->addOption('skip-setup', '', InputOption::VALUE_NONE, 'Bypass Circles Setup')
Expand Down
16 changes: 8 additions & 8 deletions lib/Command/FixUniqueId.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ private function swapToShortenUniqueIdInTable($circleId, $shortenUniqueId, $tabl
$qb = $this->connection->getQueryBuilder();
$qb->update($table)
->where(
$qb->expr()
->eq('circle_id', $qb->createNamedParameter($circleId))
$qb->expr()
->eq('circle_id', $qb->createNamedParameter($circleId))
);

$qb->set('circle_id', $qb->createNamedParameter($shortenUniqueId));
Expand All @@ -125,12 +125,12 @@ private function swapToShortenUniqueIdInShares($circleId, $shortenUniqueId) {
/** @noinspection PhpMethodParametersCountMismatchInspection */
$qb->update('share')
->where(
$expr->andX(
$expr->eq(
'share_type', $qb->createNamedParameter(Share::SHARE_TYPE_CIRCLE)
),
$expr->eq('share_with', $qb->createNamedParameter($circleId))
)
$expr->andX(
$expr->eq(
'share_type', $qb->createNamedParameter(Share::SHARE_TYPE_CIRCLE)
),
$expr->eq('share_with', $qb->createNamedParameter($circleId))
)
);

$qb->set('share_with', $qb->createNamedParameter($shortenUniqueId));
Expand Down
10 changes: 5 additions & 5 deletions lib/Command/MembersAdd.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ private function findUserFromLookup(string $search, string &$instance = ''): str
try {
$users = $this->retrieveJson($request);
} catch (
RequestContentException |
RequestNetworkException |
RequestResultSizeException |
RequestServerException |
RequestResultNotJsonException $e
RequestContentException |
RequestNetworkException |
RequestResultSizeException |
RequestServerException |
RequestResultNotJsonException $e
) {
return '';
}
Expand Down
28 changes: 14 additions & 14 deletions lib/Command/MembersList.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,12 @@ private function getMembers(
}
$node = new TreeNode(
$tree, new SimpleDataStore(
[
'circle' => $circle,
'member' => $member,
'cycling' => in_array($member->getSingleId(), $knownIds),
]
)
[
'circle' => $circle,
'member' => $member,
'cycling' => in_array($member->getSingleId(), $knownIds),
]
)
);

$this->getMembers(
Expand All @@ -380,11 +380,11 @@ private function getMembers(
if ($this->treeType !== 'circles-only') {
new TreeNode(
$tree, new SimpleDataStore(
[
'member' => $member,
'cycling' => in_array($member->getSingleId(), $knownIds)
]
)
[
'member' => $member,
'cycling' => in_array($member->getSingleId(), $knownIds)
]
)
);
}
}
Expand Down Expand Up @@ -431,9 +431,9 @@ public function displayLeaf(SimpleDataStore $data, int $lineNumber): string {

$line .= ' <info>MemberId</info>: ' . $member->getId();
$line .= ' <info>Name</info>: ' . $this->configService->displayFederatedUser(
$member,
$this->input->getOption('display-name')
);
$member,
$this->input->getOption('display-name')
);
if ($member->hasBasedOn()) {
$line .= ' <info>Source</info>: '
. Circle::$DEF_SOURCE[$member->getBasedOn()->getSource()];
Expand Down
42 changes: 21 additions & 21 deletions lib/Db/CircleProviderRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ protected function linkToCircleOwner(IQueryBuilder $qb) {
$qb->selectAlias('mo.user_id', 'circle_owner');
$qb->leftJoin(
'c', DeprecatedRequestBuilder::TABLE_MEMBERS, 'mo', $expr->andX(
$expr->eq('mo.circle_id', 'c.unique_id'),
$expr->eq('mo.user_type', $qb->createNamedParameter(DeprecatedMember::TYPE_USER)),
$expr->eq('mo.level', $qb->createNamedParameter(DeprecatedMember::LEVEL_OWNER))
)
$expr->eq('mo.circle_id', 'c.unique_id'),
$expr->eq('mo.user_type', $qb->createNamedParameter(DeprecatedMember::TYPE_USER)),
$expr->eq('mo.level', $qb->createNamedParameter(DeprecatedMember::LEVEL_OWNER))
)
);
}

Expand Down Expand Up @@ -352,10 +352,10 @@ protected function joinCircleMembers(IQueryBuilder $qb) {
$qb->addSelect('m.user_id')
->from(DeprecatedRequestBuilder::TABLE_MEMBERS, 'm')
->andWhere(
$expr->andX(
$expr->eq('s.share_with', 'm.circle_id'),
$expr->eq('m.user_type', $qb->createNamedParameter(DeprecatedMember::TYPE_USER))
)
$expr->andX(
$expr->eq('s.share_with', 'm.circle_id'),
$expr->eq('m.user_type', $qb->createNamedParameter(DeprecatedMember::TYPE_USER))
)
);
}

Expand All @@ -372,10 +372,10 @@ protected function linkToFileCache(IQueryBuilder $qb, $userId) {
$qb->leftJoin('s', 'filecache', 'f', $expr->eq('s.file_source', 'f.fileid'))
->leftJoin('f', 'storages', 'st', $expr->eq('f.storage', 'st.numeric_id'))
->leftJoin(
's', 'share', 's2', $expr->andX(
$expr->eq('s.id', 's2.parent'),
$expr->eq('s2.share_with', $qb->createNamedParameter($userId))
)
's', 'share', 's2', $expr->andX(
$expr->eq('s.id', 's2.parent'),
$expr->eq('s2.share_with', $qb->createNamedParameter($userId))
)
);

$qb->selectAlias('s2.id', 'parent_id');
Expand Down Expand Up @@ -466,11 +466,11 @@ protected function getCompleteSelectSql() {

$qb->selectDistinct('s.id')
->addSelect(
's.*', 'f.fileid', 'f.path', 'f.permissions AS f_permissions', 'f.storage',
'f.path_hash', 'f.parent AS f_parent', 'f.name', 'f.mimetype', 'f.mimepart',
'f.size', 'f.mtime', 'f.storage_mtime', 'f.encrypted', 'f.unencrypted_size',
'f.etag', 'f.checksum', 'c.type AS circle_type', 'c.name AS circle_name',
'c.alt_name AS circle_alt_name'
's.*', 'f.fileid', 'f.path', 'f.permissions AS f_permissions', 'f.storage',
'f.path_hash', 'f.parent AS f_parent', 'f.name', 'f.mimetype', 'f.mimepart',
'f.size', 'f.mtime', 'f.storage_mtime', 'f.encrypted', 'f.unencrypted_size',
'f.etag', 'f.checksum', 'c.type AS circle_type', 'c.name AS circle_name',
'c.alt_name AS circle_alt_name'
)
->selectAlias('st.id', 'storage_string_id');

Expand All @@ -492,10 +492,10 @@ private function joinShare(IQueryBuilder $qb) {
$qb->from('share', 's')
->andWhere($expr->eq('s.share_type', $qb->createNamedParameter(IShare::TYPE_CIRCLE)))
->andWhere(
$expr->orX(
$expr->eq('s.item_type', $qb->createNamedParameter('file')),
$expr->eq('s.item_type', $qb->createNamedParameter('folder'))
)
$expr->orX(
$expr->eq('s.item_type', $qb->createNamedParameter('file')),
$expr->eq('s.item_type', $qb->createNamedParameter('folder'))
)
);
}

Expand Down
Loading