@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | $mmanager->add( |
36 | 36 | RpcMethod::create( |
37 | 37 | "scheduler.refresh", |
38 | - 'Comodojo\Extender\Socket\Commands\Scheduler\Refresh::execute', |
|
39 | - $daemon) |
|
38 | + 'Comodojo\Extender\Socket\Commands\Scheduler\Refresh::execute', |
|
39 | + $daemon) |
|
40 | 40 | ->setDescription("Refresh current scheduler's schedule") |
41 | 41 | ->setReturnType('boolean') |
42 | 42 | ); |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | $mmanager->add( |
45 | 45 | RpcMethod::create( |
46 | 46 | "scheduler.info", |
47 | - 'Comodojo\Extender\Socket\Commands\Scheduler\Info::execute', |
|
48 | - $daemon) |
|
47 | + 'Comodojo\Extender\Socket\Commands\Scheduler\Info::execute', |
|
48 | + $daemon) |
|
49 | 49 | ->setDescription("Show current scheduler status") |
50 | 50 | ->setReturnType('array') |
51 | 51 | ); |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | $mmanager->add( |
54 | 54 | RpcMethod::create( |
55 | 55 | "scheduler.add", |
56 | - 'Comodojo\Extender\Socket\Commands\Scheduler\Add::execute', |
|
57 | - $daemon) |
|
56 | + 'Comodojo\Extender\Socket\Commands\Scheduler\Add::execute', |
|
57 | + $daemon) |
|
58 | 58 | ->setDescription("Set new schedule") |
59 | 59 | ->addParameter('struct', 'schedule') |
60 | 60 | ->addParameter('struct', 'request') |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | $mmanager->add( |
65 | 65 | RpcMethod::create( |
66 | 66 | "scheduler.list", |
67 | - 'Comodojo\Extender\Socket\Commands\Scheduler\GetList::execute', |
|
68 | - $daemon) |
|
67 | + 'Comodojo\Extender\Socket\Commands\Scheduler\GetList::execute', |
|
68 | + $daemon) |
|
69 | 69 | ->setDescription("List all installed schedules") |
70 | 70 | ->setReturnType('array') |
71 | 71 | ); |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | $mmanager->add( |
74 | 74 | RpcMethod::create( |
75 | 75 | "scheduler.get", |
76 | - 'Comodojo\Extender\Socket\Commands\Scheduler\Get::execute', |
|
77 | - $daemon) |
|
76 | + 'Comodojo\Extender\Socket\Commands\Scheduler\Get::execute', |
|
77 | + $daemon) |
|
78 | 78 | ->setDescription("Get a schedule and related task request by id (int) or name (string)") |
79 | 79 | ->addParameter('int', 'id') |
80 | 80 | ->setReturnType('array') |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | $mmanager->add( |
87 | 87 | RpcMethod::create( |
88 | 88 | "scheduler.edit", |
89 | - 'Comodojo\Extender\Socket\Commands\Scheduler\Edit::execute', |
|
90 | - $daemon) |
|
89 | + 'Comodojo\Extender\Socket\Commands\Scheduler\Edit::execute', |
|
90 | + $daemon) |
|
91 | 91 | ->setDescription("Edit a schedule") |
92 | 92 | ->addParameter('struct', 'schedule') |
93 | 93 | ->addParameter('struct', 'request') |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | $mmanager->add( |
98 | 98 | RpcMethod::create( |
99 | 99 | "scheduler.disable", |
100 | - 'Comodojo\Extender\Socket\Commands\Scheduler\Disable::execute', |
|
101 | - $daemon) |
|
100 | + 'Comodojo\Extender\Socket\Commands\Scheduler\Disable::execute', |
|
101 | + $daemon) |
|
102 | 102 | ->setDescription("Disable a schedule by id (int) or name (string)") |
103 | 103 | ->addParameter('int', 'id') |
104 | 104 | ->setReturnType('boolean') |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | $mmanager->add( |
111 | 111 | RpcMethod::create( |
112 | 112 | "scheduler.enable", |
113 | - 'Comodojo\Extender\Socket\Commands\Scheduler\Enable::execute', |
|
114 | - $daemon) |
|
113 | + 'Comodojo\Extender\Socket\Commands\Scheduler\Enable::execute', |
|
114 | + $daemon) |
|
115 | 115 | ->setDescription("Enable a schedule by id (int) or name (string)") |
116 | 116 | ->addParameter('int', 'id') |
117 | 117 | ->setReturnType('boolean') |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | $mmanager->add( |
124 | 124 | RpcMethod::create( |
125 | 125 | "scheduler.remove", |
126 | - 'Comodojo\Extender\Socket\Commands\Scheduler\Remove::execute', |
|
127 | - $daemon) |
|
126 | + 'Comodojo\Extender\Socket\Commands\Scheduler\Remove::execute', |
|
127 | + $daemon) |
|
128 | 128 | ->setDescription("Remove a schedule by id (int) or name (string)") |
129 | 129 | ->addParameter('int', 'id') |
130 | 130 | ->setReturnType('boolean') |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | $mmanager->add( |
141 | 141 | RpcMethod::create( |
142 | 142 | "queue.info", |
143 | - 'Comodojo\Extender\Socket\Commands\Queue\Info::execute', |
|
144 | - $daemon) |
|
143 | + 'Comodojo\Extender\Socket\Commands\Queue\Info::execute', |
|
144 | + $daemon) |
|
145 | 145 | ->setDescription("Get current queue status") |
146 | 146 | ->setReturnType('array') |
147 | 147 | ); |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | $mmanager->add( |
150 | 150 | RpcMethod::create( |
151 | 151 | "queue.add", |
152 | - 'Comodojo\Extender\Socket\Commands\Queue\Add::execute', |
|
153 | - $daemon) |
|
152 | + 'Comodojo\Extender\Socket\Commands\Queue\Add::execute', |
|
153 | + $daemon) |
|
154 | 154 | ->setDescription("Push new request to queue") |
155 | 155 | ->addParameter('struct', 'request') |
156 | 156 | ->setReturnType('string') |
@@ -159,8 +159,8 @@ discard block |
||
159 | 159 | $mmanager->add( |
160 | 160 | RpcMethod::create( |
161 | 161 | "queue.addBulk", |
162 | - 'Comodojo\Extender\Socket\Commands\Queue\AddBulk::execute', |
|
163 | - $daemon) |
|
162 | + 'Comodojo\Extender\Socket\Commands\Queue\AddBulk::execute', |
|
163 | + $daemon) |
|
164 | 164 | ->setDescription("Push new requests to queue") |
165 | 165 | ->addParameter('array', 'requests') |
166 | 166 | ->setReturnType('array') |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | $mmanager->add( |
174 | 174 | RpcMethod::create( |
175 | 175 | "worklog.count", |
176 | - 'Comodojo\Extender\Socket\Commands\Worklog\Count::execute', |
|
177 | - $daemon) |
|
176 | + 'Comodojo\Extender\Socket\Commands\Worklog\Count::execute', |
|
177 | + $daemon) |
|
178 | 178 | ->setDescription("Count recorded worklogs") |
179 | 179 | ->setReturnType('int') |
180 | 180 | ); |
@@ -182,8 +182,8 @@ discard block |
||
182 | 182 | $mmanager->add( |
183 | 183 | RpcMethod::create( |
184 | 184 | "worklog.list", |
185 | - 'Comodojo\Extender\Socket\Commands\Worklog\GetList::execute', |
|
186 | - $daemon) |
|
185 | + 'Comodojo\Extender\Socket\Commands\Worklog\GetList::execute', |
|
186 | + $daemon) |
|
187 | 187 | ->setDescription("Get a list of worklog according to (optional) filter") |
188 | 188 | ->setReturnType('array') |
189 | 189 | ->addSignature() |
@@ -194,8 +194,8 @@ discard block |
||
194 | 194 | $mmanager->add( |
195 | 195 | RpcMethod::create( |
196 | 196 | "worklog.byId", |
197 | - 'Comodojo\Extender\Socket\Commands\Worklog\ById::execute', |
|
198 | - $daemon) |
|
197 | + 'Comodojo\Extender\Socket\Commands\Worklog\ById::execute', |
|
198 | + $daemon) |
|
199 | 199 | ->setDescription("Get a worklog from id") |
200 | 200 | ->addParameter('int', 'id') |
201 | 201 | ->setReturnType('struct') |
@@ -204,8 +204,8 @@ discard block |
||
204 | 204 | $mmanager->add( |
205 | 205 | RpcMethod::create( |
206 | 206 | "worklog.byUid", |
207 | - 'Comodojo\Extender\Socket\Commands\Worklog\ByUid::execute', |
|
208 | - $daemon) |
|
207 | + 'Comodojo\Extender\Socket\Commands\Worklog\ByUid::execute', |
|
208 | + $daemon) |
|
209 | 209 | ->setDescription("Get a worklog from uid") |
210 | 210 | ->addParameter('string', 'uid') |
211 | 211 | ->setReturnType('struct') |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | $mmanager->add( |
215 | 215 | RpcMethod::create( |
216 | 216 | "worklog.byJid", |
217 | - 'Comodojo\Extender\Socket\Commands\Worklog\ByJid::execute', |
|
218 | - $daemon) |
|
217 | + 'Comodojo\Extender\Socket\Commands\Worklog\ByJid::execute', |
|
218 | + $daemon) |
|
219 | 219 | ->setDescription("Get a list of worklog from job id according to (optional) filter") |
220 | 220 | ->addParameter('int', 'jid') |
221 | 221 | ->setReturnType('array') |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | $mmanager->add( |
229 | 229 | RpcMethod::create( |
230 | 230 | "worklog.byPid", |
231 | - 'Comodojo\Extender\Socket\Commands\Worklog\ByPid::execute', |
|
232 | - $daemon) |
|
231 | + 'Comodojo\Extender\Socket\Commands\Worklog\ByPid::execute', |
|
232 | + $daemon) |
|
233 | 233 | ->setDescription("Get a list of worklog from system pid according to (optional) filter") |
234 | 234 | ->addParameter('int', 'pid') |
235 | 235 | ->setReturnType('array') |
@@ -242,8 +242,8 @@ discard block |
||
242 | 242 | $mmanager->add( |
243 | 243 | RpcMethod::create( |
244 | 244 | "worklog.byPuid", |
245 | - 'Comodojo\Extender\Socket\Commands\Worklog\ByPuid::execute', |
|
246 | - $daemon) |
|
245 | + 'Comodojo\Extender\Socket\Commands\Worklog\ByPuid::execute', |
|
246 | + $daemon) |
|
247 | 247 | ->setDescription("Get worklogs from parent uid") |
248 | 248 | ->addParameter('string', 'puid') |
249 | 249 | ->setReturnType('array') |
@@ -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 |