From 96074f7c957c3e66320890424a342f8a5cd6be8e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 9 Feb 2022 11:53:50 +0100 Subject: [PATCH] Update coding standard Signed-off-by: Joas Schilling --- lib/Chat/ChatManager.php | 2 +- lib/Chat/Command/Executor.php | 2 +- lib/Chat/Command/Listener.php | 4 ++-- lib/Controller/RoomController.php | 2 +- lib/Federation/CloudFederationProviderTalk.php | 2 +- lib/Manager.php | 6 +++--- lib/Share/RoomShareProvider.php | 2 +- lib/Signaling/Listener.php | 2 +- sample-commands/hackernews.php | 2 +- sample-commands/wikipedia.php | 2 +- tests/php/Notification/NotifierTest.php | 6 +++--- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/Chat/ChatManager.php b/lib/Chat/ChatManager.php index 60ccf59ab1..798aea5b5f 100644 --- a/lib/Chat/ChatManager.php +++ b/lib/Chat/ChatManager.php @@ -562,7 +562,7 @@ class ChatManager { * @param int $limit * @return IComment[] */ - public function searchForObjects(string $search, array $objectIds, string $verb = '', int $offset = 0, int $limit = 50): array { + public function searchForObjects(string $search, array $objectIds, string $verb = '', int $offset = 0, int $limit = 50): array { return $this->commentsManager->searchForObjects($search, 'chat', $objectIds, $verb, $offset, $limit); } diff --git a/lib/Chat/Command/Executor.php b/lib/Chat/Command/Executor.php index 121f53fe20..71dc55aa5f 100644 --- a/lib/Chat/Command/Executor.php +++ b/lib/Chat/Command/Executor.php @@ -132,7 +132,7 @@ class Executor { if ($command->getApp() !== '') { $response = $this->execHelpSingleCommand($room, $message, $command->getApp() . ' ' . $command->getCommand()); } else { - if ($command->getCommand() === 'help' || strpos($command->getScript(),'alias:') !== false || + if ($command->getCommand() === 'help' || strpos($command->getScript(), 'alias:') !== false || !$this->isCommandAvailableForParticipant($command, $participant)) { continue; } diff --git a/lib/Chat/Command/Listener.php b/lib/Chat/Command/Listener.php index 4cdb0c8e0b..42dc4bbbe6 100644 --- a/lib/Chat/Command/Listener.php +++ b/lib/Chat/Command/Listener.php @@ -91,11 +91,11 @@ class Listener { } try { - return [$this->commandService->find('', $app), trim($cmd . ' ' . $arguments)]; + return [$this->commandService->find('', $app), trim($cmd . ' ' . $arguments)]; } catch (DoesNotExistException $e) { } - return [$this->commandService->find('', 'help'), trim($message)]; + return [$this->commandService->find('', 'help'), trim($message)]; } protected function matchesCommand(string $message): array { diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 57cb0c096c..d579fb5e8e 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -1493,7 +1493,7 @@ class RoomController extends AEnvironmentAwareController { * @param bool $promote Shall the attendee be promoted or demoted * @return DataResponse */ - protected function changeParticipantType(int $attendeeId, bool $promote): DataResponse { + protected function changeParticipantType(int $attendeeId, bool $promote): DataResponse { try { $targetParticipant = $this->room->getParticipantByAttendeeId($attendeeId); } catch (ParticipantNotFoundException $e) { diff --git a/lib/Federation/CloudFederationProviderTalk.php b/lib/Federation/CloudFederationProviderTalk.php index a2fa48b62c..967140b7ea 100644 --- a/lib/Federation/CloudFederationProviderTalk.php +++ b/lib/Federation/CloudFederationProviderTalk.php @@ -149,7 +149,7 @@ class CloudFederationProviderTalk implements ICloudFederationProvider { if ($remote && $shareSecret && $shareWith && $roomToken && $remoteId && is_string($roomName) && $roomName && $owner) { $shareWith = $this->userManager->get($shareWith); if ($shareWith === null) { - throw new ProviderCouldNotAddShareException('User does not exist', '',Http::STATUS_BAD_REQUEST); + throw new ProviderCouldNotAddShareException('User does not exist', '', Http::STATUS_BAD_REQUEST); } $shareId = (string) $this->federationManager->addRemoteRoom($shareWith, $remoteId, $roomType, $roomName, $roomToken, $remote, $shareSecret); diff --git a/lib/Manager.php b/lib/Manager.php index 250773fb38..3f6b931721 100644 --- a/lib/Manager.php +++ b/lib/Manager.php @@ -884,7 +884,7 @@ class Manager { $room->setListable(Room::LISTABLE_NONE); $user = $this->userManager->get($userId); - $this->participantService->addUsers($room,[[ + $this->participantService->addUsers($room, [[ 'actorType' => Attendee::ACTOR_USERS, 'actorId' => $userId, 'displayName' => $user ? $user->getDisplayName() : $userId, @@ -898,7 +898,7 @@ class Manager { $room->getParticipant($userId, false); } catch (ParticipantNotFoundException $e) { $user = $this->userManager->get($userId); - $this->participantService->addUsers($room,[[ + $this->participantService->addUsers($room, [[ 'actorType' => Attendee::ACTOR_USERS, 'actorId' => $userId, 'displayName' => $user ? $user->getDisplayName() : $userId, @@ -1168,7 +1168,7 @@ class Manager { } protected function loadLastMessageInfo(IQueryBuilder $query): void { - $query->leftJoin('r','comments', 'c', $query->expr()->eq('r.last_message', 'c.id')); + $query->leftJoin('r', 'comments', 'c', $query->expr()->eq('r.last_message', 'c.id')); $query->selectAlias('c.id', 'comment_id'); $query->selectAlias('c.parent_id', 'comment_parent_id'); $query->selectAlias('c.topmost_parent_id', 'comment_topmost_parent_id'); diff --git a/lib/Share/RoomShareProvider.php b/lib/Share/RoomShareProvider.php index 788c615226..d306d61a43 100644 --- a/lib/Share/RoomShareProvider.php +++ b/lib/Share/RoomShareProvider.php @@ -574,7 +574,7 @@ class RoomShareProvider implements IShareProvider { ); } - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); $qb->orderBy('s.id'); diff --git a/lib/Signaling/Listener.php b/lib/Signaling/Listener.php index dce9087a09..2d603e2af0 100644 --- a/lib/Signaling/Listener.php +++ b/lib/Signaling/Listener.php @@ -323,7 +323,7 @@ class Listener { $notifier->participantsModified($event->getRoom(), $sessionIds); } }); - $dispatcher->addListener(ChatManager::EVENT_AFTER_MESSAGE_SEND , static function (ChatParticipantEvent $event) { + $dispatcher->addListener(ChatManager::EVENT_AFTER_MESSAGE_SEND, static function (ChatParticipantEvent $event) { if (self::isUsingInternalSignaling()) { return; } diff --git a/sample-commands/hackernews.php b/sample-commands/hackernews.php index 3c341b3f0c..9a56b056b2 100644 --- a/sample-commands/hackernews.php +++ b/sample-commands/hackernews.php @@ -55,7 +55,7 @@ foreach ($stories as $storyId) { $result = json_decode($content, true); $link = " - {$result['url']}\n"; - $remainingLength = max(strlen($result['title']),$length - strlen($link)); + $remainingLength = max(strlen($result['title']), $length - strlen($link)); if ($remainingLength < strlen('* ' . $result['title'])) { $response .= substr('* ' . $result['title'], 0, $remainingLength) . '…' . $link; } else { diff --git a/sample-commands/wikipedia.php b/sample-commands/wikipedia.php index 58bdd6720f..f524872d41 100644 --- a/sample-commands/wikipedia.php +++ b/sample-commands/wikipedia.php @@ -72,7 +72,7 @@ foreach ($pages as $key => $page) { } $link = " - {$page['canonicalurl']}\n"; - $remainingLength = max(strlen($page['title']),$length - strlen($link)); + $remainingLength = max(strlen($page['title']), $length - strlen($link)); if ($remainingLength < strlen("* {$page['title']} - {$page['description']}")) { $response .= substr("* {$page['title']} - {$page['description']}", 0, $remainingLength) . '…' . $link; } else { diff --git a/tests/php/Notification/NotifierTest.php b/tests/php/Notification/NotifierTest.php index 11f4971240..44cc8fe3e3 100644 --- a/tests/php/Notification/NotifierTest.php +++ b/tests/php/Notification/NotifierTest.php @@ -185,7 +185,7 @@ class NotifierTest extends \Test\TestCase { ->willReturnSelf(); $n->expects($this->once()) ->method('setRichSubject') - ->with('{user} invited you to a private conversation',[ + ->with('{user} invited you to a private conversation', [ 'user' => [ 'type' => 'user', 'id' => $uid, @@ -301,7 +301,7 @@ class NotifierTest extends \Test\TestCase { ->willReturnSelf(); $n->expects($this->once()) ->method('setRichSubject') - ->with('{user} invited you to a private conversation',[ + ->with('{user} invited you to a private conversation', [ 'user' => [ 'type' => 'user', 'id' => $uid, @@ -416,7 +416,7 @@ class NotifierTest extends \Test\TestCase { if ($type === Room::TYPE_GROUP) { $n->expects($this->once()) ->method('setRichSubject') - ->with('{user} invited you to a group conversation: {call}',[ + ->with('{user} invited you to a group conversation: {call}', [ 'user' => [ 'type' => 'user', 'id' => $uid,