@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | $thetask = $task_def->getInstance($name, $parameters); |
| 96 | 96 | |
| 97 | - $this->events->emit( new TaskEvent('start', $thetask) ); |
|
| 97 | + $this->events->emit(new TaskEvent('start', $thetask)); |
|
| 98 | 98 | |
| 99 | 99 | $pid = $thetask->getPid(); |
| 100 | 100 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | $status = Worklog::STATUS_COMPLETE; |
| 119 | 119 | |
| 120 | - $this->events->emit( new TaskEvent('complete', $thetask) ); |
|
| 120 | + $this->events->emit(new TaskEvent('complete', $thetask)); |
|
| 121 | 121 | |
| 122 | 122 | } catch (TaskException $te) { |
| 123 | 123 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $result = $te->getMessage(); |
| 127 | 127 | |
| 128 | - $this->events->emit( new TaskEvent('abort', $thetask) ); |
|
| 128 | + $this->events->emit(new TaskEvent('abort', $thetask)); |
|
| 129 | 129 | |
| 130 | 130 | } catch (Exception $e) { |
| 131 | 131 | |
@@ -133,13 +133,13 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | $result = $e->getMessage(); |
| 135 | 135 | |
| 136 | - $this->events->emit( new TaskEvent('error', $thetask) ); |
|
| 136 | + $this->events->emit(new TaskEvent('error', $thetask)); |
|
| 137 | 137 | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | $this->restoreErrorHandler(); |
| 141 | 141 | |
| 142 | - $this->events->emit( new TaskEvent('stop', $thetask) ); |
|
| 142 | + $this->events->emit(new TaskEvent('stop', $thetask)); |
|
| 143 | 143 | |
| 144 | 144 | $this->stopwatch->stop(); |
| 145 | 145 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $this->worklog_id |
| 162 | 162 | ]); |
| 163 | 163 | |
| 164 | - $this->events->emit( new TaskEvent(self::statusToEvent($status), $thetask, $result) ); |
|
| 164 | + $this->events->emit(new TaskEvent(self::statusToEvent($status), $thetask, $result)); |
|
| 165 | 165 | |
| 166 | 166 | } catch (Exception $e) { |
| 167 | 167 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $worklog->setJid($schedule); |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | - $this->events->emit( new WorklogEvent('open', $worklog) ); |
|
| 250 | + $this->events->emit(new WorklogEvent('open', $worklog)); |
|
| 251 | 251 | |
| 252 | 252 | $em->persist($worklog); |
| 253 | 253 | $em->flush(); |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | $worklog->setJid($schedule); |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | - $this->events->emit( new WorklogEvent('close', $worklog) ); |
|
| 289 | + $this->events->emit(new WorklogEvent('close', $worklog)); |
|
| 290 | 290 | |
| 291 | 291 | $em->persist($worklog); |
| 292 | 292 | $em->flush(); |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | protected function statusToEvent($status) { |
| 303 | 303 | |
| 304 | - switch ($status) { |
|
| 304 | + switch ( $status ) { |
|
| 305 | 305 | case Worklog::STATUS_COMPLETE: |
| 306 | 306 | return 'complete'; |
| 307 | 307 | break; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | public function __destruct() { |
| 86 | 86 | |
| 87 | - if ($this->destroy_em) { |
|
| 87 | + if ( $this->destroy_em ) { |
|
| 88 | 88 | $em = $this->getEntityManager(); |
| 89 | 89 | $em->getConnection()->close(); |
| 90 | 90 | $em->close(); |
@@ -102,11 +102,11 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | public function flush(array $queue) { |
| 104 | 104 | |
| 105 | - $this->getEvents()->emit( new QueueEvent('flush', null, $queue) ); |
|
| 105 | + $this->getEvents()->emit(new QueueEvent('flush', null, $queue)); |
|
| 106 | 106 | |
| 107 | 107 | $em = $this->getEntityManager(); |
| 108 | 108 | |
| 109 | - foreach ($queue as $record) { |
|
| 109 | + foreach ( $queue as $record ) { |
|
| 110 | 110 | $em->remove($record); |
| 111 | 111 | } |
| 112 | 112 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | $records = []; |
| 134 | 134 | |
| 135 | - foreach ($queue as $name => $request) { |
|
| 135 | + foreach ( $queue as $name => $request ) { |
|
| 136 | 136 | $records[] = $request instanceof Request ? $this->doAddRequest($request, $em) : false; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | protected function doAddRequest(Request $request, EntityManager $em) { |
| 146 | 146 | |
| 147 | - $this->getEvents()->emit( new QueueEvent('add', $request) ); |
|
| 147 | + $this->getEvents()->emit(new QueueEvent('add', $request)); |
|
| 148 | 148 | |
| 149 | 149 | $record = new Queue(); |
| 150 | 150 | $record->setName($request->getName())->setRequest($request); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | public function __destruct() { |
| 80 | 80 | |
| 81 | - if ($this->destroy_em) { |
|
| 81 | + if ( $this->destroy_em ) { |
|
| 82 | 82 | $em = $this->getEntityManager(); |
| 83 | 83 | $em->getConnection()->close(); |
| 84 | 84 | $em->close(); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | $schedule->setFirstrun($schedule->getNextPlannedRun($time)); |
| 155 | 155 | |
| 156 | - $this->getEvents()->emit( new ScheduleEvent('add', $schedule) ); |
|
| 156 | + $this->getEvents()->emit(new ScheduleEvent('add', $schedule)); |
|
| 157 | 157 | |
| 158 | 158 | $em = $this->getEntityManager(); |
| 159 | 159 | |
@@ -171,13 +171,13 @@ discard block |
||
| 171 | 171 | $records = []; |
| 172 | 172 | $em = $this->getEntityManager(); |
| 173 | 173 | |
| 174 | - foreach ($schedules as $key => $schedule) { |
|
| 174 | + foreach ( $schedules as $key => $schedule ) { |
|
| 175 | 175 | |
| 176 | 176 | try { |
| 177 | 177 | |
| 178 | 178 | $schedule->setFirstrun($schedule->getNextPlannedRun($time)); |
| 179 | 179 | |
| 180 | - $this->getEvents()->emit( new ScheduleEvent('add', $schedule) ); |
|
| 180 | + $this->getEvents()->emit(new ScheduleEvent('add', $schedule)); |
|
| 181 | 181 | |
| 182 | 182 | $em->persist($schedule); |
| 183 | 183 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | if ( empty($old_schedule) ) throw new InvalidArgumentException("Cannot find schedule with id $id"); |
| 213 | 213 | |
| 214 | - $this->getEvents()->emit( new ScheduleEvent('edit', $schedule, $old_schedule) ); |
|
| 214 | + $this->getEvents()->emit(new ScheduleEvent('edit', $schedule, $old_schedule)); |
|
| 215 | 215 | |
| 216 | 216 | $old_schedule->merge($schedule); |
| 217 | 217 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | |
| 232 | 232 | if ( is_null($schedule) ) throw new InvalidArgumentException("Cannot find scheule $id"); |
| 233 | 233 | |
| 234 | - $this->getEvents()->emit( new ScheduleEvent('remove', $schedule) ); |
|
| 234 | + $this->getEvents()->emit(new ScheduleEvent('remove', $schedule)); |
|
| 235 | 235 | |
| 236 | 236 | $em->remove($schedule); |
| 237 | 237 | |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | if ( is_null($schedule) ) throw new InvalidArgumentException("Cannot find scheule $name"); |
| 251 | 251 | |
| 252 | - $this->getEvents()->emit( new ScheduleEvent('remove', $schedule) ); |
|
| 252 | + $this->getEvents()->emit(new ScheduleEvent('remove', $schedule)); |
|
| 253 | 253 | |
| 254 | 254 | $em->remove($schedule); |
| 255 | 255 | |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | if ( is_null($schedule) ) throw new InvalidArgumentException("Cannot find scheule $id"); |
| 269 | 269 | |
| 270 | - $this->getEvents()->emit( new ScheduleEvent('enable', $schedule) ); |
|
| 270 | + $this->getEvents()->emit(new ScheduleEvent('enable', $schedule)); |
|
| 271 | 271 | |
| 272 | 272 | $schedule->setEnabled(true); |
| 273 | 273 | |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | if ( is_null($schedule) ) throw new InvalidArgumentException("Cannot find scheule $name"); |
| 289 | 289 | |
| 290 | - $this->getEvents()->emit( new ScheduleEvent('enable', $schedule) ); |
|
| 290 | + $this->getEvents()->emit(new ScheduleEvent('enable', $schedule)); |
|
| 291 | 291 | |
| 292 | 292 | $schedule->setEnabled(true); |
| 293 | 293 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | if ( is_null($schedule) ) throw new InvalidArgumentException("Cannot find scheule $id"); |
| 309 | 309 | |
| 310 | - $this->getEvents()->emit( new ScheduleEvent('disable', $schedule) ); |
|
| 310 | + $this->getEvents()->emit(new ScheduleEvent('disable', $schedule)); |
|
| 311 | 311 | |
| 312 | 312 | $schedule->setEnabled(false); |
| 313 | 313 | |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | |
| 328 | 328 | if ( is_null($schedule) ) throw new InvalidArgumentException("Cannot find scheule $name"); |
| 329 | 329 | |
| 330 | - $this->getEvents()->emit( new ScheduleEvent('disable', $schedule) ); |
|
| 330 | + $this->getEvents()->emit(new ScheduleEvent('disable', $schedule)); |
|
| 331 | 331 | |
| 332 | 332 | $schedule->setEnabled(false); |
| 333 | 333 | |