@@ -66,7 +66,7 @@ |
||
66 | 66 | |
67 | 67 | if ( !empty($queue) ) { |
68 | 68 | |
69 | - $events->emit( new QueueEvent('process', null, $queue) ); |
|
69 | + $events->emit(new QueueEvent('process', null, $queue)); |
|
70 | 70 | |
71 | 71 | $requests = $this->jobsToRequests($queue); |
72 | 72 |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | $thetask = $this->table->get($task)->getInstance($name, $parameters); |
88 | 88 | |
89 | - $this->events->emit( new TaskEvent('start', $thetask) ); |
|
89 | + $this->events->emit(new TaskEvent('start', $thetask)); |
|
90 | 90 | |
91 | 91 | $pid = $thetask->getPid(); |
92 | 92 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $status = Worklog::STATUS_COMPLETE; |
109 | 109 | |
110 | - $this->events->emit( new TaskEvent('complete', $thetask) ); |
|
110 | + $this->events->emit(new TaskEvent('complete', $thetask)); |
|
111 | 111 | |
112 | 112 | } catch (TaskException $te) { |
113 | 113 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | $result = $te->getMessage(); |
117 | 117 | |
118 | - $this->events->emit( new TaskEvent('abort', $thetask) ); |
|
118 | + $this->events->emit(new TaskEvent('abort', $thetask)); |
|
119 | 119 | |
120 | 120 | } catch (Exception $e) { |
121 | 121 | |
@@ -123,11 +123,11 @@ discard block |
||
123 | 123 | |
124 | 124 | $result = $e->getMessage(); |
125 | 125 | |
126 | - $this->events->emit( new TaskEvent('error', $thetask) ); |
|
126 | + $this->events->emit(new TaskEvent('error', $thetask)); |
|
127 | 127 | |
128 | 128 | } |
129 | 129 | |
130 | - $this->events->emit( new TaskEvent('stop', $thetask) ); |
|
130 | + $this->events->emit(new TaskEvent('stop', $thetask)); |
|
131 | 131 | |
132 | 132 | $this->stopwatch->stop(); |
133 | 133 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | ob_end_clean(); |
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 | return $result; |
167 | 167 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | |
271 | 271 | protected function statusToEvent($status) { |
272 | 272 | |
273 | - switch ($status) { |
|
273 | + switch ( $status ) { |
|
274 | 274 | case Worklog::STATUS_COMPLETE: |
275 | 275 | return 'complete'; |
276 | 276 | break; |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | |
80 | 80 | public function flush(array $queue) { |
81 | 81 | |
82 | - $this->getEvents()->emit( new QueueEvent('flush', null, $queue) ); |
|
82 | + $this->getEvents()->emit(new QueueEvent('flush', null, $queue)); |
|
83 | 83 | |
84 | 84 | $em = $this->getEntityManager(); |
85 | 85 | |
86 | - foreach ($queue as $record) { |
|
86 | + foreach ( $queue as $record ) { |
|
87 | 87 | $em->remove($record); |
88 | 88 | } |
89 | 89 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | $records = []; |
111 | 111 | |
112 | - foreach ($queue as $name => $request) { |
|
112 | + foreach ( $queue as $name => $request ) { |
|
113 | 113 | $records[] = $request instanceof Request ? $this->doAddRequest($request, $em) : false; |
114 | 114 | } |
115 | 115 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | protected function doAddRequest(Request $request, EntityManager $em) { |
123 | 123 | |
124 | - $this->getEvents()->emit( new QueueEvent('add', $request) ); |
|
124 | + $this->getEvents()->emit(new QueueEvent('add', $request)); |
|
125 | 125 | |
126 | 126 | $record = new Queue(); |
127 | 127 | $record->setName($request->getName())->setRequest($request); |