@@ -5,7 +5,7 @@ |
||
| 5 | 5 | |
| 6 | 6 | class Transformer extends TransformerAbstract { |
| 7 | 7 | |
| 8 | - public function transform (Worklog $worklog) { |
|
| 8 | + public function transform(Worklog $worklog) { |
|
| 9 | 9 | |
| 10 | 10 | return [ |
| 11 | 11 | 'id' => (int) $worklog->getId(), |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | $schedule->setFirstrun($schedule->getNextPlannedRun($time)); |
| 131 | 131 | |
| 132 | - $this->getEvents()->emit( new ScheduleEvent('add', $schedule) ); |
|
| 132 | + $this->getEvents()->emit(new ScheduleEvent('add', $schedule)); |
|
| 133 | 133 | |
| 134 | 134 | $em = $this->getEntityManager(); |
| 135 | 135 | |
@@ -147,13 +147,13 @@ discard block |
||
| 147 | 147 | $records = []; |
| 148 | 148 | $em = $this->getEntityManager(); |
| 149 | 149 | |
| 150 | - foreach ($schedules as $key => $schedule) { |
|
| 150 | + foreach ( $schedules as $key => $schedule ) { |
|
| 151 | 151 | |
| 152 | 152 | try { |
| 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->persist($schedule); |
| 159 | 159 | |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | if ( empty($old_schedule) ) throw new Exception("Cannot find schedule with id $id"); |
| 189 | 189 | |
| 190 | - $this->getEvents()->emit( new ScheduleEvent('edit', $schedule, $old_schedule) ); |
|
| 190 | + $this->getEvents()->emit(new ScheduleEvent('edit', $schedule, $old_schedule)); |
|
| 191 | 191 | |
| 192 | 192 | $old_schedule->merge($schedule); |
| 193 | 193 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | if ( is_null($schedule) ) throw new Exception("Cannot find scheule $id"); |
| 209 | 209 | |
| 210 | - $this->getEvents()->emit( new ScheduleEvent('remove', $schedule) ); |
|
| 210 | + $this->getEvents()->emit(new ScheduleEvent('remove', $schedule)); |
|
| 211 | 211 | |
| 212 | 212 | $em->remove($schedule); |
| 213 | 213 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | if ( is_null($schedule) ) throw new Exception("Cannot find scheule $name"); |
| 227 | 227 | |
| 228 | - $this->getEvents()->emit( new ScheduleEvent('remove', $schedule) ); |
|
| 228 | + $this->getEvents()->emit(new ScheduleEvent('remove', $schedule)); |
|
| 229 | 229 | |
| 230 | 230 | $em->remove($schedule); |
| 231 | 231 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | if ( is_null($schedule) ) throw new Exception("Cannot find scheule $id"); |
| 245 | 245 | |
| 246 | - $this->getEvents()->emit( new ScheduleEvent('enable', $schedule) ); |
|
| 246 | + $this->getEvents()->emit(new ScheduleEvent('enable', $schedule)); |
|
| 247 | 247 | |
| 248 | 248 | $schedule->setEnabled(true); |
| 249 | 249 | |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | if ( is_null($schedule) ) throw new Exception("Cannot find scheule $name"); |
| 265 | 265 | |
| 266 | - $this->getEvents()->emit( new ScheduleEvent('enable', $schedule) ); |
|
| 266 | + $this->getEvents()->emit(new ScheduleEvent('enable', $schedule)); |
|
| 267 | 267 | |
| 268 | 268 | $schedule->setEnabled(true); |
| 269 | 269 | |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | if ( is_null($schedule) ) throw new Exception("Cannot find scheule $id"); |
| 285 | 285 | |
| 286 | - $this->getEvents()->emit( new ScheduleEvent('disable', $schedule) ); |
|
| 286 | + $this->getEvents()->emit(new ScheduleEvent('disable', $schedule)); |
|
| 287 | 287 | |
| 288 | 288 | $schedule->setEnabled(false); |
| 289 | 289 | |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | |
| 304 | 304 | if ( is_null($schedule) ) throw new Exception("Cannot find scheule $name"); |
| 305 | 305 | |
| 306 | - $this->getEvents()->emit( new ScheduleEvent('disable', $schedule) ); |
|
| 306 | + $this->getEvents()->emit(new ScheduleEvent('disable', $schedule)); |
|
| 307 | 307 | |
| 308 | 308 | $schedule->setEnabled(false); |
| 309 | 309 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $thetask = $this->table->get($task)->getInstance($name, $parameters); |
| 91 | 91 | |
| 92 | - $this->events->emit( new TaskEvent('start', $thetask) ); |
|
| 92 | + $this->events->emit(new TaskEvent('start', $thetask)); |
|
| 93 | 93 | |
| 94 | 94 | $pid = $thetask->getPid(); |
| 95 | 95 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | $status = Worklog::STATUS_COMPLETE; |
| 114 | 114 | |
| 115 | - $this->events->emit( new TaskEvent('complete', $thetask) ); |
|
| 115 | + $this->events->emit(new TaskEvent('complete', $thetask)); |
|
| 116 | 116 | |
| 117 | 117 | } catch (TaskException $te) { |
| 118 | 118 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | $result = $te->getMessage(); |
| 122 | 122 | |
| 123 | - $this->events->emit( new TaskEvent('abort', $thetask) ); |
|
| 123 | + $this->events->emit(new TaskEvent('abort', $thetask)); |
|
| 124 | 124 | |
| 125 | 125 | } catch (Exception $e) { |
| 126 | 126 | |
@@ -128,13 +128,13 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | $result = $e->getMessage(); |
| 130 | 130 | |
| 131 | - $this->events->emit( new TaskEvent('error', $thetask) ); |
|
| 131 | + $this->events->emit(new TaskEvent('error', $thetask)); |
|
| 132 | 132 | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | $this->restoreErrorHandler(); |
| 136 | 136 | |
| 137 | - $this->events->emit( new TaskEvent('stop', $thetask) ); |
|
| 137 | + $this->events->emit(new TaskEvent('stop', $thetask)); |
|
| 138 | 138 | |
| 139 | 139 | $this->stopwatch->stop(); |
| 140 | 140 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | ob_end_clean(); |
| 170 | 170 | |
| 171 | - $this->events->emit( new TaskEvent(self::statusToEvent($status), $thetask, $result) ); |
|
| 171 | + $this->events->emit(new TaskEvent(self::statusToEvent($status), $thetask, $result)); |
|
| 172 | 172 | |
| 173 | 173 | return $result; |
| 174 | 174 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | $worklog->setJid($schedule); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - $this->events->emit( new WorklogEvent('open', $worklog) ); |
|
| 230 | + $this->events->emit(new WorklogEvent('open', $worklog)); |
|
| 231 | 231 | |
| 232 | 232 | $em->persist($worklog); |
| 233 | 233 | $em->flush(); |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | $worklog->setJid($schedule); |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | - $this->events->emit( new WorklogEvent('close', $worklog) ); |
|
| 269 | + $this->events->emit(new WorklogEvent('close', $worklog)); |
|
| 270 | 270 | |
| 271 | 271 | $em->persist($worklog); |
| 272 | 272 | $em->flush(); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | protected function statusToEvent($status) { |
| 283 | 283 | |
| 284 | - switch ($status) { |
|
| 284 | + switch ( $status ) { |
|
| 285 | 285 | case Worklog::STATUS_COMPLETE: |
| 286 | 286 | return 'complete'; |
| 287 | 287 | break; |