Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/deptrac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ on:

jobs:
deptrac:
uses: codeigniter4/.github/.github/workflows/deptrac.yml@CI46
uses: codeigniter4/.github/.github/workflows/deptrac.yml@CI47
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"homepage": "https://github.com/codeigniter4/queue",
"require": {
"php": "^8.1"
"php": "^8.2"
},
"require-dev": {
"codeigniter4/devkit": "^1.3",
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Listen for queued jobs.

### Requirements

- PHP 8.1+
- PHP 8.2+
- CodeIgniter 4.3+

If you use `database` handler:
Expand Down
6 changes: 0 additions & 6 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions src/Commands/QueueWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ private function checkStop(string $queue, float $startTime): bool

/**
* Handle interruption
*
* @phpstan-ignore method.unused
*/
private function onInterruption(int $signal): void
{
Expand Down
1 change: 1 addition & 0 deletions src/Handlers/BaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public function retry(?int $id, ?string $queue): int
)
->findAll();

/** @var list<QueueJobFailed> $jobs */
foreach ($jobs as $job) {
$this->setPriority($job->priority)->push($job->queue, $job->payload['job'], $job->payload['data']);
$this->forget($job->id);
Expand Down
11 changes: 8 additions & 3 deletions tests/DatabaseHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ public function testLater(): void
'id' => 2,
'status' => Status::RESERVED->value,
]);
$this->assertInstanceOf(QueueJob::class, $queueJob);

$result = $handler->later($queueJob, 60);

Expand All @@ -366,7 +367,8 @@ 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);

$this->assertTrue($result);
Expand All @@ -386,7 +388,8 @@ 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);

$this->assertTrue($result);
Expand All @@ -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);

Expand Down Expand Up @@ -476,7 +480,8 @@ 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);

$this->assertTrue($result);
Expand Down
8 changes: 6 additions & 2 deletions tests/PredisHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -280,7 +281,8 @@ 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);

$predis = self::getPrivateProperty($handler, 'predis');
Expand All @@ -304,7 +306,8 @@ 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);

$predis = self::getPrivateProperty($handler, 'predis');
Expand All @@ -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);

Expand Down
8 changes: 6 additions & 2 deletions tests/RedisHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -265,7 +266,8 @@ 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);

$redis = self::getPrivateProperty($handler, 'redis');
Expand All @@ -286,7 +288,8 @@ 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);

$redis = self::getPrivateProperty($handler, 'redis');
Expand All @@ -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);

Expand Down
Loading