Passed
Push — main ( 0e8756...467803 )
by Nicolaas
08:37
created
src/Extensions/UUIDExtension.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
     public function onBeforeWrite()
34 34
     {
35 35
         $owner = $this->getOwner();
36
-        if (! $owner->UUID) {
36
+        if (!$owner->UUID) {
37 37
             $owner->UUID = $this->getHashID();
38 38
         }
39
-        if (! $owner->PublicUUID || 'ERROR' === $owner->PublicUUID) {
39
+        if (!$owner->PublicUUID || 'ERROR' === $owner->PublicUUID) {
40 40
             $owner->PublicUUID = $this->calculatePublicUUID();
41 41
         }
42 42
     }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     public function onAfterWrite()
45 45
     {
46 46
         $owner = $this->getOwner();
47
-        if (! $owner->UUID && false === ! $this->UUIDNeverAgainRaceCondition) {
47
+        if (!$owner->UUID && false === !$this->UUIDNeverAgainRaceCondition) {
48 48
             $this->UUIDNeverAgainRaceCondition = true;
49 49
             $owner->write();
50 50
         }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     public function calculatePublicUUID(): string
60 60
     {
61 61
         $owner = $this->getOwner();
62
-        if (! $owner->UUID) {
62
+        if (!$owner->UUID) {
63 63
             return '';
64 64
         }
65 65
         $from = strpos($owner->UUID, '_') - 6;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     public function updateCMSFields(FieldList $fields)
71 71
     {
72 72
         $owner = $this->owner;
73
-        if (! ($owner instanceof SiteTree)) {
73
+        if (!($owner instanceof SiteTree)) {
74 74
             $this->updateCMSFieldsForHashId($fields);
75 75
         }
76 76
     }
Please login to merge, or discard this patch.
src/Api/HashCreator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@
 block discarded – undo
14 14
      */
15 15
     public static function generate_hash(int $length = 64): string
16 16
     {
17
-        $pieces = [];
17
+        $pieces = [ ];
18 18
         $max = mb_strlen(self::CHARS, '8bit') - 1;
19 19
         for ($i = 0; $i < $length; ++$i) {
20
-            $pieces[] = self::CHARS[random_int(0, $max)];
20
+            $pieces[ ] = self::CHARS[ random_int(0, $max) ];
21 21
         }
22 22
 
23 23
         return implode('', $pieces);
Please login to merge, or discard this patch.