зеркало из https://github.com/nextcloud/spreed.git
Changes after run --alter
psalm --alter --issues=MissingClosureReturnType,MismatchingDocblockReturnType,MissingReturnType,InvalidReturnType,MissingParamType Signed-off-by: Vitor Mattos <vitor@php.rio>
This commit is contained in:
Родитель
251d68513b
Коммит
a2e57ab980
|
@ -73,14 +73,14 @@ class Listener {
|
|||
}
|
||||
|
||||
public static function register(IEventDispatcher $dispatcher): void {
|
||||
$listener = static function (ModifyParticipantEvent $event) {
|
||||
$listener = static function (ModifyParticipantEvent $event): void {
|
||||
/** @var self $listener */
|
||||
$listener = \OC::$server->query(self::class);
|
||||
$listener->setActive($event->getRoom(), $event->getParticipant());
|
||||
};
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_SESSION_JOIN_CALL, $listener);
|
||||
|
||||
$listener = static function (RoomEvent $event) {
|
||||
$listener = static function (RoomEvent $event): void {
|
||||
/** @var self $listener */
|
||||
$listener = \OC::$server->query(self::class);
|
||||
$listener->generateCallActivity($event->getRoom());
|
||||
|
@ -90,7 +90,7 @@ class Listener {
|
|||
$dispatcher->addListener(Room::EVENT_AFTER_SESSION_LEAVE_CALL, $listener, -100);
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_ROOM_DISCONNECT, $listener, -100);
|
||||
|
||||
$listener = static function (AddParticipantsEvent $event) {
|
||||
$listener = static function (AddParticipantsEvent $event): void {
|
||||
/** @var self $listener */
|
||||
$listener = \OC::$server->query(self::class);
|
||||
$listener->generateInvitationActivity($event->getRoom(), $event->getParticipants());
|
||||
|
|
|
@ -202,7 +202,7 @@ class Application extends App implements IBootstrap {
|
|||
}
|
||||
|
||||
protected function registerRoomActivityHooks(IEventDispatcher $dispatcher): void {
|
||||
$listener = function (ChatEvent $event) {
|
||||
$listener = function (ChatEvent $event): void {
|
||||
$room = $event->getRoom();
|
||||
/** @var ITimeFactory $timeFactory */
|
||||
$timeFactory = $this->getContainer()->query(ITimeFactory::class);
|
||||
|
@ -214,7 +214,7 @@ class Application extends App implements IBootstrap {
|
|||
}
|
||||
|
||||
protected function registerChatHooks(IEventDispatcher $dispatcher): void {
|
||||
$listener = function (RoomEvent $event) {
|
||||
$listener = function (RoomEvent $event): void {
|
||||
/** @var ChatManager $chatManager */
|
||||
$chatManager = $this->getContainer()->query(ChatManager::class);
|
||||
$chatManager->deleteMessages($event->getRoom());
|
||||
|
|
|
@ -306,7 +306,7 @@ class Listener implements IEventListener {
|
|||
$listener->sendSystemMessage($room, 'guest_moderator_demoted', ['session' => $attendee->getActorId()]);
|
||||
}
|
||||
});
|
||||
$listener = function (GenericEvent $event) {
|
||||
$listener = function (GenericEvent $event): void {
|
||||
/** @var IShare $share */
|
||||
$share = $event->getSubject();
|
||||
|
||||
|
@ -406,7 +406,7 @@ class Listener implements IEventListener {
|
|||
);
|
||||
}
|
||||
|
||||
protected function getUserId() {
|
||||
protected function getUserId(): ?string {
|
||||
$user = $this->userSession->getUser();
|
||||
return $user instanceof IUser ? $user->getUID() : null;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ use OCP\IUserManager;
|
|||
|
||||
class Listener {
|
||||
public static function register(IEventDispatcher $dispatcher): void {
|
||||
$listener = static function (RoomEvent $event) {
|
||||
$listener = static function (RoomEvent $event): void {
|
||||
$room = $event->getRoom();
|
||||
/** @var IManager $manager */
|
||||
$resourceManager = \OC::$server->query(IManager::class);
|
||||
|
@ -51,7 +51,7 @@ class Listener {
|
|||
};
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_ROOM_DELETE, $listener);
|
||||
|
||||
$listener = static function (AddParticipantsEvent $event) {
|
||||
$listener = static function (AddParticipantsEvent $event): void {
|
||||
$room = $event->getRoom();
|
||||
/** @var IManager $manager */
|
||||
$resourceManager = \OC::$server->query(IManager::class);
|
||||
|
@ -75,7 +75,7 @@ class Listener {
|
|||
};
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_USERS_ADD, $listener);
|
||||
|
||||
$listener = static function (RemoveUserEvent $event) {
|
||||
$listener = static function (RemoveUserEvent $event): void {
|
||||
$room = $event->getRoom();
|
||||
/** @var IManager $manager */
|
||||
$resourceManager = \OC::$server->query(IManager::class);
|
||||
|
@ -89,7 +89,7 @@ class Listener {
|
|||
};
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_USER_REMOVE, $listener);
|
||||
|
||||
$listener = static function (RemoveParticipantEvent $event) {
|
||||
$listener = static function (RemoveParticipantEvent $event): void {
|
||||
$room = $event->getRoom();
|
||||
/** @var IManager $manager */
|
||||
$resourceManager = \OC::$server->query(IManager::class);
|
||||
|
@ -110,7 +110,7 @@ class Listener {
|
|||
};
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_PARTICIPANT_REMOVE, $listener);
|
||||
|
||||
$listener = static function (RoomEvent $event) {
|
||||
$listener = static function (RoomEvent $event): void {
|
||||
$room = $event->getRoom();
|
||||
/** @var IManager $manager */
|
||||
$resourceManager = \OC::$server->query(IManager::class);
|
||||
|
|
|
@ -95,6 +95,9 @@ class SettingsController extends OCSController {
|
|||
return new DataResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null|string $value
|
||||
*/
|
||||
protected function validateUserSetting(string $setting, $value): bool {
|
||||
if ($setting === 'attachment_folder') {
|
||||
$userFolder = $this->rootFolder->getUserFolder($this->userId);
|
||||
|
|
|
@ -229,7 +229,7 @@ class CloudFederationProviderTalk implements ICloudFederationProvider {
|
|||
return $attendee;
|
||||
}
|
||||
|
||||
private function notifyAboutNewShare(IUser $shareWith, string $shareId, string $sharedByFederatedId, string $sharedByName, string $roomName, string $roomToken, string $serverUrl) {
|
||||
private function notifyAboutNewShare(IUser $shareWith, string $shareId, string $sharedByFederatedId, string $sharedByName, string $roomName, string $roomToken, string $serverUrl): void {
|
||||
$notification = $this->notificationManager->createNotification();
|
||||
$notification->setApp(Application::APP_ID)
|
||||
->setUser($shareWith->getUID())
|
||||
|
|
|
@ -111,7 +111,7 @@ class FederationManager {
|
|||
* @throws UnauthorizedException
|
||||
* @throws MultipleObjectsReturnedException
|
||||
*/
|
||||
public function acceptRemoteRoomShare(IUser $user, int $shareId) {
|
||||
public function acceptRemoteRoomShare(IUser $user, int $shareId): void {
|
||||
$invitation = $this->invitationMapper->getInvitationById($shareId);
|
||||
if ($invitation->getUserId() !== $user->getUID()) {
|
||||
throw new UnauthorizedException('invitation is for a different user');
|
||||
|
@ -140,7 +140,7 @@ class FederationManager {
|
|||
* @throws UnauthorizedException
|
||||
* @throws MultipleObjectsReturnedException
|
||||
*/
|
||||
public function rejectRemoteRoomShare(IUser $user, int $shareId) {
|
||||
public function rejectRemoteRoomShare(IUser $user, int $shareId): void {
|
||||
$invitation = $this->invitationMapper->getInvitationById($shareId);
|
||||
if ($invitation->getUserId() !== $user->getUID()) {
|
||||
throw new UnauthorizedException('invitation is for a different user');
|
||||
|
|
|
@ -73,7 +73,7 @@ class Listener {
|
|||
}
|
||||
|
||||
public static function register(IEventDispatcher $dispatcher): void {
|
||||
$listener = static function (JoinRoomUserEvent $event) {
|
||||
$listener = static function (JoinRoomUserEvent $event): void {
|
||||
/** @var self $listener */
|
||||
$listener = \OC::$server->query(self::class);
|
||||
|
||||
|
@ -86,7 +86,7 @@ class Listener {
|
|||
};
|
||||
$dispatcher->addListener(Room::EVENT_BEFORE_ROOM_CONNECT, $listener);
|
||||
|
||||
$listener = static function (JoinRoomGuestEvent $event) {
|
||||
$listener = static function (JoinRoomGuestEvent $event): void {
|
||||
/** @var self $listener */
|
||||
$listener = \OC::$server->query(self::class);
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ class Operation implements IOperation {
|
|||
}
|
||||
}
|
||||
|
||||
protected function prepareText(IEntity $entity, string $eventName) {
|
||||
protected function prepareText(IEntity $entity, string $eventName): string {
|
||||
$message = $eventName;
|
||||
if ($entity instanceof IDisplayText) {
|
||||
$message = trim($entity->getDisplayText(3));
|
||||
|
|
|
@ -36,7 +36,8 @@ class Version10000Date20201012144235 extends SimpleMigrationStep {
|
|||
* @param IOutput $output
|
||||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||
* @param array $options
|
||||
* @return null|ISchemaWrapper
|
||||
*
|
||||
* @return ISchemaWrapper
|
||||
*/
|
||||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ISchemaWrapper {
|
||||
/** @var ISchemaWrapper $schema */
|
||||
|
|
|
@ -72,7 +72,10 @@ class Version7000Date20190724121136 extends SimpleMigrationStep {
|
|||
* @param IOutput $output
|
||||
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||
* @param array $options
|
||||
*
|
||||
* @since 13.0.0
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
|
||||
$query = $this->connection->getQueryBuilder();
|
||||
|
|
|
@ -69,7 +69,7 @@ class Listener {
|
|||
}
|
||||
|
||||
public static function register(IEventDispatcher $dispatcher): void {
|
||||
$listener = static function (AddParticipantsEvent $event) {
|
||||
$listener = static function (AddParticipantsEvent $event): void {
|
||||
$room = $event->getRoom();
|
||||
|
||||
if ($room->getObjectType() === 'file') {
|
||||
|
@ -82,28 +82,28 @@ class Listener {
|
|||
};
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_USERS_ADD, $listener);
|
||||
|
||||
$listener = static function (JoinRoomUserEvent $event) {
|
||||
$listener = static function (JoinRoomUserEvent $event): void {
|
||||
/** @var self $listener */
|
||||
$listener = \OC::$server->query(self::class);
|
||||
$listener->markInvitationRead($event->getRoom());
|
||||
};
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_ROOM_CONNECT, $listener);
|
||||
|
||||
$listener = static function (RoomEvent $event) {
|
||||
$listener = static function (RoomEvent $event): void {
|
||||
/** @var self $listener */
|
||||
$listener = \OC::$server->query(self::class);
|
||||
$listener->checkCallNotifications($event->getRoom());
|
||||
};
|
||||
$dispatcher->addListener(Room::EVENT_BEFORE_SESSION_JOIN_CALL, $listener);
|
||||
|
||||
$listener = static function (RoomEvent $event) {
|
||||
$listener = static function (RoomEvent $event): void {
|
||||
/** @var self $listener */
|
||||
$listener = \OC::$server->query(self::class);
|
||||
$listener->sendCallNotifications($event->getRoom());
|
||||
};
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_SESSION_JOIN_CALL, $listener);
|
||||
|
||||
$listener = static function (RoomEvent $event) {
|
||||
$listener = static function (RoomEvent $event): void {
|
||||
/** @var self $listener */
|
||||
$listener = \OC::$server->query(self::class);
|
||||
$listener->markCallNotificationsRead($event->getRoom());
|
||||
|
|
|
@ -49,22 +49,22 @@ use OCP\EventDispatcher\IEventDispatcher;
|
|||
*/
|
||||
class Listener {
|
||||
public static function register(IEventDispatcher $dispatcher): void {
|
||||
$listener = static function (JoinRoomUserEvent $event) {
|
||||
$listener = static function (JoinRoomUserEvent $event): void {
|
||||
self::preventExtraUsersFromJoining($event->getRoom(), $event->getUser()->getUID());
|
||||
};
|
||||
$dispatcher->addListener(Room::EVENT_BEFORE_ROOM_CONNECT, $listener);
|
||||
|
||||
$listener = static function (JoinRoomGuestEvent $event) {
|
||||
$listener = static function (JoinRoomGuestEvent $event): void {
|
||||
self::preventExtraGuestsFromJoining($event->getRoom());
|
||||
};
|
||||
$dispatcher->addListener(Room::EVENT_BEFORE_GUEST_CONNECT, $listener);
|
||||
|
||||
$listener = static function (AddParticipantsEvent $event) {
|
||||
$listener = static function (AddParticipantsEvent $event): void {
|
||||
self::preventExtraUsersFromBeingAdded($event->getRoom(), $event->getParticipants());
|
||||
};
|
||||
$dispatcher->addListener(Room::EVENT_BEFORE_USERS_ADD, $listener);
|
||||
|
||||
$listener = static function (RoomEvent $event) {
|
||||
$listener = static function (RoomEvent $event): void {
|
||||
self::destroyRoomOnParticipantLeave($event->getRoom());
|
||||
};
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_USER_REMOVE, $listener);
|
||||
|
|
|
@ -246,8 +246,12 @@ class HostedSignalingServerService {
|
|||
|
||||
/**
|
||||
* @throws HostedSignalingServerAPIException
|
||||
*
|
||||
* @return (\ArrayAccess|array|mixed)[]|\ArrayAccess
|
||||
*
|
||||
* @psalm-return list<created: mixed, owner: <array>, status: mixed, signaling: <array>>
|
||||
*/
|
||||
public function fetchAccountInfo(AccountId $accountId): array {
|
||||
public function fetchAccountInfo(AccountId $accountId) {
|
||||
try {
|
||||
$nonce = $this->secureRandom->generate(32);
|
||||
$this->config->setAppValue('spreed', 'hosted-signaling-server-nonce', $nonce);
|
||||
|
@ -400,8 +404,10 @@ class HostedSignalingServerService {
|
|||
|
||||
/**
|
||||
* @throws HostedSignalingServerAPIException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleteAccount(AccountId $accountId) {
|
||||
public function deleteAccount(AccountId $accountId): void {
|
||||
try {
|
||||
$nonce = $this->secureRandom->generate(32);
|
||||
$this->config->setAppValue('spreed', 'hosted-signaling-server-nonce', $nonce);
|
||||
|
|
|
@ -115,7 +115,7 @@ class RoomShareProvider implements IShareProvider {
|
|||
}
|
||||
|
||||
public static function register(IEventDispatcher $dispatcher): void {
|
||||
$listener = static function (ParticipantEvent $event) {
|
||||
$listener = static function (ParticipantEvent $event): void {
|
||||
$room = $event->getRoom();
|
||||
|
||||
if ($event->getParticipant()->getAttendee()->getParticipantType() === Participant::USER_SELF_JOINED) {
|
||||
|
@ -126,7 +126,7 @@ class RoomShareProvider implements IShareProvider {
|
|||
};
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_ROOM_DISCONNECT, $listener);
|
||||
|
||||
$listener = static function (RemoveUserEvent $event) {
|
||||
$listener = static function (RemoveUserEvent $event): void {
|
||||
$room = $event->getRoom();
|
||||
|
||||
/** @var self $roomShareProvider */
|
||||
|
@ -135,7 +135,7 @@ class RoomShareProvider implements IShareProvider {
|
|||
};
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_USER_REMOVE, $listener);
|
||||
|
||||
$listener = static function (RoomEvent $event) {
|
||||
$listener = static function (RoomEvent $event): void {
|
||||
$room = $event->getRoom();
|
||||
|
||||
/** @var self $roomShareProvider */
|
||||
|
|
|
@ -53,7 +53,7 @@ class Listener {
|
|||
}
|
||||
|
||||
protected static function registerInternalSignaling(IEventDispatcher $dispatcher): void {
|
||||
$listener = static function (RoomEvent $event) {
|
||||
$listener = static function (RoomEvent $event): void {
|
||||
if (!self::isUsingInternalSignaling()) {
|
||||
return;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ class Listener {
|
|||
$dispatcher->addListener(Room::EVENT_AFTER_SESSION_LEAVE_CALL, $listener);
|
||||
$dispatcher->addListener(GuestManager::EVENT_AFTER_NAME_UPDATE, $listener);
|
||||
|
||||
$listener = static function (ParticipantEvent $event) {
|
||||
$listener = static function (ParticipantEvent $event): void {
|
||||
if (!self::isUsingInternalSignaling()) {
|
||||
return;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ class Listener {
|
|||
$dispatcher->addListener(Room::EVENT_BEFORE_ROOM_DISCONNECT, $listener);
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_PARTICIPANT_PUBLISHING_PERMISSIONS_SET, $listener);
|
||||
|
||||
$listener = static function (RoomEvent $event) {
|
||||
$listener = static function (RoomEvent $event): void {
|
||||
$room = $event->getRoom();
|
||||
if (!self::isUsingInternalSignaling()) {
|
||||
return;
|
||||
|
@ -109,7 +109,7 @@ class Listener {
|
|||
|
||||
$notifier->roomInvited($event->getRoom(), $event->getParticipants());
|
||||
});
|
||||
$listener = static function (RoomEvent $event) {
|
||||
$listener = static function (RoomEvent $event): void {
|
||||
if (self::isUsingInternalSignaling()) {
|
||||
return;
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ class Listener {
|
|||
// "roomModified" message for participant type changes.
|
||||
$dispatcher->addListener(Room::EVENT_AFTER_PARTICIPANT_TYPE_SET, $listener);
|
||||
|
||||
$listener = static function (ModifyParticipantEvent $event) {
|
||||
$listener = static function (ModifyParticipantEvent $event): void {
|
||||
if (self::isUsingInternalSignaling()) {
|
||||
return;
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ class Listener {
|
|||
}
|
||||
});
|
||||
|
||||
$listener = static function (ModifyParticipantEvent $event) {
|
||||
$listener = static function (ModifyParticipantEvent $event): void {
|
||||
if (self::isUsingInternalSignaling()) {
|
||||
return;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче