@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function generate() |
| 117 | 117 | { |
| 118 | - $t = (int) floor($this->timer->getUnixTimestamp() - $this->epoch); |
|
| 118 | + $t = (int) floor($this->timer->getUnixTimestamp()-$this->epoch); |
|
| 119 | 119 | if ($t !== $this->lastTime) { |
| 120 | 120 | $this->generateWithDifferentTime($t); |
| 121 | 121 | } else { |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | if ($t < $this->lastTime) { |
| 153 | 153 | throw new UnexpectedValueException( |
| 154 | 154 | 'Time moved backwards. We cannot generate IDs for ' |
| 155 | - .($this->lastTime - $t).' milliseconds' |
|
| 155 | + .($this->lastTime-$t).' milliseconds' |
|
| 156 | 156 | ); |
| 157 | 157 | } elseif ($t < 0) { |
| 158 | 158 | throw new UnexpectedValueException( |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | private function hexdec($hex) |
| 222 | 222 | { |
| 223 | 223 | $dec = 0; |
| 224 | - for ($i = strlen($hex) - 1, $e = 1; $i >= 0; $i--, $e = bcmul($e, 16)) { |
|
| 224 | + for ($i = strlen($hex)-1, $e = 1; $i >= 0; $i--, $e = bcmul($e, 16)) { |
|
| 225 | 225 | $factor = self::$hexdec[$hex[$i]]; |
| 226 | 226 | $dec = bcadd($dec, bcmul($factor, $e)); |
| 227 | 227 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $receiver = $this->getZmqSocket($this->dsn); |
| 69 | 69 | while (true) { |
| 70 | 70 | $msg = $receiver->recv(); |
| 71 | - $this->logger->debug('ZMQ server received command: ' . $msg); |
|
| 71 | + $this->logger->debug('ZMQ server received command: '.$msg); |
|
| 72 | 72 | $response = $this->runCommand($msg); |
| 73 | 73 | $receiver->send(json_encode($response)); |
| 74 | 74 | if ($this->debugMode) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | case 'STATUS': |
| 86 | 86 | return $this->commandStatus(); |
| 87 | 87 | default: |
| 88 | - $this->logger->debug('Unknown command received: ' . $msg); |
|
| 88 | + $this->logger->debug('Unknown command received: '.$msg); |
|
| 89 | 89 | return $this->createResponse('UNKNOWN COMMAND', 404); |
| 90 | 90 | } |
| 91 | 91 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | try { |
| 101 | 101 | $response = $this->createResponse($this->generator->generate()); |
| 102 | 102 | } catch (Exception $e) { |
| 103 | - $this->logger->error('Generator error: ' . $e->getMessage(), array($e, $this)); |
|
| 103 | + $this->logger->error('Generator error: '.$e->getMessage(), array($e, $this)); |
|
| 104 | 104 | $response = $this->createResponse('ERROR', 500); |
| 105 | 105 | } |
| 106 | 106 | |