@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $em = $this->getEntityManager(); |
| 82 | 82 | |
| 83 | - foreach ($queue as $record) { |
|
| 83 | + foreach ( $queue as $record ) { |
|
| 84 | 84 | $em->remove($record); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | $records = []; |
| 108 | 108 | |
| 109 | - foreach ($queue as $name => $request) { |
|
| 109 | + foreach ( $queue as $name => $request ) { |
|
| 110 | 110 | $records[] = $request instanceof Request ? $this->doAddRequest($name, $request, $em) : false; |
| 111 | 111 | } |
| 112 | 112 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $date = new DateTime(); |
| 99 | 99 | $timestamps = []; |
| 100 | 100 | |
| 101 | - foreach ($items as $schedule) { |
|
| 101 | + foreach ( $items as $schedule ) { |
|
| 102 | 102 | |
| 103 | 103 | $timestamps[] = $schedule->getNextPlannedRun($date)->getTimestamp(); |
| 104 | 104 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | $em = $this->getEntityManager(); |
| 114 | 114 | |
| 115 | - foreach ($results as $result) { |
|
| 115 | + foreach ( $results as $result ) { |
|
| 116 | 116 | |
| 117 | 117 | $id = $result->getJid(); |
| 118 | 118 | |
@@ -139,9 +139,9 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | $responses = []; |
| 141 | 141 | |
| 142 | - foreach ($requests as $id => $request) { |
|
| 142 | + foreach ( $requests as $id => $request ) { |
|
| 143 | 143 | |
| 144 | - if ($request instanceof \Comodojo\Extender\Task\Request) { |
|
| 144 | + if ( $request instanceof \Comodojo\Extender\Task\Request ) { |
|
| 145 | 145 | $this->add($request); |
| 146 | 146 | $responses[$id] = true; |
| 147 | 147 | } else { |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | protected function cycle() { |
| 176 | 176 | |
| 177 | - foreach ($this->locker->getQueued() as $uid => $request) { |
|
| 177 | + foreach ( $this->locker->getQueued() as $uid => $request ) { |
|
| 178 | 178 | |
| 179 | 179 | if ( $this->multithread === false ) { |
| 180 | 180 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | if ( $this->max_childs > 0 && $this->locker->countRunning() >= $this->max_childs ) { |
| 204 | 204 | |
| 205 | - while( $this->locker->countRunning() >= $this->max_childs ) { |
|
| 205 | + while ( $this->locker->countRunning() >= $this->max_childs ) { |
|
| 206 | 206 | |
| 207 | 207 | $this->catcher(); |
| 208 | 208 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $thetask = $this->table->get($task)->getInstance($name, $parameters); |
| 99 | 99 | |
| 100 | - $this->events->emit( new TaskEvent('start', $thetask) ); |
|
| 100 | + $this->events->emit(new TaskEvent('start', $thetask)); |
|
| 101 | 101 | |
| 102 | 102 | $pid = $thetask->getPid(); |
| 103 | 103 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $this->stopwatch->getStartTime() |
| 113 | 113 | ); |
| 114 | 114 | |
| 115 | - $this->events->emit( new TaskStatusEvent('start', $thetask) ); |
|
| 115 | + $this->events->emit(new TaskStatusEvent('start', $thetask)); |
|
| 116 | 116 | |
| 117 | 117 | try { |
| 118 | 118 | |
@@ -134,11 +134,11 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $this->events->emit( new TaskStatusEvent($status ? 'success' : 'error', $thetask) ); |
|
| 137 | + $this->events->emit(new TaskStatusEvent($status ? 'success' : 'error', $thetask)); |
|
| 138 | 138 | |
| 139 | - $this->events->emit( new TaskStatusEvent('stop', $thetask) ); |
|
| 139 | + $this->events->emit(new TaskStatusEvent('stop', $thetask)); |
|
| 140 | 140 | |
| 141 | - $this->events->emit( new TaskEvent('stop', $thetask) ); |
|
| 141 | + $this->events->emit(new TaskEvent('stop', $thetask)); |
|
| 142 | 142 | |
| 143 | 143 | $this->stopwatch->stop(); |
| 144 | 144 | |
@@ -356,7 +356,7 @@ |
||
| 356 | 356 | |
| 357 | 357 | public function isChain() { |
| 358 | 358 | |
| 359 | - return ( $this->done !== null || $this->fail !== null || $this->pipe !== null ); |
|
| 359 | + return ($this->done !== null || $this->fail !== null || $this->pipe !== null); |
|
| 360 | 360 | |
| 361 | 361 | } |
| 362 | 362 | |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | $client = \Comodojo\Daemon\Socket\Client::create('unix://extender.sock'); |
| 8 | 8 | |
| 9 | - $data = $client->send('scheduler:refresh',[]); |
|
| 9 | + $data = $client->send('scheduler:refresh', []); |
|
| 10 | 10 | |
| 11 | 11 | } catch (Exception $e) { |
| 12 | 12 | |