From c00e3d22371065374f98c8ad23dfffffe434cfa6 Mon Sep 17 00:00:00 2001 From: Jorge Gonzalez Date: Wed, 24 Jan 2024 11:47:41 -0500 Subject: [PATCH 1/3] [ALLI-10624] Upgrade to Symfony 6.4 and PHP 8.3. --- .gitignore | 1 + composer.json | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index b631ad4..dcb8ebd 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /phpunit.xml composer.lock .phpunit.result.cache +.idea *.pyc *.swp diff --git a/composer.json b/composer.json index 3ffb633..173b687 100644 --- a/composer.json +++ b/composer.json @@ -4,17 +4,26 @@ "keywords": ["beanstalkd", "pheanstalk"], "license": "Apache-2.0", "require": { - "php": "^8.0", + "php": "^8.2", "pda/pheanstalk": "^4.0", - "symfony/framework-bundle": "^5.4", - "symfony/console": "^5.4" + "symfony/framework-bundle": "^5.4.34 || ^6.4", + "symfony/console": "^5.4.34 || ^6.4" }, "require-dev": { "phpunit/phpunit": "^9.5", - "symfony/yaml": "^5.4", - "symfony/dependency-injection": "^5.4", - "symfony/phpunit-bridge": "^5.4", - "symfony/console": "^5.4" + "symfony/yaml": "^5.4.31 || ^6.4", + "symfony/dependency-injection": "^5.4.5 || ^6.4", + "symfony/phpunit-bridge": "^5.4 || ^6.4", + "symfony/cache": "^5.4 || ^6.4", + "symfony/config": "^5.4 || ^6.4", + "symfony/routing": "^5.4.34 || ^6.4", + "symfony/http-foundation": "^5.4.24 || ^6.4", + "symfony/event-dispatcher": "^5.4.34 || ^6.4", + "symfony/var-dumper": "^5.4 || ^6.4", + "symfony/error-handler": "^5.4 || ^6.4", + "symfony/finder": "^5.4 || ^6.4", + "symfony/filesystem": "^5.4 || ^6.4", + "symfony/var-exporter": "^5.4 || ^6.4" }, "autoload": { "psr-4": { From 4bdb995fdbb7a1901dce118993b99202cbe10388 Mon Sep 17 00:00:00 2001 From: Jorge Gonzalez Date: Wed, 24 Jan 2024 12:54:14 -0500 Subject: [PATCH 2/3] [ALLI-10624] Fix CS and deprecation notices. --- .github/workflows/test.yml | 3 +-- src/Command/PurgeQueueCommand.php | 9 ++++----- src/Command/StatsCommand.php | 5 ++--- src/DependencyInjection/PmgPheanstalkExtension.php | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ad8fcc5..7eb3ac2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,9 +13,8 @@ jobs: strategy: matrix: include: - - php-version: 8.0 - - php-version: 8.1 - php-version: 8.2 + - php-version: 8.3 steps: - name: checkout diff --git a/src/Command/PurgeQueueCommand.php b/src/Command/PurgeQueueCommand.php index b1c7f57..07067f6 100644 --- a/src/Command/PurgeQueueCommand.php +++ b/src/Command/PurgeQueueCommand.php @@ -12,21 +12,20 @@ namespace PMG\PheanstalkBundle\Command; +use PMG\PheanstalkBundle\Service\QueueUtilities; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use Pheanstalk\PheanstalkInterface; -use PMG\PheanstalkBundle\Service\QueueUtilities; /** * Purge a single beanstalkd tube of jobs. */ +#[AsCommand(name: 'pheanstalk:purge-queue')] final class PurgeQueueCommand extends Command { - protected static $defaultName = 'pheanstalk:purge-queue'; - public function __construct(private QueueUtilities $queueUtilities, $name=null) { parent::__construct($name); diff --git a/src/Command/StatsCommand.php b/src/Command/StatsCommand.php index 9e88b17..4a05ea3 100644 --- a/src/Command/StatsCommand.php +++ b/src/Command/StatsCommand.php @@ -12,12 +12,12 @@ namespace PMG\PheanstalkBundle\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Pheanstalk\PheanstalkInterface; use Pheanstalk\Exception\ServerException; use PMG\PheanstalkBundle\Service\StatsService; @@ -26,10 +26,9 @@ * * @since 1.0 */ +#[AsCommand(name: 'pheanstalk:stats')] final class StatsCommand extends Command { - protected static $defaultName = 'pheanstalk:stats'; - /** * @var StatsService */ diff --git a/src/DependencyInjection/PmgPheanstalkExtension.php b/src/DependencyInjection/PmgPheanstalkExtension.php index df4eded..9244666 100644 --- a/src/DependencyInjection/PmgPheanstalkExtension.php +++ b/src/DependencyInjection/PmgPheanstalkExtension.php @@ -37,7 +37,7 @@ final class PmgPheanstalkExtension extends ConfigurableExtension /** * {@inheritdoc} */ - protected function loadInternal(array $config, ContainerBuilder $container) + protected function loadInternal(array $config, ContainerBuilder $container): void { $connections = []; foreach ($config['connections'] as $name => $connConfig) { From b93271f3397cc0cb3a8e4e70b7ff79363252b2aa Mon Sep 17 00:00:00 2001 From: Jorge Gonzalez Date: Thu, 25 Jan 2024 11:00:05 -0500 Subject: [PATCH 3/3] [ALLI-10624] Add Composer command to the matrix. --- .github/actions/setup-php/action.yml | 3 ++- .github/workflows/test.yml | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-php/action.yml b/.github/actions/setup-php/action.yml index 075753c..03dc47c 100644 --- a/.github/actions/setup-php/action.yml +++ b/.github/actions/setup-php/action.yml @@ -19,6 +19,7 @@ runs: tools: composer coverage: xdebug ini-values: zend.assertions=1,assert.exception=1,xdebug.mode=coverage + composer-command: ${{ matrix.composer-command }} - name: composer cache id: composercache @@ -34,4 +35,4 @@ runs: - name: install php dependencies shell: bash - run: composer install --no-interaction --no-progress + run: ${{ inputs.composer-command }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7eb3ac2..6d9c8cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,9 +12,10 @@ jobs: strategy: matrix: - include: - - php-version: 8.2 - - php-version: 8.3 + php-version: ["8.2", "8.3"] + composer-command: + - composer update --prefer-lowest --prefer-dist --prefer-stable + - composer install steps: - name: checkout @@ -27,6 +28,7 @@ jobs: uses: ./.github/actions/setup-php with: php-version: "${{ matrix.php-version }}" + composer-command: ${{ matrix.composer-command }} - name: tests run: ./vendor/bin/phpunit