Skip to content

Commit 33e7e47

Browse files
authored
Add PHP 8 support (#43)
1 parent 7672bda commit 33e7e47

11 files changed

+20
-14
lines changed

Diff for: .scrutinizer.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
build:
2+
dependencies:
3+
before:
4+
- composer config minimum-stability RC
25
nodes:
36
analysis:
47
tests:

Diff for: .travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ matrix:
2222
env: SYMFONY_VERSION=^5.0
2323
- php: 7.4
2424
env: SYMFONY_VERSION=^5.0
25+
- php: 8.0
26+
env: SYMFONY_VERSION=^5.0 MINIMUM_STABILITY=RC
2527

2628
allow_failures:
2729
- php: nightly
2830

2931
before_install:
3032
- if [ "$SYMFONY_VERSION" != "" ]; then composer require --no-update symfony/framework-bundle "$SYMFONY_VERSION"; fi
33+
- if [ "$MINIMUM_STABILITY" != "" ]; then composer config minimum-stability "$MINIMUM_STABILITY"; fi
3134
- if [ "$COMPOSER_FLAGS" != "" ]; then composer update --prefer-dist --no-interaction --no-scripts $COMPOSER_FLAGS; fi;
3235

3336
install:

Diff for: Resources/config/rabbitmq.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
55

66
<parameters>
7-
<parameter key="old_sound_rabbit_mq.connection.class">PhpAmqpLib\Connection\AMQPConnection</parameter>
7+
<parameter key="old_sound_rabbit_mq.connection.class">PhpAmqpLib\Connection\AMQPStreamConnection</parameter>
88
<parameter key="old_sound_rabbit_mq.socket_connection.class">PhpAmqpLib\Connection\AMQPSocketConnection</parameter>
99
<parameter key="old_sound_rabbit_mq.lazy.connection.class">PhpAmqpLib\Connection\AMQPLazyConnection</parameter>
1010
<parameter key="old_sound_rabbit_mq.lazy.socket_connection.class">PhpAmqpLib\Connection\AMQPLazySocketConnection</parameter>

Diff for: Tests/Event/AfterProcessingMessageEventTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class AfterProcessingMessageEventTest extends TestCase
1717
protected function getConsumer()
1818
{
1919
return new Consumer(
20-
$this->getMockBuilder('\PhpAmqpLib\Connection\AMQPConnection')
20+
$this->getMockBuilder('\PhpAmqpLib\Connection\AMQPStreamConnection')
2121
->disableOriginalConstructor()
2222
->getMock(),
2323
$this->getMockBuilder('\PhpAmqpLib\Channel\AMQPChannel')

Diff for: Tests/Event/BeforeProcessingMessageEventTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class BeforeProcessingMessageEventTest extends TestCase
1717
protected function getConsumer()
1818
{
1919
return new Consumer(
20-
$this->getMockBuilder('\PhpAmqpLib\Connection\AMQPConnection')
20+
$this->getMockBuilder('\PhpAmqpLib\Connection\AMQPStreamConnection')
2121
->disableOriginalConstructor()
2222
->getMock(),
2323
$this->getMockBuilder('\PhpAmqpLib\Channel\AMQPChannel')

Diff for: Tests/Event/OnIdleEventTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class OnIdleEventTest extends TestCase
1616
protected function getConsumer()
1717
{
1818
return new Consumer(
19-
$this->getMockBuilder('\PhpAmqpLib\Connection\AMQPConnection')
19+
$this->getMockBuilder('\PhpAmqpLib\Connection\AMQPStreamConnection')
2020
->disableOriginalConstructor()
2121
->getMock(),
2222
$this->getMockBuilder('\PhpAmqpLib\Channel\AMQPChannel')

Diff for: Tests/RabbitMq/BaseConsumerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class BaseConsumerTest extends TestCase
1212

1313
protected function setUp(): void
1414
{
15-
$amqpConnection = $this->getMockBuilder('\PhpAmqpLib\Connection\AMQPConnection')
15+
$amqpConnection = $this->getMockBuilder('\PhpAmqpLib\Connection\AMQPStreamConnection')
1616
->disableOriginalConstructor()
1717
->getMock();
1818

Diff for: Tests/RabbitMq/BindingTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected function getBinding($amqpConnection, $amqpChannel)
2020
*/
2121
protected function prepareAMQPConnection()
2222
{
23-
return $this->getMockBuilder('\PhpAmqpLib\Connection\AMQPConnection')
23+
return $this->getMockBuilder('\PhpAmqpLib\Connection\AMQPStreamConnection')
2424
->disableOriginalConstructor()
2525
->getMock();
2626
}

Diff for: Tests/RabbitMq/ConsumerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use OldSound\RabbitMqBundle\Event\OnIdleEvent;
99
use OldSound\RabbitMqBundle\RabbitMq\Consumer;
1010
use PhpAmqpLib\Channel\AMQPChannel;
11-
use PhpAmqpLib\Connection\AMQPConnection;
11+
use PhpAmqpLib\Connection\AMQPStreamConnection;
1212
use PhpAmqpLib\Exception\AMQPTimeoutException;
1313
use PhpAmqpLib\Message\AMQPMessage;
1414
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
@@ -26,7 +26,7 @@ protected function getConsumer($amqpConnection, $amqpChannel)
2626

2727
protected function prepareAMQPConnection()
2828
{
29-
return $this->getMockBuilder(AMQPConnection::class)
29+
return $this->getMockBuilder(AMQPStreamConnection::class)
3030
->disableOriginalConstructor()
3131
->getMock();
3232
}

Diff for: Tests/RabbitMq/MultipleConsumerTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
77
use OldSound\RabbitMqBundle\RabbitMq\MultipleConsumer;
88
use PhpAmqpLib\Channel\AMQPChannel;
9-
use PhpAmqpLib\Connection\AMQPConnection;
9+
use PhpAmqpLib\Connection\AMQPStreamConnection;
1010
use PhpAmqpLib\Message\AMQPMessage;
1111
use PHPUnit\Framework\Assert;
1212
use PHPUnit\Framework\MockObject\MockObject;
@@ -31,7 +31,7 @@ class MultipleConsumerTest extends TestCase
3131
/**
3232
* AMQP connection
3333
*
34-
* @var MockObject|AMQPConnection
34+
* @var MockObject|AMQPStreamConnection
3535
*/
3636
private $amqpConnection;
3737

@@ -255,11 +255,11 @@ public function queueBindingRoutingKeyProvider()
255255
/**
256256
* Preparing AMQP Connection
257257
*
258-
* @return MockObject|AMQPConnection
258+
* @return MockObject|AMQPStreamConnection
259259
*/
260260
private function prepareAMQPConnection()
261261
{
262-
return $this->getMockBuilder('\PhpAmqpLib\Connection\AMQPConnection')
262+
return $this->getMockBuilder('\PhpAmqpLib\Connection\AMQPStreamConnection')
263263
->disableOriginalConstructor()
264264
->getMock();
265265
}

Diff for: composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
"name" : "Alvaro Videla"
99
}],
1010
"require": {
11-
"php": "^7.1",
11+
"php": "^7.1|^8.0",
1212

1313
"symfony/dependency-injection": "^4.3|^5.0",
1414
"symfony/event-dispatcher": "^4.3|^5.0",
1515
"symfony/config": "^4.3|^5.0",
1616
"symfony/yaml": "^4.3|^5.0",
1717
"symfony/console": "^4.3|^5.0",
18-
"php-amqplib/php-amqplib": "^2.6",
18+
"php-amqplib/php-amqplib": "^2.6|^3.0",
1919
"psr/log": "^1.0",
2020
"symfony/http-kernel": "^4.4|^5.0",
2121
"symfony/framework-bundle": "^4.4|^5.0"

0 commit comments

Comments
 (0)