diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2022-11-03 11:37:00 -0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-03 11:37:00 -0100 |
commit | d573961576b23935811b3ceaa2118de3543c47fa (patch) | |
tree | 03bfc5d58133886a1f5a63d988e267f590dc9854 | |
parent | 7716f217f29b67c5bdd57aa3702da06b087bbcfa (diff) | |
parent | 05e41274a09b44a789af8a0082dedf857b1dc158 (diff) |
Merge pull request #1509 from nextcloud/fix/noid/global-cs-fix-221103
cs:fix
40 files changed, 87 insertions, 126 deletions
diff --git a/lib/Command/Fediverse.php b/lib/Command/Fediverse.php index 5996977c..f4c11956 100644 --- a/lib/Command/Fediverse.php +++ b/lib/Command/Fediverse.php @@ -58,8 +58,8 @@ class Fediverse extends Base { parent::configure(); $this->setName('social:fediverse') ->addOption( - 'type', 't', InputArgument::OPTIONAL, - 'Change the type of access management', '' + 'type', 't', InputArgument::OPTIONAL, + 'Change the type of access management', '' ) ->addArgument('action', InputArgument::OPTIONAL, 'add/remove/test address', '') ->addArgument('address', InputArgument::OPTIONAL, 'address/host', '') diff --git a/lib/Command/MigrateAlpha3.php b/lib/Command/MigrateAlpha3.php index 8a9ee936..e59e9a99 100644 --- a/lib/Command/MigrateAlpha3.php +++ b/lib/Command/MigrateAlpha3.php @@ -119,10 +119,10 @@ class MigrateAlpha3 extends Base { $this->setName('social:migrate:alpha3') ->setDescription('Trying to migrate old data to Alpha3') ->addOption( - 'remove-migrated-tables', '', InputOption::VALUE_NONE, 'Remove old table once copy is done' + 'remove-migrated-tables', '', InputOption::VALUE_NONE, 'Remove old table once copy is done' ) ->addOption( - 'force-remove-old-tables', '', InputOption::VALUE_NONE, 'Force remove old tables' + 'force-remove-old-tables', '', InputOption::VALUE_NONE, 'Force remove old tables' ); } diff --git a/lib/Command/NoteCreate.php b/lib/Command/NoteCreate.php index f719a2cc..b0e990b9 100644 --- a/lib/Command/NoteCreate.php +++ b/lib/Command/NoteCreate.php @@ -96,18 +96,18 @@ class NoteCreate extends Base { parent::configure(); $this->setName('social:note:create') ->addOption( - 'replyTo', 'r', InputOption::VALUE_OPTIONAL, 'in reply to an existing thread' + 'replyTo', 'r', InputOption::VALUE_OPTIONAL, 'in reply to an existing thread' ) ->addOption( - 'to', 't', InputOption::VALUE_OPTIONAL, 'mentioning people' + 'to', 't', InputOption::VALUE_OPTIONAL, 'mentioning people' ) ->addOption( - 'type', 'y', InputOption::VALUE_OPTIONAL, - 'type: public (default), followers, unlisted, direct' + 'type', 'y', InputOption::VALUE_OPTIONAL, + 'type: public (default), followers, unlisted, direct' ) ->addOption( - 'hashtag', 'g', InputOption::VALUE_OPTIONAL, - 'hashtag, without the leading #' + 'hashtag', 'g', InputOption::VALUE_OPTIONAL, + 'hashtag, without the leading #' ) ->addArgument('user_id', InputArgument::REQUIRED, 'userId of the author') ->addArgument('content', InputArgument::REQUIRED, 'content of the post') diff --git a/lib/Command/QueueStatus.php b/lib/Command/QueueStatus.php index 7d9606c0..67e256be 100644 --- a/lib/Command/QueueStatus.php +++ b/lib/Command/QueueStatus.php @@ -73,7 +73,7 @@ class QueueStatus extends Base { parent::configure(); $this->setName('social:queue:status') ->addOption( - 'token', 't', InputOption::VALUE_OPTIONAL, 'token of a request' + 'token', 't', InputOption::VALUE_OPTIONAL, 'token of a request' ) ->setDescription('Return status on the request queue'); } diff --git a/lib/Db/ActorsRequest.php b/lib/Db/ActorsRequest.php index 915791f6..f0b6178c 100644 --- a/lib/Db/ActorsRequest.php +++ b/lib/Db/ActorsRequest.php @@ -38,8 +38,6 @@ use OCA\Social\Model\ActivityPub\Actor\Person; use OCP\DB\QueryBuilder\IQueryBuilder; class ActorsRequest extends ActorsRequestBuilder { - - /** * Create a new Person in the database. * @throws SocialAppConfigException @@ -55,13 +53,13 @@ class ActorsRequest extends ActorsRequestBuilder { ->setValue('summary', $qb->createNamedParameter($actor->getSummary())) ->setValue('avatar_version', $qb->createNamedParameter($actor->getAvatarVersion())) ->setValue( - 'preferred_username', $qb->createNamedParameter($actor->getPreferredUsername()) + 'preferred_username', $qb->createNamedParameter($actor->getPreferredUsername()) ) ->setValue('public_key', $qb->createNamedParameter($actor->getPublicKey())) ->setValue('private_key', $qb->createNamedParameter($actor->getPrivateKey())) ->setValue( - 'creation', - $qb->createNamedParameter(new DateTime('now'), IQueryBuilder::PARAM_DATE) + 'creation', + $qb->createNamedParameter(new DateTime('now'), IQueryBuilder::PARAM_DATE) ); $qb->executeStatement(); diff --git a/lib/Db/ActorsRequestBuilder.php b/lib/Db/ActorsRequestBuilder.php index 42e3df21..ee6ad7b0 100644 --- a/lib/Db/ActorsRequestBuilder.php +++ b/lib/Db/ActorsRequestBuilder.php @@ -121,7 +121,7 @@ class ActorsRequestBuilder extends CoreRequestBuilder { ->setLocal(true) ->setAvatarVersion($this->getInt('avatar_version', $data, -1)) ->setAccount( - $actor->getPreferredUsername() . '@' . $this->configService->getSocialAddress() + $actor->getPreferredUsername() . '@' . $this->configService->getSocialAddress() ); $actor->setUrlSocial($root) ->setUrl($actor->getId()); diff --git a/lib/Db/CacheActorsRequest.php b/lib/Db/CacheActorsRequest.php index 35f65c19..0027545d 100644 --- a/lib/Db/CacheActorsRequest.php +++ b/lib/Db/CacheActorsRequest.php @@ -59,7 +59,7 @@ class CacheActorsRequest extends CacheActorsRequestBuilder { ->setValue('featured', $qb->createNamedParameter($actor->getFeatured())) ->setValue('url', $qb->createNamedParameter($actor->getUrl())) ->setValue( - 'preferred_username', $qb->createNamedParameter($actor->getPreferredUsername()) + 'preferred_username', $qb->createNamedParameter($actor->getPreferredUsername()) ) ->setValue('name', $qb->createNamedParameter($actor->getName())) ->setValue('summary', $qb->createNamedParameter($actor->getSummary())) @@ -112,7 +112,7 @@ class CacheActorsRequest extends CacheActorsRequestBuilder { ->set('featured', $qb->createNamedParameter($actor->getFeatured())) ->set('url', $qb->createNamedParameter($actor->getUrl())) ->set( - 'preferred_username', $qb->createNamedParameter($actor->getPreferredUsername()) + 'preferred_username', $qb->createNamedParameter($actor->getPreferredUsername()) ) ->set('name', $qb->createNamedParameter($actor->getName())) ->set('summary', $qb->createNamedParameter($actor->getSummary())) diff --git a/lib/Db/ClientRequest.php b/lib/Db/ClientRequest.php index ad8b0a12..162caada 100644 --- a/lib/Db/ClientRequest.php +++ b/lib/Db/ClientRequest.php @@ -56,7 +56,7 @@ class ClientRequest extends ClientRequestBuilder { $qb->setValue('app_name', $qb->createNamedParameter($client->getAppName())) ->setValue('app_website', $qb->createNamedParameter($client->getAppWebsite())) ->setValue( - 'app_redirect_uris', $qb->createNamedParameter(json_encode($client->getAppRedirectUris())) + 'app_redirect_uris', $qb->createNamedParameter(json_encode($client->getAppRedirectUris())) ) ->setValue('app_client_id', $qb->createNamedParameter($client->getAppClientId())) ->setValue('app_client_secret', $qb->createNamedParameter($client->getAppClientSecret())) diff --git a/lib/Db/CoreRequestBuilder.php b/lib/Db/CoreRequestBuilder.php index 3c22f7af..727bea99 100644 --- a/lib/Db/CoreRequestBuilder.php +++ b/lib/Db/CoreRequestBuilder.php @@ -1052,8 +1052,8 @@ class CoreRequestBuilder { ->selectAlias($prefix . '_f.follow_id', $prefix . '_follow_id') ->selectAlias($prefix . '_f.creation', $prefix . '_creation') ->leftJoin( - $this->defaultSelectAlias, CoreRequestBuilder::TABLE_FOLLOWS, $prefix . '_f', - $andX + $this->defaultSelectAlias, CoreRequestBuilder::TABLE_FOLLOWS, $prefix . '_f', + $andX ); } diff --git a/lib/Db/RequestQueueRequest.php b/lib/Db/RequestQueueRequest.php index d043038d..9cb1f908 100644 --- a/lib/Db/RequestQueueRequest.php +++ b/lib/Db/RequestQueueRequest.php @@ -66,9 +66,9 @@ class RequestQueueRequest extends RequestQueueRequestBuilder { ->setValue('author', $qb->createNamedParameter($queue->getAuthor())) ->setValue('activity', $qb->createNamedParameter($queue->getActivity())) ->setValue( - 'instance', $qb->createNamedParameter( - json_encode($queue->getInstance(), JSON_UNESCAPED_SLASHES) - ) + 'instance', $qb->createNamedParameter( + json_encode($queue->getInstance(), JSON_UNESCAPED_SLASHES) + ) ) ->setValue('priority', $qb->createNamedParameter($queue->getPriority())) ->setValue('status', $qb->createNamedParameter($queue->getStatus())) @@ -133,8 +133,8 @@ class RequestQueueRequest extends RequestQueueRequestBuilder { $qb = $this->getRequestQueueUpdateSql(); $qb->set('status', $qb->createNamedParameter(RequestQueue::STATUS_RUNNING)) ->set( - 'last', - $qb->createNamedParameter(new DateTime('now'), IQueryBuilder::PARAM_DATE) + 'last', + $qb->createNamedParameter(new DateTime('now'), IQueryBuilder::PARAM_DATE) ); $this->limitToId($qb, $queue->getId()); $this->limitToStatus($qb, RequestQueue::STATUS_STANDBY); diff --git a/lib/Db/SocialCrossQueryBuilder.php b/lib/Db/SocialCrossQueryBuilder.php index 570fc673..bf76c02a 100644 --- a/lib/Db/SocialCrossQueryBuilder.php +++ b/lib/Db/SocialCrossQueryBuilder.php @@ -45,8 +45,6 @@ use OCP\DB\QueryBuilder\ICompositeExpression; * @package OCA\Social\Db */ class SocialCrossQueryBuilder extends SocialCoreQueryBuilder { - - /** * @param string $aliasDest * @param string $aliasFollowing @@ -187,8 +185,8 @@ class SocialCrossQueryBuilder extends SocialCoreQueryBuilder { ->selectAlias('cd.error', 'cachedocument_error') ->selectAlias('cd.creation', 'cachedocument_creation') ->leftJoin( - $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_CACHE_DOCUMENTS, 'cd', - $expr->eq($func->lower($pf . '.' . $fieldDocumentId), $func->lower('cd.id')) + $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_CACHE_DOCUMENTS, 'cd', + $expr->eq($func->lower($pf . '.' . $fieldDocumentId), $func->lower('cd.id')) ); } diff --git a/lib/Db/SocialFiltersQueryBuilder.php b/lib/Db/SocialFiltersQueryBuilder.php index df9c22ae..a547b870 100644 --- a/lib/Db/SocialFiltersQueryBuilder.php +++ b/lib/Db/SocialFiltersQueryBuilder.php @@ -37,8 +37,6 @@ namespace OCA\Social\Db; * @package OCA\Social\Db */ class SocialFiltersQueryBuilder extends SocialLimitsQueryBuilder { - - /** * */ diff --git a/lib/Db/SocialLimitsQueryBuilder.php b/lib/Db/SocialLimitsQueryBuilder.php index 218b3775..f0c1cec5 100644 --- a/lib/Db/SocialLimitsQueryBuilder.php +++ b/lib/Db/SocialLimitsQueryBuilder.php @@ -45,8 +45,6 @@ use OCP\DB\QueryBuilder\ICompositeExpression; * @package OCA\Social\Db */ class SocialLimitsQueryBuilder extends SocialCrossQueryBuilder { - - /** * Limit the request to the Type * diff --git a/lib/Db/StreamActionsRequest.php b/lib/Db/StreamActionsRequest.php index 37ca8a08..cbea36a0 100644 --- a/lib/Db/StreamActionsRequest.php +++ b/lib/Db/StreamActionsRequest.php @@ -40,8 +40,6 @@ use OCA\Social\Model\StreamAction; * @package OCA\Social\Db */ class StreamActionsRequest extends StreamActionsRequestBuilder { - - /** * Create a new Queue in the database. */ @@ -58,9 +56,9 @@ class StreamActionsRequest extends StreamActionsRequestBuilder { ->setValue('stream_id', $qb->createNamedParameter($action->getStreamId())) ->setValue('stream_id_prim', $qb->createNamedParameter($this->prim($action->getStreamId()))) ->setValue( - 'values', $qb->createNamedParameter( - json_encode($values, JSON_UNESCAPED_SLASHES) - ) + 'values', $qb->createNamedParameter( + json_encode($values, JSON_UNESCAPED_SLASHES) + ) ) ->setValue('liked', $qb->createNamedParameter(($liked) ? 1 : 0)) ->setValue('boosted', $qb->createNamedParameter(($boosted) ? 1 : 0)) diff --git a/lib/Db/StreamQueueRequest.php b/lib/Db/StreamQueueRequest.php index 5c66b557..1bfadf32 100644 --- a/lib/Db/StreamQueueRequest.php +++ b/lib/Db/StreamQueueRequest.php @@ -42,8 +42,6 @@ use OCP\DB\QueryBuilder\IQueryBuilder; * @package OCA\Social\Db */ class StreamQueueRequest extends StreamQueueRequestBuilder { - - /** * create a new Queue in the database. * @@ -112,8 +110,8 @@ class StreamQueueRequest extends StreamQueueRequestBuilder { $qb = $this->getStreamQueueUpdateSql(); $qb->set('status', $qb->createNamedParameter(StreamQueue::STATUS_RUNNING)) ->set( - 'last', - $qb->createNamedParameter(new DateTime('now'), IQueryBuilder::PARAM_DATE) + 'last', + $qb->createNamedParameter(new DateTime('now'), IQueryBuilder::PARAM_DATE) ); $this->limitToId($qb, $queue->getId()); $this->limitToStatus($qb, StreamQueue::STATUS_STANDBY); diff --git a/lib/Db/StreamRequest.php b/lib/Db/StreamRequest.php index 821c3616..b300328c 100644 --- a/lib/Db/StreamRequest.php +++ b/lib/Db/StreamRequest.php @@ -76,7 +76,7 @@ class StreamRequest extends StreamRequestBuilder { /** @var Note $stream */ $qb->setValue('hashtags', $qb->createNamedParameter(json_encode($stream->getHashtags()))) ->setValue('attachments', $qb->createNamedParameter( - json_encode($stream->getAttachments(), JSON_UNESCAPED_SLASHES) + json_encode($stream->getAttachments(), JSON_UNESCAPED_SLASHES) )); } @@ -680,19 +680,19 @@ class StreamRequest extends StreamRequestBuilder { ->setValue('subtype', $qb->createNamedParameter($stream->getSubType())) ->setValue('to', $qb->createNamedParameter($stream->getTo())) ->setValue( - 'to_array', $qb->createNamedParameter( - json_encode($stream->getToArray(), JSON_UNESCAPED_SLASHES) - ) + 'to_array', $qb->createNamedParameter( + json_encode($stream->getToArray(), JSON_UNESCAPED_SLASHES) + ) ) ->setValue( - 'cc', $qb->createNamedParameter( - json_encode($stream->getCcArray(), JSON_UNESCAPED_SLASHES) - ) + 'cc', $qb->createNamedParameter( + json_encode($stream->getCcArray(), JSON_UNESCAPED_SLASHES) + ) ) ->setValue( - 'bcc', $qb->createNamedParameter( - json_encode($stream->getBccArray(), JSON_UNESCAPED_SLASHES) - ) + 'bcc', $qb->createNamedParameter( + json_encode($stream->getBccArray(), JSON_UNESCAPED_SLASHES) + ) ) ->setValue('content', $qb->createNamedParameter($stream->getContent())) ->setValue('summary', $qb->createNamedParameter($stream->getSummary())) @@ -708,13 +708,13 @@ class StreamRequest extends StreamRequestBuilder { ->setValue('details', $qb->createNamedParameter(json_encode($stream->getDetailsAll()))) ->setValue('cache', $qb->createNamedParameter($cache)) ->setValue( - 'filter_duplicate', - $qb->createNamedParameter(($stream->isFilterDuplicate()) ? '1' : '0') + 'filter_duplicate', + $qb->createNamedParameter(($stream->isFilterDuplicate()) ? '1' : '0') ) ->setValue( - 'instances', $qb->createNamedParameter( - json_encode($stream->getInstancePaths(), JSON_UNESCAPED_SLASHES) - ) + 'instances', $qb->createNamedParameter( + json_encode($stream->getInstancePaths(), JSON_UNESCAPED_SLASHES) + ) ) ->setValue('local', $qb->createNamedParameter(($stream->isLocal()) ? '1' : '0')); @@ -725,8 +725,8 @@ class StreamRequest extends StreamRequestBuilder { 'published_time', $qb->createNamedParameter($dTime, IQueryBuilder::PARAM_DATE) ) ->setValue( - 'creation', - $qb->createNamedParameter(new DateTime('now'), IQueryBuilder::PARAM_DATE) + 'creation', + $qb->createNamedParameter(new DateTime('now'), IQueryBuilder::PARAM_DATE) ); } catch (Exception $e) { } diff --git a/lib/Db/StreamRequestBuilder.php b/lib/Db/StreamRequestBuilder.php index ba3323de..634d2db1 100644 --- a/lib/Db/StreamRequestBuilder.php +++ b/lib/Db/StreamRequestBuilder.php @@ -92,10 +92,10 @@ class StreamRequestBuilder extends CoreRequestBuilder { /** @noinspection PhpMethodParametersCountMismatchInspection */ $qb->selectDistinct('s.id') ->addSelect( - 's.nid', 's.type', 's.subtype', 's.to', 's.to_array', 's.cc', 's.bcc', 's.content', - 's.summary', 's.attachments', 's.published', 's.published_time', 's.cache', - 's.object_id', 's.attributed_to', 's.in_reply_to', 's.source', 's.local', - 's.instances', 's.creation', 's.filter_duplicate', 's.details', 's.hashtags' + 's.nid', 's.type', 's.subtype', 's.to', 's.to_array', 's.cc', 's.bcc', 's.content', + 's.summary', 's.attachments', 's.published', 's.published_time', 's.cache', + 's.object_id', 's.attributed_to', 's.in_reply_to', 's.source', 's.local', + 's.instances', 's.creation', 's.filter_duplicate', 's.details', 's.hashtags' ) ->from(self::TABLE_STREAM, 's'); diff --git a/lib/Interfaces/IActivityPubInterface.php b/lib/Interfaces/IActivityPubInterface.php index 2c1d8d55..311c7ea4 100644 --- a/lib/Interfaces/IActivityPubInterface.php +++ b/lib/Interfaces/IActivityPubInterface.php @@ -41,7 +41,6 @@ use OCA\Social\Model\ActivityPub\ACore; * @package OCA\Social\Service */ interface IActivityPubInterface { - /** * Freshly imported item can be processed/parsed on incoming Request. */ diff --git a/lib/Interfaces/Object/AnnounceInterface.php b/lib/Interfaces/Object/AnnounceInterface.php index c5642391..411f22b2 100644 --- a/lib/Interfaces/Object/AnnounceInterface.php +++ b/lib/Interfaces/Object/AnnounceInterface.php @@ -316,7 +316,6 @@ class AnnounceInterface extends AbstractActivityPubInterface implements IActivit $notification->addDetail('accounts', $author->getAccount()); $notificationInterface->update($notification); } catch (StreamNotFoundException $e) { - /** @var SocialAppNotification $notification */ $notification = AP::$activityPub->getItemFromType(SocialAppNotification::TYPE); // $notification->setDetail('url', ''); diff --git a/lib/Interfaces/Object/LikeInterface.php b/lib/Interfaces/Object/LikeInterface.php index 456f2a99..e58a462d 100644 --- a/lib/Interfaces/Object/LikeInterface.php +++ b/lib/Interfaces/Object/LikeInterface.php @@ -200,7 +200,6 @@ class LikeInterface extends AbstractActivityPubInterface implements IActivityPub $notification->addDetail('accounts', $author->getAccount()); $notificationInterface->update($notification); } catch (StreamNotFoundException $e) { - /** @var SocialAppNotification $notification */ $notification = AP::$activityPub->getItemFromType(SocialAppNotification::TYPE); // $notification->setDetail('url', ''); diff --git a/lib/Search/UnifiedSearchResult.php b/lib/Search/UnifiedSearchResult.php index 7fc7c97f..0fce65fc 100644 --- a/lib/Search/UnifiedSearchResult.php +++ b/lib/Search/UnifiedSearchResult.php @@ -39,8 +39,6 @@ use OCP\Search\SearchResultEntry; * @package OCA\Social\Search */ class UnifiedSearchResult extends SearchResultEntry { - - /** * UnifiedSearchResult constructor. * diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index 1c2a852f..6f6f41ff 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -381,8 +381,8 @@ class ConfigService { public function setSocialUrl(string $url = '') { if ($url === '') { $url = $this->getCloudUrl(true) . $this->urlGenerator->linkToRoute( - 'social.Navigation.navigate' - ); + 'social.Navigation.navigate' + ); } if (parse_url($url, PHP_URL_SCHEME) === null) { diff --git a/lib/Service/RequestQueueService.php b/lib/Service/RequestQueueService.php index c4d32003..80e43f39 100644 --- a/lib/Service/RequestQueueService.php +++ b/lib/Service/RequestQueueService.php |