Skip to content

Commit d15dc13

Browse files
authored
Merge pull request #35 from michalsn/fix/cs
fix: phpstan issues
2 parents 3a4c5d3 + 5aa8b3b commit d15dc13

15 files changed

+62
-47
lines changed

phpstan.neon.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ parameters:
1515
paths:
1616
- src/Handlers/RedisHandler.php
1717
- src/Handlers/PredisHandler.php
18-
-
19-
message: '#Access to an undefined property CodeIgniter\\I18n\\Time::\$timestamp.#'
2018
-
2119
message: '#Call to an undefined method CodeIgniter\\Queue\\Models\\QueueJobFailedModel::affectedRows\(\).#'
2220
paths:

src/Commands/Generators/JobGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class JobGenerator extends BaseCommand
4545
/**
4646
* The Command's Arguments
4747
*
48-
* @var array
48+
* @var array<string, string>
4949
*/
5050
protected $arguments = [
5151
'name' => 'The job class name.',
@@ -54,7 +54,7 @@ class JobGenerator extends BaseCommand
5454
/**
5555
* The Command's Options
5656
*
57-
* @var array
57+
* @var array<string, string>
5858
*/
5959
protected $options = [
6060
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',

src/Commands/QueueClear.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class QueueClear extends BaseCommand
4040
/**
4141
* The Command's Arguments
4242
*
43-
* @var array
43+
* @var array<string, string>
4444
*/
4545
protected $arguments = [
4646
'queueName' => 'Name of the queue we will work with.',

src/Commands/QueueFailed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class QueueFailed extends BaseCommand
4141
/**
4242
* The Command's Options
4343
*
44-
* @var array
44+
* @var array<string, string>
4545
*/
4646
protected $options = [
4747
'-queue' => 'Queue name.',

src/Commands/QueueFlush.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class QueueFlush extends BaseCommand
4040
/**
4141
* The Command's Options
4242
*
43-
* @var array
43+
* @var array<string, string>
4444
*/
4545
protected $options = [
4646
'-hours' => 'Number of hours.',

src/Commands/QueueForget.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class QueueForget extends BaseCommand
4040
/**
4141
* The Command's Arguments
4242
*
43-
* @var array
43+
* @var array<string, string>
4444
*/
4545
protected $arguments = [
4646
'id' => 'ID of the failed job.',

src/Commands/QueueRetry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class QueueRetry extends BaseCommand
4040
/**
4141
* The Command's Arguments
4242
*
43-
* @var array
43+
* @var array<string, string>
4444
*/
4545
protected $arguments = [
4646
'id' => 'ID of the failed job or "all" for all failed jobs.',
@@ -49,7 +49,7 @@ class QueueRetry extends BaseCommand
4949
/**
5050
* The Command's Options
5151
*
52-
* @var array
52+
* @var array<string, string>
5353
*/
5454
protected $options = [
5555
'-queue' => 'Queue name.',

src/Commands/QueueStop.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class QueueStop extends BaseCommand
4040
/**
4141
* The Command's Arguments
4242
*
43-
* @var array
43+
* @var array<string, string>
4444
*/
4545
protected $arguments = [
4646
'queueName' => 'Name of the queue we will work with.',
@@ -49,7 +49,7 @@ class QueueStop extends BaseCommand
4949
/**
5050
* The Command's Options
5151
*
52-
* @var array
52+
* @var array<string, string>
5353
*/
5454
protected $options = [
5555
];

src/Commands/QueueWork.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class QueueWork extends BaseCommand
4444
/**
4545
* The Command's Arguments
4646
*
47-
* @var array
47+
* @var array<string, string>
4848
*/
4949
protected $arguments = [
5050
'queueName' => 'Name of the queue we will work with.',
@@ -53,7 +53,7 @@ class QueueWork extends BaseCommand
5353
/**
5454
* The Command's Options
5555
*
56-
* @var array
56+
* @var array<string, string>
5757
*/
5858
protected $options = [
5959
'-sleep' => 'Wait time between the next check for available job when the queue is empty. Default value: 10 (seconds).',

src/Handlers/DatabaseHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function push(string $queue, string $job, array $data): bool
3939
'priority' => $this->priority,
4040
'status' => Status::PENDING->value,
4141
'attempts' => 0,
42-
'available_at' => Time::now()->timestamp,
42+
'available_at' => Time::now(),
4343
]);
4444

4545
$this->priority = null;
@@ -75,7 +75,7 @@ public function pop(string $queue, array $priorities): ?QueueJob
7575
public function later(QueueJob $queueJob, int $seconds): bool
7676
{
7777
$queueJob->status = Status::PENDING->value;
78-
$queueJob->available_at = Time::now()->addSeconds($seconds)->timestamp;
78+
$queueJob->available_at = Time::now()->addSeconds($seconds);
7979

8080
return $this->jobModel->save($queueJob);
8181
}

0 commit comments

Comments
 (0)