Skip to content

Commit

Permalink
fix(openapi): Change things that don't raise any questions
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Nov 20, 2024
1 parent 81a029c commit fc95fa2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
6 changes: 3 additions & 3 deletions lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,18 +272,18 @@ public function getCapabilities(): array {
$capabilities['config']['signaling']['hello-v2-token-key'] = $pubKey;
}

/** @var ?string[] $predefinedBackgrounds */
/** @var ?list<string> $predefinedBackgrounds */
$predefinedBackgrounds = null;
$cachedPredefinedBackgrounds = $this->talkCache->get('predefined_backgrounds');
if ($cachedPredefinedBackgrounds !== null) {
// Try using cached value
/** @var string[]|null $predefinedBackgrounds */
/** @var list<string>|null $predefinedBackgrounds */
$predefinedBackgrounds = json_decode($cachedPredefinedBackgrounds, true);
}

if (!is_array($predefinedBackgrounds)) {
// Cache was empty or invalid, regenerate
/** @var string[] $predefinedBackgrounds */
/** @var list<string> $predefinedBackgrounds */
$predefinedBackgrounds = [];
if (file_exists(__DIR__ . '/../img/backgrounds')) {
$directoryIterator = new \DirectoryIterator(__DIR__ . '/../img/backgrounds');
Expand Down
3 changes: 3 additions & 0 deletions lib/Model/BanMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public function findForBannedActorAndRoom(string $bannedActorType, string $banne
return $this->findEntity($query);
}

/**
* @return list<Ban>
*/
public function findByRoomId(int $roomId, ?string $bannedActorType = null): array {
$query = $this->db->getQueryBuilder();
$query->select('*')
Expand Down
20 changes: 10 additions & 10 deletions lib/ResponseDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
* isReplyable: bool,
* markdown: bool,
* reactions: array<string, integer>|\stdClass,
* reactionsSelf?: string[],
* reactionsSelf?: list<string>,
* referenceId: string,
* timestamp: int,
* token: string,
Expand Down Expand Up @@ -156,7 +156,7 @@
* inviterDisplayName: string,
* }
*
* @psalm-type TalkMatterbridgeConfigFields = array<array<string, mixed>>
* @psalm-type TalkMatterbridgeConfigFields = list<array<string, mixed>>
*
* @psalm-type TalkMatterbridge = array{
* enabled: bool,
Expand Down Expand Up @@ -184,7 +184,7 @@
* participantType: int,
* permissions: int,
* roomToken: string,
* sessionIds: string[],
* sessionIds: list<string>,
* status?: string,
* statusClearAt?: ?int,
* statusIcon?: ?string,
Expand Down Expand Up @@ -321,15 +321,15 @@
* server: string,
* signalingMode: string,
* sipDialinInfo: string,
* stunservers: array{urls: string[]}[],
* stunservers: list<array{urls: list<string>}>,
* ticket: string,
* turnservers: array{urls: string[], username: string, credential: mixed}[],
* turnservers: list<array{urls: list<string>, username: string, credential: mixed}>,
* userId: ?string,
* }
*
* @psalm-type TalkCapabilities = array{
* features: string[],
* features-local: string[],
* features: list<string>,
* features-local: list<string>,
* config: array{
* attachments: array{
* allowed: bool,
Expand All @@ -340,8 +340,8 @@
* breakout-rooms: bool,
* recording: bool,
* recording-consent: int,
* supported-reactions: string[],
* predefined-backgrounds: string[],
* supported-reactions: list<string>,
* predefined-backgrounds: list<string>,
* can-upload-background: bool,
* sip-enabled: bool,
* sip-dialout-enabled: bool,
Expand Down Expand Up @@ -374,7 +374,7 @@
* hello-v2-token-key?: string,
* },
* },
* config-local: array<string, string[]>,
* config-local: array<string, list<string>>,
* version: string,
* }
*/
Expand Down
8 changes: 4 additions & 4 deletions lib/Service/PollService.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function createPoll(int $roomId, string $actorType, string $actorId, stri

/**
* @param int $roomId
* @return Poll[]
* @return list<Poll>
*/
public function getDraftsForRoom(int $roomId): array {
return $this->pollMapper->getDraftsByRoomId($roomId);
Expand Down Expand Up @@ -135,7 +135,7 @@ public function updatePoll(Participant $participant, Poll $poll): void {
/**
* @param Participant $participant
* @param Poll $poll
* @return Vote[]
* @return list<Vote>
*/
public function getVotesForActor(Participant $participant, Poll $poll): array {
return $this->voteMapper->findByPollIdForActor(
Expand All @@ -147,7 +147,7 @@ public function getVotesForActor(Participant $participant, Poll $poll): array {

/**
* @param Poll $poll
* @return Vote[]
* @return list<Vote>
*/
public function getVotes(Poll $poll): array {
return $this->voteMapper->findByPollId($poll->getId());
Expand All @@ -157,7 +157,7 @@ public function getVotes(Poll $poll): array {
* @param Participant $participant
* @param Poll $poll
* @param int[] $optionIds Options the user voted for
* @return Vote[]
* @return list<Vote>
* @throws \RuntimeException
*/
public function votePoll(Participant $participant, Poll $poll, array $optionIds): array {
Expand Down

0 comments on commit fc95fa2

Please sign in to comment.