@@ -128,9 +128,9 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | public function addBulk(array $requests) { |
| 130 | 130 | |
| 131 | - foreach ($requests as $id => $request) { |
|
| 131 | + foreach ( $requests as $id => $request ) { |
|
| 132 | 132 | |
| 133 | - if ($request instanceof \Comodojo\Extender\Task\Request) { |
|
| 133 | + if ( $request instanceof \Comodojo\Extender\Task\Request ) { |
|
| 134 | 134 | $this->add($request); |
| 135 | 135 | } else { |
| 136 | 136 | $this->logger->error("Skipping invalid request with local id $id: class mismatch"); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | $this->installErrorHandler(); |
| 165 | 165 | |
| 166 | - foreach ($this->tracker->getQueued() as $uid => $request) { |
|
| 166 | + foreach ( $this->tracker->getQueued() as $uid => $request ) { |
|
| 167 | 167 | |
| 168 | 168 | if ( $this->multithread === false ) { |
| 169 | 169 | |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | if ( $this->max_childs > 0 && $this->tracker->countRunning() >= $this->max_childs ) { |
| 193 | 193 | |
| 194 | - while( $this->tracker->countRunning() >= $this->max_childs ) { |
|
| 194 | + while ( $this->tracker->countRunning() >= $this->max_childs ) { |
|
| 195 | 195 | |
| 196 | 196 | $this->catcher(); |
| 197 | 197 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $thetask = $this->table->get($task)->getInstance($name, $parameters); |
| 90 | 90 | |
| 91 | - $this->events->emit( new TaskEvent('start', $thetask) ); |
|
| 91 | + $this->events->emit(new TaskEvent('start', $thetask)); |
|
| 92 | 92 | |
| 93 | 93 | $pid = $thetask->getPid(); |
| 94 | 94 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | $status = Worklog::STATUS_COMPLETE; |
| 113 | 113 | |
| 114 | - $this->events->emit( new TaskEvent('complete', $thetask) ); |
|
| 114 | + $this->events->emit(new TaskEvent('complete', $thetask)); |
|
| 115 | 115 | |
| 116 | 116 | } catch (TaskException $te) { |
| 117 | 117 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | $result = $te->getMessage(); |
| 121 | 121 | |
| 122 | - $this->events->emit( new TaskEvent('abort', $thetask) ); |
|
| 122 | + $this->events->emit(new TaskEvent('abort', $thetask)); |
|
| 123 | 123 | |
| 124 | 124 | } catch (Exception $e) { |
| 125 | 125 | |
@@ -127,13 +127,13 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $result = $e->getMessage(); |
| 129 | 129 | |
| 130 | - $this->events->emit( new TaskEvent('error', $thetask) ); |
|
| 130 | + $this->events->emit(new TaskEvent('error', $thetask)); |
|
| 131 | 131 | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | $this->restoreErrorHandler(); |
| 135 | 135 | |
| 136 | - $this->events->emit( new TaskEvent('stop', $thetask) ); |
|
| 136 | + $this->events->emit(new TaskEvent('stop', $thetask)); |
|
| 137 | 137 | |
| 138 | 138 | $this->stopwatch->stop(); |
| 139 | 139 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | ob_end_clean(); |
| 169 | 169 | |
| 170 | - $this->events->emit( new TaskEvent(self::statusToEvent($status), $thetask, $result) ); |
|
| 170 | + $this->events->emit(new TaskEvent(self::statusToEvent($status), $thetask, $result)); |
|
| 171 | 171 | |
| 172 | 172 | return $result; |
| 173 | 173 | |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | |
| 277 | 277 | protected function statusToEvent($status) { |
| 278 | 278 | |
| 279 | - switch ($status) { |
|
| 279 | + switch ( $status ) { |
|
| 280 | 280 | case Worklog::STATUS_COMPLETE: |
| 281 | 281 | return 'complete'; |
| 282 | 282 | break; |