@@ -22,8 +22,7 @@ |
||
| 22 | 22 | |
| 23 | 23 | try { |
| 24 | 24 | |
| 25 | - $remove = empty($id) ? $manager->removeByName($name) : |
|
| 26 | - $manager->remove($id); |
|
| 25 | + $remove = empty($id) ? $manager->removeByName($name) : $manager->remove($id); |
|
| 27 | 26 | |
| 28 | 27 | } catch (InvalidArgumentException $iae) { |
| 29 | 28 | throw new RpcException("No record could be found", -31002); |
@@ -22,8 +22,7 @@ |
||
| 22 | 22 | |
| 23 | 23 | try { |
| 24 | 24 | |
| 25 | - $enable = empty($id) ? $manager->enableByName($name) : |
|
| 26 | - $manager->enable($id); |
|
| 25 | + $enable = empty($id) ? $manager->enableByName($name) : $manager->enable($id); |
|
| 27 | 26 | |
| 28 | 27 | } catch (InvalidArgumentException $iae) { |
| 29 | 28 | throw new RpcException("No record could be found", -31002); |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | $id = $params->get('id'); |
| 22 | 22 | $name = $params->get('name'); |
| 23 | 23 | |
| 24 | - $schedule = empty($id) ? $manager->getByName($name) : |
|
| 25 | - $manager->get($id); |
|
| 24 | + $schedule = empty($id) ? $manager->getByName($name) : $manager->get($id); |
|
| 26 | 25 | |
| 27 | 26 | if ( empty($schedule) ) throw new RpcException("No record could be found", -31002); |
| 28 | 27 | |
@@ -32,7 +31,7 @@ discard block |
||
| 32 | 31 | $schedule_message->setId($schedule->getId()); |
| 33 | 32 | $schedule_message->setName($schedule->getName()); |
| 34 | 33 | $schedule_message->setDescription($schedule->getDescription()); |
| 35 | - $schedule_message->setExpression((string)$schedule->getExpression()); |
|
| 34 | + $schedule_message->setExpression((string) $schedule->getExpression()); |
|
| 36 | 35 | $schedule_message->setEnabled($schedule->getEnabled()); |
| 37 | 36 | |
| 38 | 37 | $request_message = $request->convertToMessage(); |
@@ -22,8 +22,7 @@ |
||
| 22 | 22 | |
| 23 | 23 | try { |
| 24 | 24 | |
| 25 | - $disable = empty($id) ? $manager->disableByName($name) : |
|
| 26 | - $manager->disable($id); |
|
| 25 | + $disable = empty($id) ? $manager->disableByName($name) : $manager->disable($id); |
|
| 27 | 26 | |
| 28 | 27 | } catch (InvalidArgumentException $iae) { |
| 29 | 28 | throw new RpcException("No record could be found", -31002); |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | |
| 6 | 6 | class WorklogTransformer extends TransformerAbstract { |
| 7 | 7 | |
| 8 | - public function transform (Worklog $worklog) { |
|
| 8 | + public function transform(Worklog $worklog) { |
|
| 9 | 9 | |
| 10 | 10 | $parameters = $worklog->getParameters()->export(); |
| 11 | 11 | if ( isset($parameters['parent']) && $parameters['parent'] instanceof \Comodojo\Extender\Task\Result ) { |
@@ -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 | |