Skip to content

PHP 8 #6

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

Closed
wants to merge 23 commits into from
Closed
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
29 changes: 27 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
extensions: mongodb, redis, :xdebug
ini-values: memory_limit=2048M

- run: php ./bin/fix-symfony-version.php "4.3.*"
- run: php ./bin/fix-symfony-version.php "5.2.*"
- run: composer install --no-progress
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php

Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
extensions: mongodb, redis, :xdebug
ini-values: memory_limit=2048M

- run: php ./bin/fix-symfony-version.php "4.3.*"
- run: php ./bin/fix-symfony-version.php "5.2.*"
- run: composer install --no-progress
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php

Expand Down Expand Up @@ -118,6 +118,12 @@ jobs:
functional_tests: false
rdkafka_tests: false
prepare_container: false
- php: 7.4
symfony_version: 5.2.*
unit_tests: true
functional_tests: false
rdkafka_tests: false
prepare_container: false
- php: 7.3 # same as in the container
symfony_version: 4.3.*
unit_tests: false
Expand All @@ -136,6 +142,23 @@ jobs:
functional_tests: false
rdkafka_tests: true
prepare_container: true
- php: 8.0
symfony_version: 5.2.*
unit_tests: true
functional_tests: false
rdkafka_tests: false
prepare_container: false
- php: 8.0
symfony_version: 5.2.*
unit_tests: false
functional_tests: true
rdkafka_tests: false
prepare_container: true
- php: 8.0
symfony_version: 5.2.*
unit_tests: false
rdkafka_tests: true
prepare_container: true

name: PHP ${{ matrix.php }} tests on Sf ${{ matrix.symfony_version }}, unit=${{ matrix.unit_tests }}, func=${{ matrix.functional_tests }}, rdkafka=${{ matrix.rdkafka_tests }}

Expand Down Expand Up @@ -168,6 +191,8 @@ jobs:
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php

- run: bin/dev -b
env:
PHP_VERSION: "${{ matrix.php }}"
if: matrix.prepare_container

- run: bin/phpunit --exclude-group=functional
Expand Down
2 changes: 1 addition & 1 deletion bin/dev
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
while getopts "bustefdp" OPTION; do
case $OPTION in
b)
docker-compose pull && docker-compose build
docker-compose pull -q && docker-compose build
;;
u)
docker-compose up
Expand Down
22 changes: 16 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@
"cs-lint": "bin/php-cs-fixer fix --config=.php_cs.php --no-interaction --dry-run --diff",
"phpstan": "bin/phpstan analyse --memory-limit=512M -c phpstan.neon"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/andrewmy/php-rabbitmq-management-api.git"
},
{
"type": "git",
"url": "https://github.com/rimvislt/DoctrineMongoDBBundle.git"
}
],
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",

"ext-amqp": "^1.9.3",
"ext-gearman": "^2.0",
Expand All @@ -20,7 +30,7 @@
"queue-interop/queue-interop": "^0.7|^0.8",
"bunny/bunny": "^0.2.4|^0.3|^0.4",
"php-amqplib/php-amqplib": "^2.7",
"doctrine/dbal": "^2.6,<2.10",
"doctrine/dbal": "^2.12",
"ramsey/uuid": "^2|^3.5|^4.0",
"psr/log": "^1",
"psr/container": "^1",
Expand All @@ -31,9 +41,9 @@
"pda/pheanstalk": "^3",
"aws/aws-sdk-php": "^3.26",
"stomp-php/stomp-php": "^4",
"php-http/guzzle6-adapter": "^1.1",
"php-http/client-common": "^1.7@dev",
"richardfullmer/rabbitmq-management-api": "^2.0",
"php-http/guzzle7-adapter": "^0.1.1",
"php-http/client-common": "^2.2.1",
"richardfullmer/rabbitmq-management-api": "dev-http-client-2 as 2.1.0",
"predis/predis": "^1.1",
"thruway/client": "^0.5.0",
"thruway/pawl-transport": "^0.5.0",
Expand All @@ -58,7 +68,7 @@
"symfony/yaml": "^4.3|^5",
"empi89/php-amqp-stubs": "*@dev",
"doctrine/doctrine-bundle": "~1.2|^2",
"doctrine/mongodb-odm-bundle": "^3.5|^4",
"doctrine/mongodb-odm-bundle": "4.3.x-dev as 4.3.0",
"alcaeus/mongo-php-adapter": "^1.0",
"kwn/php-rdkafka-stubs": "^1.0.2 | ^2.0",
"friendsofphp/php-cs-fixer": "^2",
Expand Down
7 changes: 6 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ version: '2'

