Skip to content

Fix/deprecation test #4

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 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3509b9a
fixed symfony 6.1 deprecation notices
zyv4yk Jun 5, 2024
3f91a66
fixed symfony 6.1 deprecation notices
zyv4yk Jun 5, 2024
3be1369
fixed BC
zyv4yk Jun 7, 2024
12a8974
MessageQueueCollector return type
zyv4yk Jun 7, 2024
18b3546
local repo tests
zyv4yk Jun 11, 2024
13d15de
local repo tests
zyv4yk Jun 11, 2024
8076760
local repo tests
zyv4yk Jun 11, 2024
7b8f93c
local repo tests
zyv4yk Jun 11, 2024
c26f832
local repo tests
zyv4yk Jun 11, 2024
b17b588
local repo tests
zyv4yk Jun 11, 2024
7fea921
local repo tests
zyv4yk Jun 11, 2024
829f2ee
local repo tests
zyv4yk Jun 11, 2024
1200761
local repo tests
zyv4yk Jun 11, 2024
aeed4c4
local repo tests
zyv4yk Jun 11, 2024
ee0ab0b
fixed unit tests & code style
zyv4yk Jun 11, 2024
9880c82
local repo tests
zyv4yk Aug 1, 2024
b3a71a0
Merge branch 'refs/heads/fix/deprecation' into fix/deprecation-test
zyv4yk Aug 1, 2024
d2a5dc1
local repo tests
zyv4yk Aug 1, 2024
57d3a6d
local repo tests
zyv4yk Aug 1, 2024
24fc95f
local repo tests
zyv4yk Aug 1, 2024
d1c75d7
fixed 404 error on sqs
zyv4yk Aug 1, 2024
1b43f02
fixed 404 error on sqs
zyv4yk Aug 1, 2024
801cfa2
fixed 404 error on sqs
zyv4yk Aug 1, 2024
d124e8b
fixed 404 error on sqs
zyv4yk Aug 1, 2024
665ae66
fixed 404 error on sqs
zyv4yk Aug 1, 2024
c6e5003
fixed 404 error on sqs
zyv4yk Aug 1, 2024
f4122c1
fixed 404 error on sqs
zyv4yk Aug 1, 2024
75ff2f0
fixed 404 error on sqs
zyv4yk Aug 1, 2024
4a4cf06
fixed 404 error on sqs
zyv4yk Aug 1, 2024
f3b1ff9
fixed 404 error on sqs
zyv4yk Aug 1, 2024
95877f4
fixed 404 error on sqs
zyv4yk Aug 1, 2024
d7271c2
fixed 404 error on sqs
zyv4yk Aug 1, 2024
a74e4a1
fixed 404 error on sqs
zyv4yk Aug 1, 2024
1f81699
fixed 404 error on sqs
zyv4yk Aug 1, 2024
9c383ca
fixed 404 error on sqs
zyv4yk Aug 1, 2024
3237fb0
fixed 404 error on sqs
zyv4yk Aug 1, 2024
1d0306b
fixed 404 error on sqs
zyv4yk Aug 2, 2024
8cec07c
fixed 404 error on sqs
zyv4yk Aug 2, 2024
0e2ae86
fixed 404 error on sqs
zyv4yk Aug 2, 2024
6495ca0
fixed 404 error on sqs
zyv4yk Aug 2, 2024
da7b377
fixed 404 error on sqs
zyv4yk Aug 2, 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
64 changes: 23 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: technote-space/get-diff-action@v4
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
pkg/**/*.php
Expand All @@ -25,7 +25,7 @@ jobs:

- run: php ./bin/fix-symfony-version.php "5.4.*"

- uses: "ramsey/composer-install@v1"
- uses: ramsey/composer-install@v3

- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php

Expand All @@ -37,19 +37,18 @@ jobs:
name: Code style check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: technote-space/get-diff-action@v4
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
pkg/**/*.php

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-cs-check-${{ hashFiles('**/composer.json') }}
Expand All @@ -58,7 +57,7 @@ jobs:

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

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

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
Expand All @@ -127,30 +116,20 @@ 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.*']
dependencies: ['--prefer-lowest', '--prefer-dist']
exclude:
- php: '7.4'
symfony_version: '6.2.*'
- php: '7.4'
symfony_version: '6.3.*'
- php: '8.0'
symfony_version: '6.2.*'
- php: '8.0'
symfony_version: '6.3.*'
php: ['8.1', '8.2'] # same as in the container
symfony_version: ['5.4.*', '6.4.*',]
dependencies: ['--prefer-lowest', '--prefer-stable']

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

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
Expand Down Expand Up @@ -181,3 +160,6 @@ jobs:

