@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Cruft flake config interface. |
|
4 | - * |
|
5 | - * Implement this if you want some other way to configure machines. |
|
6 | - * |
|
7 | - * @author @davegardnerisme |
|
8 | - */ |
|
3 | + * Cruft flake config interface. |
|
4 | + * |
|
5 | + * Implement this if you want some other way to configure machines. |
|
6 | + * |
|
7 | + * @author @davegardnerisme |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | namespace Gendoria\CruftFlake\Config; |
11 | 11 |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Fixed configuration. |
|
4 | - * |
|
5 | - * This is designed to be used where each machine **knows** what its machine |
|
6 | - * ID is - eg: via some kind of automatically deployed configuration |
|
7 | - * (puppet etc.) |
|
8 | - * |
|
9 | - * @author @davegardnerisme |
|
10 | - */ |
|
3 | + * Fixed configuration. |
|
4 | + * |
|
5 | + * This is designed to be used where each machine **knows** what its machine |
|
6 | + * ID is - eg: via some kind of automatically deployed configuration |
|
7 | + * (puppet etc.) |
|
8 | + * |
|
9 | + * @author @davegardnerisme |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | namespace Gendoria\CruftFlake\Config; |
13 | 13 |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Cruft flake timer. |
|
4 | - * |
|
5 | - * @author @davegardnerisme |
|
6 | - */ |
|
3 | + * Cruft flake timer. |
|
4 | + * |
|
5 | + * @author @davegardnerisme |
|
6 | + */ |
|
7 | 7 | |
8 | 8 | namespace Gendoria\CruftFlake\Timer; |
9 | 9 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Cruft flake timer interface. |
|
4 | - * |
|
5 | - * Implement this if you want some other way to provide time. |
|
6 | - * |
|
7 | - * @author @davegardnerisme |
|
8 | - */ |
|
3 | + * Cruft flake timer interface. |
|
4 | + * |
|
5 | + * Implement this if you want some other way to provide time. |
|
6 | + * |
|
7 | + * @author @davegardnerisme |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | namespace Gendoria\CruftFlake\Timer; |
11 | 11 |
@@ -114,12 +114,12 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function generate() |
116 | 116 | { |
117 | - $t = (int) floor($this->timer->getUnixTimestamp() - $this->epoch); |
|
117 | + $t = (int) floor($this->timer->getUnixTimestamp()-$this->epoch); |
|
118 | 118 | if ($t !== $this->lastTime) { |
119 | 119 | if ($t < $this->lastTime) { |
120 | 120 | throw new UnexpectedValueException( |
121 | 121 | 'Time moved backwards. We cannot generate IDs for ' |
122 | - .($this->lastTime - $t).' milliseconds' |
|
122 | + .($this->lastTime-$t).' milliseconds' |
|
123 | 123 | ); |
124 | 124 | } elseif ($t < 0) { |
125 | 125 | throw new UnexpectedValueException( |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | private function hexdec($hex) |
187 | 187 | { |
188 | 188 | $dec = 0; |
189 | - for ($i = strlen($hex) - 1, $e = 1; $i >= 0; $i--, $e = bcmul($e, 16)) { |
|
189 | + for ($i = strlen($hex)-1, $e = 1; $i >= 0; $i--, $e = bcmul($e, 16)) { |
|
190 | 190 | $factor = self::$hexdec[$hex[$i]]; |
191 | 191 | $dec = bcadd($dec, bcmul($factor, $e)); |
192 | 192 | } |