services:
dev:
image: enqueue/dev:latest
# when image publishing gets sorted:
# image: enqueue/dev:${PHP_VERSION}
build:
context: docker
args:
PHP_VERSION: "${PHP_VERSION:-7.3}"
depends_on:
- rabbitmq
- mysql
Expand Down
15 changes: 9 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
FROM formapro/nginx-php-fpm:7.3-latest-all-exts
ARG PHP_VERSION=7.3
FROM formapro/nginx-php-fpm:${PHP_VERSION}-latest-all-exts

ARG PHP_VERSION

## libs
RUN set -x && \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests wget curl openssl ca-certificates nano netcat php7.3-dev php7.3-redis php7.3-pgsql git python php-amqp
apt-get install -y --no-install-recommends --no-install-suggests wget curl openssl ca-certificates nano netcat php${PHP_VERSION}-dev php${PHP_VERSION}-redis php${PHP_VERSION}-pgsql git python php${PHP_VERSION}-amqp

## librdkafka
RUN set -x && \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests g++ php-pear php7.3-dev make && \
apt-get install -y --no-install-recommends --no-install-suggests g++ php-pear php${PHP_VERSION}-dev make && \
mkdir -p $HOME/librdkafka && \
cd $HOME/librdkafka && \
git clone https://github.com/edenhill/librdkafka.git . && \
git checkout v1.0.0 && \
./configure && make && make install && \
pecl install rdkafka && \
echo "extension=rdkafka.so" > /etc/php/7.3/cli/conf.d/10-rdkafka.ini && \
echo "extension=rdkafka.so" > /etc/php/7.3/fpm/conf.d/10-rdkafka.ini
echo "extension=rdkafka.so" > /etc/php/${PHP_VERSION}/cli/conf.d/10-rdkafka.ini && \
echo "extension=rdkafka.so" > /etc/php/${PHP_VERSION}/fpm/conf.d/10-rdkafka.ini

COPY ./php/cli.ini /etc/php/7.3/cli/conf.d/1-dev_cli.ini
COPY ./php/cli.ini /etc/php/${PHP_VERSION}/cli/conf.d/1-dev_cli.ini
COPY ./bin/dev_entrypoiny.sh /usr/local/bin/entrypoint.sh
RUN chmod u+x /usr/local/bin/entrypoint.sh

Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-bunny/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
"bunny/bunny": "^0.4",
Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-ext/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"ext-amqp": "^1.9.3",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-lib/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"php-amqplib/php-amqplib": "^2.10",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
"enqueue/dsn": "^0.10"
Expand Down
2 changes: 1 addition & 1 deletion pkg/async-event-dispatcher/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"enqueue/enqueue": "^0.10",
"queue-interop/queue-interop": "^0.8",
"symfony/event-dispatcher": "^4.3|^5"
Expand Down
4 changes: 2 additions & 2 deletions pkg/dbal/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"queue-interop/queue-interop": "^0.8",
"doctrine/dbal": "^2.6",
"doctrine/dbal": "^2.12",
"ramsey/uuid": "^3|^4"
},
"require-dev": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ public function testThrowIfClientDriverOptionsIsNotArray()
$processor = new Processor();

$this->expectException(InvalidTypeException::class);
$this->expectExceptionMessage('Invalid type for path "enqueue.default.client.driver_options". Expected array, but got string');
// Exception messages vary slightly between versions
$this->expectExceptionMessageMatches(
'/Invalid type for path "enqueue\.default\.client\.driver_options"\. Expected "?array"?, but got "?string"?/'
);

$processor->processConfiguration($configuration, [[
'default' => [
'transport' => 'null:',
Expand Down
2 changes: 1 addition & 1 deletion pkg/enqueue-bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"symfony/framework-bundle": "^4.3|^5",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
Expand Down
6 changes: 5 additions & 1 deletion pkg/enqueue/Tests/Symfony/ContainerProcessorRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ public function testThrowErrorIfServiceDoesNotImplementProcessorReturnType()
$registry = new ContainerProcessorRegistry($containerMock);

$this->expectException(\TypeError::class);
$this->expectExceptionMessage('Return value of Enqueue\Symfony\ContainerProcessorRegistry::get() must implement interface Interop\Queue\Processor, instance of stdClass returned');
// Exception messages vary slightly between versions
$this->expectExceptionMessageMatches(
'/Enqueue\\\\Symfony\\\\ContainerProcessorRegistry::get\(\).+ Interop\\\\Queue\\\\Processor,.*stdClass returned/'
);

$registry->get('processor-name');
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/enqueue/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
"enqueue/null": "^0.10",
Expand Down
2 changes: 1 addition & 1 deletion pkg/fs/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"queue-interop/queue-interop": "^0.8",
"enqueue/dsn": "^0.10",
"symfony/filesystem": "^4.3|^5",
Expand Down
2 changes: 1 addition & 1 deletion pkg/gearman/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"ext-gearman": "^2.0",
"queue-interop/queue-interop": "^0.8"
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/gps/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"queue-interop/queue-interop": "^0.8",
"google/cloud-pubsub": "^1.0",
"enqueue/dsn": "^0.10"
Expand Down
17 changes: 0 additions & 17 deletions pkg/job-queue/Test/DbalPersistedConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function connect()

if ($this->hasPersistedConnection()) {
$this->_conn = $this->getPersistedConnection();
$this->setConnected(true);
} else {
parent::connect();
$this->persistConnection($this->_conn);
Expand Down Expand Up @@ -66,22 +65,6 @@ public function rollBack()
$this->wrapTransactionNestingLevel('rollBack');
}

/**
* @param bool $connected
*/
protected function setConnected($connected)
{
$rc = new \ReflectionClass(Connection::class);
$rp = $rc->hasProperty('isConnected') ?
$rc->getProperty('isConnected') :
$rc->getProperty('_isConnected')
;

$rp->setAccessible(true);
$rp->setValue($this, $connected);
$rp->setAccessible(false);
}

/**
* @return int
*/
Expand Down
4 changes: 2 additions & 2 deletions pkg/job-queue/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"enqueue/enqueue": "^0.10",
"enqueue/null": "^0.10",
"queue-interop/queue-interop": "^0.8",
"doctrine/orm": "~2.4",
"doctrine/dbal": "<2.10"
"doctrine/dbal": "^2.12"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down
2 changes: 1 addition & 1 deletion pkg/mongodb/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"queue-interop/queue-interop": "^0.8",
"mongodb/mongodb": "^1.2",
"ext-mongodb": "^1.5"
Expand Down
2 changes: 1 addition & 1 deletion pkg/monitoring/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"enqueue/enqueue": "^0.10",
"enqueue/dsn": "^0.10"
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/null/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"queue-interop/queue-interop": "^0.8"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion pkg/pheanstalk/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"pda/pheanstalk": "^3",
"queue-interop/queue-interop": "^0.8"
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/rdkafka/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"ext-rdkafka": "^3.0.3|^4.0|^5.0",
"queue-interop/queue-interop": "^0.8"
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/redis/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"queue-interop/queue-interop": "^0.8",
"enqueue/dsn": "^0.10",
"ramsey/uuid": "^3|^4"
Expand Down
Loading