@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $id = Resque::generateJobId(); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - if($args !== null && !is_array($args)) { |
|
| 67 | + if ($args !== null && !is_array($args)) { |
|
| 68 | 68 | throw new InvalidArgumentException( |
| 69 | 69 | 'Supplied $args must be an array.' |
| 70 | 70 | ); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | 'queue_time' => microtime(true), |
| 78 | 78 | )); |
| 79 | 79 | |
| 80 | - if($monitor) { |
|
| 80 | + if ($monitor) { |
|
| 81 | 81 | Resque_Job_Status::create($id, $prefix); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | public static function reserve($queue) |
| 95 | 95 | { |
| 96 | 96 | $payload = Resque::pop($queue); |
| 97 | - if(!is_array($payload)) { |
|
| 97 | + if (!is_array($payload)) { |
|
| 98 | 98 | return false; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | $item = Resque::blpop($queues, $timeout); |
| 115 | 115 | |
| 116 | - if(!is_array($item)) { |
|
| 116 | + if (!is_array($item)) { |
|
| 117 | 117 | return false; |
| 118 | 118 | } |
| 119 | 119 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function updateStatus($status, $result = null) |
| 129 | 129 | { |
| 130 | - if(empty($this->payload['id'])) { |
|
| 130 | + if (empty($this->payload['id'])) { |
|
| 131 | 131 | return; |
| 132 | 132 | } |
| 133 | 133 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function getStatus() |
| 144 | 144 | { |
| 145 | - if(empty($this->payload['id'])) { |
|
| 145 | + if (empty($this->payload['id'])) { |
|
| 146 | 146 | return null; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -194,20 +194,20 @@ discard block |
||
| 194 | 194 | Resque_Event::trigger('beforePerform', $this); |
| 195 | 195 | |
| 196 | 196 | $instance = $this->getInstance(); |
| 197 | - if(is_callable([$instance, 'setUp'])) { |
|
| 197 | + if (is_callable([$instance, 'setUp'])) { |
|
| 198 | 198 | $instance->setUp(); |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | $result = $instance->perform(); |
| 202 | 202 | |
| 203 | - if(is_callable([$instance, 'tearDown'])) { |
|
| 203 | + if (is_callable([$instance, 'tearDown'])) { |
|
| 204 | 204 | $instance->tearDown(); |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | Resque_Event::trigger('afterPerform', $this); |
| 208 | 208 | } |
| 209 | 209 | // beforePerform/setUp have said don't perform this job. Return. |
| 210 | - catch(Resque_Job_DontPerform $e) { |
|
| 210 | + catch (Resque_Job_DontPerform $e) { |
|
| 211 | 211 | $result = false; |
| 212 | 212 | } |
| 213 | 213 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | ); |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - if(!empty($job->payload['id'])) { |
|
| 246 | + if (!empty($job->payload['id'])) { |
|
| 247 | 247 | Resque_Job_PID::del($job->payload['id']); |
| 248 | 248 | } |
| 249 | 249 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $monitor = false; |
| 261 | 261 | if (!empty($this->payload['id'])) { |
| 262 | 262 | $status = new Resque_Job_Status($this->payload['id'], $this->getPrefix()); |
| 263 | - if($status->isTracking()) { |
|
| 263 | + if ($status->isTracking()) { |
|
| 264 | 264 | $monitor = true; |
| 265 | 265 | } |
| 266 | 266 | } |
@@ -276,13 +276,13 @@ discard block |
||
| 276 | 276 | public function __toString() |
| 277 | 277 | { |
| 278 | 278 | $name = array( |
| 279 | - 'Job{' . $this->queue .'}' |
|
| 279 | + 'Job{' . $this->queue . '}' |
|
| 280 | 280 | ); |
| 281 | - if(!empty($this->payload['id'])) { |
|
| 281 | + if (!empty($this->payload['id'])) { |
|
| 282 | 282 | $name[] = 'ID: ' . $this->payload['id']; |
| 283 | 283 | } |
| 284 | 284 | $name[] = $this->payload['class']; |
| 285 | - if(!empty($this->payload['args'])) { |
|
| 285 | + if (!empty($this->payload['args'])) { |
|
| 286 | 286 | $name[] = json_encode($this->payload['args']); |
| 287 | 287 | } |
| 288 | 288 | return '(' . implode(' | ', $name) . ')'; |