@@ -33,10 +33,10 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -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); |