- run: bin/test.sh --exclude-group=gearman
if: ${{ matrix.php == '8.1' && matrix.php != '8.2' }}

- run: docker-compose logs localstack
if: ${{ always() }}
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 -q && docker-compose build
docker-compose pull --progress quiet && docker-compose build
;;
u)
docker-compose up
Expand Down
6 changes: 3 additions & 3 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.1",

"ext-amqp": "^1.9.3|^2.0.0",
"ext-gearman": "^2.0",
Expand Down Expand Up @@ -72,7 +72,8 @@
"kwn/php-rdkafka-stubs": "^2.0.3",
"friendsofphp/php-cs-fixer": "^3.4",
"dms/phpunit-arraysubset-asserts": "^0.2.1",
"phpspec/prophecy-phpunit": "^2.0"
"phpspec/prophecy-phpunit": "^2.0",
"symfony/http-foundation": "^5.4|^6.0"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -137,4 +138,3 @@
}
}
}

5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,12 @@ services:
localstack:
image: 'localstack/localstack:0.8.10'
ports:
- '4576:4576'
- '4575:4575'
- "4567-4597:4567-4597"
environment:
DEFAULT_REGION: 'us-east-1'
HOSTNAME_EXTERNAL: 'localstack'
SERVICES: 'sqs,sns'
DEBUG: 'true'

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

php docker/bin/refresh-mysql-database.php || exit 1
php docker/bin/refresh-postgres-database.php || exit 1
php pkg/job-queue/Tests/Functional/app/console doctrine:database:create --if-not-exists || exit 1
php pkg/job-queue/Tests/Functional/app/console doctrine:schema:update --force || exit 1
php pkg/job-queue/Tests/Functional/app/console doctrine:schema:update --force --complete || exit 1

#php pkg/enqueue-bundle/Tests/Functional/app/console.php config:dump-reference enqueue
bin/phpunit "$@"
6 changes: 4 additions & 2 deletions pkg/amqp-ext/Tests/Functional/AmqpCommonUseCasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,11 @@ public function testConsumerReceiveMessageFromTopicDirectly()
$this->amqpContext->declareTopic($topic);

$consumer = $this->amqpContext->createConsumer($topic);
//guard
// guard
$this->assertNull($consumer->receive(1000));

$message = $this->amqpContext->createMessage(__METHOD__);
$message->setDeliveryTag(1);

$producer = $this->amqpContext->createProducer();
$producer->send($topic, $message);
Expand All @@ -181,10 +182,11 @@ public function testConsumerReceiveMessageWithZeroTimeout()
$this->amqpContext->declareTopic($topic);

$consumer = $this->amqpContext->createConsumer($topic);
//guard
// guard
$this->assertNull($consumer->receive(1000));

$message = $this->amqpContext->createMessage(__METHOD__);
$message->setDeliveryTag(1);

$producer = $this->amqpContext->createProducer();
$producer->send($topic, $message);
Expand Down
3 changes: 1 addition & 2 deletions pkg/enqueue-bundle/Profiler/MessageQueueCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Throwable;

