Skip to content

Commit 9230f5c

Browse files
committed
phpcsfixer run
1 parent 05c8326 commit 9230f5c

File tree

18 files changed

+141
-165
lines changed

18 files changed

+141
-165
lines changed

config/Schema/queued_tasks.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,84 +14,84 @@
1414
'type' => 'integer',
1515
'length' => 10,
1616
'null' => false,
17-
'default' => null
17+
'default' => null,
1818
]);
1919
$t->addColumn('jobtype', [
2020
'type' => 'string',
2121
'null' => false,
22-
'length' => 45
22+
'length' => 45,
2323
]);
2424
$t->addColumn('data', [
2525
'type' => 'text',
2626
'null' => true,
27-
'default' => null
27+
'default' => null,
2828
]);
2929
$t->addColumn('task_group', [
3030
'type' => 'string',
3131
'length' => 255,
3232
'null' => true,
33-
'default' => null
33+
'default' => null,
3434
]);
3535
$t->addColumn('reference', [
3636
'type' => 'string',
3737
'length' => 255,
3838
'null' => true,
39-
'default' => null
39+
'default' => null,
4040
]);
4141
$t->addColumn('created', [
4242
'type' => 'datetime',
4343
'null' => true,
44-
'default' => null
44+
'default' => null,
4545
]);
4646
$t->addColumn('notbefore', [
4747
'type' => 'datetime',
4848
'null' => true,
49-
'default' => null
49+
'default' => null,
5050
]);
5151
$t->addColumn('fetched', [
5252
'type' => 'datetime',
5353
'null' => true,
54-
'default' => null
54+
'default' => null,
5555
]);
5656
$t->addColumn('progress', [
5757
'type' => 'float',
5858
'length' => '3,2',
5959
'null' => true,
60-
'default' => null
60+
'default' => null,
6161
]);
6262
$t->addColumn('status', [
6363
'type' => 'string',
6464
'length' => 255,
6565
'null' => true,
66-
'default' => null
66+
'default' => null,
6767
]);
6868
$t->addColumn('completed', [
6969
'type' => 'datetime',
7070
'null' => true,
71-
'default' => null
71+
'default' => null,
7272
]);
7373
$t->addColumn('failed', [
7474
'type' => 'integer',
7575
'null' => false,
7676
'default' => '0',
77-
'length' => 3
77+
'length' => 3,
7878
]);
7979
$t->addColumn('failure_message', [
8080
'type' => 'text',
8181
'null' => true,
82-
'default' => null
82+
'default' => null,
8383
]);
8484
$t->addColumn('workerkey', [
8585
'type' => 'string',
8686
'null' => true,
87-
'length' => 45
87+
'length' => 45,
8888
]);
8989

9090
$t->addConstraint('primary', [
9191
'type' => 'primary',
92-
'columns' => ['id']
92+
'columns' => ['id'],
9393
]);
9494

9595
$t->options([
96-
'collate' => 'utf8_unicode_ci'
96+
'collate' => 'utf8_unicode_ci',
9797
]);

config/queue.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* This file configures default behavior for all workers
44
*
55
* To modify these parameters, copy this file into your own CakePHP APP/Config directory.
6-
*
76
*/
87
return [
98
'Queue' => [
@@ -35,6 +34,6 @@
3534
'log' => true,
3635

3736
// set to false to disable (tmp = file in TMP dir)
38-
'notify' => 'tmp'
39-
]
37+
'notify' => 'tmp',
38+
],
4039
];

