Skip to content

Commit

Permalink
Fixed some psalm errors (and some are ignored as Client is bunny stuff)
Browse files Browse the repository at this point in the history
  • Loading branch information
bckp committed Feb 12, 2024
1 parent 00901ff commit d934ab9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<psalm
errorLevel="2"
resolveFromConfigFile="true"
findUnusedBaselineEntry="false"
findUnusedCode="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand All @@ -10,6 +12,7 @@
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
<file name="src/Connection/Client.php" />
</ignoreFiles>
</projectFiles>
</psalm>
6 changes: 3 additions & 3 deletions src/Connection/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ public function createFederation(
'exchange' => $name,
];

if ($messageTTL) {
if ($messageTTL !== null && $messageTTL > 0) {
$federationParamsPrototype['message-ttl'] = $messageTTL;
}
if ($expires) {
if ($expires !== null && $expires > 0) {
$federationParamsPrototype['expires'] = $expires;
}

Expand Down Expand Up @@ -167,7 +167,7 @@ private function request(string $method, string $url, array $params = []): array

return [
'status' => $info['http_code'],
'data' => $response ? json_decode((string) $response, flags: JSON_THROW_ON_ERROR) : '',
'data' => $response !== false ? json_decode((string) $response, flags: JSON_THROW_ON_ERROR) : '',
];
}

Expand Down

0 comments on commit d934ab9

Please sign in to comment.