class MessageQueueCollector extends AbstractMessageQueueCollector
{
public function collect(Request $request, Response $response, Throwable $exception = null)
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
$this->collectInternal($request, $response);
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/enqueue/Doctrine/DoctrineSchemaCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class DoctrineSchemaCompilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if (false === $container->hasDefinition('doctrine')) {
return;
Expand Down
6 changes: 3 additions & 3 deletions pkg/enqueue/Symfony/Client/ConsumeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand('enqueue:consume')]
#[AsCommand(self::COMMAND_NAME)]
class ConsumeCommand extends Command
{
use ChooseLoggerCommandTrait;
use LimitsExtensionsCommandTrait;
use QueueConsumerOptionsCommandTrait;
use SetupBrokerExtensionCommandTrait;

protected static $defaultName = 'enqueue:consume';
private const COMMAND_NAME = 'enqueue:consume';

/**
* @var ContainerInterface
Expand Down Expand Up @@ -68,7 +68,7 @@ public function __construct(
$this->driverIdPattern = $driverIdPattern;
$this->processorIdPattern = $processorIdPatter;

parent::__construct(self::$defaultName);
parent::__construct(self::COMMAND_NAME);
}

protected function configure(): void
Expand Down
6 changes: 3 additions & 3 deletions pkg/enqueue/Symfony/Client/ProduceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand('enqueue:produce')]
#[AsCommand(self::COMMAND_NAME)]
class ProduceCommand extends Command
{
protected static $defaultName = 'enqueue:produce';
private const COMMAND_NAME = 'enqueue:produce';

/**
* @var ContainerInterface
Expand All @@ -39,7 +39,7 @@ public function __construct(ContainerInterface $container, string $defaultClient
$this->defaultClient = $defaultClient;
$this->producerIdPattern = $producerIdPattern;

parent::__construct(static::$defaultName);
parent::__construct(self::COMMAND_NAME);
}

protected function configure(): void
Expand Down
7 changes: 3 additions & 4 deletions pkg/enqueue/Symfony/Client/RoutesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand('enqueue:routes')]
#[AsCommand(self::COMMAND_NAME)]
class RoutesCommand extends Command
{
protected static $defaultName = 'enqueue:routes';

private const COMMAND_NAME = 'enqueue:routes';
/**
* @var ContainerInterface
*/
Expand All @@ -45,7 +44,7 @@ public function __construct(ContainerInterface $container, string $defaultClient
$this->defaultClient = $defaultClient;
$this->driverIdPatter = $driverIdPatter;

parent::__construct(static::$defaultName);
parent::__construct(self::COMMAND_NAME);
}

protected function configure(): void
Expand Down
6 changes: 3 additions & 3 deletions pkg/enqueue/Symfony/Client/SetupBrokerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
use Symfony\Component\Console\Logger\ConsoleLogger;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand('enqueue:setup-broker')]
#[AsCommand(self::COMMAND_NAME)]
class SetupBrokerCommand extends Command
{
protected static $defaultName = 'enqueue:setup-broker';
private const COMMAND_NAME = 'enqueue:setup-broker';

/**
* @var ContainerInterface
Expand All @@ -38,7 +38,7 @@ public function __construct(ContainerInterface $container, string $defaultClient
$this->defaultClient = $defaultClient;
$this->driverIdPattern = $driverIdPattern;

parent::__construct(static::$defaultName);
parent::__construct(self::COMMAND_NAME);
}

protected function configure(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand('enqueue:transport:consume')]
#[AsCommand(self::COMMAND_NAME)]
class ConfigurableConsumeCommand extends Command
{
use ChooseLoggerCommandTrait;
use LimitsExtensionsCommandTrait;
use QueueConsumerOptionsCommandTrait;

protected static $defaultName = 'enqueue:transport:consume';
private const COMMAND_NAME = 'enqueue:transport:consume';

/**
* @var ContainerInterface
Expand Down Expand Up @@ -55,7 +55,7 @@ public function __construct(
$this->queueConsumerIdPattern = $queueConsumerIdPattern;
$this->processorRegistryIdPattern = $processorRegistryIdPattern;

parent::__construct(static::$defaultName);
parent::__construct(self::COMMAND_NAME);
}

protected function configure(): void
Expand Down
6 changes: 3 additions & 3 deletions pkg/enqueue/Symfony/Consumption/ConsumeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand('enqueue:transport:consume')]
#[AsCommand(self::COMMAND_NAME)]
class ConsumeCommand extends Command
{
use ChooseLoggerCommandTrait;
use LimitsExtensionsCommandTrait;
use QueueConsumerOptionsCommandTrait;

protected static $defaultName = 'enqueue:transport:consume';
private const COMMAND_NAME = 'enqueue:transport:consume';

/**
* @var ContainerInterface
Expand All @@ -43,7 +43,7 @@ public function __construct(ContainerInterface $container, string $defaultTransp
$this->defaultTransport = $defaultTransport;
$this->queueConsumerIdPattern = $queueConsumerIdPattern;

parent::__construct(static::$defaultName);
parent::__construct(self::COMMAND_NAME);
}

protected function configure(): void
Expand Down
Loading