Skip to content

Commit

Permalink
cs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsn committed Jan 17, 2025
1 parent 9cdc8e8 commit db615f1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
'CodeIgniter Queue',
'CodeIgniter Foundation',
'admin@codeigniter.com'
'admin@codeigniter.com',
);
2 changes: 1 addition & 1 deletion src/Commands/QueueWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function run(array $params)
$memory,
$priority,
$tries,
$retryAfter
$retryAfter,
] = $this->readOptions($params, $config, $queue);

if ($error !== null) {
Expand Down
10 changes: 5 additions & 5 deletions src/Handlers/BaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public function retry(?int $id, ?string $queue): int
$jobs = model(QueueJobFailedModel::class)
->when(
$id !== null,
static fn ($query) => $query->where('id', $id)
static fn ($query) => $query->where('id', $id),
)
->when(
$queue !== null,
static fn ($query) => $query->where('queue', $queue)
static fn ($query) => $query->where('queue', $queue),
)
->findAll();

Expand Down Expand Up @@ -112,11 +112,11 @@ public function flush(?int $hours, ?string $queue): bool
return model(QueueJobFailedModel::class)
->when(
$hours !== null,
static fn ($query) => $query->where('failed_at <=', Time::now()->subHours($hours)->timestamp)
static fn ($query) => $query->where('failed_at <=', Time::now()->subHours($hours)->timestamp),
)
->when(
$queue !== null,
static fn ($query) => $query->where('queue', $queue)
static fn ($query) => $query->where('queue', $queue),
)
->delete();
}
Expand All @@ -129,7 +129,7 @@ public function listFailed(?string $queue): array
return model(QueueJobFailedModel::class)
->when(
$queue !== null,
static fn ($query) => $query->where('queue', $queue)
static fn ($query) => $query->where('queue', $queue),
)
->orderBy('failed_at', 'desc')
->findAll();
Expand Down
2 changes: 1 addition & 1 deletion src/Handlers/PredisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function later(QueueJob $queueJob, int $seconds): bool

$result = $this->predis->zadd(
"queues:{$queueJob->queue}:{$queueJob->priority}",
[json_encode($queueJob) => $queueJob->available_at->timestamp]
[json_encode($queueJob) => $queueJob->available_at->timestamp],
);
if ($result !== 0) {
$this->predis->hdel("queues:{$queueJob->queue}::reserved", [$queueJob->id]);
Expand Down
2 changes: 1 addition & 1 deletion src/Handlers/RedisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function later(QueueJob $queueJob, int $seconds): bool
$result = (int) $this->redis->zAdd(
"queues:{$queueJob->queue}:{$queueJob->priority}",
$queueJob->available_at->timestamp,
json_encode($queueJob)
json_encode($queueJob),
);
if ($result !== 0) {
$this->redis->hDel("queues:{$queueJob->queue}::reserved", (string) $queueJob->id);
Expand Down
8 changes: 4 additions & 4 deletions src/Models/QueueJobModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,22 @@ private function setPriority(BaseBuilder $builder, array $priority): BaseBuilder
sprintf('CASE %s ', $this->db->protectIdentifiers('priority'))
. implode(
' ',
array_map(static fn ($value, $key) => "WHEN '{$value}' THEN {$key}", $priority, array_keys($priority))
array_map(static fn ($value, $key) => "WHEN '{$value}' THEN {$key}", $priority, array_keys($priority)),
)
. ' END',
'',
false
false,
);
} else {
$builder->orderBy(
'FIELD(priority, '
. implode(
',',
array_map(static fn ($value) => "'{$value}'", $priority)
array_map(static fn ($value) => "'{$value}'", $priority),
)
. ')',
'',
false
false,
);
}
}
Expand Down

0 comments on commit db615f1

Please sign in to comment.