@@ -14,10 +14,10 @@ |
||
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); |
@@ -37,14 +37,14 @@ discard block |
||
37 | 37 | { |
38 | 38 | $owner = $this->getOwner(); |
39 | 39 | if ($this->requiresUUID()) { |
40 | - if (! $owner->UUID) { |
|
40 | + if (!$owner->UUID) { |
|
41 | 41 | $owner->UUID = $this->getHashID(); |
42 | 42 | } |
43 | 43 | } else { |
44 | 44 | $this->UUIDNeverAgainRaceCondition = true; |
45 | 45 | $owner->UUID = ''; |
46 | 46 | } |
47 | - if (! $owner->PublicUUID || 'ERROR' === $owner->PublicUUID) { |
|
47 | + if (!$owner->PublicUUID || 'ERROR' === $owner->PublicUUID) { |
|
48 | 48 | $owner->PublicUUID = $this->calculatePublicUUID(); |
49 | 49 | } |
50 | 50 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function onAfterWrite() |
53 | 53 | { |
54 | 54 | $owner = $this->getOwner(); |
55 | - if (! $owner->PublicUUID && false === $this->UUIDNeverAgainRaceCondition) { |
|
55 | + if (!$owner->PublicUUID && false === $this->UUIDNeverAgainRaceCondition) { |
|
56 | 56 | $this->UUIDNeverAgainRaceCondition = true; |
57 | 57 | $owner->write(); |
58 | 58 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | public function updateCMSFields(FieldList $fields) |
67 | 67 | { |
68 | 68 | $owner = $this->owner; |
69 | - if (! ($owner instanceof SiteTree)) { |
|
69 | + if (!($owner instanceof SiteTree)) { |
|
70 | 70 | $this->updateCMSFieldsForHashId($fields); |
71 | 71 | } |
72 | 72 | } |