Skip to content

Commit

Permalink
fix(psalm): Match psalm definitions
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Aug 28, 2024
1 parent d19361b commit 24a26e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ public function getCapabilities(): array {
return [];
}

/** @psalm-var non-empty-string $version */
$version = $this->appManager->getAppVersion('spreed');
$capabilities = [
'features' => self::FEATURES,
'features-local' => self::LOCAL_FEATURES,
Expand Down Expand Up @@ -211,15 +213,15 @@ public function getCapabilities(): array {
'only-trusted-servers' => true,
],
'previews' => [
'max-gif-size' => (int)$this->serverConfig->getAppValue('spreed', 'max-gif-size', '3145728'),
'max-gif-size' => max(0, (int)$this->serverConfig->getAppValue('spreed', 'max-gif-size', '3145728')),
],
'signaling' => [
'session-ping-limit' => max(0, (int)$this->serverConfig->getAppValue('spreed', 'session-ping-limit', '200')),
// 'hello-v2-token-key' => string,
],
],
'config-local' => self::LOCAL_CONFIGS,
'version' => $this->appManager->getAppVersion('spreed'),
'version' => $version,
];

if ($this->serverConfig->getAppValue('core', 'backgroundjobs_mode', 'ajax') === 'cron') {
Expand All @@ -246,7 +248,7 @@ public function getCapabilities(): array {
}

$pubKey = $this->talkConfig->getSignalingTokenPublicKey();
if ($pubKey) {
if ($pubKey !== '') {
$capabilities['config']['signaling']['hello-v2-token-key'] = $pubKey;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/ResponseDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
*
* @psalm-type TalkSignalingSession = array{
* actorId: non-empty-string,
* actorType: non-empty-string,
* actorType: TalkActorTypes,
* inCall: TalkCallFlags,
* lastPing: int<0, max>,
* participantPermissions: TalkPermissions,
Expand Down

0 comments on commit 24a26e7

Please sign in to comment.