src/Model/Table/QueuedTasksTable.php

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class QueuedTasksTable extends Table {
1919
public $exit = false;
2020

2121
public $findMethods = [
22-
'progress' => true
22+
'progress' => true,
2323
];
2424

2525
protected $_key = null;
@@ -70,7 +70,7 @@ public function createJob($jobName, $data = null, $notBefore = null, $group = nu
7070
'jobtype' => $jobName,
7171
'data' => serialize($data),
7272
'task_group' => $group,
73-
'reference' => $reference
73+
'reference' => $reference,
7474
];
7575
if ($notBefore !== null) {
7676
$data['notbefore'] = strtotime($notBefore);
@@ -101,8 +101,8 @@ public function onError() {
101101
public function getLength($type = null) {
102102
$findConf = [
103103
'conditions' => [
104-
'completed IS' => null
105-
]
104+
'completed IS' => null,
105+
],
106106
];
107107
if ($type !== null) {
108108
$findConf['conditions']['jobtype'] = $type;
@@ -119,10 +119,10 @@ public function getLength($type = null) {
119119
public function getTypes() {
120120
$findCond = [
121121
'fields' => [
122-
'jobtype'
122+
'jobtype',
123123
],
124124
'group' => [
125-
'jobtype'
125+
'jobtype',
126126
],
127127
'keyField' => 'jobtype',
128128
'valueField' => 'jobtype',
@@ -148,11 +148,11 @@ public function getStats() {
148148
];
149149
},
150150
'conditions' => [
151-
'completed IS NOT' => null
151+
'completed IS NOT' => null,
152152
],
153153
'group' => [
154-
'jobtype'
155-
]
154+
'jobtype',
155+
],
156156
];
157157
return $this->find('all', $options);
158158
}
@@ -173,7 +173,7 @@ public function requestJob(array $capabilities, $group = null) {
173173
$findCond = [
174174
'conditions' => [
175175
'completed IS' => null,
176-
'OR' => []
176+
'OR' => [],
177177
],
178178
'fields' => function ($query) {
179179
return [
@@ -186,9 +186,9 @@ public function requestJob(array $capabilities, $group = null) {
186186
},
187187
'order' => [
188188
'age ASC',
189-
'id ASC'
189+
'id ASC',
190190
],
191-
'limit' => 3
191+
'limit' => 3,
192192
];
193193

194194
if ($group !== null) {
@@ -204,17 +204,17 @@ public function requestJob(array $capabilities, $group = null) {
204204
[
205205
'OR' => [
206206
'notbefore <' => time(),
207-
'notbefore IS' => null
208-
]
207+
'notbefore IS' => null,
208+
],
209209
],
210210
[
211211
'OR' => [
212212
'fetched <' => time() - $task['timeout'],
213-
'fetched IS' => null
214-
]
215-
]
213+
'fetched IS' => null,
214+
],
215+
],
216216
],
217-
'failed <' => ($task['retries'] + 1)
217+
'failed <' => ($task['retries'] + 1),
218218
];
219219
if (array_key_exists('rate', $task) && $tmp['jobtype'] && array_key_exists($tmp['jobtype'], $this->rateHistory)) {
220220
$tmp['UNIX_TIMESTAMP() >='] = $this->rateHistory[$tmp['jobtype']] + $task['rate'];
@@ -250,7 +250,7 @@ public function requestJob(array $capabilities, $group = null) {
250250
'workerkey' => $key,
251251
'completed IS' => null,
252252
],
253-
'order' => ['fetched' => 'DESC']
253+
'order' => ['fetched' => 'DESC'],
254254
])->first();
255255

256256
if (!$data) {
@@ -291,10 +291,10 @@ public function updateProgress($id, $progress) {
291291
*/
292292
public function markJobDone($id) {
293293
$fields = [
294-
'completed' => time()
294+
'completed' => time(),
295295
];
296296
$conditions = [
297-
'id' => $id
297+
'id' => $id,
298298
];
299299
return $this->updateAll($fields, $conditions);
300300
}
@@ -314,7 +314,7 @@ public function reset() {
314314
'failure_message' => null,
315315
];
316316
$conditions = [
317-
'completed IS' => null
317+
'completed IS' => null,
318318
];
319319
return $this->updateAll($fields, $conditions);
320320
}
@@ -336,7 +336,7 @@ public function markJobFailed($id, $failureMessage = null) {
336336
'failure_message' => $failureMessage,
337337
];
338338
$conditions = [
339-
'id' => $id
339+
'id' => $id,
340340
];
341341
return $this->updateAll($fields, $conditions);
342342
}
@@ -356,11 +356,11 @@ public function getPendingStats() {
356356
'progress',
357357
'reference',
358358
'failed',
359-
'failure_message'
359+
'failure_message',
360360
],
361361
'conditions' => [
362-
'completed IS' => null
363-
]
362+
'completed IS' => null,
363+
],
364364
];
365365
return $this->find('all', $findCond);
366366
}
@@ -372,7 +372,7 @@ public function getPendingStats() {
372372
*/
373373
public function cleanOldJobs() {
374374
$this->deleteAll([
375-
'completed <' => time() - Configure::read('Queue.cleanuptimeout')
375+
'completed <' => time() - Configure::read('Queue.cleanuptimeout'),
376376
]);
377377
if (!($pidFilePath = Configure::read('Queue.pidfilepath'))) {
378378
return;
@@ -428,7 +428,7 @@ protected function _findProgress($state, $query = [], $results = []) {
428428
'reference',
429429
'status',
430430
'progress',
431-
'failure_message'
431+
'failure_message',
432432
];
433433
if (isset($query['conditions']['exclude'])) {
434434
$exclude = $query['conditions']['exclude'];
@@ -437,8 +437,8 @@ protected function _findProgress($state, $query = [], $results = []) {
437437
$exclude = explode(',', $exclude);
438438
$query['conditions'][] = [
439439
'NOT' => [
440-
'reference' => $exclude
441-
]
440+
'reference' => $exclude,
441+
],
442442
];
443443
}
444444
if (isset($query['conditions']['task_group'])) {
@@ -451,7 +451,7 @@ protected function _findProgress($state, $query = [], $results = []) {
451451
foreach ($results as $k => $result) {
452452
$results[$k] = [
453453
'reference' => $result['reference'],
454-
'status' => $result['status']
454+
'status' => $result['status'],
455455
];
456456
if (!empty($result['progress'])) {
457457
$results[$k]['progress'] = $result['progress'];
@@ -480,9 +480,9 @@ public function clearDoublettes() {
480480
$numX = count($x);
481481
while ($start <= $numX) {
482482
$this->deleteAll([
483-
'id' => array_slice($x, $start, 10)
483+
'id' => array_slice($x, $start, 10),
484484
]);
485-
debug(array_slice($x, $start, 10));
485+
//debug(array_slice($x, $start, 10));
486486
$start = $start + 100;
487487
}
488488
}

src/Network/Email/QueueTransport.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
/**
1515
* Send mail using Queue plugin
16-
*
1716
*/
1817
class QueueTransport extends AbstractTransport {
1918

0 commit comments

Comments
 (0)