Skip to content

Commit 427f89f

Browse files
ph4r05StyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent 9e3c483 commit 427f89f

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

src/Queue/Misc/WorkerTracker.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
* Created by PhpStorm.
44
* User: dusanklinec
55
* Date: 26/01/2018
6-
* Time: 13:01
6+
* Time: 13:01.
77
*/
88

99
namespace ph4r05\LaravelDatabasePh4\Queue\Misc;
1010

1111
/**
12-
* Class WorkersTracker
12+
* Class WorkersTracker.
1313
*
1414
* Uses database table to track active workers currently working on the given queue.
1515
* Worker register itself to the DB when created, updates his record during the progress
@@ -18,24 +18,25 @@
1818
*
1919
* The number of active workers per queue helps to optimize parameter setup for optimistic
2020
* queue locking.
21-
*
22-
* @package ph4r05\LaravelDatabasePh4\Queue\Misc
2321
*/
2422
class WorkerTracker
2523
{
2624
/**
27-
* queue -> last ping time
25+
* queue -> last ping time.
26+
*
2827
* @var array
2928
*/
3029
protected $lastPingMap = [];
3130

3231
/**
33-
* queue -> active workers list
32+
* queue -> active workers list.
33+
*
3434
* @var array
3535
*/
3636
protected $workersMap = [];
3737

38-
public function __construct(){
38+
public function __construct()
39+
{
3940
// TODO: implement
4041
}
4142

@@ -46,7 +47,8 @@ public function __construct(){
4647
* @param $queue
4748
* @param $force bool - override caching, enforce db write
4849
*/
49-
public function tick($queue, $force = false){
50+
public function tick($queue, $force = false)
51+
{
5052
// TODO: implement
5153
}
5254

@@ -55,7 +57,8 @@ public function tick($queue, $force = false){
5557
*
5658
* @param $queues
5759
*/
58-
public function create($queues){
60+
public function create($queues)
61+
{
5962
// TODO: implement
6063
}
6164

@@ -65,19 +68,18 @@ public function create($queues){
6568
*
6669
* @param $queues
6770
*/
68-
public function destroy($queues){
71+
public function destroy($queues)
72+
{
6973
// TODO: implement
7074
}
7175

7276
/**
7377
* Returns number of workers active for the queue.
78+
*
7479
* @param $queue
7580
*/
76-
public function getNumWorkers($queue){
81+
public function getNumWorkers($queue)
82+
{
7783
// TODO: implement
7884
}
79-
80-
8185
}
82-
83-

src/Queue/OptimisticDatabaseQueue.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function pop($queue = null)
142142
// Get set of first N available jobs
143143
$jobs = $this->getNextAvailableJobs($queue, $numJobs);
144144
if ($jobs->isEmpty()) {
145-
return null;
145+
return;
146146
}
147147

148148
// Random pick from the jobs, depending on the strategy
@@ -158,14 +158,14 @@ public function pop($queue = null)
158158
$ctr += 1;
159159
}
160160
} while ($job !== null);
161-
return null;
162161
}
163162

164163
/**
165164
* Get the next available job for the queue.
166165
*
167166
* @param string|null $queue
168-
* @param int $limit
167+
* @param int $limit
168+
*
169169
* @return \Illuminate\Support\Collection
170170
*/
171171
protected function getNextAvailableJobs($queue, $limit = 1)
@@ -195,7 +195,7 @@ protected function marshalJob($queue, $job)
195195
{
196196
$job = $this->markJobAsReserved($job);
197197
if (empty($job)) {
198-
return null;
198+
return;
199199
}
200200

201201
return new DatabaseJob(

0 commit comments

Comments
 (0)