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 ad8fcc5..6d9c8cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,10 +12,10 @@ jobs: strategy: matrix: - include: - - php-version: 8.0 - - php-version: 8.1 - - php-version: 8.2 + php-version: ["8.2", "8.3"] + composer-command: + - composer update --prefer-lowest --prefer-dist --prefer-stable + - composer install steps: - name: checkout @@ -28,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 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": { 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) {