Skip to content

Commit c941aea

Browse files
authored
Apply conservative Rector cleanup (#501)
* Run PHPCS cleanup * Address queue review follow-ups * Remove stale queue results annotation * Restore !empty ternary in queue cleanup * Fix queue rebase marker * Fix queue review follow-up * Fix queue process status typing
1 parent d01d1a4 commit c941aea

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Model/Table/QueueProcessesTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,13 @@ public function status(): array {
242242
->enableHydration(false)
243243
->all()
244244
->toArray();
245-
/** @var array<array{modified: \Cake\I18n\DateTime}> $results */
246245

247246
if (!$results) {
248247
return [];
249248
}
250249

251250
$count = count($results);
251+
/** @var array{modified: \Cake\I18n\DateTime} $record */
252252
$record = array_shift($results);
253253
/** @var \Cake\I18n\DateTime $time */
254254
$time = $record['modified'];

src/Queue/Task/ProgressExampleTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function description(): ?string {
7575
public function run(array $data, int $jobId): void {
7676
$this->io->hr();
7777
$this->io->out('CakePHP Queue ProgressExample task.');
78-
$seconds = empty($data['duration']) ? 2 * static::MINUTE : (int)$data['duration'];
78+
$seconds = !empty($data['duration']) ? (int)$data['duration'] : 2 * static::MINUTE;
7979

8080
$this->io->out('A total of ' . $seconds . ' seconds need to pass...');
8181
for ($i = 0; $i < $seconds; $i++) {

0 commit comments

Comments
 (0)