Skip to content

Commit

Permalink
Remove unreachable condition
Browse files Browse the repository at this point in the history
This brings bunny to PHPStan Level 5
  • Loading branch information
jeromegamez committed May 20, 2024
1 parent 873ec47 commit 32c747c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install Dependencies
uses: ramsey/composer-install@v2
- name: Run PHPStan
run: ./vendor/bin/phpstan analyze src --level 0
run: ./vendor/bin/phpstan analyze src --level 5
test:
name: "Run Tests on PHP ${{ matrix.php }} against RabbitMQ ${{ matrix.rabbitmq }} (Composer: ${{ matrix.composer }}; TLS: ${{ matrix.ssl_test }})"
runs-on: ubuntu-latest
Expand Down
8 changes: 1 addition & 7 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,7 @@ public function awaitConnectionClose(): Protocol\MethodConnectionCloseFrame
$deferred = new Deferred();
$this->awaitList[] = [
'filter' => function (Protocol\AbstractFrame $frame): bool {
if ($frame instanceof Protocol\MethodConnectionCloseFrame) {
return true;
} elseif ($frame instanceof Protocol\MethodConnectionCloseFrame) {
$this->connectionCloseOk();
throw new ClientException($frame->replyText, $frame->replyCode);
}
return false;
return $frame instanceof Protocol\MethodConnectionCloseFrame;
},
'promise' => $deferred,
];
Expand Down

0 comments on commit 32c747c

Please sign in to comment.