@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | public function run(array $options, OutputInterface $output = null) |
| 111 | 111 | { |
| 112 | 112 | $this->options = $options; |
| 113 | - $runTimes = !empty($options['run_times']) ? (int)$options['run_times'] : null; |
|
| 113 | + $runTimes = !empty($options['run_times']) ? (int) $options['run_times'] : null; |
|
| 114 | 114 | $output->writeln(sprintf("Worker run with options: %s", print_r($options, true))); |
| 115 | 115 | $this->logger->debug(sprintf("Worker run with options: %s", print_r($options, true))); |
| 116 | 116 | |
@@ -196,11 +196,11 @@ discard block |
||
| 196 | 196 | try { |
| 197 | 197 | $this->connection->beginTransaction(); |
| 198 | 198 | $sqlProto = "SELECT * " |
| 199 | - . " FROM " . $platform->appendLockHint($this->tableName, LockMode::PESSIMISTIC_WRITE) |
|
| 199 | + . " FROM ".$platform->appendLockHint($this->tableName, LockMode::PESSIMISTIC_WRITE) |
|
| 200 | 200 | . " WHERE processed = ? AND pool = ? AND process_after <= ? " |
| 201 | 201 | . " ORDER BY id ASC" |
| 202 | 202 | ; |
| 203 | - $sql = $platform->modifyLimitQuery($sqlProto, 1) . " " . $platform->getWriteLockSQL(); |
|
| 203 | + $sql = $platform->modifyLimitQuery($sqlProto, 1)." ".$platform->getWriteLockSQL(); |
|
| 204 | 204 | $row = $this->connection->fetchAssoc($sql, array(0, $this->pool, new DateTime()), array('integer', 'string', 'datetime')); |
| 205 | 205 | |
| 206 | 206 | if (!$row) { |
@@ -248,13 +248,13 @@ discard block |
||
| 248 | 248 | { |
| 249 | 249 | $parameters = array( |
| 250 | 250 | 'processed' => true, |
| 251 | - 'id' => (int)$id, |
|
| 251 | + 'id' => (int) $id, |
|
| 252 | 252 | ); |
| 253 | 253 | $types = array( |
| 254 | 254 | 'processed' => 'boolean', |
| 255 | 255 | 'id' => 'smallint' |
| 256 | 256 | ); |
| 257 | - $updateSql = "UPDATE " . $this->tableName |
|
| 257 | + $updateSql = "UPDATE ".$this->tableName |
|
| 258 | 258 | . " SET processed = :processed" |
| 259 | 259 | . " WHERE id = :id"; |
| 260 | 260 | return $this->connection->executeUpdate($updateSql, $parameters, $types); |
@@ -271,9 +271,9 @@ discard block |
||
| 271 | 271 | { |
| 272 | 272 | $parameters = array( |
| 273 | 273 | 'processed' => false, |
| 274 | - 'failed_no' => (int)$failedRetries, |
|
| 275 | - 'id' => (int)$id, |
|
| 276 | - 'process_after' => new DateTime('@'.(time()+20*$failedRetries)), |
|
| 274 | + 'failed_no' => (int) $failedRetries, |
|
| 275 | + 'id' => (int) $id, |
|
| 276 | + 'process_after' => new DateTime('@'.(time()+20 * $failedRetries)), |
|
| 277 | 277 | ); |
| 278 | 278 | $types = array( |
| 279 | 279 | 'processed' => 'boolean', |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | 'id' => 'smallint', |
| 282 | 282 | 'process_after' => 'datetime', |
| 283 | 283 | ); |
| 284 | - $updateSql = "UPDATE " . $this->tableName |
|
| 284 | + $updateSql = "UPDATE ".$this->tableName |
|
| 285 | 285 | . " SET processed = :processed, failed_no = :failed_no, process_after = :process_after" |
| 286 | 286 | . " WHERE id = :id"; |
| 287 | 287 | return $this->connection->executeUpdate($updateSql, $parameters, $types); |
@@ -55,8 +55,8 @@ |
||
| 55 | 55 | { |
| 56 | 56 | $this->serializer = $serializer; |
| 57 | 57 | $this->connection = $connection; |
| 58 | - $this->tableName = (string)$tableName; |
|
| 59 | - $this->pool = (string)$pool; |
|
| 58 | + $this->tableName = (string) $tableName; |
|
| 59 | + $this->pool = (string) $pool; |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |