swarrot / SwarrotBundle

A symfony bundle for swarrot integration
MIT License
89 stars 59 forks source link

php-amqplib: use AMQPStreamConnection instead of AMQPConnection #209

Closed Altahrim closed 3 years ago

Altahrim commented 3 years ago

Fix compatibility with php-amqplib version 3. In this version class AMQPConnection was dropped, leading to the following error:

In AmqpLibFactory.php line 111: Attempted to load class "AMQPConnection" from namespace "PhpAmqpLib\Connection".

For the following reasons, AMQPStreamConnection can be safely used instead of AMQPConnection when using php-amqplib:

Moreover, it allows compatibility with PHP 8.0 \o/


CI: I also needed to fix CI for tests with LibRabbitMQ version master.


[1] https://github.com/php-amqplib/php-amqplib/commit/68a26730b46c9a87c1c76c297bc2c752f736be0e#diff-f335edbdd39701e7e2a7b44a647a54e0010f15508a06baca2a3db1836549f3eb [2] https://github.com/php-amqplib/php-amqplib/commit/64eb289c9f5721daa2bd3ad0f333c5b738580843#diff-f335edbdd39701e7e2a7b44a647a54e0010f15508a06baca2a3db1836549f3eb

Altahrim commented 3 years ago

Travis CI test failed with PHP 7.3 and LibRabbitMQ master but it seems unrelated to proposed changes :

+ cmake ..
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.10...3.18 or higher is required.  You are running version 3.5.1

Does someone know how to fix CI? Is it possible to merge this change anyway?

Edit: finally fixed by upgrading Ubuntu and PHP versions for this specific test.

odolbeau commented 3 years ago

Hi @Altahrim! Thank you for your contribution & sorry for the (very) long delay.

Everything looks good to me, so let's merge, I'll correct the PHPStan check in another PR! :ok_hand: