Skip to content

Symfony 5 #997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,42 @@ matrix:
include:
- php: 7.1
sudo: false
env: SYMFONY_VERSION=3.4.* PHPSTAN=true
env: SYMFONY_VERSION=4.3.* PHPSTAN=true
- php: 7.1
sudo: false
env: SYMFONY_VERSION=3.4.* PHP_CS_FIXER=true
env: SYMFONY_VERSION=4.3.* PHP_CS_FIXER=true
- php: 7.1
sudo: false
env: SYMFONY_VERSION=3.4.* UNIT_TESTS=true
- php: 7.1
env: SYMFONY_VERSION=4.3.* UNIT_TESTS=true
- php: 7.2
sudo: false
env: SYMFONY_VERSION=4.0.* UNIT_TESTS=true
env: SYMFONY_VERSION=4.3.* UNIT_TESTS=true
- php: 7.2
sudo: false
env: SYMFONY_VERSION=4.0.* UNIT_TESTS=true
env: SYMFONY_VERSION=5.0.* UNIT_TESTS=true
- php: 7.3
sudo: false
env: SYMFONY_VERSION=4.1.* UNIT_TESTS=true
env: SYMFONY_VERSION=4.3.* UNIT_TESTS=true
- php: 7.3
sudo: false
env: SYMFONY_VERSION=4.2.* UNIT_TESTS=true
env: SYMFONY_VERSION=4.4.* UNIT_TESTS=true
- php: 7.3
sudo: false
env: SYMFONY_VERSION=5.0.* UNIT_TESTS=true
- php: 7.1
services: docker
sudo: required
env: SYMFONY_VERSION=3.4.* FUNCTIONAL_TESTS=true PREPARE_CONTAINER=true
- php: 7.1
services: docker
env: SYMFONY_VERSION=4.3.* FUNCTIONAL_TESTS=true PREPARE_CONTAINER=true
- php: 7.3
sudo: required
services: docker
env: SYMFONY_VERSION=4.0.* FUNCTIONAL_TESTS=true PREPARE_CONTAINER=true
env: SYMFONY_VERSION=5.0.* FUNCTIONAL_TESTS=true PREPARE_CONTAINER=true
- php: 7.1
sudo: required
services: docker
env: SYMFONY_VERSION=3.4.* RDKAFKA_TESTS=true PREPARE_CONTAINER=true
env: SYMFONY_VERSION=4.3.* RDKAFKA_TESTS=true PREPARE_CONTAINER=true
allow_failures:
- env: SYMFONY_VERSION=3.4.* RDKAFKA_TESTS=true PREPARE_CONTAINER=true
- env: SYMFONY_VERSION=4.3.* RDKAFKA_TESTS=true PREPARE_CONTAINER=true

cache:
directories:
Expand All @@ -66,12 +69,12 @@ script:
- if [ "$UNIT_TESTS" = true ]; then bin/phpunit --exclude-group=functional; fi
- if [ "$FUNCTIONAL_TESTS" = true ]; then bin/test.sh --exclude-group=rdkafka; fi
- if [ "RDKAFKA_TESTS" = true ]; then bin/test.sh --group=rdkafka; fi

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/3f8b3668e7792de23a49
on_success: change
on_failure: always
on_start: never
on_success: change
on_failure: always
on_start: never

15 changes: 8 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

"ext-amqp": "^1.9.3",
"ext-gearman": "^2.0",
"ext-mongodb": "^1.3",
"ext-mongodb": "^1.5",
"ext-rdkafka": "^3.0.3",

"queue-interop/amqp-interop": "^0.8",
Expand All @@ -35,14 +35,14 @@
"php-http/client-common": "^1.7@dev",
"richardfullmer/rabbitmq-management-api": "^2.0",
"predis/predis": "^1.1",
"thruway/client": "^0.5.0",
"thruway/pawl-transport": "^0.5.0",
"voryx/thruway": "^0.5.3",
"influxdb/influxdb-php": "^1.14",
"datadog/php-datadogstatsd": "^1.3"
},
"require-dev": {
"phpunit/phpunit": "^5.5",
"phpstan/phpstan": "^0.10",
"phpunit/phpunit": "^7.5",
"phpstan/phpstan": "^0.12",
"queue-interop/queue-spec": "^0.6",
"symfony/browser-kit": "^3.4|^4",
"symfony/config": "^3.4|^4",
Expand All @@ -54,9 +54,10 @@
"symfony/http-kernel": "^3.4|^4",
"symfony/filesystem": "^3.4|^4",
"symfony/framework-bundle": "^3.4|^4",
"symfony/yaml": "^4.3|^5",
"empi89/php-amqp-stubs": "*@dev",
"doctrine/doctrine-bundle": "~1.2",
"doctrine/mongodb-odm-bundle": "^3.5",
"doctrine/doctrine-bundle": "~1.2|^2",
"doctrine/mongodb-odm-bundle": "^3.5|^4",
"alcaeus/mongo-php-adapter": "^1.0",
"kwn/php-rdkafka-stubs": "^1.0.2",
"friendsofphp/php-cs-fixer": "^2"
Expand Down Expand Up @@ -112,7 +113,7 @@
"ext-amqp": "1.9.3",
"ext-gearman": "2.0.3",
"ext-rdkafka": "3.3",
"ext-mongodb": "1.3",
"ext-mongodb": "1.5",
"ext-bcmath": "1",
"ext-mbstring": "1",
"ext-mongo": "1.6.14"
Expand Down
8 changes: 1 addition & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,9 @@ services:
- "27017:27017"

thruway:
image: formapro/nginx-php-fpm:latest-all-exts
build: './docker/thruway'
ports:
- '9090:9090'
working_dir: '/app'
volumes:
- './:/app'
entrypoint:
- '/usr/bin/php'
- 'docker/thruway/WsRouter.php'

localstack:
image: 'localstack/localstack:latest'
Expand Down
13 changes: 13 additions & 0 deletions docker/thruway/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM formapro/nginx-php-fpm:latest-all-exts

RUN mkdir -p /thruway
WORKDIR /thruway

# Thruway router
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN COMPOSER_HOME=/thruway composer global require --prefer-dist --no-scripts voryx/thruway

COPY WsRouter.php .

CMD ["/usr/bin/php", "WsRouter.php"]

2 changes: 1 addition & 1 deletion docker/thruway/WsRouter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require __DIR__.'/../../vendor/autoload.php';
require __DIR__.'/vendor/autoload.php';

use Thruway\Peer\Router;
use Thruway\Transport\RatchetTransportProvider;
Expand Down
2 changes: 1 addition & 1 deletion docs/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ There are available options (and all available metrics):
Install additional packages:

```
composer req thruway/pawl-transport:^0.5.0 voryx/thruway:^0.5.3
composer req thruway/pawl-transport:^0.5.0 thruway/client:^0.5.0
```

```php
Expand Down
5 changes: 4 additions & 1 deletion docs/transport/wamp.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nav_order: 3

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

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

## Start the WAMP router

You can get a WAMP router with [Thruway](https://github.com/voryx/Thruway):

```bash
$ composer require voryx/thruway
$ php vendor/voryx/thruway/Examples/SimpleWsRouter.php
```

Expand Down
7 changes: 7 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ parameters:
- pkg/enqueue-bundle/DependencyInjection/Configuration.php
- pkg/enqueue/Tests/Symfony/DependencyInjection/TransportFactoryTest.php
- pkg/simple-client/SimpleClient.php
ignoreErrors:
-
message: '#Class Symfony\\Component\\EventDispatcher\\LegacyEventDispatcherProxy not found#'
path: %currentWorkingDirectory%/*
-
message: '#.*Symfony\\Contracts\\EventDispatcher\\Event.*#'
path: %currentWorkingDirectory%/*
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./vendor/autoload.php"
>

Expand Down
7 changes: 4 additions & 3 deletions pkg/amqp-bunny/Tests/AmqpConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Interop\Amqp\Impl\AmqpQueue;
use Interop\Queue\Consumer;
use Interop\Queue\Exception\InvalidMessageException;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class AmqpConsumerTest extends TestCase
Expand Down Expand Up @@ -205,23 +206,23 @@ public function testShouldReturnMessageOnReceiveWithReceiveMethodBasicGet()
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|Client
* @return MockObject|Client
*/
public function createClientMock()
{
return $this->createMock(Client::class);
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|AmqpContext
* @return MockObject|AmqpContext
*/
public function createContextMock()
{
return $this->createMock(AmqpContext::class);
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|Channel
* @return MockObject|Channel
*/
public function createBunnyChannelMock()
{
Expand Down
3 changes: 2 additions & 1 deletion pkg/amqp-bunny/Tests/AmqpContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Interop\Amqp\Impl\AmqpBind;
use Interop\Amqp\Impl\AmqpQueue;
use Interop\Amqp\Impl\AmqpTopic;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class AmqpContextTest extends TestCase
Expand Down Expand Up @@ -244,7 +245,7 @@ public function testShouldReturnExpectedSubscriptionConsumerInstance()
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|Channel
* @return MockObject|Channel
*/
public function createChannelMock()
{
Expand Down
11 changes: 6 additions & 5 deletions pkg/amqp-bunny/Tests/AmqpProducerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Interop\Queue\Exception\InvalidMessageException;
use Interop\Queue\Message;
use Interop\Queue\Producer;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class AmqpProducerTest extends TestCase
Expand Down Expand Up @@ -200,39 +201,39 @@ public function testShouldPropagateFlags()
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|Message
* @return MockObject|Message
*/
private function createMessageMock()
{
return $this->createMock(Message::class);
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|Destination
* @return MockObject|Destination
*/
private function createDestinationMock()
{
return $this->createMock(Destination::class);
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|Channel
* @return MockObject|Channel
*/
private function createBunnyChannelMock()
{
return $this->createMock(Channel::class);
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|AmqpContext
* @return MockObject|AmqpContext
*/
private function createContextMock()
{
return $this->createPartialMock(AmqpContext::class, []);
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|DelayStrategy
* @return MockObject|DelayStrategy
*/
private function createDelayStrategyMock()
{
Expand Down
3 changes: 2 additions & 1 deletion pkg/amqp-bunny/Tests/AmqpSubscriptionConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Enqueue\AmqpBunny\AmqpContext;
use Enqueue\AmqpBunny\AmqpSubscriptionConsumer;
use Interop\Queue\SubscriptionConsumer;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class AmqpSubscriptionConsumerTest extends TestCase
Expand All @@ -22,7 +23,7 @@ public function testCouldBeConstructedWithAmqpContextAsFirstArgument()
}

/**
* @return AmqpContext|\PHPUnit_Framework_MockObject_MockObject
* @return AmqpContext|MockObject
*/
private function createAmqpContextMock()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
class AmqpSubscriptionConsumerConsumeUntilUnsubscribedTest extends SubscriptionConsumerConsumeUntilUnsubscribedSpec
{
protected function tearDown()
protected function tearDown(): void
{
if ($this->subscriptionConsumer) {
$this->subscriptionConsumer->unsubscribeAll();
Expand Down
1 change: 0 additions & 1 deletion pkg/amqp-bunny/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./vendor/autoload.php"
>

Expand Down
3 changes: 2 additions & 1 deletion pkg/amqp-ext/Tests/AmqpConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Enqueue\Test\ClassExtensionTrait;
use Interop\Amqp\Impl\AmqpQueue;
use Interop\Queue\Consumer;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class AmqpConsumerTest extends TestCase
Expand All @@ -24,7 +25,7 @@ public function testCouldBeConstructedWithContextAndQueueAsArguments()
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|AmqpContext
* @return MockObject|AmqpContext
*/
private function createContext()
{
Expand Down
5 changes: 3 additions & 2 deletions pkg/amqp-ext/Tests/AmqpContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Interop\Amqp\Impl\AmqpTopic;
use Interop\Queue\Context;
use Interop\Queue\Exception\InvalidDestinationException;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class AmqpContextTest extends TestCase
Expand Down Expand Up @@ -243,15 +244,15 @@ public function testShouldReturnExpectedSubscriptionConsumerInstance()
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|\AMQPChannel
* @return MockObject|\AMQPChannel
*/
private function createExtChannelMock()
{
return $this->createMock(\AMQPChannel::class);
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject|\AMQPChannel
* @return MockObject|\AMQPChannel
*/
private function createExtConnectionMock()
{
Expand Down
Loading