@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $this->connection->setTransactionIsolation(Connection::TRANSACTION_SERIALIZABLE); |
| 127 | 127 | |
| 128 | - while ($this->checkRunTimes() && $this->runIteration($output, (bool)$this->options['exit_if_empty'])) { |
|
| 128 | + while ($this->checkRunTimes() && $this->runIteration($output, (bool) $this->options['exit_if_empty'])) { |
|
| 129 | 129 | $this->logger->debug('Doctrine worker tick.'); |
| 130 | 130 | } |
| 131 | 131 | } |
@@ -204,11 +204,11 @@ discard block |
||
| 204 | 204 | try { |
| 205 | 205 | $this->connection->beginTransaction(); |
| 206 | 206 | $sqlProto = "SELECT * " |
| 207 | - . " FROM " . $platform->appendLockHint($this->tableName, LockMode::PESSIMISTIC_WRITE) |
|
| 207 | + . " FROM ".$platform->appendLockHint($this->tableName, LockMode::PESSIMISTIC_WRITE) |
|
| 208 | 208 | . " WHERE processed = ? AND pool = ? AND process_after <= ? " |
| 209 | 209 | . " ORDER BY id ASC" |
| 210 | 210 | ; |
| 211 | - $sql = $platform->modifyLimitQuery($sqlProto, 1) . " " . $platform->getWriteLockSQL(); |
|
| 211 | + $sql = $platform->modifyLimitQuery($sqlProto, 1)." ".$platform->getWriteLockSQL(); |
|
| 212 | 212 | $row = $this->connection->fetchAssoc($sql, array(0, $this->pool, new DateTime()), array('integer', 'string', 'datetime')); |
| 213 | 213 | |
| 214 | 214 | if (empty($row)) { |
@@ -253,13 +253,13 @@ discard block |
||
| 253 | 253 | { |
| 254 | 254 | $parameters = array( |
| 255 | 255 | 'processed' => true, |
| 256 | - 'id' => (int)$id, |
|
| 256 | + 'id' => (int) $id, |
|
| 257 | 257 | ); |
| 258 | 258 | $types = array( |
| 259 | 259 | 'processed' => 'boolean', |
| 260 | 260 | 'id' => 'smallint' |
| 261 | 261 | ); |
| 262 | - $updateSql = "UPDATE " . $this->tableName |
|
| 262 | + $updateSql = "UPDATE ".$this->tableName |
|
| 263 | 263 | . " SET processed = :processed" |
| 264 | 264 | . " WHERE id = :id"; |
| 265 | 265 | return $this->connection->executeUpdate($updateSql, $parameters, $types); |
@@ -276,9 +276,9 @@ discard block |
||
| 276 | 276 | { |
| 277 | 277 | $parameters = array( |
| 278 | 278 | 'processed' => false, |
| 279 | - 'failed_no' => (int)$failedRetries, |
|
| 280 | - 'id' => (int)$id, |
|
| 281 | - 'process_after' => new DateTime('@'.(time()+20*$failedRetries)), |
|
| 279 | + 'failed_no' => (int) $failedRetries, |
|
| 280 | + 'id' => (int) $id, |
|
| 281 | + 'process_after' => new DateTime('@'.(time()+20 * $failedRetries)), |
|
| 282 | 282 | ); |
| 283 | 283 | $types = array( |
| 284 | 284 | 'processed' => 'boolean', |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | 'id' => 'smallint', |
| 287 | 287 | 'process_after' => 'datetime', |
| 288 | 288 | ); |
| 289 | - $updateSql = "UPDATE " . $this->tableName |
|
| 289 | + $updateSql = "UPDATE ".$this->tableName |
|
| 290 | 290 | . " SET processed = :processed, failed_no = :failed_no, process_after = :process_after" |
| 291 | 291 | . " WHERE id = :id"; |
| 292 | 292 | return $this->connection->executeUpdate($updateSql, $parameters, $types); |