Skip to content

Commit 5529415

Browse files
committed
docs: add PHPDoc types
1 parent e8c074b commit 5529415

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

src/Config/Queue.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
use CodeIgniter\Queue\Handlers\DatabaseHandler;
88
use CodeIgniter\Queue\Handlers\PredisHandler;
99
use CodeIgniter\Queue\Handlers\RedisHandler;
10+
use CodeIgniter\Queue\Interfaces\JobInterface;
11+
use CodeIgniter\Queue\Interfaces\QueueInterface;
1012

1113
class Queue extends BaseConfig
1214
{
@@ -17,6 +19,8 @@ class Queue extends BaseConfig
1719

1820
/**
1921
* Available handlers.
22+
*
23+
* @var array<string, class-string<QueueInterface>>
2024
*/
2125
public array $handlers = [
2226
'database' => DatabaseHandler::class,
@@ -81,6 +85,8 @@ class Queue extends BaseConfig
8185

8286
/**
8387
* Your jobs handlers.
88+
*
89+
* @var array<string, class-string<JobInterface>>
8490
*/
8591
public array $jobHandlers = [];
8692

@@ -95,6 +101,8 @@ public function __construct()
95101

96102
/**
97103
* Resolve job class name.
104+
*
105+
* @return class-string<JobInterface>
98106
*/
99107
public function resolveJobClass(string $name): string
100108
{

src/Config/Services.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static function queue(?QueueConfig $config = null, $getShared = true): Qu
1515
return static::getSharedInstance('queue', $config);
1616
}
1717

18-
/** @var QueueConfig $config */
18+
/** @var QueueConfig|null $config */
1919
$config ??= config('Queue');
2020

2121
return (new Queue($config))->init();

src/Entities/QueueJob.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@
33
namespace CodeIgniter\Queue\Entities;
44

55
use CodeIgniter\Entity\Entity;
6+
use CodeIgniter\I18n\Time;
67

8+
/**
9+
* @property int $attempts
10+
* @property Time $available_at
11+
* @property Time $created_at
12+
* @property int $id
13+
* @property array $payload
14+
* @property string $priority
15+
* @property string $queue
16+
* @property int $status
17+
*/
718
class QueueJob extends Entity
819
{
920
protected $dates = ['available_at', 'created_at'];

0 commit comments

Comments
 (0)