Skip to content

Commit d934ab9

Browse files
committed
Fixed some psalm errors (and some are ignored as Client is bunny stuff)
1 parent 00901ff commit d934ab9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

psalm.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<psalm
33
errorLevel="2"
44
resolveFromConfigFile="true"
5+
findUnusedBaselineEntry="false"
6+
findUnusedCode="false"
57
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
68
xmlns="https://getpsalm.org/schema/config"
79
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
@@ -10,6 +12,7 @@
1012
<directory name="src" />
1113
<ignoreFiles>
1214
<directory name="vendor" />
15+
<file name="src/Connection/Client.php" />
1316
</ignoreFiles>
1417
</projectFiles>
1518
</psalm>

src/Connection/Api.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ public function createFederation(
7171
'exchange' => $name,
7272
];
7373

74-
if ($messageTTL) {
74+
if ($messageTTL !== null && $messageTTL > 0) {
7575
$federationParamsPrototype['message-ttl'] = $messageTTL;
7676
}
77-
if ($expires) {
77+
if ($expires !== null && $expires > 0) {
7878
$federationParamsPrototype['expires'] = $expires;
7979
}
8080

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

168168
return [
169169
'status' => $info['http_code'],
170-
'data' => $response ? json_decode((string) $response, flags: JSON_THROW_ON_ERROR) : '',
170+
'data' => $response !== false ? json_decode((string) $response, flags: JSON_THROW_ON_ERROR) : '',
171171
];
172172
}
173173

0 commit comments

Comments
 (0)