Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Mac
.DS_Store

# Editor
/.idea

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
}
},
"require": {
"php": "^8.0",
"php": ">=8.0 <8.4",
"ext-pcntl": "*",
"bunny/bunny": "^0.5",
"symfony/console": "~3.3 || ^4.0 || ^5.0 || ^6.0",
"symfony/console": "~3.3 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
"nette/di": "^3.1.0",
"nette/schema": "^1.2"
},
Expand All @@ -48,7 +48,7 @@
"nette/neon": "^2.4.3 || ^3.2.1",
"mockery/mockery": "^1.3.3",
"tracy/tracy": "^2.5",
"vimeo/psalm": "^4.9",
"vimeo/psalm": "^5.0",
"ninjify/nunjuck": "^0.4",
"phpstan/phpstan": "^1.8"
},
Expand Down
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