Completed
Push — master ( 6c20ac...99f9fc )
by Marcel
01:49
created
src/UuidGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace UMA\Uuid;
6 6
 
Please login to merge, or discard this patch.
src/Version4Generator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace UMA\Uuid;
6 6
 
Please login to merge, or discard this patch.
src/Version5Generator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace UMA\Uuid;
6 6
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         }
39 39
 
40 40
         // Use the 16 most significant octets of the hash as the basis for the new Uuid.
41
-        $bytes = \unpack('C16', \sha1($this->nsBytes . $name, true));
41
+        $bytes = \unpack('C16', \sha1($this->nsBytes.$name, true));
42 42
 
43 43
         // Set the four most significant bits (bits 12 through 15) of the
44 44
         // time_hi_and_version field to the appropriate 4-bit version number
Please login to merge, or discard this patch.
src/CombGenerator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace UMA\Uuid;
6 6
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     public function __construct(int $granularity = 6)
26 26
     {
27 27
         if (!\in_array($granularity, \range(0, 6), true)) {
28
-            throw new \InvalidArgumentException('$granularity must be in the [0, 6] range. Got: ' . $granularity);
28
+            throw new \InvalidArgumentException('$granularity must be in the [0, 6] range. Got: '.$granularity);
29 29
         }
30 30
 
31 31
         $this->exponent = 10 ** $granularity;
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $head = $this->procrust($this->timestamp());
38 38
         $tail = \substr($this->v4->generate()->asBytes(), -10);
39 39
 
40
-        return Uuid::fromBytes($head . $tail);
40
+        return Uuid::fromBytes($head.$tail);
41 41
     }
42 42
 
43 43
     /**
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     {
52 52
         $fullTimestampLength = \strlen($this->timestamp());
53 53
         $choppedDigits = $fullTimestampLength < 12 ? 0 : $fullTimestampLength - 12;
54
-        $maxTimestamp = (int)(\hexdec(\str_pad('', 12 + $choppedDigits, 'f'))/$this->exponent);
54
+        $maxTimestamp = (int) (\hexdec(\str_pad('', 12 + $choppedDigits, 'f')) / $this->exponent);
55 55
 
56 56
         return new \DateTimeImmutable("@$maxTimestamp UTC");
57 57
     }
@@ -96,6 +96,6 @@  discard block
 block discarded – undo
96 96
      */
97 97
     private function timestamp(): string
98 98
     {
99
-        return \dechex((int)(\microtime(true) * $this->exponent));
99
+        return \dechex((int) (\microtime(true) * $this->exponent));
100 100
     }
101 101
 }
Please login to merge, or discard this patch.
src/Uuid.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace UMA\Uuid;
6 6
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     public static function fromBytes(string $bytes): Uuid
84 84
     {
85 85
         if (16 !== \strlen($bytes)) {
86
-            throw new \InvalidArgumentException('Length of $bytes for new Uuid is not 16. Got: 0x' . \bin2hex($bytes));
86
+            throw new \InvalidArgumentException('Length of $bytes for new Uuid is not 16. Got: 0x'.\bin2hex($bytes));
87 87
         }
88 88
 
89 89
         return new self($bytes, self::bin2str($bytes));
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     public static function fromString(string $text): Uuid
101 101
     {
102 102
         if (false === self::isUuid($text)) {
103
-            throw new \InvalidArgumentException('$text is not a valid Uuid. Got: ' . $text);
103
+            throw new \InvalidArgumentException('$text is not a valid Uuid. Got: '.$text);
104 104
         }
105 105
 
106 106
         return new self(self::str2bin($text), $text);
Please login to merge, or discard this patch.
src/Version1Generator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace UMA\Uuid;
6 6
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     public function __construct(string $nodeID)
46 46
     {
47 47
         if (0 === \preg_match(self::MAC_ADDR_FORMAT, $nodeID)) {
48
-            throw new \InvalidArgumentException('$nodeID is not a valid MAC address. Got: ' . $nodeID);
48
+            throw new \InvalidArgumentException('$nodeID is not a valid MAC address. Got: '.$nodeID);
49 49
         }
50 50
 
51 51
         $this->nodeID = \str_replace(':', '', $nodeID);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
         $bytes = \pack(
60 60
             'NnnnH12',
61
-            $t       & 0xffffffff,
61
+            $t & 0xffffffff,
62 62
             $t >> 32 & 0xffff,
63 63
             $t >> 48 & 0x0fff | 0x1000,
64 64
             $this->clockSeq,
@@ -82,6 +82,6 @@  discard block
 block discarded – undo
82 82
      */
83 83
     private function timestamp(): int
84 84
     {
85
-        return self::GREGORIAN_OFFSET + (int)(10000000 * \microtime(true));
85
+        return self::GREGORIAN_OFFSET + (int) (10000000 * \microtime(true));
86 86
     }
87 87
 }
Please login to merge, or discard this patch.
bin/Benchmarker.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace UMA\Uuid\Performance;
6 6
 
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
             \get_class($this->benchmarked),
45 45
             $count,
46 46
             $runTime,
47
-            \number_format($count/$runTime, 1)
47
+            \number_format($count / $runTime, 1)
48 48
         );
49 49
     }
50 50
 
51 51
     private static function currentTimeMicros(): int
52 52
     {
53
-        return (int)(\microtime(true) * 1000000);
53
+        return (int) (\microtime(true) * 1000000);
54 54
     }
55 55
 }
Please login to merge, or discard this patch.
bin/bench.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 use UMA\Uuid\CombGenerator;
6 6
 use UMA\Uuid\Performance\Benchmarker;
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use UMA\Uuid\Version4Generator;
10 10
 use UMA\Uuid\Version5Generator;
11 11
 
12
-require_once __DIR__ . '/../vendor/autoload.php';
12
+require_once __DIR__.'/../vendor/autoload.php';
13 13
 
14 14
 echo \sprintf("Running on: %s\n\n", PHP_VERSION);
15 15
 
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     echo "[!] The xdebug extension is enabled. This has a major impact on runtime performance.\n\n";
18 18
 }
19 19
 
20
-$runTime = (int)($argv[1] ?? 5);
20
+$runTime = (int) ($argv[1] ?? 5);
21 21
 
22 22
 $ns = Uuid::fromString(Version5Generator::NS_DNS);
23 23
 
Please login to merge, or discard this patch.