Skip to content

Commit 23d22f9

Browse files
author
Mathieu Lemoine
committed
Reduced dependency to voryx/Thruway
1 parent 3943c7e commit 23d22f9

File tree

234 files changed

+1288
-760
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+1288
-760
lines changed

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ matrix:
4646
sudo: required
4747
services: docker
4848
env: SYMFONY_VERSION=4.0.* FUNCTIONAL_TESTS=true PREPARE_CONTAINER=true
49+
- php: 7.3
50+
sudo: required
51+
services: docker
52+
env: SYMFONY_VERSION=5.0.* FUNCTIONAL_TESTS=true PREPARE_CONTAINER=true
4953
- php: 7.1
5054
sudo: required
5155
services: docker

composer.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
"ext-amqp": "^1.9.3",
1515
"ext-gearman": "^2.0",
16-
"ext-mongodb": "^1.3",
16+
"ext-mongodb": "^1.5",
1717
"ext-rdkafka": "^3.0.3",
1818

1919
"queue-interop/amqp-interop": "^0.8",
@@ -35,14 +35,14 @@
3535
"php-http/client-common": "^1.7@dev",
3636
"richardfullmer/rabbitmq-management-api": "^2.0",
3737
"predis/predis": "^1.1",
38+
"thruway/client": "^0.5.0",
3839
"thruway/pawl-transport": "^0.5.0",
39-
"voryx/thruway": "^0.5.3",
4040
"influxdb/influxdb-php": "^1.14",
4141
"datadog/php-datadogstatsd": "^1.3"
4242
},
4343
"require-dev": {
44-
"phpunit/phpunit": "^5.5",
45-
"phpstan/phpstan": "^0.10",
44+
"phpunit/phpunit": "^7.5",
45+
"phpstan/phpstan": "^0.12",
4646
"queue-interop/queue-spec": "^0.6",
4747
"symfony/browser-kit": "^3.4|^4",
4848
"symfony/config": "^3.4|^4",
@@ -54,9 +54,10 @@
5454
"symfony/http-kernel": "^3.4|^4",
5555
"symfony/filesystem": "^3.4|^4",
5656
"symfony/framework-bundle": "^3.4|^4",
57+
"symfony/yaml": "^3.4|^4|^5",
5758
"empi89/php-amqp-stubs": "*@dev",
58-
"doctrine/doctrine-bundle": "~1.2",
59-
"doctrine/mongodb-odm-bundle": "^3.5",
59+
"doctrine/doctrine-bundle": "~1.2|^2",
60+
"doctrine/mongodb-odm-bundle": "^3.5|^4",
6061
"alcaeus/mongo-php-adapter": "^1.0",
6162
"kwn/php-rdkafka-stubs": "^1.0.2",
6263
"friendsofphp/php-cs-fixer": "^2"
@@ -112,7 +113,7 @@
112113
"ext-amqp": "1.9.3",
113114
"ext-gearman": "2.0.3",
114115
"ext-rdkafka": "3.3",
115-
"ext-mongodb": "1.3",
116+
"ext-mongodb": "1.5",
116117
"ext-bcmath": "1",
117118
"ext-mbstring": "1",
118119
"ext-mongo": "1.6.14"

docker-compose.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,9 @@ services:
117117
- "27017:27017"
118118

119119
thruway:
120-
image: formapro/nginx-php-fpm:latest-all-exts
120+
build: './docker/thruway'
121121
ports:
122122
- '9090:9090'
123-
working_dir: '/app'
124-
volumes:
125-
- './:/app'
126-
entrypoint:
127-
- '/usr/bin/php'
128-
- 'docker/thruway/WsRouter.php'
129123

130124
localstack:
131125
image: 'localstack/localstack:latest'

docker/thruway/Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM formapro/nginx-php-fpm:latest-all-exts
2+
3+
RUN mkdir -p /thruway
4+
WORKDIR /thruway
5+
6+
# Thruway router
7+
COPY --from=composer /usr/bin/composer /usr/bin/composer
8+
RUN COMPOSER_HOME=/thruway composer global require --prefer-dist --no-scripts voryx/thruway
9+
10+
COPY WsRouter.php .
11+
12+
CMD ["/usr/bin/php", "WsRouter.php"]
13+

docker/thruway/WsRouter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require __DIR__.'/../../vendor/autoload.php';
3+
require __DIR__.'/vendor/autoload.php';
44

55
use Thruway\Peer\Router;
66
use Thruway\Transport\RatchetTransportProvider;

docs/monitoring.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ There are available options (and all available metrics):
294294
Install additional packages:
295295

296296
```
297-
composer req thruway/pawl-transport:^0.5.0 voryx/thruway:^0.5.3
297+
composer req thruway/pawl-transport:^0.5.0 thruway/client:^0.5.0
298298
```
299299

300300
```php

docs/transport/wamp.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ nav_order: 3
1010

1111
A transport for [Web Application Messaging Protocol](https://wamp-proto.org/).
1212
WAMP is an open standard WebSocket subprotocol.
13-
It uses internally Thruway PHP library [voryx/thruway](https://github.com/voryx/Thruway)
13+
It uses internally Thruway PHP library [thruway/client](https://github.com/thruway/client)
1414

1515
* [Installation](#installation)
1616
* [Start the WAMP router](#start-the-wamp-router)
@@ -27,7 +27,10 @@ $ composer require enqueue/wamp
2727

2828
## Start the WAMP router
2929

30+
You can get a WAMP router with [Thruway](https://github.com/voryx/Thruway):
31+
3032
```bash
33+
$ composer require voryx/thruway
3134
$ php vendor/voryx/thruway/Examples/SimpleWsRouter.php
3235
```
3336

phpunit.xml.dist

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
bootstrap="./vendor/autoload.php"
1312
>
1413

pkg/amqp-bunny/Tests/AmqpConsumerTest.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Interop\Amqp\Impl\AmqpQueue;
1515
use Interop\Queue\Consumer;
1616
use Interop\Queue\Exception\InvalidMessageException;
17+
use PHPUnit\Framework\MockObject\MockObject;
1718
use PHPUnit\Framework\TestCase;
1819

1920
class AmqpConsumerTest extends TestCase
@@ -205,23 +206,23 @@ public function testShouldReturnMessageOnReceiveWithReceiveMethodBasicGet()
205206
}
206207

207208
/**
208-
* @return \PHPUnit_Framework_MockObject_MockObject|Client
209+
* @return MockObject|Client
209210
*/
210211
public function createClientMock()
211212
{
212213
return $this->createMock(Client::class);
213214
}
214215

215216
/**
216-
* @return \PHPUnit_Framework_MockObject_MockObject|AmqpContext
217+
* @return MockObject|AmqpContext
217218
*/
218219
public function createContextMock()
219220
{
220221
return $this->createMock(AmqpContext::class);
221222
}
222223

223224
/**
224-
* @return \PHPUnit_Framework_MockObject_MockObject|Channel
225+
* @return MockObject|Channel
225226
*/
226227
public function createBunnyChannelMock()
227228
{

pkg/amqp-bunny/Tests/AmqpContextTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Interop\Amqp\Impl\AmqpBind;
1010
use Interop\Amqp\Impl\AmqpQueue;
1111
use Interop\Amqp\Impl\AmqpTopic;
12+
use PHPUnit\Framework\MockObject\MockObject;
1213
use PHPUnit\Framework\TestCase;
1314

1415
class AmqpContextTest extends TestCase
@@ -244,7 +245,7 @@ public function testShouldReturnExpectedSubscriptionConsumerInstance()
244245
}
245246

246247
/**
247-
* @return \PHPUnit_Framework_MockObject_MockObject|Channel
248+
* @return MockObject|Channel
248249
*/
249250
public function createChannelMock()
250251
{

pkg/amqp-bunny/Tests/AmqpProducerTest.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Interop\Queue\Exception\InvalidMessageException;
1818
use Interop\Queue\Message;
1919
use Interop\Queue\Producer;
20+
use PHPUnit\Framework\MockObject\MockObject;
2021
use PHPUnit\Framework\TestCase;
2122

2223
class AmqpProducerTest extends TestCase
@@ -200,39 +201,39 @@ public function testShouldPropagateFlags()
200201
}
201202

202203
/**
203-
* @return \PHPUnit_Framework_MockObject_MockObject|Message
204+
* @return MockObject|Message
204205
*/
205206
private function createMessageMock()
206207
{
207208
return $this->createMock(Message::class);
208209
}
209210

210211
/**
211-
* @return \PHPUnit_Framework_MockObject_MockObject|Destination
212+
* @return MockObject|Destination
212213
*/
213214
private function createDestinationMock()
214215
{
215216
return $this->createMock(Destination::class);
216217
}
217218

218219
/**
219-
* @return \PHPUnit_Framework_MockObject_MockObject|Channel
220+
* @return MockObject|Channel
220221
*/
221222
private function createBunnyChannelMock()
222223
{
223224
return $this->createMock(Channel::class);
224225
}
225226

226227
/**
227-
* @return \PHPUnit_Framework_MockObject_MockObject|AmqpContext
228+
* @return MockObject|AmqpContext
228229
*/
229230
private function createContextMock()
230231
{
231232
return $this->createPartialMock(AmqpContext::class, []);
232233
}
233234

234235
/**
235-
* @return \PHPUnit_Framework_MockObject_MockObject|DelayStrategy
236+
* @return MockObject|DelayStrategy
236237
*/
237238
private function createDelayStrategyMock()
238239
{

pkg/amqp-bunny/Tests/AmqpSubscriptionConsumerTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Enqueue\AmqpBunny\AmqpContext;
66
use Enqueue\AmqpBunny\AmqpSubscriptionConsumer;
77
use Interop\Queue\SubscriptionConsumer;
8+
use PHPUnit\Framework\MockObject\MockObject;
89
use PHPUnit\Framework\TestCase;
910

1011
class AmqpSubscriptionConsumerTest extends TestCase
@@ -22,7 +23,7 @@ public function testCouldBeConstructedWithAmqpContextAsFirstArgument()
2223
}
2324

2425
/**
25-
* @return AmqpContext|\PHPUnit_Framework_MockObject_MockObject
26+
* @return AmqpContext|MockObject
2627
*/
2728
private function createAmqpContextMock()
2829
{

pkg/amqp-bunny/Tests/Spec/AmqpSubscriptionConsumerConsumeUntilUnsubscribedTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class AmqpSubscriptionConsumerConsumeUntilUnsubscribedTest extends SubscriptionConsumerConsumeUntilUnsubscribedSpec
1515
{
16-
protected function tearDown()
16+
protected function tearDown(): void
1717
{
1818
if ($this->subscriptionConsumer) {
1919
$this->subscriptionConsumer->unsubscribeAll();

pkg/amqp-bunny/phpunit.xml.dist

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
bootstrap="./vendor/autoload.php"
1312
>
1413

pkg/amqp-ext/Tests/AmqpConsumerTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Enqueue\Test\ClassExtensionTrait;
88
use Interop\Amqp\Impl\AmqpQueue;
99
use Interop\Queue\Consumer;
10+
use PHPUnit\Framework\MockObject\MockObject;
1011
use PHPUnit\Framework\TestCase;
1112

1213
class AmqpConsumerTest extends TestCase
@@ -24,7 +25,7 @@ public function testCouldBeConstructedWithContextAndQueueAsArguments()
2425
}
2526

2627
/**
27-
* @return \PHPUnit_Framework_MockObject_MockObject|AmqpContext
28+
* @return MockObject|AmqpContext
2829
*/
2930
private function createContext()
3031
{

pkg/amqp-ext/Tests/AmqpContextTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Interop\Amqp\Impl\AmqpTopic;
1515
use Interop\Queue\Context;
1616
use Interop\Queue\Exception\InvalidDestinationException;
17+
use PHPUnit\Framework\MockObject\MockObject;
1718
use PHPUnit\Framework\TestCase;
1819

1920
class AmqpContextTest extends TestCase
@@ -243,15 +244,15 @@ public function testShouldReturnExpectedSubscriptionConsumerInstance()
243244
}
244245

245246
/**
246-
* @return \PHPUnit_Framework_MockObject_MockObject|\AMQPChannel
247+
* @return MockObject|\AMQPChannel
247248
*/
248249
private function createExtChannelMock()
249250
{
250251
return $this->createMock(\AMQPChannel::class);
251252
}
252253

253254
/**
254-
* @return \PHPUnit_Framework_MockObject_MockObject|\AMQPChannel
255+
* @return MockObject|\AMQPChannel
255256
*/
256257
private function createExtConnectionMock()
257258
{

pkg/amqp-ext/Tests/AmqpSubscriptionConsumerTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Enqueue\AmqpExt\AmqpContext;
66
use Enqueue\AmqpExt\AmqpSubscriptionConsumer;
77
use Interop\Queue\SubscriptionConsumer;
8+
use PHPUnit\Framework\MockObject\MockObject;
89
use PHPUnit\Framework\TestCase;
910

1011
class AmqpSubscriptionConsumerTest extends TestCase
@@ -22,7 +23,7 @@ public function testCouldBeConstructedWithAmqpContextAsFirstArgument()
2223
}
2324

2425
/**
25-
* @return AmqpContext|\PHPUnit_Framework_MockObject_MockObject
26+
* @return AmqpContext|MockObject
2627
*/
2728
private function createAmqpContextMock()
2829
{

pkg/amqp-ext/Tests/Functional/AmqpCommonUseCasesTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function setUp()
3030
$this->removeExchange('amqp_ext.test_exchange');
3131
}
3232

33-
public function tearDown()
33+
public function tearDown(): void
3434
{
3535
$this->amqpContext->close();
3636
}

pkg/amqp-ext/Tests/Functional/AmqpConsumptionUseCasesTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function setUp()
3636
$this->removeQueue('amqp_ext.test');
3737
}
3838

39-
public function tearDown()
39+
public function tearDown(): void
4040
{
4141
$this->amqpContext->close();
4242
}

pkg/amqp-ext/Tests/Functional/AmqpRpcUseCasesTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function setUp()
3131
$this->removeQueue('rpc.reply_test');
3232
}
3333

34-
public function tearDown()
34+
public function tearDown(): void
3535
{
3636
$this->amqpContext->close();
3737
}

pkg/amqp-ext/Tests/Spec/AmqpSubscriptionConsumerConsumeUntilUnsubscribedTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class AmqpSubscriptionConsumerConsumeUntilUnsubscribedTest extends SubscriptionConsumerConsumeUntilUnsubscribedSpec
1515
{
16-
protected function tearDown()
16+
protected function tearDown(): void
1717
{
1818
if ($this->subscriptionConsumer) {
1919
$this->subscriptionConsumer->unsubscribeAll();

pkg/amqp-ext/phpunit.xml.dist

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
bootstrap="./vendor/autoload.php"
1312
>
1413

0 commit comments

Comments
 (0)