Test Failed
Push — master ( c6f287...66f507 )
by Marco
04:33
created
src/Comodojo/Extender/Socket/Commands/Scheduler/Remove.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Comodojo/Extender/Socket/Commands/Scheduler/Enable.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Comodojo/Extender/Socket/Commands/Scheduler/Get.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/Comodojo/Extender/Socket/Commands/Scheduler/Disable.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Comodojo/Extender/Socket/SocketInjector.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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')
Please login to merge, or discard this patch.
src/Comodojo/Extender/Transformers/WorklogTransformer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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 ) {
Please login to merge, or discard this patch.
src/Comodojo/Extender/Task/Runner.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
             $thetask = $this->table->get($name)->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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Comodojo/Extender/Schedule/Manager.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
         $schedule->setFirstrun($schedule->getNextPlannedRun($time));
132 132
 
133
-        $this->getEvents()->emit( new ScheduleEvent('add', $schedule) );
133
+        $this->getEvents()->emit(new ScheduleEvent('add', $schedule));
134 134
 
135 135
         $em = $this->getEntityManager();
136 136
 
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
         $records = [];
149 149
         $em = $this->getEntityManager();
150 150
 
151
-        foreach ($schedules as $key => $schedule) {
151
+        foreach ( $schedules as $key => $schedule ) {
152 152
 
153 153
             try {
154 154
 
155 155
                 $schedule->setFirstrun($schedule->getNextPlannedRun($time));
156 156
 
157
-                $this->getEvents()->emit( new ScheduleEvent('add', $schedule) );
157
+                $this->getEvents()->emit(new ScheduleEvent('add', $schedule));
158 158
 
159 159
                 $em->persist($schedule);
160 160
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
         if ( empty($old_schedule) ) throw new InvalidArgumentException("Cannot find schedule with id $id");
190 190
 
191
-        $this->getEvents()->emit( new ScheduleEvent('edit', $schedule, $old_schedule) );
191
+        $this->getEvents()->emit(new ScheduleEvent('edit', $schedule, $old_schedule));
192 192
 
193 193
         $old_schedule->merge($schedule);
194 194
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
         if ( is_null($schedule) ) throw new InvalidArgumentException("Cannot find scheule $id");
210 210
 
211
-        $this->getEvents()->emit( new ScheduleEvent('remove', $schedule) );
211
+        $this->getEvents()->emit(new ScheduleEvent('remove', $schedule));
212 212
 
213 213
         $em->remove($schedule);
214 214
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
         if ( is_null($schedule) ) throw new InvalidArgumentException("Cannot find scheule $name");
228 228
 
229
-        $this->getEvents()->emit( new ScheduleEvent('remove', $schedule) );
229
+        $this->getEvents()->emit(new ScheduleEvent('remove', $schedule));
230 230
 
231 231
         $em->remove($schedule);
232 232
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
         if ( is_null($schedule) ) throw new InvalidArgumentException("Cannot find scheule $id");
246 246
 
247
-        $this->getEvents()->emit( new ScheduleEvent('enable', $schedule) );
247
+        $this->getEvents()->emit(new ScheduleEvent('enable', $schedule));
248 248
 
249 249
         $schedule->setEnabled(true);
250 250
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 
265 265
         if ( is_null($schedule) ) throw new InvalidArgumentException("Cannot find scheule $name");
266 266
 
267
-        $this->getEvents()->emit( new ScheduleEvent('enable', $schedule) );
267
+        $this->getEvents()->emit(new ScheduleEvent('enable', $schedule));
268 268
 
269 269
         $schedule->setEnabled(true);
270 270
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
         if ( is_null($schedule) ) throw new InvalidArgumentException("Cannot find scheule $id");
286 286
 
287
-        $this->getEvents()->emit( new ScheduleEvent('disable', $schedule) );
287
+        $this->getEvents()->emit(new ScheduleEvent('disable', $schedule));
288 288
 
289 289
         $schedule->setEnabled(false);
290 290
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 
305 305
         if ( is_null($schedule) ) throw new InvalidArgumentException("Cannot find scheule $name");
306 306
 
307
-        $this->getEvents()->emit( new ScheduleEvent('disable', $schedule) );
307
+        $this->getEvents()->emit(new ScheduleEvent('disable', $schedule));
308 308
 
309 309
         $schedule->setEnabled(false);
310 310
 
Please login to merge, or discard this patch.