From 13c1e1f0ce11154897aac87d5ac56f14af83ff60 Mon Sep 17 00:00:00 2001 From: michalsn Date: Sat, 7 Feb 2026 16:00:55 +0100 Subject: [PATCH 1/5] chore: update workflow to include PHP 8.5 --- .github/workflows/deptrac.yml | 2 +- .github/workflows/phpstan.yml | 2 +- .github/workflows/phpunit.yml | 2 +- .github/workflows/rector.yml | 2 +- README.md | 2 +- docs/index.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deptrac.yml b/.github/workflows/deptrac.yml index 78b7ecf..a41e15d 100644 --- a/.github/workflows/deptrac.yml +++ b/.github/workflows/deptrac.yml @@ -20,4 +20,4 @@ on: jobs: deptrac: - uses: codeigniter4/.github/.github/workflows/deptrac.yml@CI46 + uses: codeigniter4/.github/.github/workflows/deptrac.yml@CI47 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index f9550ba..8e6ec0f 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -26,7 +26,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['8.2', '8.4'] + php-versions: ['8.2', '8.5'] steps: - name: Checkout diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index bc10d9f..bb545b6 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -38,7 +38,7 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" strategy: matrix: - php-versions: ['8.2', '8.3', '8.4'] + php-versions: ['8.2', '8.3', '8.4', '8.5'] db-platforms: ['MySQLi', 'SQLite3'] include: # Postgre diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 9ce2ffd..194bf9e 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['8.2', '8.4'] + php-versions: ['8.2', '8.5'] steps: - name: Checkout diff --git a/README.md b/README.md index f4c6ee0..caf5e99 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Queues for the CodeIgniter 4 framework. [![Deptrac](https://github.com/codeigniter4/queue/actions/workflows/deptrac.yml/badge.svg)](https://github.com/codeigniter4/queue/actions/workflows/deptrac.yml) [![Coverage Status](https://coveralls.io/repos/github/codeigniter4/queue/badge.svg?branch=develop)](https://coveralls.io/github/codeigniter4/queue?branch=develop) -![PHP](https://img.shields.io/badge/PHP-%5E8.1-blue) +![PHP](https://img.shields.io/badge/PHP-%5E8.2-blue) ![CodeIgniter](https://img.shields.io/badge/CodeIgniter-%5E4.3-blue) ![License](https://img.shields.io/badge/License-MIT-blue) diff --git a/docs/index.md b/docs/index.md index 0bd0af0..148fd72 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,7 +18,7 @@ Listen for queued jobs. ### Requirements -- PHP 8.1+ +- PHP 8.2+ - CodeIgniter 4.3+ If you use `database` handler: From 15bc9562b4b272a30bc297e69aace9e38a094547 Mon Sep 17 00:00:00 2001 From: michalsn Date: Sat, 7 Feb 2026 16:23:00 +0100 Subject: [PATCH 2/5] update minimal PHP version in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bf1ace2..0320b25 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ ], "homepage": "https://github.com/codeigniter4/queue", "require": { - "php": "^8.1" + "php": "^8.2" }, "require-dev": { "codeigniter4/devkit": "^1.3", From e324ced16ca8ea52bb839bed5d85311772c8c60e Mon Sep 17 00:00:00 2001 From: michalsn Date: Sat, 7 Feb 2026 16:26:35 +0100 Subject: [PATCH 3/5] fix PHPStan errors --- phpstan.neon.dist | 6 ------ src/Commands/QueueWork.php | 2 ++ src/Handlers/BaseHandler.php | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 399b947..92533f9 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -10,12 +10,6 @@ parameters: ignoreErrors: - message: '#Call to method PHPUnit\\Framework\\Assert::assertInstanceOf\(\) with.#' - - - message: '#Call to deprecated function random_string\(\):#' - paths: - - src/Handlers/RedisHandler.php - - src/Handlers/PredisHandler.php - - src/Handlers/RabbitMQHandler.php - message: '#Call to an undefined method CodeIgniter\\Queue\\Models\\QueueJobFailedModel::affectedRows\(\).#' paths: diff --git a/src/Commands/QueueWork.php b/src/Commands/QueueWork.php index 550da49..d3a8848 100644 --- a/src/Commands/QueueWork.php +++ b/src/Commands/QueueWork.php @@ -492,6 +492,8 @@ private function checkStop(string $queue, float $startTime): bool /** * Handle interruption + * + * @phpstan-ignore method.unused */ private function onInterruption(int $signal): void { diff --git a/src/Handlers/BaseHandler.php b/src/Handlers/BaseHandler.php index 38c9beb..48a4acd 100644 --- a/src/Handlers/BaseHandler.php +++ b/src/Handlers/BaseHandler.php @@ -70,6 +70,7 @@ public function retry(?int $id, ?string $queue): int ) ->findAll(); + /** @var list $jobs */ foreach ($jobs as $job) { $this->setPriority($job->priority)->push($job->queue, $job->payload['job'], $job->payload['data']); $this->forget($job->id); From 9c46eed281671bfb1d0262e5e1e468f49db11db7 Mon Sep 17 00:00:00 2001 From: michalsn Date: Sat, 7 Feb 2026 16:27:22 +0100 Subject: [PATCH 4/5] fix Rector errors --- tests/DatabaseHandlerTest.php | 5 +++++ tests/PredisHandlerTest.php | 4 ++++ tests/RedisHandlerTest.php | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/tests/DatabaseHandlerTest.php b/tests/DatabaseHandlerTest.php index 77df5be..e9ad6ec 100644 --- a/tests/DatabaseHandlerTest.php +++ b/tests/DatabaseHandlerTest.php @@ -345,6 +345,7 @@ public function testLater(): void 'id' => 2, 'status' => Status::RESERVED->value, ]); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->later($queueJob, 60); @@ -367,6 +368,7 @@ public function testFailedAndKeepJob(): void $queueJob = $handler->pop('queue1', ['default']); $err = new Exception('Sample exception'); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, true); $this->assertTrue($result); @@ -387,6 +389,7 @@ public function testFailedAndDontKeepJob(): void $queueJob = $handler->pop('queue1', ['default']); $err = new Exception('Sample exception'); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, false); $this->assertTrue($result); @@ -407,6 +410,7 @@ public function testDone(): void { $handler = new DatabaseHandler($this->config); $queueJob = $handler->pop('queue1', ['default']); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->done($queueJob); @@ -477,6 +481,7 @@ public function testFlush(): void $queueJob = $handler->pop('queue1', ['default']); $err = new Exception('Sample exception here'); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, true); $this->assertTrue($result); diff --git a/tests/PredisHandlerTest.php b/tests/PredisHandlerTest.php index 935dd65..c56ee12 100644 --- a/tests/PredisHandlerTest.php +++ b/tests/PredisHandlerTest.php @@ -264,6 +264,7 @@ public function testLater(): void $predis = self::getPrivateProperty($handler, 'predis'); $this->assertSame(1, $predis->hexists('queues:queue1::reserved', $queueJob->id)); $this->assertSame(0, $predis->zcard('queues:queue1:default')); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->later($queueJob, 60); @@ -281,6 +282,7 @@ public function testFailedAndKeepJob(): void $queueJob = $handler->pop('queue1', ['default']); $err = new Exception('Sample exception'); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, true); $predis = self::getPrivateProperty($handler, 'predis'); @@ -305,6 +307,7 @@ public function testFailedAndDontKeepJob(): void $queueJob = $handler->pop('queue1', ['default']); $err = new Exception('Sample exception'); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, false); $predis = self::getPrivateProperty($handler, 'predis'); @@ -330,6 +333,7 @@ public function testDone(): void $predis = self::getPrivateProperty($handler, 'predis'); $this->assertSame(0, $predis->zcard('queues:queue1:default')); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->done($queueJob); diff --git a/tests/RedisHandlerTest.php b/tests/RedisHandlerTest.php index ba12413..2ab37e6 100644 --- a/tests/RedisHandlerTest.php +++ b/tests/RedisHandlerTest.php @@ -252,6 +252,7 @@ public function testLater(): void $redis = self::getPrivateProperty($handler, 'redis'); $this->assertTrue($redis->hExists('queues:queue1::reserved', (string) $queueJob->id)); $this->assertSame(0, $redis->zCard('queues:queue1:default')); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->later($queueJob, 60); @@ -266,6 +267,7 @@ public function testFailedAndKeepJob(): void $queueJob = $handler->pop('queue1', ['default']); $err = new Exception('Sample exception'); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, true); $redis = self::getPrivateProperty($handler, 'redis'); @@ -287,6 +289,7 @@ public function testFailedAndDontKeepJob(): void $queueJob = $handler->pop('queue1', ['default']); $err = new Exception('Sample exception'); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, false); $redis = self::getPrivateProperty($handler, 'redis'); @@ -309,6 +312,7 @@ public function testDone(): void $redis = self::getPrivateProperty($handler, 'redis'); $this->assertSame(0, $redis->zCard('queues:queue1:default')); + $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->done($queueJob); From 6270f51a31d11ae4761be5ee4d5f59f723af1890 Mon Sep 17 00:00:00 2001 From: michalsn Date: Sat, 7 Feb 2026 16:29:05 +0100 Subject: [PATCH 5/5] cs fix --- tests/DatabaseHandlerTest.php | 6 +++--- tests/PredisHandlerTest.php | 4 ++-- tests/RedisHandlerTest.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/DatabaseHandlerTest.php b/tests/DatabaseHandlerTest.php index e9ad6ec..dadd42e 100644 --- a/tests/DatabaseHandlerTest.php +++ b/tests/DatabaseHandlerTest.php @@ -367,7 +367,7 @@ public function testFailedAndKeepJob(): void $handler = new DatabaseHandler($this->config); $queueJob = $handler->pop('queue1', ['default']); - $err = new Exception('Sample exception'); + $err = new Exception('Sample exception'); $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, true); @@ -388,7 +388,7 @@ public function testFailedAndDontKeepJob(): void $handler = new DatabaseHandler($this->config); $queueJob = $handler->pop('queue1', ['default']); - $err = new Exception('Sample exception'); + $err = new Exception('Sample exception'); $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, false); @@ -480,7 +480,7 @@ public function testFlush(): void $handler = new DatabaseHandler($this->config); $queueJob = $handler->pop('queue1', ['default']); - $err = new Exception('Sample exception here'); + $err = new Exception('Sample exception here'); $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, true); diff --git a/tests/PredisHandlerTest.php b/tests/PredisHandlerTest.php index c56ee12..8fcf4e2 100644 --- a/tests/PredisHandlerTest.php +++ b/tests/PredisHandlerTest.php @@ -281,7 +281,7 @@ public function testFailedAndKeepJob(): void $handler = new PredisHandler($this->config); $queueJob = $handler->pop('queue1', ['default']); - $err = new Exception('Sample exception'); + $err = new Exception('Sample exception'); $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, true); @@ -306,7 +306,7 @@ public function testFailedAndDontKeepJob(): void $handler = new PredisHandler($this->config); $queueJob = $handler->pop('queue1', ['default']); - $err = new Exception('Sample exception'); + $err = new Exception('Sample exception'); $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, false); diff --git a/tests/RedisHandlerTest.php b/tests/RedisHandlerTest.php index 2ab37e6..0b64d0b 100644 --- a/tests/RedisHandlerTest.php +++ b/tests/RedisHandlerTest.php @@ -266,7 +266,7 @@ public function testFailedAndKeepJob(): void $handler = new RedisHandler($this->config); $queueJob = $handler->pop('queue1', ['default']); - $err = new Exception('Sample exception'); + $err = new Exception('Sample exception'); $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, true); @@ -288,7 +288,7 @@ public function testFailedAndDontKeepJob(): void $handler = new RedisHandler($this->config); $queueJob = $handler->pop('queue1', ['default']); - $err = new Exception('Sample exception'); + $err = new Exception('Sample exception'); $this->assertInstanceOf(QueueJob::class, $queueJob); $result = $handler->failed($queueJob, $err, false);