Skip to content

Conversation

@villfa
Copy link
Contributor

@villfa villfa commented Jul 8, 2024

Hi,

I work on a project where we override publishBasic() like this:

try {
    parent::publishBasic($msg, $exchange, $destination, $mandatory, $immediate, $ticket);
} catch (AMQPConnectionClosedException|AMQPChannelClosedException) {
    $this->reconnect();
    parent::publishBasic($msg, $exchange, $destination, $mandatory, $immediate, $ticket);
}

but PHPStan emits this error:

Dead catch - PhpAmqpLib\Exception\AMQPChannelClosedException\|PhpAmqpLib\Exception\AMQPConnectionClosedException is never thrown in the try block.

These changes will fix this issue.

@khepin khepin merged commit f7a3f9d into vyuldashev:master Jul 8, 2024
@villfa villfa deleted the patch-1 branch July 9, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants