Skip to content

Add Symfony 7.0 to reqs and CI, drop 6.2 from CI; drop PHP 7.4 #1328

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 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
847eca8
Add Symfony 7.0 to reqs and CI, drop 6.2 from CI
andrewmy Dec 21, 2023
6814e1d
Cast to int to avoid type errors — probably the new extension forces …
andrewmy Dec 21, 2023
9d4b80d
Skip PHP 8.1 on Symfony 7.0 in the CI matrix
andrewmy Dec 21, 2023
f0a0ae7
Fix CS
andrewmy Dec 21, 2023
90b6b56
Try with doctrine/mongodb-odm-bundle:5.0.x-dev
andrewmy Dec 21, 2023
48d4fea
Fix ext-mongo override
andrewmy Dec 21, 2023
b5ef96e
Remove usage of deprecated ContainerAware
andrewmy Dec 21, 2023
fd6a9b6
Fix CS
andrewmy Dec 21, 2023
e99fac7
Fix config type error?
andrewmy Dec 21, 2023
e9bad64
Fix CS
andrewmy Dec 21, 2023
e910537
Fix doctrine/annotations:2 compatibility
andrewmy Dec 21, 2023
3b41306
Fix CS 🤦
andrewmy Dec 21, 2023
eda3d7d
Drop PHP 7.4 🔥
andrewmy Dec 21, 2023
dd3168c
Fix CS
andrewmy Dec 21, 2023
f9b26f2
Force older AWS SDK version to avoid SQS-JSON requirement
andrewmy Dec 28, 2023
401396c
Try with localstack v3
andrewmy Dec 28, 2023
4cf175d
Re-run please
andrewmy Dec 28, 2023
eff6293
Update localstack env var
andrewmy Dec 28, 2023
92ede9f
Update localstack ports
andrewmy Dec 28, 2023
b00b53e
Fix the matrix 🤦
andrewmy Dec 28, 2023
14ac0b6
Refactor doctrine entity annotations into attributes
andrewmy Dec 28, 2023
45b2eb4
Refactor doctrine entity mapping into XML — compatible in both lowest…
andrewmy Dec 28, 2023
603b9b4
Backwards-compatible SQS endpoints pls
andrewmy Dec 28, 2023
c14d383
Derp
andrewmy Dec 28, 2023
bc5db65
Fix mapping in tests
andrewmy Dec 28, 2023
6f6d9b2
Fix table names
andrewmy Dec 28, 2023
74b6dc7
Bump phpunit to 9.6.15
andrewmy Dec 28, 2023
5aaab0c
Fix deprecation
andrewmy Dec 28, 2023
313a569
Re-run please
andrewmy Dec 28, 2023
5341f51
Fix CS
andrewmy Dec 28, 2023
f2b6241
Fix more deprecations
andrewmy Dec 28, 2023
bfc1d65
Fix CS
andrewmy Dec 28, 2023
169c9e3
Fix newer sf compat
andrewmy Dec 28, 2023
3bf83cf
Bump amqplib to avoid deprecations
andrewmy Dec 28, 2023
462660c
Fix CS, bump cs-fixer
andrewmy Dec 29, 2023
1df3087
Try sleeping?
andrewmy Dec 29, 2023
4e1f44d
One more deprecation
andrewmy Dec 29, 2023
0834598
Fix CS
andrewmy Dec 29, 2023
4eb3b57
Fix a deprecation
andrewmy Jan 3, 2024
7f5ad73
Try eager localstack service loading
andrewmy Jan 3, 2024
b031bca
Move the sleep
andrewmy Jan 3, 2024
ffec2be
Run the CI again
andrewmy Apr 4, 2024
c7d74b5
Fix CS
andrewmy Apr 4, 2024
cbabc23
Launch localstack with debug
andrewmy Apr 4, 2024
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
32 changes: 16 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.0'
coverage: none
extensions: mongodb, redis, :xdebug
ini-values: memory_limit=2048M
Expand All @@ -77,18 +77,18 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2']
symfony_version: ['5.4.*', '6.2.*', '6.3.*']
php: ['8.0', '8.1', '8.2']
symfony_version: ['5.4.*', '6.3.*', '6.4.*', '7.0.*']
dependencies: ['--prefer-lowest', '--prefer-dist']
exclude:
- php: '7.4'
symfony_version: '6.2.*'
- php: '7.4'
- php: '8.0'
symfony_version: '6.3.*'
- php: '8.0'
symfony_version: '6.2.*'
symfony_version: '6.4.*'
- php: '8.0'
symfony_version: '6.3.*'
symfony_version: '7.0.*'
- php: '8.1'
symfony_version: '7.0.*'

name: PHP ${{ matrix.php }} unit tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }}

Expand Down Expand Up @@ -127,18 +127,18 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2'] # same as in the container
symfony_version: ['5.4.*', '6.2.*', '6.3.*']
php: ['8.0', '8.1', '8.2'] # same as in the container
symfony_version: ['5.4.*', '6.3.*', '6.4.*', '7.0.*']
dependencies: ['--prefer-lowest', '--prefer-dist']
exclude:
- php: '7.4'
symfony_version: '6.2.*'
- php: '7.4'
- php: '8.0'
symfony_version: '6.3.*'
- php: '8.0'
symfony_version: '6.2.*'
symfony_version: '6.4.*'
- php: '8.0'
symfony_version: '6.3.*'
symfony_version: '7.0.*'
- php: '8.1'
symfony_version: '7.0.*'

name: PHP ${{ matrix.php }} functional tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }}

Expand Down Expand Up @@ -180,4 +180,4 @@ jobs:
if: ${{ matrix.php != '8.1' && matrix.php != '8.2' }}

- run: bin/test.sh --exclude-group=gearman
if: ${{ matrix.php == '8.1' && matrix.php != '8.2' }}
if: ${{ matrix.php == '8.1' || matrix.php == '8.2' }}
36 changes: 18 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"phpstan": "bin/phpstan analyse --memory-limit=512M -c phpstan.neon"
},
"require": {
"php": "^7.4|^8.0",
"php": "^8.0",

"ext-amqp": "^1.9.3|^2.0.0",
"ext-gearman": "^2.0",
Expand All @@ -19,7 +19,7 @@
"queue-interop/amqp-interop": "^0.8.2",
"queue-interop/queue-interop": "^0.8.1",
"bunny/bunny": "^0.4|^0.5",
"php-amqplib/php-amqplib": "^3.0",
"php-amqplib/php-amqplib": "^3.6",
"doctrine/dbal": "^2.12|^3.1",
"ramsey/uuid": "^3.5|^4",
"psr/log": "^1.1 || ^2.0 || ^3.0",
Expand Down Expand Up @@ -50,27 +50,27 @@
},
"require-dev": {
"ext-pcntl": "*",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.6.15",
"phpstan/phpstan": "^0.12",
"queue-interop/queue-spec": "^0.6.2",
"symfony/browser-kit": "^5.4|^6.0",
"symfony/config": "^5.4|^6.0",
"symfony/process": "^5.4|^6.0",
"symfony/console": "^5.4|^6.0",
"symfony/dependency-injection": "^5.4|^6.0",
"symfony/event-dispatcher": "^5.4|^6.0",
"symfony/expression-language": "^5.4|^6.0",
"symfony/http-kernel": "^5.4|^6.0",
"symfony/filesystem": "^5.4|^6.0",
"symfony/framework-bundle": "^5.4|^6.0",
"symfony/validator": "^5.4|^6.0",
"symfony/yaml": "^5.4|^6.0",
"symfony/browser-kit": "^5.4|^6.0|^7.0",
"symfony/config": "^5.4|^6.0|^7.0",
"symfony/process": "^5.4|^6.0|^7.0",
"symfony/console": "^5.4|^6.0|^7.0",
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
"symfony/event-dispatcher": "^5.4|^6.0|^7.0",
"symfony/expression-language": "^5.4|^6.0|^7.0",
"symfony/http-kernel": "^5.4|^6.0|^7.0",
"symfony/filesystem": "^5.4|^6.0|^7.0",
"symfony/framework-bundle": "^5.4|^6.0|^7.0",
"symfony/validator": "^5.4|^6.0|^7.0",
"symfony/yaml": "^5.4|^6.0|^7.0",
"empi89/php-amqp-stubs": "*@dev",
"doctrine/doctrine-bundle": "^2.3.2",
"doctrine/mongodb-odm-bundle": "^3.5|^4.3",
"doctrine/mongodb-odm-bundle": "^3.5|^4.3|5.0.x-dev",
"alcaeus/mongo-php-adapter": "^1.0",
"kwn/php-rdkafka-stubs": "^2.0.3",
"friendsofphp/php-cs-fixer": "^3.4",
"friendsofphp/php-cs-fixer": "^3.43",
"dms/phpunit-arraysubset-asserts": "^0.2.1",
"phpspec/prophecy-phpunit": "^2.0"
},
Expand Down Expand Up @@ -125,7 +125,7 @@
"ext-amqp": "1.9.3",
"ext-gearman": "2.0.3",
"ext-rdkafka": "4.0",
"ext-mongodb": "1.5",
"ext-mongodb": "1.17",
"ext-bcmath": "1",
"ext-mbstring": "1",
"ext-mongo": "1.6.14",
Expand Down
22 changes: 12 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ version: '2'
services:
dev:
# when image publishing gets sorted:
# image: enqueue/dev:${PHP_VERSION:-7.4}
# image: enqueue/dev:${PHP_VERSION:-8.0}
build:
context: docker
args:
PHP_VERSION: "${PHP_VERSION:-7.4}"
PHP_VERSION: "${PHP_VERSION:-8.0}"
depends_on:
- rabbitmq
- mysql
Expand Down Expand Up @@ -38,16 +38,16 @@ services:
- PREDIS_DSN=redis+predis://redis
- PHPREDIS_DSN=redis+phpredis://redis
- GPS_DSN=gps:?projectId=mqdev&emulatorHost=http://google-pubsub:8085
- SQS_DSN=sqs:?key=key&secret=secret&region=us-east-1&endpoint=http://localstack:4576&version=latest
- SNS_DSN=sns:?key=key&secret=secret&region=us-east-1&endpoint=http://localstack:4575&version=latest
- SNSQS_DSN=snsqs:?key=key&secret=secret&region=us-east-1&sns_endpoint=http://localstack:4575&sqs_endpoint=http://localstack:4576&version=latest
- SQS_DSN=sqs:?key=key&secret=secret&region=us-east-1&endpoint=http://localstack:4566&version=latest
- SNS_DSN=sns:?key=key&secret=secret&region=us-east-1&endpoint=http://localstack:4566&version=latest
- SNSQS_DSN=snsqs:?key=key&secret=secret&region=us-east-1&sns_endpoint=http://localstack:4566&sqs_endpoint=http://localstack:4566&version=latest
- WAMP_DSN=wamp://thruway:9090
- REDIS_HOST=redis
- REDIS_PORT=6379
- AWS_SQS_KEY=key
- AWS_SQS_SECRET=secret
- AWS_SQS_REGION=us-east-1
- AWS_SQS_ENDPOINT=http://localstack:4576
- AWS_SQS_ENDPOINT=http://localstack:4566
- AWS_SQS_VERSION=latest
- BEANSTALKD_DSN=beanstalk://beanstalkd:11300
- GEARMAN_DSN=gearman://gearmand:4730
Expand Down Expand Up @@ -127,13 +127,15 @@ services:
- '9090:9090'

localstack:
image: 'localstack/localstack:0.8.10'
image: 'localstack/localstack:3.0'
ports:
- '4576:4576'
- '4575:4575'
- '4566:4566'
environment:
HOSTNAME_EXTERNAL: 'localstack'
LOCALSTACK_HOST: 'localstack:4566'
SERVICES: 'sqs,sns'
SQS_ENDPOINT_STRATEGY: 'off'
EAGER_SERVICE_LOADING: 1
DEBUG: 1

influxdb:
image: 'influxdb:latest'
Expand Down
2 changes: 1 addition & 1 deletion docker/bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ waitForService gearmand 4730 50
waitForService kafka 9092 50
waitForService mongo 27017 50
waitForService thruway 9090 50
waitForService localstack 4576 50
waitForService localstack 4566 50

php docker/bin/refresh-mysql-database.php || exit 1
php docker/bin/refresh-postgres-database.php || exit 1
Expand Down
2 changes: 1 addition & 1 deletion docker/thruway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM makasim/nginx-php-fpm:7.4-all-exts
FROM makasim/nginx-php-fpm:8.0-all-exts

RUN mkdir -p /thruway
WORKDIR /thruway
Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-bunny/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2']
php: ['8.0', '8.1', '8.2']

name: PHP ${{ matrix.php }} tests

Expand Down
12 changes: 4 additions & 8 deletions pkg/amqp-bunny/AmqpContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class AmqpContext implements InteropAmqpContext, DelayStrategyAware
* Callable must return instance of \Bunny\Channel once called.
*
* @param Channel|callable $bunnyChannel
* @param array $config
*/
public function __construct($bunnyChannel, array $config)
{
Expand Down Expand Up @@ -218,7 +217,7 @@ public function bind(InteropAmqpBind $bind): void
$this->getBunnyChannel()->exchangeBind(
$bind->getTarget()->getTopicName(),
$bind->getSource()->getTopicName(),
$bind->getRoutingKey(),
(string) $bind->getRoutingKey(),
(bool) ($bind->getFlags() & InteropAmqpBind::FLAG_NOWAIT),
$bind->getArguments()
);
Expand All @@ -227,7 +226,7 @@ public function bind(InteropAmqpBind $bind): void
$this->getBunnyChannel()->queueBind(
$bind->getSource()->getQueueName(),
$bind->getTarget()->getTopicName(),
$bind->getRoutingKey(),
(string) $bind->getRoutingKey(),
(bool) ($bind->getFlags() & InteropAmqpBind::FLAG_NOWAIT),
$bind->getArguments()
);
Expand All @@ -236,7 +235,7 @@ public function bind(InteropAmqpBind $bind): void
$this->getBunnyChannel()->queueBind(
$bind->getTarget()->getQueueName(),
$bind->getSource()->getTopicName(),
$bind->getRoutingKey(),
(string) $bind->getRoutingKey(),
(bool) ($bind->getFlags() & InteropAmqpBind::FLAG_NOWAIT),
$bind->getArguments()
);
Expand Down Expand Up @@ -294,10 +293,7 @@ public function getBunnyChannel(): Channel
if (false == $this->bunnyChannel) {
$bunnyChannel = call_user_func($this->bunnyChannelFactory);
if (false == $bunnyChannel instanceof Channel) {
throw new \LogicException(sprintf(
'The factory must return instance of \Bunny\Channel. It returned %s',
is_object($bunnyChannel) ? get_class($bunnyChannel) : gettype($bunnyChannel)
));
throw new \LogicException(sprintf('The factory must return instance of \Bunny\Channel. It returned %s', is_object($bunnyChannel) ? $bunnyChannel::class : gettype($bunnyChannel)));
}

$this->bunnyChannel = $bunnyChannel;
Expand Down
12 changes: 6 additions & 6 deletions pkg/amqp-bunny/AmqpProducer.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function send(Destination $destination, Message $message): void
/**
* @return self
*/
public function setDeliveryDelay(int $deliveryDelay = null): Producer
public function setDeliveryDelay(?int $deliveryDelay = null): Producer
{
if (null === $this->delayStrategy) {
throw DeliveryDelayNotSupportedException::providerDoestNotSupportIt();
Expand All @@ -98,7 +98,7 @@ public function getDeliveryDelay(): ?int
/**
* @return self
*/
public function setPriority(int $priority = null): Producer
public function setPriority(?int $priority = null): Producer
{
$this->priority = $priority;

Expand All @@ -113,7 +113,7 @@ public function getPriority(): ?int
/**
* @return self
*/
public function setTimeToLive(int $timeToLive = null): Producer
public function setTimeToLive(?int $timeToLive = null): Producer
{
$this->timeToLive = $timeToLive;

Expand Down Expand Up @@ -152,8 +152,8 @@ private function doSend(InteropAmqpDestination $destination, InteropAmqpMessage
$this->channel->publish(
$message->getBody(),
$amqpProperties,
$destination->getTopicName(),
$message->getRoutingKey(),
(string) $destination->getTopicName(),
(string) $message->getRoutingKey(),
(bool) ($message->getFlags() & InteropAmqpMessage::FLAG_MANDATORY),
(bool) ($message->getFlags() & InteropAmqpMessage::FLAG_IMMEDIATE)
);
Expand All @@ -162,7 +162,7 @@ private function doSend(InteropAmqpDestination $destination, InteropAmqpMessage
$message->getBody(),
$amqpProperties,
'',
$destination->getQueueName(),
(string) $destination->getQueueName(),
(bool) ($message->getFlags() & InteropAmqpMessage::FLAG_MANDATORY),
(bool) ($message->getFlags() & InteropAmqpMessage::FLAG_IMMEDIATE)
);
Expand Down
4 changes: 2 additions & 2 deletions pkg/amqp-bunny/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.4|^8.0",
"php": "^8.0",
"queue-interop/amqp-interop": "^0.8.2",
"queue-interop/queue-interop": "^0.8",
"bunny/bunny": "^0.4|^0.5",
"enqueue/amqp-tools": "^0.10"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.6.15",
"enqueue/test": "0.10.x-dev",
"enqueue/null": "0.10.x-dev",
"queue-interop/queue-spec": "^0.6.2"
Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-ext/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2']
php: ['8.0', '8.1', '8.2']

name: PHP ${{ matrix.php }} tests

Expand Down
8 changes: 4 additions & 4 deletions pkg/amqp-ext/AmqpConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(AmqpContext $context, InteropAmqpQueue $queue)
$this->flags = self::FLAG_NOPARAM;
}

public function setConsumerTag(string $consumerTag = null): void
public function setConsumerTag(?string $consumerTag = null): void
{
$this->consumerTag = $consumerTag;
}
Expand Down Expand Up @@ -93,7 +93,7 @@ public function receive(int $timeout = 0): ?Message
return $message;
}

usleep(100000); //100ms
usleep(100000); // 100ms
}

return null;
Expand All @@ -118,7 +118,7 @@ public function acknowledge(Message $message): void
{
InvalidMessageException::assertMessageInstanceOf($message, InteropAmqpMessage::class);

$this->getExtQueue()->ack($message->getDeliveryTag());
$this->getExtQueue()->ack((int) $message->getDeliveryTag());
}

/**
Expand All @@ -130,7 +130,7 @@ public function reject(Message $message, bool $requeue = false): void

$this->getExtQueue()->reject(
$message->getDeliveryTag(),
$requeue ? AMQP_REQUEUE : AMQP_NOPARAM
$requeue ? \AMQP_REQUEUE : \AMQP_NOPARAM
);
}

Expand Down
Loading
Loading