@@ -55,8 +55,7 @@ |
||
55 | 55 | |
56 | 56 | if ( $e_count == 5 ) $e_array[] = "*"; |
57 | 57 | |
58 | - } |
|
59 | - catch (Exception $e) { |
|
58 | + } catch (Exception $e) { |
|
60 | 59 | |
61 | 60 | throw $e; |
62 | 61 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | |
21 | 21 | |
22 | -class Result extends Model{ |
|
22 | +class Result extends Model { |
|
23 | 23 | |
24 | 24 | protected $mode = self::READONLY; |
25 | 25 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | |
21 | 21 | |
22 | -class Result extends Model{ |
|
22 | +class Result extends Model { |
|
23 | 23 | |
24 | 24 | protected $mode = self::READONLY; |
25 | 25 |
@@ -111,9 +111,9 @@ |
||
111 | 111 | |
112 | 112 | $t = microtime(true); |
113 | 113 | |
114 | - $micro = sprintf("%06d",($t - floor($t)) * 1000000); |
|
114 | + $micro = sprintf("%06d", ($t - floor($t)) * 1000000); |
|
115 | 115 | |
116 | - return new DateTime( date('Y-m-d H:i:s.'.$micro, $t) ); |
|
116 | + return new DateTime(date('Y-m-d H:i:s.'.$micro, $t)); |
|
117 | 117 | |
118 | 118 | } |
119 | 119 |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | false |
85 | 85 | ]; |
86 | 86 | |
87 | - switch (strtoupper($metadata_mode)) { |
|
87 | + switch ( strtoupper($metadata_mode) ) { |
|
88 | 88 | |
89 | 89 | case 'YAML': |
90 | 90 | $db_config = Setup::createYAMLMetadataConfiguration(...$config_args); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $repos = $configuration->get('database-repositories'); |
179 | 179 | |
180 | 180 | return array_map(function($repo) use ($base_folder) { |
181 | - return substr($repo, 0, 1 ) === "/" ? $repo : "$base_folder/$repo"; |
|
181 | + return substr($repo, 0, 1) === "/" ? $repo : "$base_folder/$repo"; |
|
182 | 182 | }, $repos); |
183 | 183 | |
184 | 184 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $base_folder = $configuration->get('base-path'); |
189 | 189 | $folder = $configuration->get('database-proxies'); |
190 | 190 | |
191 | - return substr($folder, 0, 1 ) === "/" ? $folder : "$base_folder/$folder"; |
|
191 | + return substr($folder, 0, 1) === "/" ? $folder : "$base_folder/$folder"; |
|
192 | 192 | |
193 | 193 | } |
194 | 194 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | $em = Database::init($this->getConfiguration())->getEntityManager(); |
60 | 60 | |
61 | - foreach ($results as $result) { |
|
61 | + foreach ( $results as $result ) { |
|
62 | 62 | |
63 | 63 | $id = $result->jid; |
64 | 64 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $date = new DateTime(); |
94 | 94 | $timestamps = []; |
95 | 95 | |
96 | - foreach ($items as $schedule) { |
|
96 | + foreach ( $items as $schedule ) { |
|
97 | 97 | |
98 | 98 | $timestamps[] = $schedule->getNextPlannedRun($date)->getTimestamp(); |
99 | 99 |
@@ -34,12 +34,12 @@ |
||
34 | 34 | use EventsTrait; |
35 | 35 | |
36 | 36 | /** |
37 | - * Class constructor |
|
38 | - * |
|
39 | - * @param Configuration $configuration |
|
40 | - * @param LoggerInterface $logger |
|
41 | - * @param EventsManager $events |
|
42 | - */ |
|
37 | + * Class constructor |
|
38 | + * |
|
39 | + * @param Configuration $configuration |
|
40 | + * @param LoggerInterface $logger |
|
41 | + * @param EventsManager $events |
|
42 | + */ |
|
43 | 43 | public function __construct( |
44 | 44 | Configuration $configuration, |
45 | 45 | LoggerInterface $logger, |
@@ -139,7 +139,7 @@ |
||
139 | 139 | |
140 | 140 | $result = []; |
141 | 141 | |
142 | - foreach($tasks as $name => $task) { |
|
142 | + foreach ( $tasks as $name => $task ) { |
|
143 | 143 | |
144 | 144 | if ( empty($task['class']) ) { |
145 | 145 |
@@ -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 |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | |
129 | 129 | public function addBulk(array $requests) { |
130 | 130 | |
131 | - foreach ($requests as $id => $request) { |
|
131 | + foreach ( $requests as $id => $request ) { |
|
132 | 132 | |
133 | - if ($request instanceof \Comodojo\Extender\Task\Request) { |
|
133 | + if ( $request instanceof \Comodojo\Extender\Task\Request ) { |
|
134 | 134 | $this->add($request); |
135 | 135 | } else { |
136 | 136 | $this->logger->error("Skipping invalid request with local id $id: class mismatch"); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | |
164 | 164 | $this->installErrorHandler(); |
165 | 165 | |
166 | - foreach ($this->tracker->getQueued() as $uid => $request) { |
|
166 | + foreach ( $this->tracker->getQueued() as $uid => $request ) { |
|
167 | 167 | |
168 | 168 | if ( $this->multithread === false ) { |
169 | 169 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | if ( $this->max_childs > 0 && $this->tracker->countRunning() >= $this->max_childs ) { |
193 | 193 | |
194 | - while( $this->tracker->countRunning() >= $this->max_childs ) { |
|
194 | + while ( $this->tracker->countRunning() >= $this->max_childs ) { |
|
195 | 195 | |
196 | 196 | $this->catcher(); |
197 | 197 |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | public function isChain() { |
263 | 263 | |
264 | - return ( $this->done !== null || $this->fail !== null || $this->pipe !== null ); |
|
264 | + return ($this->done !== null || $this->fail !== null || $this->pipe !== null); |
|
265 | 265 | |
266 | 266 | } |
267 | 267 | |
@@ -275,9 +275,9 @@ discard block |
||
275 | 275 | $message->setMaxtime($this->getMaxtime()); |
276 | 276 | $message->setParameters($this->getParameters()->export()); |
277 | 277 | |
278 | - if ( $this->done !== null ) $message->onDone( $this->getOnDone()->convertToMessage() ); |
|
279 | - if ( $this->fail !== null ) $message->onFail( $this->getOnFail()->convertToMessage() ); |
|
280 | - if ( $this->pipe !== null ) $message->pipe( $this->getPipe()->convertToMessage() ); |
|
278 | + if ( $this->done !== null ) $message->onDone($this->getOnDone()->convertToMessage()); |
|
279 | + if ( $this->fail !== null ) $message->onFail($this->getOnFail()->convertToMessage()); |
|
280 | + if ( $this->pipe !== null ) $message->pipe($this->getPipe()->convertToMessage()); |
|
281 | 281 | |
282 | 282 | return $message; |
283 | 283 |