diff --git a/.gitignore b/.gitignore index a379b0b..27a24dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Mac +.DS_Store + # Editor /.idea diff --git a/composer.json b/composer.json index 9905d2d..e4ebd4e 100644 --- a/composer.json +++ b/composer.json @@ -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" }, @@ -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" }, diff --git a/psalm.xml b/psalm.xml index 4e9226b..6c5f6e8 100644 --- a/psalm.xml +++ b/psalm.xml @@ -2,6 +2,8 @@ + diff --git a/src/Connection/Api.php b/src/Connection/Api.php index 92d0ab0..70f3979 100644 --- a/src/Connection/Api.php +++ b/src/Connection/Api.php @@ -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; } @@ -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) : '', ]; }