Skip to content

Commit e0f1906

Browse files
committed
fix(CS): Prepare coding standard update
Signed-off-by: Joas Schilling <[email protected]>
1 parent 3c4b214 commit e0f1906

File tree

17 files changed

+41
-42
lines changed

17 files changed

+41
-42
lines changed

lib/Activity/Provider/Call.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Call extends Base {
3535
* @throws \InvalidArgumentException
3636
* @since 11.0.0
3737
*/
38-
public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent {
38+
public function parse($language, IEvent $event, ?IEvent $previousEvent = null): IEvent {
3939
$event = $this->preParse($event);
4040

4141
if ($event->getSubject() === 'call') {

lib/Activity/Provider/Invitation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Invitation extends Base {
3535
* @throws \InvalidArgumentException
3636
* @since 11.0.0
3737
*/
38-
public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent {
38+
public function parse($language, IEvent $event, ?IEvent $previousEvent = null): IEvent {
3939
$event = $this->preParse($event);
4040

4141
if ($event->getSubject() === 'invitation') {

lib/Chat/SystemMessage/Listener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ protected function attendeesRemovedEvent(AttendeesRemovedEvent $event): void {
426426
}
427427
}
428428

429-
protected function sendSystemMessage(Room $room, string $message, array $parameters = [], Participant $participant = null, bool $shouldSkipLastMessageUpdate = false, bool $silent = false, bool $forceSystemAsActor = false): IComment {
429+
protected function sendSystemMessage(Room $room, string $message, array $parameters = [], ?Participant $participant = null, bool $shouldSkipLastMessageUpdate = false, bool $silent = false, bool $forceSystemAsActor = false): IComment {
430430
if ($participant instanceof Participant) {
431431
$actorType = $participant->getAttendee()->getActorType();
432432
$actorId = $participant->getAttendee()->getActorId();

lib/Collaboration/Resources/ConversationProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function getResourceRichObject(IResource $resource): array {
7575
}
7676
}
7777

78-
public function canAccessResource(IResource $resource, IUser $user = null): bool {
78+
public function canAccessResource(IResource $resource, ?IUser $user = null): bool {
7979
$userId = $user instanceof IUser ? $user->getUID() : null;
8080
if ($userId === null) {
8181
throw new ResourceException('Guests are not supported at the moment');

lib/Controller/ChatController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function __construct(
103103
private ParticipantService $participantService,
104104
private SessionService $sessionService,
105105
protected AttachmentService $attachmentService,
106-
protected avatarService $avatarService,
106+
protected AvatarService $avatarService,
107107
protected ReminderService $reminderService,
108108
private GuestManager $guestManager,
109109
private MessageParser $messageParser,
@@ -150,7 +150,7 @@ protected function getActorInfo(string $actorDisplayName = ''): array {
150150
/**
151151
* @return DataResponse<Http::STATUS_CREATED, ?TalkChatMessageWithParent, array{X-Chat-Last-Common-Read?: numeric-string}>
152152
*/
153-
protected function parseCommentToResponse(IComment $comment, Message $parentMessage = null): DataResponse {
153+
protected function parseCommentToResponse(IComment $comment, ?Message $parentMessage = null): DataResponse {
154154
$chatMessage = $this->messageParser->createMessage($this->room, $this->participant, $comment, $this->l);
155155
$this->messageParser->parseMessage($chatMessage);
156156

lib/Controller/RoomController.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
namespace OCA\Talk\Controller;
3030

31-
use InvalidArgumentException;
3231
use OCA\Talk\Config;
3332
use OCA\Talk\Events\AAttendeeRemovedEvent;
3433
use OCA\Talk\Events\BeforeRoomsFetchEvent;
@@ -282,7 +281,7 @@ public function getListedRooms(string $searchTerm = ''): DataResponse {
282281
public function getBreakoutRooms(): DataResponse {
283282
try {
284283
$rooms = $this->breakoutRoomService->getBreakoutRooms($this->room, $this->participant);
285-
} catch (InvalidArgumentException $e) {
284+
} catch (\InvalidArgumentException $e) {
286285
return new DataResponse(['error' => $e->getMessage()], Http::STATUS_BAD_REQUEST);
287286
}
288287

@@ -534,7 +533,7 @@ protected function createOneToOneRoom(string $targetUserId): DataResponse {
534533
$this->formatRoom($room, $this->participantService->getParticipant($room, $currentUser->getUID(), false)),
535534
Http::STATUS_CREATED
536535
);
537-
} catch (InvalidArgumentException $e) {
536+
} catch (\InvalidArgumentException $e) {
538537
// Same current and target user
539538
return new DataResponse([], Http::STATUS_FORBIDDEN);
540539
} catch (RoomNotFoundException $e) {
@@ -642,7 +641,7 @@ protected function createEmptyRoom(string $roomName, bool $public = true, string
642641
// Create the room
643642
try {
644643
$room = $this->roomService->createConversation($roomType, $roomName, $currentUser, $objectType, $objectId);
645-
} catch (InvalidArgumentException $e) {
644+
} catch (\InvalidArgumentException $e) {
646645
return new DataResponse([], Http::STATUS_BAD_REQUEST);
647646
}
648647

@@ -852,7 +851,7 @@ public function getBreakoutRoomParticipants(bool $includeStatus = false): DataRe
852851

853852
try {
854853
$breakoutRooms = $this->breakoutRoomService->getBreakoutRooms($this->room, $this->participant);
855-
} catch (InvalidArgumentException $e) {
854+
} catch (\InvalidArgumentException $e) {
856855
return new DataResponse(['error' => $e->getMessage()], Http::STATUS_BAD_REQUEST);
857856
}
858857

lib/Flow/Operation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ public function isAvailableForScope(int $scope): bool {
8888
* @since 9.1
8989
*/
9090
public function validateOperation(string $name, array $checks, string $operation): void {
91-
list($mode, $token) = $this->parseOperationConfig($operation);
91+
[$mode, $token] = $this->parseOperationConfig($operation);
9292
$this->validateOperationConfig($mode, $token, $this->getUser()->getUID());
9393
}
9494

9595
public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatcher): void {
9696
$flows = $ruleMatcher->getFlows(false);
9797
foreach ($flows as $flow) {
9898
try {
99-
list($mode, $token) = $this->parseOperationConfig($flow['operation']);
99+
[$mode, $token] = $this->parseOperationConfig($flow['operation']);
100100
$uid = $flow['scope_actor_id'];
101101
$this->validateOperationConfig($mode, $token, $uid);
102102

lib/Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function resetAssignedSignalingServers(ICache $cache): void {
273273
* @param int|null $offset
274274
* @return Room[]
275275
*/
276-
public function searchRoomsByToken(string $searchToken = '', int $limit = null, int $offset = null): array {
276+
public function searchRoomsByToken(string $searchToken = '', ?int $limit = null, ?int $offset = null): array {
277277
$query = $this->db->getQueryBuilder();
278278
$helper = new SelectHelper();
279279
$helper->selectRoomsTable($query);

lib/Middleware/InjectionMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public function afterException(Controller $controller, string $methodName, \Exce
309309
$protection = $attribute->newInstance();
310310
$action = $protection->getAction();
311311

312-
if ('talkRoomToken' === $action) {
312+
if ($action === 'talkRoomToken') {
313313
try {
314314
$this->throttler->sleepDelayOrThrowOnMax($this->request->getRemoteAddress(), $action);
315315
} catch (MaxDelayReached $e) {

lib/Migration/Version13000Date20210625232111.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
6868
]);
6969
}
7070

71-
/** Removed in {@see \OCA\Talk\Migration\Version18000Date20231024141626} */
72-
/** Recreated in {@see \OCA\Talk\Migration\Version18000Date20231024141627} */
71+
/** Removed in {@see Version18000Date20231024141626} */
72+
/** Recreated in {@see Version18000Date20231024141627} */
7373
// if (!$schema->hasTable('talk_invitations')) {
7474
// $table = $schema->createTable('talk_invitations');
7575
// $table->addColumn('id', Types::BIGINT, [

0 commit comments

Comments
 (0)