Skip to content

Commit e852801

Browse files
committed
Address queue review follow-ups
1 parent 65b0889 commit e852801

4 files changed

Lines changed: 29 additions & 8 deletions

File tree

src/Controller/Admin/QueueController.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,28 @@ public function index() {
118118

119119
$configurations = (array)Configure::read('Queue');
120120

121-
$this->set(['new' => $new, 'current' => $current, 'data' => $data, 'pendingDetails' => $pendingDetails, 'scheduledDetails' => $scheduledDetails, 'pendingDetailsTruncated' => $pendingDetailsTruncated, 'scheduledDetailsTruncated' => $scheduledDetailsTruncated, 'detailsLimit' => $detailsLimit, 'totalPending' => $totalPending, 'status' => $status, 'tasks' => $tasks, 'addableTasks' => $addableTasks, 'taskDescriptions' => $taskDescriptions, 'servers' => $servers, 'workers' => $workers, 'pendingJobs' => $pendingJobs, 'scheduledJobs' => $scheduledJobs, 'runningJobs' => $runningJobs, 'failedJobs' => $failedJobs, 'configurations' => $configurations]);
121+
$this->set(compact(
122+
'new',
123+
'current',
124+
'data',
125+
'pendingDetails',
126+
'scheduledDetails',
127+
'pendingDetailsTruncated',
128+
'scheduledDetailsTruncated',
129+
'detailsLimit',
130+
'totalPending',
131+
'status',
132+
'tasks',
133+
'addableTasks',
134+
'taskDescriptions',
135+
'servers',
136+
'workers',
137+
'pendingJobs',
138+
'scheduledJobs',
139+
'runningJobs',
140+
'failedJobs',
141+
'configurations',
142+
));
122143
}
123144

124145
/**

src/Model/Table/QueuedJobsTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public function createJob(string $jobTask, array|object|null $data = null, array
267267
* @return string
268268
*/
269269
protected function jobTask(string $jobType): string {
270-
if (!$this->taskFinder instanceof TaskFinder) {
270+
if (!($this->taskFinder instanceof TaskFinder)) {
271271
$this->taskFinder = new TaskFinder();
272272
}
273273

src/Queue/TaskFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function resolve(string $jobTask): string {
145145

146146
if (!str_contains($jobTask, '\\')) {
147147
// Let's try matching without plugin prefix
148-
foreach (array_keys($all) as $name) {
148+
foreach ($all as $name => $_) {
149149
if (!str_contains($name, '.')) {
150150
continue;
151151
}

tests/TestCase/Model/Table/QueuedJobsTableTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,11 @@ public function testSequence() {
321321
}
322322

323323
/**
324-
* Test creating Jobs to run close to a specified time, and strtotime parsing.
325-
* Using toUnixString() function to convert Time object to timestamp, instead of strtotime
326-
*
327-
* @return void
328-
*/
324+
* Test creating Jobs to run close to a specified time, and strtotime parsing.
325+
* Using toUnixString() function to convert Time object to timestamp, instead of strtotime
326+
*
327+
* @return void
328+
*/
329329
public function testNotBefore() {
330330
$this->assertTrue((bool)$this->QueuedJobs->createJob('Foo', null, ['notBefore' => '+ 1 Min']));
331331
$this->assertTrue((bool)$this->QueuedJobs->createJob('Foo', null, ['notBefore' => '+ 1 Day']));

0 commit comments

Comments
 (0)