Passed
Push — master ( fdca42...7dd147 )
by Hennik
03:23 queued 10s
created
lib/Resque/Worker.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -212,8 +212,7 @@  discard block
 block discarded – undo
212 212
 					$this->logger->log(Psr\Log\LogLevel::INFO, 'Sleeping for {interval}', array('interval' => $interval));
213 213
 					if($this->paused) {
214 214
 						$this->updateProcLine('Paused');
215
-					}
216
-					else {
215
+					} else {
217 216
 						$this->updateProcLine('Waiting');
218 217
 					}
219 218
 
@@ -272,8 +271,7 @@  discard block
 block discarded – undo
272 271
 					$job->fail(new Resque_Job_DirtyExitException(
273 272
 						'Job exited with exit code ' . $exitStatus
274 273
 					));
275
-				}
276
-				else
274
+				} else
277 275
 				{
278 276
 					if (in_array($job->getStatus(), array(Resque_Job_Status::STATUS_WAITING, Resque_Job_Status::STATUS_RUNNING)))
279 277
 					{
@@ -301,13 +299,11 @@  discard block
 block discarded – undo
301 299
 		try {
302 300
 			Resque_Event::trigger('afterFork', $job);
303 301
 			$result = $job->perform();
304
-		}
305
-		catch(Exception $e) {
302
+		} catch(Exception $e) {
306 303
 			$this->logger->log(Psr\Log\LogLevel::CRITICAL, '{job} has failed {exception}', array('job' => $job, 'exception' => $e));
307 304
 			$job->fail($e);
308 305
 			return;
309
-		}
310
-		catch(Error $e) {
306
+		} catch(Error $e) {
311 307
 			$this->logger->log(Psr\Log\LogLevel::CRITICAL, '{job} has failed {exception}', array('job' => $job, 'exception' => $e));
312 308
 			$job->fail($e);
313 309
 			return;
@@ -405,8 +401,7 @@  discard block
 block discarded – undo
405 401
 		$processTitle = static::$processPrefix . '-' . Resque::VERSION . ' (' . implode(',', $this->queues) . '): ' . $status;
406 402
 		if(function_exists('cli_set_process_title') && PHP_OS !== 'Darwin') {
407 403
 			cli_set_process_title($processTitle);
408
-		}
409
-		else if(function_exists('setproctitle')) {
404
+		} else if(function_exists('setproctitle')) {
410 405
 			setproctitle($processTitle);
411 406
 		}
412 407
 	}
@@ -496,8 +491,7 @@  discard block
 block discarded – undo
496 491
 			$this->logger->log(Psr\Log\LogLevel::DEBUG, 'Child {child} found, killing.', array('child' => $this->child));
497 492
 			posix_kill($this->child, SIGKILL);
498 493
 			$this->child = null;
499
-		}
500
-		else {
494
+		} else {
501 495
 			$this->logger->log(Psr\Log\LogLevel::INFO, 'Child {child} not found, restarting.', array('child' => $this->child));
502 496
 			$this->shutdown();
503 497
 		}
@@ -542,8 +536,7 @@  discard block
 block discarded – undo
542 536
 				$line = preg_replace('/\s+/m', ' ', $line);
543 537
 				list(,,$pids[]) = explode(' ', trim($line), 3);
544 538
 			}
545
-		}
546
-		else {
539
+		} else {
547 540
 			exec('ps -A -o pid,args | grep [r]esque', $cmdOutput);
548 541
 			foreach($cmdOutput as $line) {
549 542
 				list($pids[],) = explode(' ', trim($line), 2);
@@ -628,8 +621,7 @@  discard block
 block discarded – undo
628 621
 		$job = Resque::redis()->get('worker:' . $this);
629 622
 		if(!$job) {
630 623
 			return array();
631
-		}
632
-		else {
624
+		} else {
633 625
 			return json_decode($job, true);
634 626
 		}
635 627
 	}
Please login to merge, or discard this patch.
lib/Resque/Redis.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -115,14 +115,11 @@  discard block
 block discarded – undo
115 115
 		try {
116 116
 			if (is_object($client)) {
117 117
 				$this->driver = $client;
118
-			}
119
-			elseif (is_object($server)) {
118
+			} elseif (is_object($server)) {
120 119
 				$this->driver = $server;
121
-			}
122
-			elseif (is_array($server)) {
120
+			} elseif (is_array($server)) {
123 121
 				$this->driver = new Credis_Cluster($server);
124
-			}
125
-			else {
122
+			} else {
126 123
 				list($host, $port, $dsnDatabase, $user, $password, $options) = self::parseDsn($server);
127 124
 				// $user is not used, only $password
128 125
 
@@ -147,8 +144,7 @@  discard block
 block discarded – undo
147 144
 			if ($database !== null) {
148 145
 				$this->driver->select($database);
149 146
 			}
150
-		}
151
-		catch(CredisException $e) {
147
+		} catch(CredisException $e) {
152 148
 			throw new Resque_RedisException('Error communicating with Redis: ' . $e->getMessage(), 0, $e);
153 149
 		}
154 150
 	}
@@ -243,15 +239,13 @@  discard block
 block discarded – undo
243 239
 				foreach ($args[0] AS $i => $v) {
244 240
 					$args[0][$i] = self::$defaultNamespace . $v;
245 241
 				}
246
-			}
247
-			else {
242
+			} else {
248 243
 				$args[0] = self::$defaultNamespace . $args[0];
249 244
 			}
250 245
 		}
251 246
 		try {
252 247
 			return $this->driver->__call($name, $args);
253
-		}
254
-		catch (CredisException $e) {
248
+		} catch (CredisException $e) {
255 249
 			throw new Resque_RedisException('Error communicating with Redis: ' . $e->getMessage(), 0, $e);
256 250
 		}
257 251
 	}
Please login to merge, or discard this patch.