@@ -57,8 +57,7 @@ |
||
| 57 | 57 | if ($job->getStatus() === BaseJob::STATUS_SUCCESS) { |
| 58 | 58 | $this->beanstalkd |
| 59 | 59 | ->delete($job); |
| 60 | - } |
|
| 61 | - else { |
|
| 60 | + } else { |
|
| 62 | 61 | $this->beanstalkd |
| 63 | 62 | ->bury($job); |
| 64 | 63 | } |
@@ -179,8 +179,7 @@ |
||
| 179 | 179 | |
| 180 | 180 | if ($prioritize) { |
| 181 | 181 | $qb->sort('priority', 'asc'); |
| 182 | - } |
|
| 183 | - else { |
|
| 182 | + } else { |
|
| 184 | 183 | $qb->sort('when', 'asc'); |
| 185 | 184 | } |
| 186 | 185 | |
@@ -259,8 +259,7 @@ |
||
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | return true; |
| 262 | - } |
|
| 263 | - else { |
|
| 262 | + } else { |
|
| 264 | 263 | return !is_object($args); |
| 265 | 264 | } |
| 266 | 265 | } |
@@ -45,8 +45,7 @@ |
||
| 45 | 45 | if ($time) { |
| 46 | 46 | $dateTime = new \DateTime(); |
| 47 | 47 | $dateTime->setTimestamp($time); |
| 48 | - } |
|
| 49 | - else { |
|
| 48 | + } else { |
|
| 50 | 49 | $dateTime = null; |
| 51 | 50 | } |
| 52 | 51 | |
@@ -73,8 +73,7 @@ |
||
| 73 | 73 | // Job finshed successfuly... do we remove the job from database? |
| 74 | 74 | $job->setStatus(Job::STATUS_SUCCESS); |
| 75 | 75 | $job->setMessage(null); |
| 76 | - } |
|
| 77 | - catch (\Exception $e) { |
|
| 76 | + } catch (\Exception $e) { |
|
| 78 | 77 | if ($this->logger) { |
| 79 | 78 | $this->logger->debug("Failed: {$job->getClassName()}->{$job->getMethod()}\n{$e->getMessage()}"); |
| 80 | 79 | } |
@@ -20,12 +20,17 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function fibonacci($n) |
| 22 | 22 | { |
| 23 | - if($n == 0) |
|
| 24 | - return 0; //F0 |
|
| 25 | - elseif ($n == 1) |
|
| 26 | - return 1; //F1 |
|
| 27 | - else |
|
| 28 | - return $this->fibonacci($n - 1) + $this->fibonacci($n - 2); |
|
| 23 | + if($n == 0) { |
|
| 24 | + return 0; |
|
| 25 | + } |
|
| 26 | + //F0 |
|
| 27 | + elseif ($n == 1) { |
|
| 28 | + return 1; |
|
| 29 | + } |
|
| 30 | + //F1 |
|
| 31 | + else { |
|
| 32 | + return $this->fibonacci($n - 1) + $this->fibonacci($n - 2); |
|
| 33 | + } |
|
| 29 | 34 | } |
| 30 | 35 | |
| 31 | 36 | public function getName() { |
@@ -115,8 +115,7 @@ |
||
| 115 | 115 | if ($priority) { |
| 116 | 116 | $this->assertEquals($priority, $job->getPriority(), |
| 117 | 117 | "Priority should be the same."); |
| 118 | - } |
|
| 119 | - else { |
|
| 118 | + } else { |
|
| 120 | 119 | $this->assertNull($job->getPriority(), "Priority should be null"); |
| 121 | 120 | } |
| 122 | 121 | |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | if ($job->getStatus() === BaseJob::STATUS_SUCCESS) { |
| 58 | 58 | $this->beanstalkd |
| 59 | 59 | ->delete($job); |
| 60 | - } |
|
| 61 | - else { |
|
| 60 | + } else { |
|
| 62 | 61 | $this->beanstalkd |
| 63 | 62 | ->bury($job); |
| 64 | 63 | } |